aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/brcm47xx/patches-3.3/501-bcma-add-gpio-driver.patch
diff options
context:
space:
mode:
authorHauke Mehrtens <hauke@openwrt.org>2013-07-11 22:20:26 +0000
committerHauke Mehrtens <hauke@openwrt.org>2013-07-11 22:20:26 +0000
commitc09cf1db9473ea3ca88ed633801b2042126c08b2 (patch)
tree8b95f2ea5ea87e7c27370bd70256b457048aeac1 /target/linux/brcm47xx/patches-3.3/501-bcma-add-gpio-driver.patch
parent0a2e45ea30966e3587a9d937361bc1c05c6588d6 (diff)
downloadupstream-c09cf1db9473ea3ca88ed633801b2042126c08b2.tar.gz
upstream-c09cf1db9473ea3ca88ed633801b2042126c08b2.tar.bz2
upstream-c09cf1db9473ea3ca88ed633801b2042126c08b2.zip
kernel: update bcma and ssb to wireless-testing/master master-2013-07-03
This updates 025-bcma_backport.patch and 020-ssb_update.patch to a version of ssb and bcma used in recent wireless-testing. I removed all patches adding serial and nand flash support before doing so to not conflict with the existing flash support in the brcm47xx target. This update was done to easily update the wireless drivers afterwards. Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de> git-svn-id: svn://svn.openwrt.org/openwrt/branches/attitude_adjustment@37261 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux/brcm47xx/patches-3.3/501-bcma-add-gpio-driver.patch')
-rw-r--r--target/linux/brcm47xx/patches-3.3/501-bcma-add-gpio-driver.patch132
1 files changed, 7 insertions, 125 deletions
diff --git a/target/linux/brcm47xx/patches-3.3/501-bcma-add-gpio-driver.patch b/target/linux/brcm47xx/patches-3.3/501-bcma-add-gpio-driver.patch
index 951c6d40e9..7c4323e452 100644
--- a/target/linux/brcm47xx/patches-3.3/501-bcma-add-gpio-driver.patch
+++ b/target/linux/brcm47xx/patches-3.3/501-bcma-add-gpio-driver.patch
@@ -1,136 +1,18 @@
---- a/drivers/bcma/driver_chipcommon.c
-+++ b/drivers/bcma/driver_chipcommon.c
-@@ -70,6 +70,8 @@ void bcma_core_chipcommon_init(struct bc
- (leddc_off << BCMA_CC_GPIOTIMER_OFFTIME_SHIFT)));
- }
-
-+ spin_lock_init(&cc->gpio_lock);
-+
- cc->setup_done = true;
- }
-
-@@ -92,34 +94,81 @@ u32 bcma_chipco_irq_status(struct bcma_d
-
- u32 bcma_chipco_gpio_in(struct bcma_drv_cc *cc, u32 mask)
- {
-- return bcma_cc_read32(cc, BCMA_CC_GPIOIN) & mask;
-+ unsigned long flags;
-+ u32 res;
-+
-+ spin_lock_irqsave(&cc->gpio_lock, flags);
-+ res = bcma_cc_read32(cc, BCMA_CC_GPIOIN) & mask;
-+ spin_unlock_irqrestore(&cc->gpio_lock, flags);
-+
-+ return res;
- }
-+EXPORT_SYMBOL_GPL(bcma_chipco_gpio_in);
-
- u32 bcma_chipco_gpio_out(struct bcma_drv_cc *cc, u32 mask, u32 value)
- {
-- return bcma_cc_write32_masked(cc, BCMA_CC_GPIOOUT, mask, value);
-+ unsigned long flags;
-+ u32 res;
-+
-+ spin_lock_irqsave(&cc->gpio_lock, flags);
-+ res = bcma_cc_write32_masked(cc, BCMA_CC_GPIOOUT, mask, value);
-+ spin_unlock_irqrestore(&cc->gpio_lock, flags);
-+
-+ return res;
- }
-+EXPORT_SYMBOL_GPL(bcma_chipco_gpio_out);
-
- u32 bcma_chipco_gpio_outen(struct bcma_drv_cc *cc, u32 mask, u32 value)
- {
-- return bcma_cc_write32_masked(cc, BCMA_CC_GPIOOUTEN, mask, value);
-+ unsigned long flags;
-+ u32 res;
-+
-+ spin_lock_irqsave(&cc->gpio_lock, flags);
-+ res = bcma_cc_write32_masked(cc, BCMA_CC_GPIOOUTEN, mask, value);
-+ spin_unlock_irqrestore(&cc->gpio_lock, flags);
-+
-+ return res;
- }
-+EXPORT_SYMBOL_GPL(bcma_chipco_gpio_outen);
-
- u32 bcma_chipco_gpio_control(struct bcma_drv_cc *cc, u32 mask, u32 value)
- {
-- return bcma_cc_write32_masked(cc, BCMA_CC_GPIOCTL, mask, value);
-+ unsigned long flags;
-+ u32 res;
-+
-+ spin_lock_irqsave(&cc->gpio_lock, flags);
-+ res = bcma_cc_write32_masked(cc, BCMA_CC_GPIOCTL, mask, value);
-+ spin_unlock_irqrestore(&cc->gpio_lock, flags);
-+
-+ return res;
- }
- EXPORT_SYMBOL_GPL(bcma_chipco_gpio_control);
-
- u32 bcma_chipco_gpio_intmask(struct bcma_drv_cc *cc, u32 mask, u32 value)
- {
-- return bcma_cc_write32_masked(cc, BCMA_CC_GPIOIRQ, mask, value);
-+ unsigned long flags;
-+ u32 res;
-+
-+ spin_lock_irqsave(&cc->gpio_lock, flags);
-+ res = bcma_cc_write32_masked(cc, BCMA_CC_GPIOIRQ, mask, value);
-+ spin_unlock_irqrestore(&cc->gpio_lock, flags);
-+
-+ return res;
- }
-+EXPORT_SYMBOL_GPL(bcma_chipco_gpio_intmask);
-
- u32 bcma_chipco_gpio_polarity(struct bcma_drv_cc *cc, u32 mask, u32 value)
- {
-- return bcma_cc_write32_masked(cc, BCMA_CC_GPIOPOL, mask, value);
-+ unsigned long flags;
-+ u32 res;
-+
-+ spin_lock_irqsave(&cc->gpio_lock, flags);
-+ res = bcma_cc_write32_masked(cc, BCMA_CC_GPIOPOL, mask, value);
-+ spin_unlock_irqrestore(&cc->gpio_lock, flags);
-+
-+ return res;
- }
-+EXPORT_SYMBOL_GPL(bcma_chipco_gpio_polarity);
-
- #ifdef CONFIG_BCMA_DRIVER_MIPS
- void bcma_chipco_serial_init(struct bcma_drv_cc *cc)
--- a/include/linux/bcma/bcma_driver_chipcommon.h
+++ b/include/linux/bcma/bcma_driver_chipcommon.h
-@@ -495,6 +495,9 @@ struct bcma_drv_cc {
- int nr_serial_ports;
- struct bcma_serial_port serial_ports[4];
- #endif /* CONFIG_BCMA_DRIVER_MIPS */
-+
-+ /* Lock for GPIO register access. */
-+ spinlock_t gpio_lock;
- };
-
- /* Register access */
-@@ -525,13 +528,22 @@ void bcma_chipco_irq_mask(struct bcma_dr
+@@ -678,6 +678,8 @@ void bcma_chipco_irq_mask(struct bcma_dr
u32 bcma_chipco_irq_status(struct bcma_drv_cc *cc, u32 mask);
+#define BCMA_CC_GPIO_LINES 16
+
/* Chipcommon GPIO pin access. */
--u32 bcma_chipco_gpio_in(struct bcma_drv_cc *cc, u32 mask);
--u32 bcma_chipco_gpio_out(struct bcma_drv_cc *cc, u32 mask, u32 value);
--u32 bcma_chipco_gpio_outen(struct bcma_drv_cc *cc, u32 mask, u32 value);
--u32 bcma_chipco_gpio_control(struct bcma_drv_cc *cc, u32 mask, u32 value);
--u32 bcma_chipco_gpio_intmask(struct bcma_drv_cc *cc, u32 mask, u32 value);
--u32 bcma_chipco_gpio_polarity(struct bcma_drv_cc *cc, u32 mask, u32 value);
-+extern u32 bcma_chipco_gpio_in(struct bcma_drv_cc *cc, u32 mask);
-+extern u32 bcma_chipco_gpio_out(struct bcma_drv_cc *cc, u32 mask, u32 value);
-+extern u32 bcma_chipco_gpio_outen(struct bcma_drv_cc *cc, u32 mask, u32 value);
-+extern u32 bcma_chipco_gpio_control(struct bcma_drv_cc *cc, u32 mask,
-+ u32 value);
-+extern u32 bcma_chipco_gpio_intmask(struct bcma_drv_cc *cc, u32 mask,
-+ u32 value);
-+extern u32 bcma_chipco_gpio_polarity(struct bcma_drv_cc *cc, u32 mask,
-+ u32 value);
+ u32 bcma_chipco_gpio_in(struct bcma_drv_cc *cc, u32 mask);
+ u32 bcma_chipco_gpio_out(struct bcma_drv_cc *cc, u32 mask, u32 value);
+@@ -687,6 +689,10 @@ u32 bcma_chipco_gpio_intmask(struct bcma
+ u32 bcma_chipco_gpio_polarity(struct bcma_drv_cc *cc, u32 mask, u32 value);
+ u32 bcma_chipco_gpio_pullup(struct bcma_drv_cc *cc, u32 mask, u32 value);
+ u32 bcma_chipco_gpio_pulldown(struct bcma_drv_cc *cc, u32 mask, u32 value);
+static inline int bcma_chipco_gpio_count(void)
+{
+ return BCMA_CC_GPIO_LINES;