summaryrefslogtreecommitdiff
path: root/drivers/staging/greybus/arche-apb-ctrl.c
diff options
context:
space:
mode:
authorVaibhav Hiremath <vaibhav.hiremath@linaro.org>2016-01-11 17:41:23 +0530
committerGreg Kroah-Hartman <gregkh@google.com>2016-01-11 15:58:10 -0800
commitf1e9cbd5a097aa6ec62f261bdf44879bbaefb72a (patch)
tree09b0e9f1193e9f92d683f8683869b0aef5d5ce75 /drivers/staging/greybus/arche-apb-ctrl.c
parent33036178bf04a06ad7e87513c76d7075959088e8 (diff)
greybus: arche-apb-ctrl: deassert reset at the end of probe
Now the complete handshaking between AP<=>SVC would be offloaded to parent driver (arche-platform) who is responsible for SVC control, so the apb-ctrl driver can just simply bring APB's out of reset during probe itself. Along with deasserting reset, this patch renames the local fn to exclusively use it for reset purpose. Note that, driver is exporting reset gpio to user, so user can still flash FW from prompt. Signed-off-by: Vaibhav Hiremath <vaibhav.hiremath@linaro.org> Tested-by: Michael Scott <michael.scott@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Diffstat (limited to 'drivers/staging/greybus/arche-apb-ctrl.c')
-rw-r--r--drivers/staging/greybus/arche-apb-ctrl.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/drivers/staging/greybus/arche-apb-ctrl.c b/drivers/staging/greybus/arche-apb-ctrl.c
index 5b9a3ed212af..65b1e9a700e7 100644
--- a/drivers/staging/greybus/arche-apb-ctrl.c
+++ b/drivers/staging/greybus/arche-apb-ctrl.c
@@ -51,13 +51,13 @@ struct arche_apb_ctrl_drvdata {
/*
* Note that these low level api's are active high
*/
-static inline void assert_gpio(unsigned int gpio)
+static inline void deassert_reset(unsigned int gpio)
{
gpio_set_value(gpio, 1);
msleep(500);
}
-static inline void deassert_gpio(unsigned int gpio)
+static inline void assert_reset(unsigned int gpio)
{
gpio_set_value(gpio, 0);
}
@@ -224,7 +224,7 @@ static void apb_ctrl_cleanup(struct arche_apb_ctrl_drvdata *apb)
regulator_disable(apb->vio);
/* As part of exit, put APB back in reset state */
- gpio_set_value(apb->resetn_gpio, 0);
+ assert_reset(apb->resetn_gpio);
apb->state = APB_STATE_OFF;
/* TODO: May have to send an event to SVC about this exit */
@@ -253,8 +253,9 @@ int arche_apb_ctrl_probe(struct platform_device *pdev)
return ret;
}
- apb->state = APB_STATE_OFF;
-
+ /* deassert reset to APB : Active-low signal */
+ deassert_reset(apb->resetn_gpio);
+ apb->state = APB_STATE_ACTIVE;
platform_set_drvdata(pdev, apb);