[lantiq]
[openwrt.git] / target / linux / lantiq / patches / 104-board_xway.patch
index 1aaeab6..fcd9c0e 100644 (file)
@@ -23,7 +23,7 @@
 +endif
 --- /dev/null
 +++ b/arch/mips/lantiq/xway/gpio_ebu.c
-@@ -0,0 +1,107 @@
+@@ -0,0 +1,116 @@
 +/*
 + *  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
 +}
 +
 +static void
-+lq_ebu_set(struct gpio_chip *chip, unsigned offset, int value)
++lq_ebu_apply(void)
 +{
 +      unsigned long flags;
-+      if(value)
-+              shadow |= (1 << offset);
-+      else
-+              shadow &= ~(1 << offset);
 +      spin_lock_irqsave(&ebu_lock, flags);
 +      lq_w32(LQ_EBU_BUSCON, LQ_EBU_BUSCON1);
 +      *((__u16*)virt) = shadow;
 +      spin_unlock_irqrestore(&ebu_lock, flags);
 +}
 +
++static void
++lq_ebu_set(struct gpio_chip *chip, unsigned offset, int value)
++{
++      if(value)
++              shadow |= (1 << offset);
++      else
++              shadow &= ~(1 << offset);
++      lq_ebu_apply();
++}
++
 +static struct gpio_chip
 +lq_ebu_chip =
 +{
 +
 +      ret = gpiochip_add(&lq_ebu_chip);
 +      if (!ret)
++      {
++              lq_ebu_apply();
 +              return 0;
++      }
 +
 +err_release_mem_region:
 +      release_mem_region(res->start, resource_size(res));
 +      return platform_driver_register(&lq_ebu_driver);
 +}
 +
-+arch_initcall(init_lq_ebu);
++postcore_initcall(init_lq_ebu);
 --- /dev/null
 +++ b/arch/mips/lantiq/xway/gpio_leds.c
 @@ -0,0 +1,161 @@
 +      return ret;
 +}
 +
-+arch_initcall(init_lq_stp);
++postcore_initcall(init_lq_stp);
 --- /dev/null
 +++ b/arch/mips/lantiq/xway/mach-easy4010.c
-@@ -0,0 +1,79 @@
+@@ -0,0 +1,82 @@
 +/*
 + *  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
 +
 +static struct lq_pci_data lq_pci_data = {
 +      .clock      = PCI_CLOCK_INT,
-+      .req_mask   = 0xf,
++      .gpio   = PCI_GNT1 | PCI_REQ1,
++      .irq    = {
++              [14] = INT_NUM_IM0_IRL0 + 22,
++      },
 +};
 +
 +static struct lq_eth_data lq_eth_data = {
 +                      easy4010_init);
 --- /dev/null
 +++ b/arch/mips/lantiq/xway/mach-easy50712.c
-@@ -0,0 +1,79 @@
+@@ -0,0 +1,82 @@
 +/*
 + *  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
 +
 +static struct lq_pci_data lq_pci_data = {
 +      .clock      = PCI_CLOCK_INT,
-+      .req_mask   = 0xf,
++      .gpio   = PCI_GNT1 | PCI_REQ1,
++      .irq    = {
++              [14] = INT_NUM_IM0_IRL0 + 22,
++      },
 +};
 +
 +static struct lq_eth_data lq_eth_data = {
 +                      easy50712_init);
 --- /dev/null
 +++ b/arch/mips/lantiq/xway/mach-easy50812.c
-@@ -0,0 +1,78 @@
+@@ -0,0 +1,81 @@
 +/*
 + *  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
 +
 +static struct lq_pci_data lq_pci_data = {
 +      .clock      = PCI_CLOCK_INT,
-+      .req_mask   = 0xf,
++      .gpio   = PCI_GNT1 | PCI_REQ1,
++      .irq    = {
++              [14] = INT_NUM_IM0_IRL0 + 22,
++      },
 +};
 +
 +static struct lq_eth_data lq_eth_data = {
 +}
 --- /dev/null
 +++ b/arch/mips/lantiq/xway/devices.c
-@@ -0,0 +1,278 @@
+@@ -0,0 +1,305 @@
 +/*
 + *  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
 +#include <linux/time.h>
 +#include <linux/io.h>
 +#include <linux/gpio.h>
++#include <linux/gpio_buttons.h>
 +#include <linux/leds.h>
 +
 +#include <asm/bootinfo.h>
 +      platform_device_register(&lq_gpio_leds);
 +}
 +
++/* gpio buttons */
++static struct gpio_buttons_platform_data lq_gpio_buttons_platform_data;
++
++static struct platform_device lq_gpio_buttons_platform_device =
++{
++      .name = "gpio-buttons",
++      .id = 0,
++      .dev = {
++              .platform_data = (void *) &lq_gpio_buttons_platform_data,
++      },
++};
++
++void __init
++lq_register_gpio_buttons(struct gpio_button *buttons, int cnt)
++{
++      lq_gpio_buttons_platform_data.buttons = buttons;
++      lq_gpio_buttons_platform_data.nbuttons = cnt;
++      platform_device_register(&lq_gpio_buttons_platform_device);
++}
++
 +/* serial to parallel conversion */
 +static struct resource lq_stp_resource =
 +{
 +              break;
 +      }
 +}
++
++void __init
++lq_register_crypto(const char *name)
++{
++      platform_device_register_simple(name, 0, 0, 0);
++}
 --- /dev/null
 +++ b/arch/mips/lantiq/xway/devices.h
-@@ -0,0 +1,24 @@
+@@ -0,0 +1,26 @@
 +/*
 + *  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
 +#define _LQ_DEVICES_H__
 +
 +#include <lantiq_platform.h>
++#include <xway_irq.h>
 +
 +extern void __init lq_register_gpio(void);
 +extern void __init lq_register_gpio_stp(void);
 +extern void __init lq_register_wdt(void);
 +extern void __init lq_register_ethernet(struct lq_eth_data *eth);
 +extern void __init lq_register_asc(int port);
++extern void __init lq_register_gpio_buttons(struct gpio_button *buttons, int cnt);
 +
 +#endif
 --- /dev/null
 +
 --- /dev/null
 +++ b/arch/mips/lantiq/xway/gpio.c
-@@ -0,0 +1,203 @@
+@@ -0,0 +1,206 @@
 +/*
 + *  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
 +              printk("failed to register %s gpio\n", name);
 +              return -EBUSY;
 +      }
-+      gpio_direction_output(pin, dir);
++      if(dir)
++              gpio_direction_output(pin, 1);
++      else
++              gpio_direction_input(pin);
 +      if(pin >= PINS_PER_PORT)
 +      {
 +              pin -= PINS_PER_PORT;
 +      return ret;
 +}
 +
-+arch_initcall(lq_gpio_init);
++postcore_initcall(lq_gpio_init);
 --- /dev/null
 +++ b/arch/mips/lantiq/xway/reset.c
 @@ -0,0 +1,53 @@
This page took 0.035872 seconds and 4 git commands to generate.