aboutsummaryrefslogtreecommitdiffstats
path: root/package/broadcom-diag/src
diff options
context:
space:
mode:
authorMichael Büsch <mb@bu3sch.de>2008-02-19 13:52:57 +0000
committerMichael Büsch <mb@bu3sch.de>2008-02-19 13:52:57 +0000
commite5a4fe334d805d6e1dfefaf65dddee624e8ebadc (patch)
tree9aa1e77c58fac6efbdff6b2bdaf15155d8667a08 /package/broadcom-diag/src
parent2d948e3fda3a1853a0c83cf958413684e1082f13 (diff)
downloadupstream-e5a4fe334d805d6e1dfefaf65dddee624e8ebadc.tar.gz
upstream-e5a4fe334d805d6e1dfefaf65dddee624e8ebadc.tar.bz2
upstream-e5a4fe334d805d6e1dfefaf65dddee624e8ebadc.zip
ssb: Update the GPIO API
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@10495 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package/broadcom-diag/src')
-rw-r--r--package/broadcom-diag/src/gpio.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/package/broadcom-diag/src/gpio.h b/package/broadcom-diag/src/gpio.h
index 6d83039ee7..22f20c99b2 100644
--- a/package/broadcom-diag/src/gpio.h
+++ b/package/broadcom-diag/src/gpio.h
@@ -53,6 +53,15 @@ static inline u32 gpio_intpolarity(u32 mask, u32 value)
gpio_op(polarity, mask, value);
}
+static inline u32 __ssb_write32_masked(struct ssb_device *dev, u16 offset,
+ u32 mask, u32 value)
+{
+ value &= mask;
+ value |= ssb_read32(dev, offset) & ~mask;
+ ssb_write32(dev, offset, value);
+ return value;
+}
+
static void gpio_set_irqenable(int enabled, irqreturn_t (*handler)(int, void *))
{
int irq;
@@ -71,7 +80,7 @@ static void gpio_set_irqenable(int enabled, irqreturn_t (*handler)(int, void *))
}
if (ssb.chipco.dev)
- ssb_write32_masked(ssb.chipco.dev, SSB_CHIPCO_IRQMASK, SSB_CHIPCO_IRQ_GPIO, (enabled ? SSB_CHIPCO_IRQ_GPIO : 0));
+ __ssb_write32_masked(ssb.chipco.dev, SSB_CHIPCO_IRQMASK, SSB_CHIPCO_IRQ_GPIO, (enabled ? SSB_CHIPCO_IRQ_GPIO : 0));
}
#else