fix/work around dependency issues when !MBEDTLS_ECP_C

Signed-off-by: Tomi Fontanilles <tomi.fontanilles@nordicsemi.no>
diff --git a/include/mbedtls/debug.h b/include/mbedtls/debug.h
index 9a17488..922e5be 100644
--- a/include/mbedtls/debug.h
+++ b/include/mbedtls/debug.h
@@ -230,7 +230,7 @@
                              const char *text, const mbedtls_mpi *X);
 #endif
 
-#if defined(MBEDTLS_ECP_C)
+#if defined(MBEDTLS_ECP_LIGHT)
 /**
  * \brief   Print an ECP point to the debug output. This function is always
  *          used through the MBEDTLS_SSL_DEBUG_ECP() macro, which supplies the
diff --git a/library/pk_internal.h b/library/pk_internal.h
index d4b140a..025ee8b 100644
--- a/library/pk_internal.h
+++ b/library/pk_internal.h
@@ -44,7 +44,7 @@
 #define PEM_BEGIN_ENCRYPTED_PRIVATE_KEY_PKCS8 "-----BEGIN ENCRYPTED PRIVATE KEY-----"
 #define PEM_END_ENCRYPTED_PRIVATE_KEY_PKCS8   "-----END ENCRYPTED PRIVATE KEY-----"
 
-#if !defined(MBEDTLS_PK_USE_PSA_EC_DATA)
+#if defined(MBEDTLS_PK_HAVE_ECC_KEYS) && !defined(MBEDTLS_PK_USE_PSA_EC_DATA)
 /**
  * Public function mbedtls_pk_ec() can be used to get direct access to the
  * wrapped ecp_keypair structure pointed to the pk_ctx. However this is not
@@ -80,7 +80,7 @@
             return NULL;
     }
 }
-#endif /* !MBEDTLS_PK_USE_PSA_EC_DATA */
+#endif /* MBEDTLS_PK_HAVE_ECC_KEYS && !MBEDTLS_PK_USE_PSA_EC_DATA */
 
 #if defined(MBEDTLS_PK_HAVE_ECC_KEYS)
 static inline mbedtls_ecp_group_id mbedtls_pk_get_ec_group_id(const mbedtls_pk_context *pk)
diff --git a/library/pkparse.c b/library/pkparse.c
index c33b742..6ce7fcf 100644
--- a/library/pkparse.c
+++ b/library/pkparse.c
@@ -15,6 +15,7 @@
 #include "mbedtls/platform_util.h"
 #include "mbedtls/platform.h"
 #include "mbedtls/error.h"
+#include "mbedtls/ecp.h"
 #include "pk_internal.h"
 
 #include <string.h>
@@ -28,9 +29,6 @@
 #if defined(MBEDTLS_RSA_C)
 #include "mbedtls/rsa.h"
 #endif
-#if defined(MBEDTLS_PK_HAVE_ECC_KEYS)
-#include "mbedtls/ecp.h"
-#endif
 
 /* Extended formats */
 #if defined(MBEDTLS_PEM_PARSE_C)