2015-02-09 14:24:00 +00:00
|
|
|
--- a/arch/arm/mach-ixp4xx/common.c
|
|
|
|
+++ b/arch/arm/mach-ixp4xx/common.c
|
2015-02-13 10:54:01 +00:00
|
|
|
@@ -93,22 +93,7 @@
|
2015-02-09 14:24:00 +00:00
|
|
|
/*
|
|
|
|
* GPIO-functions
|
|
|
|
*/
|
|
|
|
-/*
|
|
|
|
- * The following converted to the real HW bits the gpio_line_config
|
|
|
|
- */
|
|
|
|
-/* GPIO pin types */
|
|
|
|
-#define IXP4XX_GPIO_OUT 0x1
|
|
|
|
-#define IXP4XX_GPIO_IN 0x2
|
|
|
|
-
|
|
|
|
-/* GPIO signal types */
|
|
|
|
-#define IXP4XX_GPIO_LOW 0
|
|
|
|
-#define IXP4XX_GPIO_HIGH 1
|
|
|
|
-
|
|
|
|
-/* GPIO Clocks */
|
|
|
|
-#define IXP4XX_GPIO_CLK_0 14
|
|
|
|
-#define IXP4XX_GPIO_CLK_1 15
|
|
|
|
-
|
|
|
|
-static void gpio_line_config(u8 line, u32 direction)
|
|
|
|
+void gpio_line_config(u8 line, u32 direction)
|
|
|
|
{
|
|
|
|
if (direction == IXP4XX_GPIO_IN)
|
|
|
|
*IXP4XX_GPIO_GPOER |= (1 << line);
|
2015-02-13 10:54:01 +00:00
|
|
|
@@ -116,17 +101,17 @@
|
2015-02-09 14:24:00 +00:00
|
|
|
*IXP4XX_GPIO_GPOER &= ~(1 << line);
|
|
|
|
}
|
|
|
|
|
|
|
|
-static void gpio_line_get(u8 line, int *value)
|
|
|
|
+void gpio_line_get(u8 line, int *value)
|
|
|
|
{
|
|
|
|
*value = (*IXP4XX_GPIO_GPINR >> line) & 0x1;
|
|
|
|
}
|
|
|
|
|
|
|
|
-static void gpio_line_set(u8 line, int value)
|
|
|
|
+void gpio_line_set(u8 line, int value)
|
|
|
|
{
|
2015-02-13 10:54:01 +00:00
|
|
|
- if (value == IXP4XX_GPIO_HIGH)
|
|
|
|
- *IXP4XX_GPIO_GPOUTR |= (1 << line);
|
|
|
|
- else if (value == IXP4XX_GPIO_LOW)
|
|
|
|
+ if (value == IXP4XX_GPIO_LOW)
|
|
|
|
*IXP4XX_GPIO_GPOUTR &= ~(1 << line);
|
|
|
|
+ else
|
|
|
|
+ *IXP4XX_GPIO_GPOUTR |= (1 << line);
|
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
2015-02-09 14:24:00 +00:00
|
|
|
--- a/arch/arm/mach-ixp4xx/include/mach/platform.h
|
|
|
|
+++ b/arch/arm/mach-ixp4xx/include/mach/platform.h
|
2015-02-13 10:54:01 +00:00
|
|
|
@@ -131,5 +131,21 @@
|
2015-02-09 14:24:00 +00:00
|
|
|
extern int ixp4xx_setup(int nr, struct pci_sys_data *sys);
|
|
|
|
extern struct pci_ops ixp4xx_ops;
|
|
|
|
|
|
|
|
+/* GPIO pin types */
|
|
|
|
+#define IXP4XX_GPIO_OUT 0x1
|
|
|
|
+#define IXP4XX_GPIO_IN 0x2
|
|
|
|
+
|
|
|
|
+/* GPIO signal types */
|
|
|
|
+#define IXP4XX_GPIO_LOW 0
|
|
|
|
+#define IXP4XX_GPIO_HIGH 1
|
|
|
|
+
|
|
|
|
+/* GPIO Clocks */
|
|
|
|
+#define IXP4XX_GPIO_CLK_0 14
|
|
|
|
+#define IXP4XX_GPIO_CLK_1 15
|
|
|
|
+
|
|
|
|
+void gpio_line_config(u8 line, u32 direction);
|
|
|
|
+void gpio_line_get(u8 line, int *value);
|
|
|
|
+void gpio_line_set(u8 line, int value);
|
|
|
|
+
|
|
|
|
#endif // __ASSEMBLY__
|
|
|
|
|