Skip to contentSkip to conversation

gpio: Add PMIC GPIO block support

PATCH In review Alan Cox 2 participants 2 messages Jul 13, 2010 – Jul 22, 2010 x86 platform drivers

lore
Share & tools
lore

Alan Cox

author
#0 lore raw

PATCH 1/1 gpio: Add PMIC GPIO block support

From: Alek Du <[email protected]>

Moorestown has PMIC chip which contains GPIO blocks. The PMIC chip is connected to Langwell by SPI interface. So this GPIO driver will be regarded as SPI GPIO expander though the actual GPIO access is through IPC and SRAM. The SPI master contoller will probe this device driver by parsing SPIB table.

Cleaned up for new IPC, GPE removed and some printk and other tidying by Alan Cox. Fixes for points noted by Matthew Garrett

---

 drivers/platform/x86/Kconfig           |    7 +
 drivers/platform/x86/Makefile          |    2 
 drivers/platform/x86/intel_pmic_gpio.c |  341 ++++++++++++++++++++++++++++++++
 include/linux/intel_pmic_gpio.h        |   15 +
 4 files changed, 365 insertions(+), 0 deletions(-)
 create mode 100644 drivers/platform/x86/intel_pmic_gpio.c
 create mode 100644 include/linux/intel_pmic_gpio.h
drivers/platform/x86/Kconfig +7 -0
index 2f173bc..1ff8e8c 100644
@@ -539,6 +539,13 @@ config INTEL_SCU_IPC
 	  some embedded Intel x86 platforms. This is not needed for PC-type
 	  machines.
 
+config GPIO_INTEL_PMIC
+	bool "Intel PMIC GPIO support"
+	depends on INTEL_SCU_IPC && GPIOLIB
+	help
+	  Say Y here to support GPIO via the SCU IPC interface
+	  on Intel MID platforms.
+
 config RAR_REGISTER
 	bool "Restricted Access Region Register Driver"
 	depends on PCI && X86_MRST
drivers/platform/x86/Makefile +2 -0
index ed50eca..4744c77 100644
@@ -28,3 +28,5 @@ obj-$(CONFIG_TOSHIBA_BT_RFKILL)	+= toshiba_bluetooth.o
 obj-$(CONFIG_INTEL_SCU_IPC)	+= intel_scu_ipc.o
 obj-$(CONFIG_RAR_REGISTER)	+= intel_rar_register.o
 obj-$(CONFIG_INTEL_IPS)		+= intel_ips.o
+obj-$(CONFIG_GPIO_INTEL_PMIC)	+= intel_pmic_gpio.o
+
drivers/platform/x86/intel_pmic_gpio.c new file +341 -0

341 lines not on this page · raw message

include/linux/intel_pmic_gpio.h new file +15 -0
new file mode 100644
index 0000000..920109a
@@ -0,0 +1,15 @@
+#ifndef LINUX_INTEL_PMIC_H
+#define LINUX_INTEL_PMIC_H
+
+struct intel_pmic_gpio_platform_data {
+	/* the first IRQ of the chip */
+	unsigned	irq_base;
+	/* number assigned to the first GPIO */
+	unsigned	gpio_base;
+	/* sram address for gpiointr register, the langwell chip will map
+	 * the PMIC spi GPIO expander's GPIOINTR register in sram.
+	 */
+	unsigned	gpiointr;
+};
+
+#endif
#1 lore raw
Quoted 9 lines · Alan Cox

From: Alek Du <[email protected]>

Moorestown has PMIC chip which contains GPIO blocks. The PMIC chip is connected to Langwell by SPI interface. So this GPIO driver will be regarded as SPI GPIO expander though the actual GPIO access is through IPC and SRAM. The SPI master contoller will probe this device driver by parsing SPIB table.

Cleaned up for new IPC, GPE removed and some printk and other tidying by Alan Cox. Fixes for points noted by Matthew Garrett

Applied with some whitespace cleanup.

Signature · 1 line
Matthew Garrett | [email protected]