diff options
author | Hauke Mehrtens <hauke@hauke-m.de> | 2012-11-20 17:24:31 -0500 |
---|---|---|
committer | John Crispin <blogic@openwrt.org> | 2012-11-21 15:55:52 -0500 |
commit | da22f22e91f0d14d996c7258101575a5a06ddf85 (patch) | |
tree | d10551775ef16fc8da8d49946d53c4bd9b5e2466 /drivers | |
parent | cf0936b06d8e98a157630e99f647e2ff6d29d7ad (diff) |
ssb: add ssb_chipco_gpio_pull{up,down}
Add functions to access the GPIO registers for pullup and pulldown.
These are needed for handling gpio registration.
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Patchwork: http://patchwork.linux-mips.org/patch/4589
Acked-by: Florian Fainelli <florian@openwrt.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/ssb/driver_chipcommon.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/drivers/ssb/driver_chipcommon.c b/drivers/ssb/driver_chipcommon.c index e9d2ca11283b..4df492665565 100644 --- a/drivers/ssb/driver_chipcommon.c +++ b/drivers/ssb/driver_chipcommon.c | |||
@@ -442,6 +442,22 @@ u32 ssb_chipco_gpio_polarity(struct ssb_chipcommon *cc, u32 mask, u32 value) | |||
442 | return chipco_write32_masked(cc, SSB_CHIPCO_GPIOPOL, mask, value); | 442 | return chipco_write32_masked(cc, SSB_CHIPCO_GPIOPOL, mask, value); |
443 | } | 443 | } |
444 | 444 | ||
445 | u32 ssb_chipco_gpio_pullup(struct ssb_chipcommon *cc, u32 mask, u32 value) | ||
446 | { | ||
447 | if (cc->dev->id.revision < 20) | ||
448 | return 0xffffffff; | ||
449 | |||
450 | return chipco_write32_masked(cc, SSB_CHIPCO_GPIOPULLUP, mask, value); | ||
451 | } | ||
452 | |||
453 | u32 ssb_chipco_gpio_pulldown(struct ssb_chipcommon *cc, u32 mask, u32 value) | ||
454 | { | ||
455 | if (cc->dev->id.revision < 20) | ||
456 | return 0xffffffff; | ||
457 | |||
458 | return chipco_write32_masked(cc, SSB_CHIPCO_GPIOPULLDOWN, mask, value); | ||
459 | } | ||
460 | |||
445 | #ifdef CONFIG_SSB_SERIAL | 461 | #ifdef CONFIG_SSB_SERIAL |
446 | int ssb_chipco_serial_init(struct ssb_chipcommon *cc, | 462 | int ssb_chipco_serial_init(struct ssb_chipcommon *cc, |
447 | struct ssb_serial_port *ports) | 463 | struct ssb_serial_port *ports) |