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.

Signed-off-by: Michal Lenc <[email protected]>
  • Loading branch information
michallenc committed May 6, 2024
1 parent 9d6e2b9 commit 73ca3ab
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 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
8 changes: 4 additions & 4 deletions drivers/ioexpander/icjx.c
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ struct icjx_dev_s
uint16_t irqpins;
mutex_t lock;

#ifdef CONFIG_IOEXPANDER_INT_ENABLE
#ifdef CONFIG_ICJX_INT_ENABLE
struct work_s work;
struct icjx_callback_s callback;
#endif
Expand Down Expand Up @@ -114,7 +114,7 @@ static int icjx_multireadpin(FAR struct ioexpander_dev_s *dev,
FAR const uint8_t *pins, FAR bool *values,
int count);
#endif
#ifdef CONFIG_IOEXPANDER_INT_ENABLE
#ifdef CONFIG_ICJX_INT_ENABLE
static FAR void *icjx_attach(FAR struct ioexpander_dev_s *dev,
ioe_pinset_t pinset, ioe_callback_t callback,
FAR void *arg);
Expand Down Expand Up @@ -147,7 +147,7 @@ static const struct ioexpander_ops_s g_icjx_ops =
, icjx_multireadpin
, icjx_multireadpin
#endif
#ifdef CONFIG_IOEXPANDER_INT_ENABLE
#ifdef CONFIG_ICJX_INT_ENABLE
, icjx_attach
, icjx_detach
#endif
Expand Down Expand Up @@ -871,7 +871,7 @@ static int icjx_multireadpin(FAR struct ioexpander_dev_s *dev,
*
****************************************************************************/

#ifdef CONFIG_IOEXPANDER_INT_ENABLE
#ifdef CONFIG_ICJX_INT_ENABLE
static FAR void *icjx_attach(FAR struct ioexpander_dev_s *dev,
ioe_pinset_t pinset, ioe_callback_t callback,
FAR void *arg)
Expand Down

0 comments on commit 73ca3ab

Please sign in to comment.