Skip to content

Commit b52f5cb

Browse files
granquetkartben
authored andcommitted
drivers: gpio: add MAX22017 gpio support
MAX22017 is a DAC with support for 6 GPIOs Signed-off-by: Guillaume Ranquet <granquet@baylibre.com>
1 parent 31510fb commit b52f5cb

File tree

6 files changed

+477
-0
lines changed

6 files changed

+477
-0
lines changed

drivers/gpio/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ zephyr_library_sources_ifdef(CONFIG_GPIO_LMP90XXX gpio_lmp90xxx.c)
4444
zephyr_library_sources_ifdef(CONFIG_GPIO_LPC11U6X gpio_lpc11u6x.c)
4545
zephyr_library_sources_ifdef(CONFIG_GPIO_MAX14906 gpio_max14906.c)
4646
zephyr_library_sources_ifdef(CONFIG_GPIO_MAX14916 gpio_max14916.c)
47+
zephyr_library_sources_ifdef(CONFIG_GPIO_MAX22017 gpio_max22017.c)
4748
zephyr_library_sources_ifdef(CONFIG_GPIO_MAX22190 gpio_max22190.c)
4849
zephyr_library_sources_ifdef(CONFIG_GPIO_MAX32 gpio_max32.c)
4950
zephyr_library_sources_ifdef(CONFIG_GPIO_MCHP_MEC5 gpio_mchp_mec5.c)

drivers/gpio/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,7 @@ source "drivers/gpio/Kconfig.lmp90xxx"
134134
source "drivers/gpio/Kconfig.lpc11u6x"
135135
source "drivers/gpio/Kconfig.max14906"
136136
source "drivers/gpio/Kconfig.max14916"
137+
source "drivers/gpio/Kconfig.max22017"
137138
source "drivers/gpio/Kconfig.max22190"
138139
source "drivers/gpio/Kconfig.max32"
139140
source "drivers/gpio/Kconfig.mchp_mss"

drivers/gpio/Kconfig.max22017

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Copyright (c) 2024 Analog Devices Inc.
2+
# Copyright (c) 2024 BayLibre SAS
3+
# SPDX-License-Identifier: Apache-2.0
4+
5+
config GPIO_MAX22017
6+
bool "Analog Devices MAX22017 GPIO support"
7+
default y
8+
depends on DT_HAS_ADI_MAX22017_GPIO_ENABLED
9+
select MFD
10+
help
11+
Enable GPIO support for the Analog Devices MAX22017
12+
13+
if GPIO_MAX22017
14+
15+
config GPIO_MAX22017_INIT_PRIORITY
16+
int "Init priority"
17+
default 81
18+
help
19+
Analog Devices MAX22017 gpio device driver initialization priority.
20+
21+
config GPIO_MAX22017_INT_QUIRK
22+
bool "MAX22017 GPIO Interrupt quirk"
23+
help
24+
The GPIO controller will not report any new GPI interrupt as long as its interrupt status
25+
register hasn't been read.
26+
Reading the interrupt status register happens on a falling edge of the INT pin.
27+
There seems to be a condition when the GPIO controller detects an interrupt but it's INT
28+
pin stays high which masks any subsequent interrupts.
29+
To avoid being stuck in that state, fire a timer to periodically check the interrupt status
30+
register.
31+
32+
endif # GPIO_MAX22017

0 commit comments

Comments
 (0)