Skip to contentSkip to conversation

RC5T583: Add support for gpio

PATCH Applied Laxman Dewangan 2 participants 4 messages Apr 9, 2012 – Apr 16, 2012

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

v2 cover RC5T583: Add support for gpio

RICOH's PMIC support 8 gpios. Adding support of accessing these pins through gpio library.
This patch series add the related support.

Changes from V1:
As per suggestion from Grant, the gpio driver should be register as separate driver.
Making the related changes to have gpio driver as platform driver which got register through mfd devices from mfd core.

Laxman Dewangan (2):
gpio: Add gpio driver for RICOH PMIC RC5T583
mfd: rc5t583: add rc5t583's gpio in mfd device list

 drivers/gpio/Kconfig        |    9 ++
 drivers/gpio/Makefile       |    1 +
 drivers/gpio/gpio-rc5t583.c |  195 +++++++++++++++++++++++++++++++++++++++++++
 drivers/mfd/rc5t583.c       |    1 +
 include/linux/mfd/rc5t583.h |    9 ++
 5 files changed, 215 insertions(+), 0 deletions(-)
 create mode 100644 drivers/gpio/gpio-rc5t583.c
#1 lore raw

PATCH v2 1/2 gpio: 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.

---
 drivers/gpio/Kconfig        |    9 ++
 drivers/gpio/Makefile       |    1 +
 drivers/gpio/gpio-rc5t583.c |  195 +++++++++++++++++++++++++++++++++++++++++++
 include/linux/mfd/rc5t583.h |    9 ++
 4 files changed, 214 insertions(+), 0 deletions(-)
 create mode 100644 drivers/gpio/gpio-rc5t583.c
drivers/gpio/Kconfig +9 -0
index e03653d..4e1bd9e 100644
@@ -288,6 +288,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 007f54b..a27bf53 100644
@@ -43,6 +43,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 +195 -0

195 lines not on this page · raw message

include/linux/mfd/rc5t583.h +9 -0
index a2c6160..f5e64b2 100644
@@ -252,6 +252,8 @@ enum {
 struct rc5t583 {
 	struct device	*dev;
 	struct regmap	*regmap;
+	int		gpio_base;
+	struct gpio_chip *gpio_chip;
 	int		chip_irq;
 	int		irq_base;
 	struct mutex	irq_lock;
@@ -270,13 +272,20 @@ struct rc5t583 {
 /*
  * rc5t583_platform_data: Platform data for ricoh rc5t583 pmu.
  * The board specific data is provided through this structure.
+ * @gpio_base: Gpio base number on which device starts its gpio.
  * @irq_base: Irq base number on which this device registers their interrupts.
  * @enable_shutdown: Enable shutdown through the input pin "shutdown".
+ * @gpio_enable_pulldn: Enable internal pull down of gpios.
+ * @gpio_init_flag: Initial gpio flag which need to be configure during gpio
+ *		registration.
  */
 
 struct rc5t583_platform_data {
+	int		gpio_base;
 	int		irq_base;
 	bool		enable_shutdown;
+	bool		gpio_enable_pulldn[RC5T583_MAX_GPIO];
+	unsigned int	gpio_init_flag[RC5T583_MAX_GPIO];
 };
 
 int rc5t583_write(struct device *dev, u8 reg, uint8_t val);
Signature · 1 line
1.7.1.1
#2 lore raw

PATCH v2 2/2 mfd: rc5t583: add rc5t583's gpio in mfd device list

In reply to Laxman Dewangan

Adding the gpio of RC583 in the list of rc583 mfd devices to register the gpio driver of RC5T583.

---
 drivers/mfd/rc5t583.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
drivers/mfd/rc5t583.c +1 -0
index 99ef944..3439d3e 100644
@@ -75,6 +75,7 @@ static struct deepsleep_control_data deepsleep_data[] = {
 	(RC5T583_EXT_PWRREQ1_CONTROL | RC5T583_EXT_PWRREQ2_CONTROL)
 
 static struct mfd_cell rc5t583_subdevs[] = {
+	{.name = "rc5t583-gpio",},
 	{.name = "rc5t583-regulator",},
 	{.name = "rc5t583-rtc",      },
 	{.name = "rc5t583-key",      }
Signature · 1 line
1.7.1.1
Applied
#3 lore raw

Re: [PATCH V2 2/2] mfd: rc5t583: add rc5t583's gpio in mfd device list

Hi Laxman,

Quoted 7 lines · Laxman Dewangan

Adding the gpio of RC583 in the list of rc583 mfd devices to register the gpio driver of RC5T583.

---
 drivers/mfd/rc5t583.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

Applied to my for-next branch, thanks.

Cheers,
Samuel.

Signature · 2 lines
Intel Open Source Technology Centre
http://oss.intel.com/