From f1e9cbd5a097aa6ec62f261bdf44879bbaefb72a Mon Sep 17 00:00:00 2001 From: Vaibhav Hiremath Date: Mon, 11 Jan 2016 17:41:23 +0530 Subject: [PATCH] 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 Tested-by: Michael Scott Signed-off-by: Greg Kroah-Hartman --- drivers/staging/greybus/arche-apb-ctrl.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/drivers/staging/greybus/arche-apb-ctrl.c b/drivers/staging/greybus/arche-apb-ctrl.c index 5b9a3ed..65b1e9a 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); -- 2.7.4