summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorVaibhav Hiremath <vaibhav.hiremath@linaro.org>2016-02-25 04:37:37 +0530
committerGreg Kroah-Hartman <gregkh@google.com>2016-02-25 16:24:23 -0800
commit16fe18ca9ef0a3d806d33121a3a653138a1a6854 (patch)
treed8a9aab8615c6194c4194d0a9dc9c6081f7401f6 /drivers
parentf760bbfb5c10952739fd0d39869cdd6a43844037 (diff)
greybus: arche-platform: Assert wake/detect after SVC reset without delay
Since now driver supports interrupt based mechanism to read events from SVC over wake/detect line, no need to delay wake/detect assertion. We can assert wake/detect after SVC reset deassertion, so during boot itself SVC will start sending wake_out pulses. Testing Done: Tested on DB3.5 platform. Signed-off-by: Vaibhav Hiremath <vaibhav.hiremath@linaro.org> Reviewed-by: Michael Scott <michael.scott@linaro.org> Tested-by: Michael Scott <michael.scott@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/staging/greybus/arche-platform.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/staging/greybus/arche-platform.c b/drivers/staging/greybus/arche-platform.c
index 83db892a8a5d..87526b2bf0a9 100644
--- a/drivers/staging/greybus/arche-platform.c
+++ b/drivers/staging/greybus/arche-platform.c
@@ -115,6 +115,16 @@ static void hub_conf_delayed_work(struct work_struct *work)
dev_warn(arche_pdata->dev, "failed to control hub device\n");
}
+static void assert_wakedetect(struct arche_platform_drvdata *arche_pdata)
+{
+ /* Assert wake/detect = Detect event from AP */
+ gpio_direction_output(arche_pdata->wake_detect_gpio, 1);
+
+ /* Enable interrupt here, to read event back from SVC */
+ gpio_direction_input(arche_pdata->wake_detect_gpio);
+ enable_irq(arche_pdata->wake_detect_irq);
+}
+
static irqreturn_t arche_platform_wd_irq_thread(int irq, void *devid)
{
struct arche_platform_drvdata *arche_pdata = devid;
@@ -297,6 +307,8 @@ static ssize_t state_store(struct device *dev,
return count;
ret = arche_platform_coldboot_seq(arche_pdata);
+
+ assert_wakedetect(arche_pdata);
} else if (sysfs_streq(buf, "standby")) {
if (arche_pdata->state == ARCHE_PLATFORM_STATE_STANDBY)
return count;
@@ -482,6 +494,7 @@ static int arche_platform_probe(struct platform_device *pdev)
goto err_populate;
}
+ assert_wakedetect(arche_pdata);
INIT_DELAYED_WORK(&arche_pdata->delayed_work, hub_conf_delayed_work);
dev_info(dev, "Device registered successfully\n");