Commit da22f22e authored by Hauke Mehrtens's avatar Hauke Mehrtens Committed by John Crispin

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: default avatarHauke Mehrtens <hauke@hauke-m.de>
Patchwork: http://patchwork.linux-mips.org/patch/4589Acked-by: default avatarFlorian Fainelli <florian@openwrt.org>
parent cf0936b0
...@@ -442,6 +442,22 @@ u32 ssb_chipco_gpio_polarity(struct ssb_chipcommon *cc, u32 mask, u32 value) ...@@ -442,6 +442,22 @@ u32 ssb_chipco_gpio_polarity(struct ssb_chipcommon *cc, u32 mask, u32 value)
return chipco_write32_masked(cc, SSB_CHIPCO_GPIOPOL, mask, value); return chipco_write32_masked(cc, SSB_CHIPCO_GPIOPOL, mask, value);
} }
u32 ssb_chipco_gpio_pullup(struct ssb_chipcommon *cc, u32 mask, u32 value)
{
if (cc->dev->id.revision < 20)
return 0xffffffff;
return chipco_write32_masked(cc, SSB_CHIPCO_GPIOPULLUP, mask, value);
}
u32 ssb_chipco_gpio_pulldown(struct ssb_chipcommon *cc, u32 mask, u32 value)
{
if (cc->dev->id.revision < 20)
return 0xffffffff;
return chipco_write32_masked(cc, SSB_CHIPCO_GPIOPULLDOWN, mask, value);
}
#ifdef CONFIG_SSB_SERIAL #ifdef CONFIG_SSB_SERIAL
int ssb_chipco_serial_init(struct ssb_chipcommon *cc, int ssb_chipco_serial_init(struct ssb_chipcommon *cc,
struct ssb_serial_port *ports) struct ssb_serial_port *ports)
......
...@@ -644,6 +644,8 @@ u32 ssb_chipco_gpio_outen(struct ssb_chipcommon *cc, u32 mask, u32 value); ...@@ -644,6 +644,8 @@ u32 ssb_chipco_gpio_outen(struct ssb_chipcommon *cc, u32 mask, u32 value);
u32 ssb_chipco_gpio_control(struct ssb_chipcommon *cc, u32 mask, u32 value); u32 ssb_chipco_gpio_control(struct ssb_chipcommon *cc, u32 mask, u32 value);
u32 ssb_chipco_gpio_intmask(struct ssb_chipcommon *cc, u32 mask, u32 value); u32 ssb_chipco_gpio_intmask(struct ssb_chipcommon *cc, u32 mask, u32 value);
u32 ssb_chipco_gpio_polarity(struct ssb_chipcommon *cc, u32 mask, u32 value); u32 ssb_chipco_gpio_polarity(struct ssb_chipcommon *cc, u32 mask, u32 value);
u32 ssb_chipco_gpio_pullup(struct ssb_chipcommon *cc, u32 mask, u32 value);
u32 ssb_chipco_gpio_pulldown(struct ssb_chipcommon *cc, u32 mask, u32 value);
#ifdef CONFIG_SSB_SERIAL #ifdef CONFIG_SSB_SERIAL
extern int ssb_chipco_serial_init(struct ssb_chipcommon *cc, extern int ssb_chipco_serial_init(struct ssb_chipcommon *cc,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment