Ignore:
Timestamp:
2011-07-17T21:27:44+02:00 (5 years ago)
Author:
blogic
Message:

[lantiq]

  • add gigasx76x update
  • rebase patches
  • add arv752DPW arv7525PD
  • fixes gpio_keys

Signed-off-by: Luka Perkov <openwrt@…>
Signed-off-by: John Crispin <blogic@…>

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/target/linux/lantiq/patches-2.6.39/520-register_buttons.patch

    r27104 r27665  
    1 --- a/arch/mips/lantiq/xway/devices.c 
    2 +++ b/arch/mips/lantiq/xway/devices.c 
    3 @@ -154,6 +154,26 @@ ltq_register_madwifi_eep(void) 
    4         lantiq_emulate_madwifi_eep = 1; 
    5  } 
     1--- a/arch/mips/lantiq/Makefile 
     2+++ b/arch/mips/lantiq/Makefile 
     3@@ -4,7 +4,7 @@ 
     4 # under the terms of the GNU General Public License version 2 as published 
     5 # by the Free Software Foundation. 
    66  
    7 +/* gpio buttons */ 
    8 +static struct gpio_buttons_platform_data ltq_gpio_buttons_platform_data; 
     7-obj-y := irq.o setup.o clk.o prom.o devices.o 
     8+obj-y := irq.o setup.o clk.o prom.o devices.o dev-gpio-buttons.o 
     9  
     10 obj-$(CONFIG_EARLY_PRINTK) += early_printk.o 
     11  
     12--- /dev/null 
     13+++ b/arch/mips/lantiq/dev-gpio-buttons.c 
     14@@ -0,0 +1,58 @@ 
     15+/* 
     16+ *  Lantiq GPIO button support 
     17+ * 
     18+ *  Copyright (C) 2008-2009 Gabor Juhos <juhosg@openwrt.org> 
     19+ *  Copyright (C) 2008 Imre Kaloz <kaloz@openwrt.org> 
     20+ * 
     21+ *  This program is free software; you can redistribute it and/or modify it 
     22+ *  under the terms of the GNU General Public License version 2 as published 
     23+ *  by the Free Software Foundation. 
     24+ */ 
    925+ 
    10 +static struct platform_device ltq_gpio_buttons_platform_device = 
     26+#include "linux/init.h" 
     27+#include "linux/slab.h" 
     28+#include <linux/platform_device.h> 
     29+ 
     30+#include "dev-gpio-buttons.h" 
     31+ 
     32+void __init ltq_register_gpio_keys_polled(int id, 
     33+                                            unsigned poll_interval, 
     34+                                            unsigned nbuttons, 
     35+                                            struct gpio_keys_button *buttons) 
    1136+{ 
    12 +       .name = "gpio-buttons", 
    13 +       .id = 0, 
    14 +       .dev = { 
    15 +               .platform_data = (void *) &ltq_gpio_buttons_platform_data, 
    16 +       }, 
    17 +}; 
     37+       struct platform_device *pdev; 
     38+       struct gpio_keys_platform_data pdata; 
     39+       struct gpio_keys_button *p; 
     40+       int err; 
    1841+ 
    19 +void __init 
    20 +ltq_register_gpio_buttons(struct gpio_button *buttons, int cnt) 
    21 +{ 
    22 +       ltq_gpio_buttons_platform_data.buttons = buttons; 
    23 +       ltq_gpio_buttons_platform_data.nbuttons = cnt; 
    24 +       platform_device_register(&ltq_gpio_buttons_platform_device); 
     42+       p = kmalloc(nbuttons * sizeof(*p), GFP_KERNEL); 
     43+       if (!p) 
     44+               return; 
     45+ 
     46+       memcpy(p, buttons, nbuttons * sizeof(*p)); 
     47+ 
     48+       pdev = platform_device_alloc("gpio-keys-polled", id); 
     49+       if (!pdev) 
     50+               goto err_free_buttons; 
     51+ 
     52+       memset(&pdata, 0, sizeof(pdata)); 
     53+       pdata.poll_interval = poll_interval; 
     54+       pdata.nbuttons = nbuttons; 
     55+       pdata.buttons = p; 
     56+ 
     57+       err = platform_device_add_data(pdev, &pdata, sizeof(pdata)); 
     58+       if (err) 
     59+               goto err_put_pdev; 
     60+ 
     61+       err = platform_device_add(pdev); 
     62+       if (err) 
     63+               goto err_put_pdev; 
     64+ 
     65+       return; 
     66+ 
     67+err_put_pdev: 
     68+       platform_device_put(pdev); 
     69+ 
     70+err_free_buttons: 
     71+       kfree(p); 
    2572+} 
     73--- /dev/null 
     74+++ b/arch/mips/lantiq/dev-gpio-buttons.h 
     75@@ -0,0 +1,26 @@ 
     76+/* 
     77+ *  Lantiq GPIO button support 
     78+ * 
     79+ *  Copyright (C) 2008-2009 Gabor Juhos <juhosg@openwrt.org> 
     80+ *  Copyright (C) 2008 Imre Kaloz <kaloz@openwrt.org> 
     81+ * 
     82+ *  This program is free software; you can redistribute it and/or modify it 
     83+ *  under the terms of the GNU General Public License version 2 as published 
     84+ *  by the Free Software Foundation. 
     85+ */ 
    2686+ 
    27  static struct resource ltq_spi_resources[] = { 
    28         { 
    29                 .start  = LTQ_SSC_BASE_ADDR, 
    30 --- a/arch/mips/lantiq/xway/devices.h 
    31 +++ b/arch/mips/lantiq/xway/devices.h 
    32 @@ -11,6 +11,7 @@ 
    33   
    34  #include "../devices.h" 
    35  #include <linux/phy.h> 
    36 +#include <linux/gpio_buttons.h> 
    37   
    38  extern void ltq_register_gpio(void); 
    39  extern void ltq_register_gpio_stp(void); 
    40 @@ -18,5 +19,6 @@ extern void ltq_register_ase_asc(void); 
    41  extern void ltq_register_etop(struct ltq_eth_data *eth); 
    42  extern void ltq_register_gpio_ebu(unsigned int value); 
    43  extern void ltq_register_madwifi_eep(void); 
    44 +extern void ltq_register_gpio_buttons(struct gpio_button *buttons, int cnt); 
    45   
    46  #endif 
     87+#ifndef _LANTIQ_DEV_GPIO_BUTTONS_H 
     88+#define _LANTIQ_DEV_GPIO_BUTTONS_H 
     89+ 
     90+#include <linux/input.h> 
     91+#include <linux/gpio_keys.h> 
     92+ 
     93+#define LTQ_KEYS_POLL_INTERVAL         20 /* msecs */ 
     94+#define LTQ_KEYS_DEBOUNCE_INTERVAL     (3 * LTQ_KEYS_POLL_INTERVAL) 
     95+ 
     96+void ltq_register_gpio_keys_polled(int id, 
     97+                                     unsigned poll_interval, 
     98+                                     unsigned nbuttons, 
     99+                                     struct gpio_keys_button *buttons); 
     100+ 
     101+#endif /* _LANTIQ_DEV_GPIO_BUTTONS_H */ 
Note: See TracChangeset for help on using the changeset viewer.