]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
greybus: arche-apb-ctrl: Set wake_detect gpio to low initially
authorVaibhav Hiremath <vaibhav.hiremath@linaro.org>
Wed, 6 Jan 2016 18:16:45 +0000 (23:46 +0530)
committerGreg Kroah-Hartman <gregkh@google.com>
Thu, 7 Jan 2016 04:03:18 +0000 (20:03 -0800)
This patch enables handshaking of AP and SVC using wake_detect
gpio (WD_8A and WD_8B).
Note that WAKE_DETECT polarity is active-high, so in order to
enable handshaking between AP <=> SVC, we need to set wake_detect
gpio to low initially, so that driver can send WAKE_DET signal
(active-high) to SVC and then SVC can send back WAKE_MOD signal
(active-low).
And on reception of WAKE_MOD signal, driver would bring respective
APB out of reset.

  WD_8A => APB1
  WD_8B => APB2

Signed-off-by: Vaibhav Hiremath <vaibhav.hiremath@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
drivers/staging/greybus/arche-apb-ctrl.c

index 8046e1eced83e4f71db6ad9399c13d6a9cc55e78..d3db7fbb33b456dffac3fed0ba04be487ae62989 100644 (file)
@@ -195,7 +195,8 @@ static int apb_ctrl_init_seq(struct platform_device *pdev,
        gpio_set_value(apb->boot_ret_gpio, 0);
        udelay(50);
 
-       ret = devm_gpio_request(dev, apb->wake_detect_gpio, "wake detect");
+       ret = devm_gpio_request_one(dev, apb->wake_detect_gpio,
+                       GPIOF_INIT_LOW, "wake detect");
        if (ret)
                dev_err(dev, "Failed requesting wake_detect gpio %d\n",
                                apb->wake_detect_gpio);