aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/greybus/arche-platform.c
diff options
context:
space:
mode:
authorVaibhav Hiremath <vaibhav.hiremath@linaro.org>2016-05-17 22:39:46 +0530
committerGreg Kroah-Hartman <gregkh@google.com>2016-05-20 16:31:26 -0700
commit16fd976c392bf2e9b88531e842d8d255bccddc98 (patch)
tree4b35d2c33390e2a6ab0b86223953f91067c6816d /drivers/staging/greybus/arche-platform.c
parentgreybus: gpbridge: rename 'gpbridge' to 'gbphy' everywhere (diff)
downloadlinux-dev-16fd976c392bf2e9b88531e842d8d255bccddc98.tar.xz
linux-dev-16fd976c392bf2e9b88531e842d8d255bccddc98.zip
greybus: arche-platform: Do not assert wake/detect signal to SVC
With new definition of AP module boot flow (from HotPlug camp), AP is not supposed to send any wake/detect signal to SVC, instead, during boot SVC would straight away send wake_out pulse on wake/detect line. Note that, pin configuration of wake/detect line would be set to active-high by default, so wake/detect line would always stay high, unless SVC drives it. AP module uses wake/detect line strictly in input mode. Testing Done: Tested on EVT1.5 platform. Note: We are yet to decide on PM support for APBx, so we may need to generate/handshake with SVC over wake/detect line in the future. As of now, follow the implementation and add stuff as and when they come. 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.c20
1 files changed, 6 insertions, 14 deletions
diff --git a/drivers/staging/greybus/arche-platform.c b/drivers/staging/greybus/arche-platform.c
index e3854349b36c..c02ff58ddefe 100644
--- a/drivers/staging/greybus/arche-platform.c
+++ b/drivers/staging/greybus/arche-platform.c
@@ -207,9 +207,6 @@ static int apb_poweroff(struct device *dev, void *data)
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);
@@ -371,9 +368,7 @@ static void arche_platform_poweroff_seq(struct arche_platform_drvdata *arche_pda
/* If in fw_flashing mode, then no need to repeate things again */
if (arche_pdata->state != ARCHE_PLATFORM_STATE_FW_FLASHING) {
disable_irq(arche_pdata->wake_detect_irq);
- /* Send disconnect/detach event to SVC */
- gpio_direction_output(arche_pdata->wake_detect_gpio, 0);
- usleep_range(100, 200);
+
spin_lock_irqsave(&arche_pdata->wake_lock, flags);
arche_platform_set_wake_detect_state(arche_pdata,
WD_STATE_IDLE);
@@ -411,9 +406,9 @@ static ssize_t state_store(struct device *dev,
if (arche_pdata->state == ARCHE_PLATFORM_STATE_ACTIVE)
goto exit;
+ assert_wakedetect(arche_pdata);
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)
goto exit;
@@ -484,8 +479,8 @@ static int arche_platform_pm_notifier(struct notifier_block *notifier,
arche_platform_poweroff_seq(arche_pdata);
break;
case PM_POST_SUSPEND:
- arche_platform_coldboot_seq(arche_pdata);
assert_wakedetect(arche_pdata);
+ arche_platform_coldboot_seq(arche_pdata);
break;
default:
break;
@@ -588,8 +583,7 @@ static int arche_platform_probe(struct platform_device *pdev)
arche_pdata->wake_detect_gpio);
return ret;
}
- /* deassert wake detect */
- gpio_direction_output(arche_pdata->wake_detect_gpio, 0);
+
arche_platform_set_wake_detect_state(arche_pdata, WD_STATE_IDLE);
arche_pdata->dev = &pdev->dev;
@@ -608,8 +602,8 @@ static int arche_platform_probe(struct platform_device *pdev)
dev_err(dev, "failed to request wake detect IRQ %d\n", ret);
return ret;
}
- /* Enable it only after sending wake/detect event */
- disable_irq(arche_pdata->wake_detect_irq);
+
+ assert_wakedetect(arche_pdata);
ret = device_create_file(dev, &dev_attr_state);
if (ret) {
@@ -630,8 +624,6 @@ static int arche_platform_probe(struct platform_device *pdev)
goto err_populate;
}
- assert_wakedetect(arche_pdata);
-
arche_pdata->pm_notifier.notifier_call = arche_platform_pm_notifier;
ret = register_pm_notifier(&arche_pdata->pm_notifier);
mutex_unlock(&arche_pdata->platform_state_mutex);