diff options
author | Russell King <rmk+kernel@armlinux.org.uk> | 2016-08-31 07:49:45 (GMT) |
---|---|---|
committer | Russell King <rmk+kernel@armlinux.org.uk> | 2016-09-22 08:38:59 (GMT) |
commit | 535e0abc0534b139b067d496bb93663acffb72ce (patch) | |
tree | cdb492a540551ed00b7c601074dd01f751e91dee /drivers/pcmcia/soc_common.c | |
parent | 7bfe49785b28931297d9e6e811f88732914f8ff3 (diff) | |
download | linux-535e0abc0534b139b067d496bb93663acffb72ce.tar.xz |
pcmcia: soc_common: add support for reset and bus enable GPIOs
Add support to soc_common for controlling reset and bus enable GPIOs
from within the generic soc_common layer, rather than having
individual drivers having to perform this themselves.
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
Diffstat (limited to 'drivers/pcmcia/soc_common.c')
-rw-r--r-- | drivers/pcmcia/soc_common.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/drivers/pcmcia/soc_common.c b/drivers/pcmcia/soc_common.c index 4036454..f772127 100644 --- a/drivers/pcmcia/soc_common.c +++ b/drivers/pcmcia/soc_common.c @@ -119,6 +119,7 @@ static void __soc_pcmcia_hw_shutdown(struct soc_pcmcia_socket *skt, if (skt->ops->hw_shutdown) skt->ops->hw_shutdown(skt); + clk_disable_unprepare(skt->clk); } @@ -286,6 +287,21 @@ static int soc_common_pcmcia_config_skt( ret = skt->ops->configure_socket(skt, state); if (ret == 0) { + struct gpio_desc *descs[2]; + int values[2], n = 0; + + if (skt->gpio_reset) { + descs[n] = skt->gpio_reset; + values[n++] = !!(state->flags & SS_RESET); + } + if (skt->gpio_bus_enable) { + descs[n] = skt->gpio_bus_enable; + values[n++] = !!(state->flags & SS_OUTPUT_ENA); + } + + if (n) + gpiod_set_array_value_cansleep(n, descs, values); + /* * This really needs a better solution. The IRQ * may or may not be claimed by the driver. |