[bugfix][T108][task-view-1874] solve gpio output error in sleep mode
Only Configure: No
Affected branch: GSW_V1453
Affected module: hsm
Self-test: yes
Doc Update: no
Change-Id: Id5ac78c1fd1f92844bfc7c38c07b64784e94320c
diff --git a/marvell/linux/drivers/input/keyboard/wake_gpio.c b/marvell/linux/drivers/input/keyboard/wake_gpio.c
index 43ba28c..008327b 100755
--- a/marvell/linux/drivers/input/keyboard/wake_gpio.c
+++ b/marvell/linux/drivers/input/keyboard/wake_gpio.c
@@ -301,7 +301,7 @@
int mbtkGpioWakeUp_probe(struct platform_device *pdev)
{
int gpio;
-
+ int hsm_en_gpio;
int gpio_value;
unsigned long flags;
int ret = 0, error;
@@ -323,6 +323,24 @@
goto wake_source_init_fail;
}
+ hsm_en_gpio = of_get_named_gpio(np, "hsm-en-out-gpio", 0);
+ if (unlikely(hsm_en_gpio < 0)) {
+ pr_err("%s. parse hsm-en-out-gpio failed\n", __func__);
+ ret = -EINVAL;
+ } else {
+ pr_err("%s. hsm-en-out-gpio=%d\n", __func__, hsm_en_gpio);
+ if (gpio_request(hsm_en_gpio, "hsm-en-out-gpio")) {
+ pr_err("Failed to request GPIO %d\n", hsm_en_gpio);
+ ret = -EBUSY;
+ }
+ if (gpio_direction_output(hsm_en_gpio, 1)) {
+ pr_err("Failed to set GPIO %d as output\n", hsm_en_gpio);
+ ret = -EIO;
+ }
+ pr_err("hsm-gpio config sucess\n");
+ gpio_free(hsm_en_gpio);
+ }
+
gpio = of_get_named_gpio(np, "wakeup-in-gpio", 0);
if (unlikely(gpio < 0)) {