Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

drivers: gpio: Make PCA9535 driver generic to support multiple PCA95xx devices #19262

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@
/drivers/flash/*stm32* @superna9999
/drivers/gpio/*ht16k33* @henrikbrixandersen
/drivers/gpio/*stm32* @rsalveti @idlethread
/drivers/gpio/*pcal95* @dcpleung @tbursztyka @albertofloyd
/drivers/hwinfo/ @alexanderwachter
/drivers/i2s/i2s_ll_stm32* @avisconti
/drivers/ieee802154/ @jukkar @tbursztyka
Expand Down
2 changes: 1 addition & 1 deletion drivers/gpio/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ zephyr_library_sources_ifdef(CONFIG_GPIO_MCUX_LPC gpio_mcux_lpc.c)
zephyr_library_sources_ifdef(CONFIG_GPIO_MMIO32 gpio_mmio32.c)
zephyr_library_sources_ifdef(CONFIG_GPIO_XEC gpio_mchp_xec.c)
zephyr_library_sources_ifdef(CONFIG_GPIO_NRFX gpio_nrfx.c)
zephyr_library_sources_ifdef(CONFIG_GPIO_PCAL9535A gpio_pcal9535a.c)
zephyr_library_sources_ifdef(CONFIG_GPIO_PCAL95XX gpio_pcal95xx.c)
zephyr_library_sources_ifdef(CONFIG_GPIO_STM32 gpio_stm32.c)
zephyr_library_sources_ifdef(CONFIG_GPIO_SAM0 gpio_sam0.c)
zephyr_library_sources_ifdef(CONFIG_GPIO_SAM gpio_sam.c)
Expand Down
2 changes: 1 addition & 1 deletion drivers/gpio/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ config GPIO_SHELL

source "drivers/gpio/Kconfig.dw"

source "drivers/gpio/Kconfig.pcal9535a"
source "drivers/gpio/Kconfig.pcal95xx"

source "drivers/gpio/Kconfig.mcux"

Expand Down
70 changes: 38 additions & 32 deletions drivers/gpio/Kconfig.pcal9535a → drivers/gpio/Kconfig.pcal95xx
Original file line number Diff line number Diff line change
Expand Up @@ -6,118 +6,124 @@
# SPDX-License-Identifier: Apache-2.0
#

menuconfig GPIO_PCAL9535A
menuconfig GPIO_PCAL95XX
bool "PCAL9535A I2C-based GPIO chip"
depends on I2C
help
Enable driver for PCAL9535A I2C-based GPIO chip.

if GPIO_PCAL9535A
if GPIO_PCAL95XX

config GPIO_PCAL9535A_INIT_PRIORITY
config GPIO_PCAL95XX_INIT_PRIORITY
int "Init priority"
default 70
help
Device driver initialization priority.

config GPIO_PCAL9535A_0
config GPIO_PCAL95XX_PUD
bool "GPIO chip pull-up/down support"
default y
help
Compatible chips support for pull-up/down registers.

config GPIO_PCAL95XX_0
bool "PCAL9535A GPIO chip #0"
help
Enable config options for the PCAL9535A I2C-based GPIO chip #0.

config GPIO_PCAL9535A_0_DEV_NAME
config GPIO_PCAL95XX_0_DEV_NAME
string "PCAL9535A GPIO chip #0 Device Name"
depends on GPIO_PCAL9535A_0
depends on GPIO_PCAL95XX_0
default "GPIO_P0"
help
Specify the device name for the PCAL9535A I2C-based GPIO chip #0.

config GPIO_PCAL9535A_0_I2C_ADDR
config GPIO_PCAL95XX_0_I2C_ADDR
hex "PCAL9535A GPIO chip #0 I2C slave address"
depends on GPIO_PCAL9535A_0
depends on GPIO_PCAL95XX_0
help
Specify the I2C slave address for the PCAL9535A I2C-based GPIO chip #0.

config GPIO_PCAL9535A_0_I2C_MASTER_DEV_NAME
config GPIO_PCAL95XX_0_I2C_MASTER_DEV_NAME
string "I2C Master where PCAL9535A GPIO chip #0 is connected"
depends on GPIO_PCAL9535A_0
depends on GPIO_PCAL95XX_0
help
Specify the device name of the I2C master device to which this
PCAL9535A chip #0 is binded.

config GPIO_PCAL9535A_1
config GPIO_PCAL95XX_1
bool "PCAL9535A GPIO chip #1"
help
Enable config options for the PCAL9535A I2C-based GPIO chip #1.

config GPIO_PCAL9535A_1_DEV_NAME
config GPIO_PCAL95XX_1_DEV_NAME
string "PCAL9535A GPIO chip #1 Device Name"
depends on GPIO_PCAL9535A_1
depends on GPIO_PCAL95XX_1
default "GPIO_P1"
help
Specify the device name for the PCAL9535A I2C-based GPIO chip #1.

config GPIO_PCAL9535A_1_I2C_ADDR
config GPIO_PCAL95XX_1_I2C_ADDR
hex "PCAL9535A GPIO chip #1 I2C slave address"
depends on GPIO_PCAL9535A_1
depends on GPIO_PCAL95XX_1
help
Specify the I2C slave address for the PCAL9535A I2C-based GPIO chip #1.

config GPIO_PCAL9535A_1_I2C_MASTER_DEV_NAME
config GPIO_PCAL95XX_1_I2C_MASTER_DEV_NAME
string "I2C Master where PCAL9535A GPIO chip #1 is connected"
depends on GPIO_PCAL9535A_1
depends on GPIO_PCAL95XX_1
help
Specify the device name of the I2C master device to which this
PCAL9535A chip #1 is binded.

config GPIO_PCAL9535A_2
config GPIO_PCAL95XX_2
bool "PCAL9535A GPIO chip #2"
help
Enable config options for the PCAL9535A I2C-based GPIO chip #2.

config GPIO_PCAL9535A_2_DEV_NAME
config GPIO_PCAL95XX_2_DEV_NAME
string "PCAL9535A GPIO chip #2 Device Name"
depends on GPIO_PCAL9535A_2
depends on GPIO_PCAL95XX_2
default "GPIO_P2"
help
Specify the device name for the PCAL9535A I2C-based GPIO chip #2.

config GPIO_PCAL9535A_2_I2C_ADDR
config GPIO_PCAL95XX_2_I2C_ADDR
hex "PCAL9535A GPIO chip #2 I2C slave address"
depends on GPIO_PCAL9535A_2
depends on GPIO_PCAL95XX_2
help
Specify the I2C slave address for the PCAL9535A I2C-based GPIO chip #2.

config GPIO_PCAL9535A_2_I2C_MASTER_DEV_NAME
config GPIO_PCAL95XX_2_I2C_MASTER_DEV_NAME
string "I2C Master where PCAL9535A GPIO chip #2 is connected"
depends on GPIO_PCAL9535A_2
depends on GPIO_PCAL95XX_2
help
Specify the device name of the I2C master device to which this
PCAL9535A chip #2 is binded.

config GPIO_PCAL9535A_3
config GPIO_PCAL95XX_3
bool "PCAL9535A GPIO chip #3"
help
Enable config options for the PCAL9535A I2C-based GPIO chip #3.

config GPIO_PCAL9535A_3_DEV_NAME
config GPIO_PCAL95XX_3_DEV_NAME
string "PCAL9535A GPIO chip #3 Device Name"
depends on GPIO_PCAL9535A_3
depends on GPIO_PCAL95XX_3
default "GPIO_P3"
help
Specify the device name for the PCAL9535A I2C-based GPIO chip #3.

config GPIO_PCAL9535A_3_I2C_ADDR
config GPIO_PCAL95XX_3_I2C_ADDR
hex "PCAL9535A GPIO chip #3 I2C slave address"
depends on GPIO_PCAL9535A_3
depends on GPIO_PCAL95XX_3
help
Specify the I2C slave address for the PCAL9535A I2C-based GPIO chip #3.

config GPIO_PCAL9535A_3_I2C_MASTER_DEV_NAME
config GPIO_PCAL95XX_3_I2C_MASTER_DEV_NAME
string "I2C Master where PCAL9535A GPIO chip #3 is connected"
depends on GPIO_PCAL9535A_3
depends on GPIO_PCAL95XX_3
help
Specify the device name of the I2C master device to which this
PCAL9535A chip #3 is binded.

endif # GPIO_PCAL9535A
endif # GPIO_PCAL95XX
Loading