Skip to content

Commit

Permalink
drivers: gpio: add MAX22017 gpio support
Browse files Browse the repository at this point in the history
MAX22017 is a DAC with support for 6 GPIOs

Signed-off-by: Guillaume Ranquet <[email protected]>
  • Loading branch information
granquet committed Oct 15, 2024
1 parent 60e8c17 commit dd23c39
Show file tree
Hide file tree
Showing 6 changed files with 475 additions and 0 deletions.
1 change: 1 addition & 0 deletions drivers/gpio/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ zephyr_library_sources_ifdef(CONFIG_GPIO_LMP90XXX gpio_lmp90xxx.c)
zephyr_library_sources_ifdef(CONFIG_GPIO_LPC11U6X gpio_lpc11u6x.c)
zephyr_library_sources_ifdef(CONFIG_GPIO_MAX14906 gpio_max14906.c)
zephyr_library_sources_ifdef(CONFIG_GPIO_MAX14916 gpio_max14916.c)
zephyr_library_sources_ifdef(CONFIG_GPIO_MAX22017 gpio_max22017.c)
zephyr_library_sources_ifdef(CONFIG_GPIO_MAX32 gpio_max32.c)
zephyr_library_sources_ifdef(CONFIG_GPIO_MCHP_MSS gpio_mchp_mss.c)
zephyr_library_sources_ifdef(CONFIG_GPIO_MCP230XX gpio_mcp230xx.c)
Expand Down
1 change: 1 addition & 0 deletions drivers/gpio/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ config GPIO_ENABLE_DISABLE_INTERRUPT

# zephyr-keep-sorted-start
source "drivers/gpio/Kconfig.ad559x"
source "drivers/gpio/Kconfig.adi_max22017"
source "drivers/gpio/Kconfig.adp5585"
source "drivers/gpio/Kconfig.ads114s0x"
source "drivers/gpio/Kconfig.altera"
Expand Down
33 changes: 33 additions & 0 deletions drivers/gpio/Kconfig.adi_max22017
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Copyright (c) 2024 Analog Devices Inc.
# Copyright (c) 2024 BayLibre SAS
# SPDX-License-Identifier: Apache-2.0

config GPIO_MAX22017
bool "Analog Devices MAX22017 GPIO support"
default y
depends on DT_HAS_ADI_MAX22017_GPIO_ENABLED
select MFD
help
Enable GPIO support for the Analog Devices MAX22017

if GPIO_MAX22017

config GPIO_MAX22017_INIT_PRIORITY
int "Init priority"
default 81
help
Analog Devices MAX22017 gpio device driver initialization priority.

config GPIO_MAX22017_INT_QUIRK
bool "MAX22017 GPIO Interrupt quirk"
default n
help
The GPIO controller will not report any new GPI interrupt as long as its interrupt status
register hasn't been read.
Reading the interrupt status register happens on a falling edge of the INT pin.
There seems to be a condition when the GPIO controller detects an interrupt but it's INT
pin stays high which masks any subsequent interrupts.
To avoid being stuck in that state, fire a timer to periodically check the interrupt status
register.

endif # GPIO_MAX22017
Loading

0 comments on commit dd23c39

Please sign in to comment.