Skip to contentSkip to conversation

gpio: rc5t583: add gpio driver for RICOH PMIC RC5T583

PATCH New Laxman Dewangan 1 participant 1 message May 14, 2012

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 gpio: rc5t583: add gpio driver for RICOH PMIC RC5T583

The PMIC device RC5T583 from RICOH supports 8 gpios. Adding gpio driver for this device to access the pins control through gpio library.

---
Changes from V1:
- Removing init flags through platform data.
- Configuring pins to gpio mode in direction_* functions.

 drivers/gpio/Kconfig        |    9 ++
 drivers/gpio/Makefile       |    1 +
 drivers/gpio/gpio-rc5t583.c |  185 +++++++++++++++++++++++++++++++++++++++++++
 include/linux/mfd/rc5t583.h |    2 +
 4 files changed, 197 insertions(+), 0 deletions(-)
 create mode 100644 drivers/gpio/gpio-rc5t583.c
drivers/gpio/Kconfig +9 -0
index 0833ed5..34899cd 100644
@@ -306,6 +306,15 @@ config GPIO_PCF857X
 	  This driver provides an in-kernel interface to those GPIOs using
 	  platform-neutral GPIO calls.
 
+config GPIO_RC5T583
+	bool "RICOH RC5T583 GPIO"
+	depends on MFD_RC5T583
+	help
+	  Select this option to enable GPIO driver for the Ricoh RC5T583
+	  chip family.
+	  This driver provides the support for driving/reading the gpio pins
+	  of RC5T583 device through standard gpio library.
+
 config GPIO_SX150X
 	bool "Semtech SX150x I2C GPIO expander"
 	depends on I2C=y
drivers/gpio/Makefile +1 -0
index ad96381..58897a8 100644
@@ -45,6 +45,7 @@ obj-$(CONFIG_GPIO_PCF857X)	+= gpio-pcf857x.o
 obj-$(CONFIG_GPIO_PCH)		+= gpio-pch.o
 obj-$(CONFIG_GPIO_PL061)	+= gpio-pl061.o
 obj-$(CONFIG_GPIO_PXA)		+= gpio-pxa.o
+obj-$(CONFIG_GPIO_RC5T583)	+= gpio-rc5t583.o
 obj-$(CONFIG_GPIO_RDC321X)	+= gpio-rdc321x.o
 obj-$(CONFIG_PLAT_SAMSUNG)	+= gpio-samsung.o
 obj-$(CONFIG_ARCH_SA1100)	+= gpio-sa1100.o
drivers/gpio/gpio-rc5t583.c new file +185 -0

185 lines not on this page · raw message

include/linux/mfd/rc5t583.h +2 -0
index c42fe92..3661c59 100644
@@ -292,6 +292,7 @@ struct rc5t583 {
  * rc5t583_platform_data: Platform data for ricoh rc5t583 pmu.
  * The board specific data is provided through this structure.
  * @irq_base: Irq base number on which this device registers their interrupts.
+ * @gpio_base: GPIO base from which gpio of this device will start.
  * @enable_shutdown: Enable shutdown through the input pin "shutdown".
  * @regulator_deepsleep_slot: The slot number on which device goes to sleep
  *		in device sleep mode.
@@ -303,6 +304,7 @@ struct rc5t583 {
 
 struct rc5t583_platform_data {
 	int		irq_base;
+	int		gpio_base;
 	bool		enable_shutdown;
 	int		regulator_deepsleep_slot[RC5T583_REGULATOR_MAX];
 	unsigned long	regulator_ext_pwr_control[RC5T583_REGULATOR_MAX];
Signature · 1 line
1.7.1.1