summaryrefslogtreecommitdiffstats
path: root/drivers/staging/greybus/arche-apb-ctrl.c
diff options
context:
space:
mode:
authorVaibhav Hiremath2016-01-26 02:53:29 +0100
committerGreg Kroah-Hartman2016-01-26 05:08:55 +0100
commitd8b16338df9bcef1fa0a047bd3e8d2e922dc5bb8 (patch)
tree2a103a69e022c622963e2727df1e2f8390b48d76 /drivers/staging/greybus/arche-apb-ctrl.c
parentgreybus: camera: Stream config change unipro speed (diff)
downloadkernel-qcow2-linux-d8b16338df9bcef1fa0a047bd3e8d2e922dc5bb8.tar.gz
kernel-qcow2-linux-d8b16338df9bcef1fa0a047bd3e8d2e922dc5bb8.tar.xz
kernel-qcow2-linux-d8b16338df9bcef1fa0a047bd3e8d2e922dc5bb8.zip
greybus: arche-platform: Disable clock as part of driver remove
As part of driver remove (cleanup) function, disable the clock for both SVC, APB1 & APB2. Testing Done: Tested on EVT1 platform with Connect=>disconnect=>connect iteration, almost close to 100 iterations have passed (demo branch). And also tested with kernel-only build. Signed-off-by: Vaibhav Hiremath <vaibhav.hiremath@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.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/staging/greybus/arche-apb-ctrl.c b/drivers/staging/greybus/arche-apb-ctrl.c
index d073543963a5..f2bad8df0cf7 100644
--- a/drivers/staging/greybus/arche-apb-ctrl.c
+++ b/drivers/staging/greybus/arche-apb-ctrl.c
@@ -220,6 +220,10 @@ static int apb_ctrl_get_devtree_data(struct platform_device *pdev,
static void apb_ctrl_cleanup(struct arche_apb_ctrl_drvdata *apb)
{
+ /* disable the clock */
+ if (gpio_is_valid(apb->clk_en_gpio))
+ gpio_set_value(apb->clk_en_gpio, 0);
+
if (!IS_ERR(apb->vcore) && regulator_is_enabled(apb->vcore) > 0)
regulator_disable(apb->vcore);