From: Michael Büsch Date: Sat, 18 Sep 2010 17:58:30 +0000 (+0000) Subject: omap24xx: Add n8x0 specific GPIO switch code X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=1e3c230596933752856f895a2b422b040b885639;p=openwrt%2Fstaging%2Fsvanheule.git omap24xx: Add n8x0 specific GPIO switch code SVN-Revision: 23082 --- diff --git a/target/linux/omap24xx/patches-2.6.36/300-nokia-board.patch b/target/linux/omap24xx/patches-2.6.36/300-nokia-board.patch index 4bec75ec8b..825d8be066 100644 --- a/target/linux/omap24xx/patches-2.6.36/300-nokia-board.patch +++ b/target/linux/omap24xx/patches-2.6.36/300-nokia-board.patch @@ -1,13 +1,13 @@ --- arch/arm/mach-omap1/board-nokia770.c | 16 + - arch/arm/mach-omap2/Kconfig | 10 + + arch/arm/mach-omap2/Kconfig | 10 arch/arm/mach-omap2/Makefile | 2 - arch/arm/mach-omap2/board-n8x0-lcd.c | 127 +++++++++++++ - arch/arm/mach-omap2/board-n8x0-usb.c | 175 +++++++++++++++++++ - arch/arm/mach-omap2/board-n8x0.c | 318 +++++++++++++++++++++++++---------- + arch/arm/mach-omap2/board-n8x0-lcd.c | 127 ++++++++++++ + arch/arm/mach-omap2/board-n8x0-usb.c | 175 +++++++++++++++++ + arch/arm/mach-omap2/board-n8x0.c | 355 ++++++++++++++++++++++++++--------- arch/arm/mach-omap2/control.c | 2 arch/arm/mach-omap2/serial.c | 8 - 8 files changed, 571 insertions(+), 87 deletions(-) + 8 files changed, 608 insertions(+), 87 deletions(-) --- linux-2.6.36-rc4.orig/arch/arm/mach-omap1/board-nokia770.c +++ linux-2.6.36-rc4/arch/arm/mach-omap1/board-nokia770.c @@ -58,15 +58,16 @@ #include #include -@@ -32,6 +36,7 @@ +@@ -32,6 +36,8 @@ #include #include #include +#include ++#include #include "mux.h" -@@ -39,109 +44,154 @@ static int slot1_cover_open; +@@ -39,109 +45,154 @@ static int slot1_cover_open; static int slot2_cover_open; static struct device *mmc_device; @@ -304,7 +305,7 @@ { .modalias = "p54spi", .bus_num = 2, -@@ -149,6 +199,68 @@ static struct spi_board_info n800_spi_bo +@@ -149,6 +200,68 @@ static struct spi_board_info n800_spi_bo .max_speed_hz = 48000000, .controller_data = &p54spi_mcspi_config, }, @@ -373,7 +374,7 @@ }; #if defined(CONFIG_MTD_ONENAND_OMAP2) || \ -@@ -183,6 +295,20 @@ static struct mtd_partition onenand_part +@@ -183,6 +296,20 @@ static struct mtd_partition onenand_part }, }; @@ -394,7 +395,7 @@ static struct omap_onenand_platform_data board_onenand_data = { .cs = 0, .gpio_irq = 26, -@@ -659,15 +785,41 @@ static struct omap_board_mux board_mux[] +@@ -659,15 +786,77 @@ static struct omap_board_mux board_mux[] #define board_mux NULL #endif @@ -407,13 +408,49 @@ +#endif + +extern void n8x0_usb_init(void); ++ ++static struct omap_gpio_switch n8x0_gpio_switches[] __initdata = { ++ { ++ .name = "headphone", ++ .gpio = -1, ++ .debounce_rising = 200, ++ .debounce_falling = 200, ++ }, { ++ .name = "cam_act", ++ .gpio = -1, ++ .debounce_rising = 200, ++ .debounce_falling = 200, ++ }, { ++ .name = "cam_turn", ++ .gpio = -1, ++ .debounce_rising = 100, ++ .debounce_falling = 100, ++ }, { ++ .name = "slide", ++ .gpio = -1, ++ .debounce_rising = 200, ++ .debounce_falling = 200, ++ }, { ++ .name = "kb_lock", ++ .gpio = -1, ++ .debounce_rising = 200, ++ .debounce_falling = 200, ++ }, ++}; ++ ++static void __init n8x0_gpio_switches_init(void) ++{ ++ /* The switches are actually registered through ATAG mechanism. ++ * This just updates the parameters (thus .gpio is -1) */ ++ omap_register_gpio_switches(n8x0_gpio_switches, ++ ARRAY_SIZE(n8x0_gpio_switches)); ++} + static void __init n8x0_init_machine(void) { omap2420_mux_init(board_mux, OMAP_PACKAGE_ZAC); -+ ++ n8x0_gpio_switches_init(); + platform_device_register(&n8x0_cbus_device); -+ + n8x0_bt_init(); + /* FIXME: add n810 spi devices */ diff --git a/target/linux/omap24xx/patches-2.6.36/900-n810-battery-management.patch b/target/linux/omap24xx/patches-2.6.36/900-n810-battery-management.patch index ea8f896c11..c3507fba99 100644 --- a/target/linux/omap24xx/patches-2.6.36/900-n810-battery-management.patch +++ b/target/linux/omap24xx/patches-2.6.36/900-n810-battery-management.patch @@ -460,9 +460,9 @@ int retu_request_irq(int id, void *irq_handler, unsigned long arg, char *name); --- linux-2.6.36-rc4.orig/arch/arm/mach-omap2/board-n8x0.c +++ linux-2.6.36-rc4/arch/arm/mach-omap2/board-n8x0.c -@@ -795,6 +795,17 @@ extern void n8x0_blizzard_init(void); - - extern void n8x0_usb_init(void); +@@ -833,6 +833,17 @@ static void __init n8x0_gpio_switches_in + ARRAY_SIZE(n8x0_gpio_switches)); + } +static struct platform_device n810_bm_device = { + .name = "n810bm", @@ -478,7 +478,7 @@ static void __init n8x0_init_machine(void) { omap2420_mux_init(board_mux, OMAP_PACKAGE_ZAC); -@@ -823,6 +834,8 @@ static void __init n8x0_init_machine(voi +@@ -860,6 +871,8 @@ static void __init n8x0_init_machine(voi n8x0_onenand_init(); n8x0_mmc_init(); n8x0_usb_init();