ARM/mx35/3ds: gpio: add mc9s08dz60 gpio function
PATCH v7 1/1 ARM/mx35/3ds: gpio: add mc9s08dz60 gpio function
From: wu guoxing <[email protected]>
we only use the gpio function of mc9s08dz60 mcu chip, so just add the gpio driver, as this mcu will never be used in other board.
---
changes since v6:
1. use module_i2c_driver()
2. some style changes.
changes since v5:
1. do not set i2c client data to NULL in probe&remove as i2c core will handle it.
2. return error code to i2c core in remove function as i2c-core will depend on it to set i2c client data to NULL.
changes since v4:
1. set i2c client data to NULL only when gpiochip_remove success.
changes since v3:
1. set i2c client data before gpiochip_add
2. return error value in mc9s08dz60_direction_output
Changes since v1:
1. add can_sleep = 1
2. removed some useless return checks and local variable
3. removed the static variable for i2c client.
4. make init&exit function static
drivers/gpio/Kconfig | 6 ++ drivers/gpio/Makefile | 1 + drivers/gpio/gpio-mc9s08dz60.c | 161 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 168 insertions(+), 0 deletions(-) create mode 100644 drivers/gpio/gpio-mc9s08dz60.c
drivers/gpio/Kconfig +6 -0
@@ -489,4 +489,10 @@ config GPIO_TPS65910 help Select this option to enable GPIO driver for the TPS65910 chip family. + +config GPIO_MC9S08DZ60 + bool "MX35 3DS BOARD MC9S08DZ60 GPIO functions" + depends on I2C && MACH_MX35_3DS + help + Select this to enable the MC9S08DZ60 GPIO driver endif
drivers/gpio/Makefile +1 -0
@@ -26,6 +26,7 @@ obj-$(CONFIG_GPIO_MAX7300) += gpio-max7300.o obj-$(CONFIG_GPIO_MAX7301) += gpio-max7301.o obj-$(CONFIG_GPIO_MAX732X) += gpio-max732x.o obj-$(CONFIG_GPIO_MC33880) += gpio-mc33880.o +obj-$(CONFIG_GPIO_MC9S08DZ60) += gpio-mc9s08dz60.o obj-$(CONFIG_GPIO_MCP23S08) += gpio-mcp23s08.o obj-$(CONFIG_GPIO_ML_IOH) += gpio-ml-ioh.o obj-$(CONFIG_GPIO_MPC5200) += gpio-mpc5200.o
drivers/gpio/gpio-mc9s08dz60.c new file +161 -0
161 lines not on this page · raw message
Signature · 1 line
1.7.1
PATCH v7 1/1 ARM/mx35/3ds: gpio: add mc9s08dz60 gpio function
Quoted 9 lines · Wu Guoxing
From: wu guoxing <[email protected]>
we only use the gpio function of mc9s08dz60 mcu chip, so just add the gpio driver, as this mcu will never be used in other board.
Signed-off-by Wu Guoxing <[email protected]>Reviewed-by Sascha Hauer <[email protected]>---
please add the of bindings directly
Best Regards,
J.
PATCH v7 1/1 ARM/mx35/3ds: gpio: add mc9s08dz60 gpio function
Quoted 12 lines · Jean-Christophe PLAGNIOL-VILLARD
Quoted 9 lines · Wu Guoxing
From: wu guoxing <[email protected]>
we only use the gpio function of mc9s08dz60 mcu chip, so just add the gpio driver, as this mcu will never be used in other board.
Signed-off-by Wu Guoxing <[email protected]>Reviewed-by Sascha Hauer <[email protected]>---
please add the of bindings directly
We do not have device tree support on imx3 yet, so I'm not sure we can test it.
Signature · 2 lines
Regards, Shawn
Grant Likely
AppliedPATCH v7 1/1 ARM/mx35/3ds: gpio: add mc9s08dz60 gpio function
In reply to Wu GuoxingQuoted 8 lines · Wu Guoxing
From: wu guoxing <[email protected]>
we only use the gpio function of mc9s08dz60 mcu chip, so just add the gpio driver, as this mcu will never be used in other board.
Signed-off-by Wu Guoxing <[email protected]>Reviewed-by Sascha Hauer <[email protected]>
Applied, thanks.
g.