From 188f75cf17c5e7da915f588de43f3d44eb2fd192 Mon Sep 17 00:00:00 2001 From: Neeraj Upadhyay Date: Thu, 17 Dec 2020 12:12:57 +0530 Subject: [PATCH] pinctrl: qcom: Add flexibility to disable the wakeup capability for Yupik By default, the system firmware enables the mpm wakeup functionality of all the supported GPIOs. However, certain usecases demand that this capability be disabled on certain gpios. Hence, provide a generic interface to disable the GPIOs as needed. Change-Id: I147629e0126b2eb41c645de03958ef480fd5d7d0 Signed-off-by: Neeraj Upadhyay --- drivers/pinctrl/qcom/pinctrl-yupik.c | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/drivers/pinctrl/qcom/pinctrl-yupik.c b/drivers/pinctrl/qcom/pinctrl-yupik.c index 553ae718c287..2543d4fbfefa 100644 --- a/drivers/pinctrl/qcom/pinctrl-yupik.c +++ b/drivers/pinctrl/qcom/pinctrl-yupik.c @@ -1849,9 +1849,32 @@ static const struct msm_pinctrl_soc_data yupik_pinctrl = { .nwakeirq_map = ARRAY_SIZE(yupik_pdc_map), }; +/* By default, all the gpios that are mpm wake capable are enabled. + * The following list disables the gpios explicitly + */ +static const unsigned int config_mpm_wake_disable_gpios[] = { +}; + +static void yupik_pinctrl_config_mpm_wake_disable_gpios(void) +{ + unsigned int i; + unsigned int n_gpios = ARRAY_SIZE(config_mpm_wake_disable_gpios); + + for (i = 0; i < n_gpios; i++) + msm_gpio_mpm_wake_set(config_mpm_wake_disable_gpios[i], false); +} + static int yupik_pinctrl_probe(struct platform_device *pdev) { - return msm_pinctrl_probe(pdev, &yupik_pinctrl); + int ret; + + ret = msm_pinctrl_probe(pdev, &yupik_pinctrl); + if (ret) + return ret; + + yupik_pinctrl_config_mpm_wake_disable_gpios(); + + return 0; } static const struct of_device_id yupik_pinctrl_of_match[] = {