atheros: update to 2.6.37.1
[openwrt/svn-archive/archive.git] / target / linux / atheros / patches-2.6.30 / 100-board.patch
index 4367ce413dbf1943a6baae5baaa9e718f3a67a26..8183fb8aa2976e9a5a87516605ccc50d127c3e2c 100644 (file)
 +
 --- /dev/null
 +++ b/arch/mips/ar231x/ar5312.c
-@@ -0,0 +1,547 @@
+@@ -0,0 +1,549 @@
 +/*
 + * This file is subject to the terms and conditions of the GNU General Public
 + * License.  See the file "COPYING" in the main directory of this archive
 +              if (!ar231x_board.radio)
 +                      return 0;
 +
-+              if (*((u32 *) radio) & AR531X_RADIO0_MASK)
++              if ((*((u32 *) radio) & AR531X_RADIO0_MASK) &&
++                  (config->flags & BD_WLAN0))
 +                      ar231x_add_wmac(0, AR531X_WLAN0,
 +                              AR5312_IRQ_WLAN0_INTRS);
 +
 +              break;
 +      }
 +
-+      if (*((u32 *) radio) & AR531X_RADIO1_MASK)
++      if ((*((u32 *) radio) & AR531X_RADIO1_MASK) &&
++          (config->flags & BD_WLAN1))
 +              ar231x_add_wmac(1, AR531X_WLAN1,
 +                      AR5312_IRQ_WLAN1_INTRS);
 +
 +
 --- /dev/null
 +++ b/arch/mips/ar231x/ar2315.c
-@@ -0,0 +1,643 @@
+@@ -0,0 +1,658 @@
 +/*
 + * This file is subject to the terms and conditions of the GNU General Public
 + * License.  See the file "COPYING" in the main directory of this archive
 +      if (!pend)
 +              ar231x_write_reg(AR2315_ISR, AR2315_ISR_GPIO);
 +
++      /* Enable interrupt with edge detection */
++      if ((ar231x_read_reg(AR2315_GPIO_CR) & AR2315_GPIO_CR_M(bit)) != AR2315_GPIO_CR_I(bit))
++              return;
++
 +      if (bit >= 0)
 +              do_IRQ(AR531X_GPIO_IRQ_BASE + bit);
 +}
 +{
 +      unsigned int gpio = irq - AR531X_GPIO_IRQ_BASE;
 +
-+      /* reconfigure GPIO line as input */
-+      ar231x_mask_reg(AR2315_GPIO_CR, AR2315_GPIO_CR_M(gpio), AR2315_GPIO_CR_I(gpio));
-+
 +      /* Enable interrupt with edge detection */
++      if ((ar231x_read_reg(AR2315_GPIO_CR) & AR2315_GPIO_CR_M(gpio)) != AR2315_GPIO_CR_I(gpio))
++              return;
++
 +      gpiointmask |= (1 << gpio);
 +      ar2315_set_gpiointmask(gpio, 3);
 +}
 +
++static unsigned int ar2315_gpio_intr_startup(unsigned int irq)
++{
++      unsigned int gpio = irq - AR531X_GPIO_IRQ_BASE;
++
++      /* reconfigure GPIO line as input */
++      ar231x_mask_reg(AR2315_GPIO_CR, AR2315_GPIO_CR_M(gpio), AR2315_GPIO_CR_I(gpio));
++      ar2315_gpio_intr_enable(irq);
++      return 0;
++}
++
 +static void ar2315_gpio_intr_disable(unsigned int irq)
 +{
 +      unsigned int gpio = irq - AR531X_GPIO_IRQ_BASE;
 +
 +static struct irq_chip ar2315_gpio_intr_controller = {
 +      .typename       = "AR2315-GPIO",
++      .startup  = ar2315_gpio_intr_startup,
 +      .ack      = ar2315_gpio_intr_disable,
 +      .mask_ack = ar2315_gpio_intr_disable,
 +      .mask     = ar2315_gpio_intr_disable,