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

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


The following commit(s) were added to refs/heads/master by this push:
     new a1f5fd4e72 icjx: use iC-JX interrupt config instead of the general one
a1f5fd4e72 is described below

commit a1f5fd4e722a38e58b16d058ccfc8450cde9a3ee
Author: Michal Lenc <[email protected]>
AuthorDate: Mon May 6 10:45:56 2024 +0200

    icjx: use iC-JX interrupt config instead of the general one
    
    There might be multiple expanders, one with interrupt used and other
    without. This commit fixes initial incorrect interrupt design by
    introducing ICJX_INT_ENABLE config option.
    
    Also fixes naming of ICJX_MULTIPLE option.
    
    Signed-off-by: Michal Lenc <[email protected]>
---
 drivers/ioexpander/Kconfig | 9 ++++++++-
 drivers/ioexpander/icjx.c  | 5 +++--
 2 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/drivers/ioexpander/Kconfig b/drivers/ioexpander/Kconfig
index b71704377a..ed69d67ac6 100644
--- a/drivers/ioexpander/Kconfig
+++ b/drivers/ioexpander/Kconfig
@@ -66,12 +66,19 @@ config IOEXPANDER_ICJX
 
 if IOEXPANDER_ICJX
 
-config iC-JX_MULTIPLE
+config ICJX_MULTIPLE
        bool "Multiple iC-JX Devices"
        default n
        ---help---
                Can be defined to support multiple iC-JX devices on board.
 
+config ICJX_INT_ENABLE
+       bool "Enable iC-JX Interrupt Support"
+       default n
+       select IOEXPANDER_INT_ENABLE
+       ---help---
+               Enable driver interrupt functionality
+
 endif # IOEXPANDER_ICJX
 
 config IOEXPANDER_ISO1H812G
diff --git a/drivers/ioexpander/icjx.c b/drivers/ioexpander/icjx.c
index 90fc94d311..f79df627b1 100644
--- a/drivers/ioexpander/icjx.c
+++ b/drivers/ioexpander/icjx.c
@@ -939,10 +939,10 @@ static int icjx_detach(FAR struct ioexpander_dev_s *dev, 
FAR void *handle)
  *
  ****************************************************************************/
 
+#ifdef CONFIG_ICJX_INT_ENABLE
 static void icjx_interrupt_worker(void *arg)
 {
   FAR struct icjx_dev_s *priv = (FAR struct icjx_dev_s *)arg;
-  uint8_t regaddr;
   uint16_t change_of_input;
   uint16_t isr;
   ioe_pinset_t irq_match;
@@ -1001,7 +1001,8 @@ static int icjx_interrupt(int irq, FAR void *context, FAR 
void *arg)
   return OK;
 }
 
-#endif
+#endif /* CONFIG_ICJX_INT_ENABLE */
+#endif /* CONFIG_IOEXPANDER_INT_ENABLE */
 
 /****************************************************************************
  * Public Functions

Reply via email to