aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/greybus/arche-platform.c
diff options
context:
space:
mode:
authorVaibhav Hiremath <vaibhav.hiremath@linaro.org>2016-02-25 16:45:45 +0530
committerGreg Kroah-Hartman <gregkh@google.com>2016-02-25 16:28:17 -0800
commite915ce48bae606b79150a4d799a30037604a93ed (patch)
tree7280d8ede9c90eebe95bf9c1ceb9abebaf29734a /drivers/staging/greybus/arche-platform.c
parentgreybus: arche-platform: Make sure APB power cycles on coldboot (diff)
downloadlinux-dev-e915ce48bae606b79150a4d799a30037604a93ed.tar.xz
linux-dev-e915ce48bae606b79150a4d799a30037604a93ed.zip
greybus: arche-platform: Disable HUB3613 only in APB poweroff fn
HUB3613 configuration, either disable (Standby mode) or enable (HUB mode) is related to APB. So it makes perfect sense to put both of them together in one function. HUB3613 enable happens only at one place, in hub_conf_delayed_work() fn, but disable is initiated from multiple places. Move all calls to usb3613_hub_mode_ctrl(false) to apb_poweroff(). Testing Done: Tested on DB3.5 platform. 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-platform.c')
-rw-r--r--drivers/staging/greybus/arche-platform.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/drivers/staging/greybus/arche-platform.c b/drivers/staging/greybus/arche-platform.c
index f44c34314127..64dd8a1ebe37 100644
--- a/drivers/staging/greybus/arche-platform.c
+++ b/drivers/staging/greybus/arche-platform.c
@@ -94,6 +94,10 @@ static int apb_poweroff(struct device *dev, void *data)
{
apb_ctrl_poweroff(dev);
+ /* Enable HUB3613 into HUB mode. */
+ if (usb3613_hub_mode_ctrl(false))
+ dev_warn(dev, "failed to control hub device\n");
+
return 0;
}
@@ -142,6 +146,7 @@ static irqreturn_t arche_platform_wd_irq_thread(int irq, void *devid)
/* It should complete power cycle, so first make sure it is poweroff */
device_for_each_child(arche_pdata->dev, NULL, apb_poweroff);
+
/* Bring APB out of reset: cold boot sequence */
device_for_each_child(arche_pdata->dev, NULL, apb_cold_boot);
@@ -301,10 +306,6 @@ static ssize_t state_store(struct device *dev,
arche_platform_poweroff_seq(arche_pdata);
- ret = usb3613_hub_mode_ctrl(false);
- if (ret)
- dev_warn(arche_pdata->dev, "failed to control hub device\n");
- /* TODO: Should we do anything more here ?? */
} else if (sysfs_streq(buf, "active")) {
if (arche_pdata->state == ARCHE_PLATFORM_STATE_ACTIVE)
return count;
@@ -327,11 +328,6 @@ static ssize_t state_store(struct device *dev,
arche_platform_poweroff_seq(arche_pdata);
- ret = usb3613_hub_mode_ctrl(false);
- if (ret)
- dev_warn(arche_pdata->dev, "failed to control hub device\n");
- /* TODO: Should we do anything more here ?? */
-
arche_platform_fw_flashing_seq(arche_pdata);
device_for_each_child(arche_pdata->dev, NULL, apb_fw_flashing_state);