This is an automated email from the ASF dual-hosted git repository.

xiaoxiang781216 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git

commit 955ba67b7c4309059111b9f66d58170a79afbd9b
Author: Justin Hammond <[email protected]>
AuthorDate: Sun Aug 16 18:33:44 2026 +0800

    drivers/pinctrl: Add debug output levels.
    
    The pinctrl framework has no debug output of its own, so a provider
    reporting a pad it could not configure has to reach for the bare _err()
    and _info() macros.  Those are gated only by DEBUG_ERROR and DEBUG_INFO,
    so the output cannot be turned off without silencing every subsystem that
    has not been given its own level.
    
    Add CONFIG_DEBUG_PINCTRL with the usual three levels and the matching
    pinctrlerr(), pinctrlwarn() and pinctrlinfo() macros, in the same shape as
    the reset ones above them.
    
    Nothing selects these, so the build is unchanged until a provider starts
    using them.
    
    Assisted-by: Claude:claude-opus-5
    Signed-off-by: Justin Hammond <[email protected]>
---
 Kconfig               | 32 ++++++++++++++++++++++++++++++++
 include/nuttx/debug.h | 18 ++++++++++++++++++
 2 files changed, 50 insertions(+)

diff --git a/Kconfig b/Kconfig
index b7d2e6f49c6..b7cca6e82f2 100644
--- a/Kconfig
+++ b/Kconfig
@@ -2363,6 +2363,38 @@ config DEBUG_RESET_INFO
 
 endif # DEBUG_RESET
 
+config DEBUG_PINCTRL
+       bool "PINCTRL Debug Features"
+       default n
+       depends on PINCTRL
+       ---help---
+               Enable PINCTRL debug features.
+
+if DEBUG_PINCTRL
+
+config DEBUG_PINCTRL_ERROR
+       bool "PINCTRL Error Output"
+       default n
+       depends on DEBUG_ERROR
+       ---help---
+               Enable PINCTRL driver error output to SYSLOG.
+
+config DEBUG_PINCTRL_WARN
+       bool "PINCTRL Warnings Output"
+       default n
+       depends on DEBUG_WARN
+       ---help---
+               Enable PINCTRL driver warning output to SYSLOG.
+
+config DEBUG_PINCTRL_INFO
+       bool "PINCTRL Informational Output"
+       default n
+       depends on DEBUG_INFO
+       ---help---
+               Enable PINCTRL driver informational output to SYSLOG.
+
+endif # DEBUG_PINCTRL
+
 config DEBUG_IPC
        bool "IPC (Inter-Process Communication) Debug Features"
        default n
diff --git a/include/nuttx/debug.h b/include/nuttx/debug.h
index 14d3678201c..e4000ea37ee 100644
--- a/include/nuttx/debug.h
+++ b/include/nuttx/debug.h
@@ -959,6 +959,24 @@
 #  define rstinfo     _none
 #endif
 
+#ifdef CONFIG_DEBUG_PINCTRL_ERROR
+#  define pinctrlerr  _err
+#else
+#  define pinctrlerr  _none
+#endif
+
+#ifdef CONFIG_DEBUG_PINCTRL_WARN
+#  define pinctrlwarn _warn
+#else
+#  define pinctrlwarn _none
+#endif
+
+#ifdef CONFIG_DEBUG_PINCTRL_INFO
+#  define pinctrlinfo _info
+#else
+#  define pinctrlinfo _none
+#endif
+
 #ifdef CONFIG_DEBUG_IPC_ERROR
 #  define ipcerr       _err
 #else

Reply via email to