Skip to contentSkip to conversation

gpio: Added timbgpio

PATCH In review Richard Ršöjfors 2 participants 4 messages Jun 3, 2009 – Jun 4, 2009 GPIO

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 gpio: Added timbgpio

Supplied is a GPIO driver for the Timberdale FPGA found on the Intel Atom board Russellville.

---

drivers/gpio/timbgpio.h +48 -0
Index: linux-2.6.30-rc7/drivers/gpio/timbgpio.h
===================================================================
@@ -0,0 +1,48 @@
+/*
+ * timbgpio.h timberdale FPGA GPIO driver defines
+ * Copyright (c) 2009 Intel Corporation
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+/* Supports:
+ * Timberdale FPGA GPIO
+ */
+
+#ifndef _TIMBGPIO_H_
+#define _TIMBGPIO_H_
+
+#include <linux/mutex.h>
+#include <linux/gpio.h>
+
+#define TIMB_NR_GPIOS 16
+
+#define TGPIOVAL 	0
+#define TGPIODIR 	0x04
+#define TGPIOINT 	0x08
+#define TGPIOINT_STATUS	0x0c
+#define TGPIOINT_PENDING 0x10
+#define TGPIOINT_CLR	0x14
+#define TGPIOFLK 	0x18
+#define TGPIOLVL 	0x1c
+
+struct timbgpio {
+	void __iomem		*membase;
+	struct resource		rscr;
+	struct mutex		lock; /* mutual exclusion */
+	struct pci_dev		*pdev;
+	struct gpio_chip	gpio;
+};
+
+#endif
drivers/gpio/timbgpio.c +275 -0

275 lines not on this page · raw message

drivers/gpio/Kconfig +6 -0
Index: linux-2.6.30-rc7/drivers/gpio/Kconfig
===================================================================
@@ -161,6 +161,12 @@
 
 	  If unsure, say N.
 
+config GPIO_TIMBERDALE
+	tristate "Support for timberdale GPIO"
+	depends on MFD_TIMBERDALE && GPIOLIB
+	---help---
+	Add support for GPIO usage of some pins of the timberdale FPGA.
+
 comment "SPI GPIO expanders:"
 
 config GPIO_MAX7301
drivers/gpio/Makefile +2 -0
Index: linux-2.6.30-rc7/drivers/gpio/Makefile
===================================================================
@@ -12,3 +12,5 @@
 obj-$(CONFIG_GPIO_TWL4030)	+= twl4030-gpio.o
 obj-$(CONFIG_GPIO_XILINX)	+= xilinx_gpio.o
 obj-$(CONFIG_GPIO_BT8XX)	+= bt8xxgpio.o
+obj-$(CONFIG_GPIO_TIMBERDALE)	+= timbgpio.o
+
#1 lore raw

drivers/gpio/timbgpio.c line 124

Quoted 9 lines · On Wed, 03 Jun 2009 10:07:48 +0200 Richard R____jfors…

Supplied is a GPIO driver for the Timberdale FPGA found on the Intel Atom board Russellville.

...

drivers/gpio/timbgpio.c +4 -0
+EXPORT_SYMBOL(timbgpio_gpio_flnk_lvl_ctrl);
+EXPORT_SYMBOL(timbgpio_gpio_int_ctrl);
+EXPORT_SYMBOL(timbgpio_gpio_lvl_ctrl);
+EXPORT_SYMBOL(timbgpio_gpio_int_clr);

Why all these module exports?

drivers/gpio/Kconfig line 169

Quoted 8 lines

...

drivers/gpio/Kconfig +6 -0
+config GPIO_TIMBERDALE
+	tristate "Support for timberdale GPIO"
+	depends on MFD_TIMBERDALE && GPIOLIB
+	---help---
+	Add support for GPIO usage of some pins of the timberdale FPGA.
+

I cannot find anything which sets MFD_TIMBERDALE anywhere?

#2 lore raw
Quoted 5 lines · Andrew Morton
Quoted 3 lines · On Wed, 03 Jun 2009 10:07:48 +0200 Richard R____jfors…

Supplied is a GPIO driver for the Timberdale FPGA found on the Intel Atom board Russellville.

Quoted 8 lines

drivers/gpio/timbgpio.c line 124

Quoted 6 lines

...

drivers/gpio/timbgpio.c +4 -0
+EXPORT_SYMBOL(timbgpio_gpio_flnk_lvl_ctrl);
+EXPORT_SYMBOL(timbgpio_gpio_int_ctrl);
+EXPORT_SYMBOL(timbgpio_gpio_lvl_ctrl);
+EXPORT_SYMBOL(timbgpio_gpio_int_clr);

Why all these module exports?

Internal stuff, I will remove it.

Quoted 10 lines

drivers/gpio/Kconfig line 169

Quoted 8 lines

...

drivers/gpio/Kconfig +6 -0
+config GPIO_TIMBERDALE
+	tristate "Support for timberdale GPIO"
+	depends on MFD_TIMBERDALE && GPIOLIB
+	---help---
+	Add support for GPIO usage of some pins of the timberdale FPGA.
+

I cannot find anything which sets MFD_TIMBERDALE anywhere?

Sorry, I realize I have to come back with a bigger patch set.

Timberdale is the MFD driver for the FPGA which among other expose this GPIO device. This patch set will depend on patches in i2c-ocores and xilinx_spi which I have posted earlier on the corresponding mailinglists.
Shall I repost those driver changes within this patch set, or can I leave them out?

--Richard

#3 lore raw
Quoted 4 lines · On Thu, 04 Jun 2009 14:53:04 +0200 Richard R____jfors…

Timberdale is the MFD driver for the FPGA which among other expose this GPIO device. This patch set will depend on patches in i2c-ocores and xilinx_spi which I have posted earlier on the corresponding mailinglists.
Shall I repost those driver changes within this patch set, or can I leave them out?

Resend everything in a single sequence-numbered patchset, Ccing every relevant person (including myself) and mailing list on everything. That should cover it ;)

Please also identify any merging-order interdependencies between the individual patches.

If it all looks OK then the chances are that I'll merge it all into my tree and than shall take care of maintainer-bugging for you.