diff options
author | John Crispin <john@openwrt.org> | 2010-03-25 11:50:46 +0000 |
---|---|---|
committer | John Crispin <john@openwrt.org> | 2010-03-25 11:50:46 +0000 |
commit | 0f1522cf59ad4f10ce0422a473d02f86b79670c0 (patch) | |
tree | 4d89b518e236ed45c32629556b0b3c5ca6120941 /target/linux/ifxmips/patches-2.6.30 | |
parent | 821bd49569acf55cc6489c762dc279f6da838dee (diff) | |
download | upstream-0f1522cf59ad4f10ce0422a473d02f86b79670c0.tar.gz upstream-0f1522cf59ad4f10ce0422a473d02f86b79670c0.tar.bz2 upstream-0f1522cf59ad4f10ce0422a473d02f86b79670c0.zip |
implement gpiolib drivers for core gpio and ebu attached latches
SVN-Revision: 20418
Diffstat (limited to 'target/linux/ifxmips/patches-2.6.30')
-rw-r--r-- | target/linux/ifxmips/patches-2.6.30/100-board.patch | 25 | ||||
-rw-r--r-- | target/linux/ifxmips/patches-2.6.30/600-ebu-gpio.patch | 196 |
2 files changed, 208 insertions, 13 deletions
diff --git a/target/linux/ifxmips/patches-2.6.30/100-board.patch b/target/linux/ifxmips/patches-2.6.30/100-board.patch index 16272698ec..5e7530ecde 100644 --- a/target/linux/ifxmips/patches-2.6.30/100-board.patch +++ b/target/linux/ifxmips/patches-2.6.30/100-board.patch @@ -1,8 +1,8 @@ -Index: linux-2.6.30.5/arch/mips/Kconfig +Index: linux-2.6.30.10/arch/mips/Kconfig =================================================================== ---- linux-2.6.30.5.orig/arch/mips/Kconfig 2009-09-02 22:12:48.000000000 +0200 -+++ linux-2.6.30.5/arch/mips/Kconfig 2009-09-03 01:18:31.000000000 +0200 -@@ -79,6 +79,24 @@ +--- linux-2.6.30.10.orig/arch/mips/Kconfig 2010-03-24 15:32:02.000000000 +0100 ++++ linux-2.6.30.10/arch/mips/Kconfig 2010-03-24 21:56:29.000000000 +0100 +@@ -79,6 +79,23 @@ select SYS_SUPPORTS_64BIT_KERNEL select SYS_SUPPORTS_LITTLE_ENDIAN @@ -20,14 +20,13 @@ Index: linux-2.6.30.5/arch/mips/Kconfig + select SYS_SUPPORTS_MULTITHREADING + select SYS_HAS_EARLY_PRINTK + select HW_HAS_PCI -+ select GENERIC_GPIO -+ select ARCH_WANT_OPTIONAL_GPIOLIB ++ select ARCH_REQUIRE_GPIOLIB + select SWAP_IO_SPACE + config MACH_DECSTATION bool "DECstations" select BOOT_ELF32 -@@ -643,6 +661,7 @@ +@@ -643,6 +660,7 @@ source "arch/mips/txx9/Kconfig" source "arch/mips/vr41xx/Kconfig" source "arch/mips/cavium-octeon/Kconfig" @@ -35,10 +34,10 @@ Index: linux-2.6.30.5/arch/mips/Kconfig endmenu -Index: linux-2.6.30.5/arch/mips/Makefile +Index: linux-2.6.30.10/arch/mips/Makefile =================================================================== ---- linux-2.6.30.5.orig/arch/mips/Makefile 2009-09-02 22:12:48.000000000 +0200 -+++ linux-2.6.30.5/arch/mips/Makefile 2009-09-02 22:12:53.000000000 +0200 +--- linux-2.6.30.10.orig/arch/mips/Makefile 2010-03-24 15:32:02.000000000 +0100 ++++ linux-2.6.30.10/arch/mips/Makefile 2010-03-24 15:32:04.000000000 +0100 @@ -290,6 +290,13 @@ load-$(CONFIG_MIPS_COBALT) += 0xffffffff80080000 @@ -53,10 +52,10 @@ Index: linux-2.6.30.5/arch/mips/Makefile # DECstation family # core-$(CONFIG_MACH_DECSTATION) += arch/mips/dec/ -Index: linux-2.6.30.5/arch/mips/include/asm/bootinfo.h +Index: linux-2.6.30.10/arch/mips/include/asm/bootinfo.h =================================================================== ---- linux-2.6.30.5.orig/arch/mips/include/asm/bootinfo.h 2009-09-02 22:12:48.000000000 +0200 -+++ linux-2.6.30.5/arch/mips/include/asm/bootinfo.h 2009-09-02 22:13:05.000000000 +0200 +--- linux-2.6.30.10.orig/arch/mips/include/asm/bootinfo.h 2009-12-04 07:00:07.000000000 +0100 ++++ linux-2.6.30.10/arch/mips/include/asm/bootinfo.h 2010-03-24 15:32:04.000000000 +0100 @@ -57,6 +57,8 @@ #define MACH_MIKROTIK_RB532 0 /* Mikrotik RouterBoard 532 */ #define MACH_MIKROTIK_RB532A 1 /* Mikrotik RouterBoard 532A */ diff --git a/target/linux/ifxmips/patches-2.6.30/600-ebu-gpio.patch b/target/linux/ifxmips/patches-2.6.30/600-ebu-gpio.patch new file mode 100644 index 0000000000..01e428a183 --- /dev/null +++ b/target/linux/ifxmips/patches-2.6.30/600-ebu-gpio.patch @@ -0,0 +1,196 @@ +Index: linux-2.6.30.10/drivers/gpio/Kconfig +=================================================================== +--- linux-2.6.30.10.orig/drivers/gpio/Kconfig 2010-03-24 21:55:56.000000000 +0100 ++++ linux-2.6.30.10/drivers/gpio/Kconfig 2010-03-24 21:56:36.000000000 +0100 +@@ -176,4 +176,12 @@ + SPI driver for Microchip MCP23S08 I/O expander. This provides + a GPIO interface supporting inputs and outputs. + ++comment "EBU GPIO expanders:" ++ ++config GPIO_IFXMIPS_EBU ++ boolean "IFXMIPS EBU attached I/O expander" ++ depends on IFXMIPS ++ help ++ This driver allows you to drive latches attached to the SoCc External Bus Unit ++ + endif +Index: linux-2.6.30.10/drivers/gpio/Makefile +=================================================================== +--- linux-2.6.30.10.orig/drivers/gpio/Makefile 2010-03-24 21:55:56.000000000 +0100 ++++ linux-2.6.30.10/drivers/gpio/Makefile 2010-03-24 21:56:36.000000000 +0100 +@@ -12,3 +12,4 @@ + obj-$(CONFIG_GPIO_TWL4030) += twl4030-gpio.o + obj-$(CONFIG_GPIO_XILINX) += xilinx_gpio.o + obj-$(CONFIG_GPIO_BT8XX) += bt8xxgpio.o ++obj-$(CONFIG_GPIO_IFXMIPS_EBU) += ifxmips_ebu_gpio.o +Index: linux-2.6.30.10/arch/mips/ifxmips/board.c +=================================================================== +--- linux-2.6.30.10.orig/arch/mips/ifxmips/board.c 2010-03-25 10:43:06.000000000 +0100 ++++ linux-2.6.30.10/arch/mips/ifxmips/board.c 2010-03-25 12:40:54.000000000 +0100 +@@ -111,6 +111,11 @@ + .name = "ifxmips_wdt", + }; + ++static struct platform_device ifxmips_ebu = { ++ .id = 0, ++ .name = "ifxmips_ebu", ++}; ++ + static struct resource ifxmips_mtd_resource = { + .start = IFXMIPS_FLASH_START, + .end = IFXMIPS_FLASH_START + IFXMIPS_FLASH_MAX - 1, +@@ -145,10 +150,18 @@ + static struct gpio_led arv452_gpio_leds[] = { + { .name = "ifx:blue:power", .gpio = 3, .active_low = 1, }, + { .name = "ifx:blue:adsl", .gpio = 4, .active_low = 1, }, +- { .name = "ifx:pink:internet", .gpio = 5, .active_low = 1, }, ++ { .name = "ifx:blue:internet", .gpio = 5, .active_low = 1, }, + { .name = "ifx:red:power", .gpio = 6, .active_low = 1, }, + { .name = "ifx:yello:wps", .gpio = 7, .active_low = 1, }, + { .name = "ifx:red:wps", .gpio = 9, .active_low = 1, }, ++ { .name = "ifx:blue:voip", .gpio = 32, .active_low = 1, }, ++ { .name = "ifx:blue:fxs1", .gpio = 33, .active_low = 1, }, ++ { .name = "ifx:blue:fxs2", .gpio = 34, .active_low = 1, }, ++ { .name = "ifx:blue:fxo", .gpio = 35, .active_low = 1, }, ++ { .name = "ifx:blue:voice", .gpio = 36, .active_low = 1, }, ++ { .name = "ifx:blue:usb", .gpio = 37, .active_low = 1, }, ++ { .name = "ifx:blue:wlan", .gpio = 38, .active_low = 1, }, ++ { .name = "ifx:red:internet", .gpio = 41, .active_low = 1, }, + }; + + static struct gpio_led_platform_data ifxmips_gpio_led_data; +@@ -205,6 +218,7 @@ + struct platform_device *arv452_devs[] = { + &ifxmips_gpio, &ifxmips_mii, &ifxmips_mtd, + &ifxmips_gpio_dev, &ifxmips_wdt, &dwc_usb, ++ &ifxmips_ebu, + #ifdef CONFIG_LEDS_GPIO + &ifxmips_gpio_leds, + #endif +Index: linux-2.6.30.10/drivers/gpio/ifxmips_ebu_gpio.c +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ linux-2.6.30.10/drivers/gpio/ifxmips_ebu_gpio.c 2010-03-25 12:47:07.000000000 +0100 +@@ -0,0 +1,121 @@ ++/* ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. ++ * ++ * Copyright (C) 2010 John Crispin <blogic@openwrt.org> ++ */ ++ ++#include <linux/init.h> ++#include <linux/platform_device.h> ++#include <linux/mutex.h> ++#include <linux/gpio.h> ++#include <ifxmips.h> ++ ++#define IFXMIPS_EBU_START 0x14000000 ++#define IFXMIPS_EBU_MAX 0x00001000 ++#define IFXMIPS_EBU_BUSCON 0x1e7ff ++#define IFXMIPS_EBU_WP 0x80000000 ++ ++static int shadow = (1 << 10) | (1 << 8); ++static void __iomem *virt; ++ ++static int ++ifxmips_ebu_direction_input(struct gpio_chip *chip, unsigned offset) ++{ ++ return -EINVAL; ++} ++ ++static int ++ifxmips_ebu_direction_output(struct gpio_chip *chip, unsigned offset, int value) ++{ ++ return 0; ++} ++ ++static int ++ifxmips_ebu_get(struct gpio_chip *chip, unsigned offset) ++{ ++ return -EINVAL; ++} ++ ++static void ++ifxmips_ebu_set(struct gpio_chip *chip, unsigned offset, int value) ++{ ++ if(value) ++ shadow |= (1 << offset); ++ else ++ shadow &= ~(1 << offset); ++ ifxmips_w32(IFXMIPS_EBU_BUSCON, IFXMIPS_EBU_BUSCON1); ++ *((__u16*)virt) = shadow; ++ ifxmips_w32(IFXMIPS_EBU_BUSCON | IFXMIPS_EBU_WP, IFXMIPS_EBU_BUSCON1); ++} ++ ++static struct gpio_chip ++ifxmips_ebu_chip = ++{ ++ .label = "ifxmips_ebu", ++ .direction_input = ifxmips_ebu_direction_input, ++ .direction_output = ifxmips_ebu_direction_output, ++ .set = ifxmips_ebu_set, ++ .get = ifxmips_ebu_get, ++ .base = 32, ++ .ngpio = 16, ++ .can_sleep = 1, ++ .owner = THIS_MODULE, ++}; ++ ++static int __devinit ++ifxmips_ebu_probe(struct platform_device *dev) ++{ ++ ifxmips_w32(IFXMIPS_EBU_START | 0x1, IFXMIPS_EBU_ADDRSEL1); ++ ifxmips_w32(IFXMIPS_EBU_BUSCON | IFXMIPS_EBU_WP, IFXMIPS_EBU_BUSCON1); ++ virt = ioremap_nocache(IFXMIPS_EBU_START, IFXMIPS_EBU_MAX); ++ if(gpiochip_add(&ifxmips_ebu_chip)) ++ return -EINVAL; ++ return 0; ++} ++ ++static int ++ifxmips_ebu_remove(struct platform_device *dev) ++{ ++ return gpiochip_remove(&ifxmips_ebu_chip); ++} ++ ++static struct platform_driver ++ifxmips_ebu_driver = { ++ .probe = ifxmips_ebu_probe, ++ .remove = ifxmips_ebu_remove, ++ .driver = { ++ .name = "ifxmips_ebu", ++ .owner = THIS_MODULE, ++ }, ++}; ++ ++static int __init ++ifxmips_ebu_init(void) ++{ ++ return platform_driver_register(&ifxmips_ebu_driver); ++} ++ ++static void __exit ++ifxmips_ebu_exit(void) ++{ ++ platform_driver_unregister(&ifxmips_ebu_driver); ++} ++ ++module_init(ifxmips_ebu_init); ++module_exit(ifxmips_ebu_exit); ++ ++MODULE_AUTHOR("John Crispin <blogic@openwrt.org>"); ++MODULE_LICENSE("GPL v2"); ++MODULE_DESCRIPTION("ifxmips - EBU Latch GPIO-Expander"); |