Skip to content

Commit

Permalink
icjx: use iC-JX interrupt config instead of the general one
Browse files Browse the repository at this point in the history
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 <michallenc@seznam.cz>
  • Loading branch information
michallenc committed May 9, 2024
1 parent 9d6e2b9 commit c3cd9fb
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
9 changes: 8 additions & 1 deletion drivers/ioexpander/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 3 additions & 2 deletions drivers/ioexpander/icjx.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit c3cd9fb

Please sign in to comment.