[PATCH v2] pinctrl: qcom: sc7180: Make gpio28 non wakeup capable for google,lazor

From: Rajendra Nayak
Date: Fri Jul 03 2020 - 03:49:10 EST


The PDC irqchip driver currently does not handle dual-edge interrupts,
and we have google,lazor board with sc7180 designed to configure gpio28
as a dual-edge interrupt. This interrupt is however not expected to be
wakeup capable on this board, so an easy way to fix this, seems to be to
make this gpio non wakeup capable and let TLMM handle it (which is capable
of handling dual-edge irqs)

To be able to do so only on this board, so other boards designed with
this SoC can continue to use gpio28 as a wakeup capable one, make a
copy of msm_gpio_wakeirq_map for lazor and remove gpio28 from the
list.

Reported-by: Jimmy Cheng-Yi Chiang <cychiang@xxxxxxxxxx>
Signed-off-by: Rajendra Nayak <rnayak@xxxxxxxxxxxxxx>
---
drivers/pinctrl/qcom/pinctrl-sc7180.c | 23 ++++++++++++++++++++++-
1 file changed, 22 insertions(+), 1 deletion(-)

diff --git a/drivers/pinctrl/qcom/pinctrl-sc7180.c b/drivers/pinctrl/qcom/pinctrl-sc7180.c
index 1b6465a..0668933 100644
--- a/drivers/pinctrl/qcom/pinctrl-sc7180.c
+++ b/drivers/pinctrl/qcom/pinctrl-sc7180.c
@@ -1135,7 +1135,24 @@ static const struct msm_gpio_wakeirq_map sc7180_pdc_map[] = {
{117, 114}, {118, 119},
};

-static const struct msm_pinctrl_soc_data sc7180_pinctrl = {
+/* Dropped gpio28 from the map for the google,lazor board */
+static const struct msm_gpio_wakeirq_map sc7180_lazor_pdc_map[] = {
+ {0, 40}, {3, 50}, {4, 42}, {5, 70}, {6, 41}, {9, 35},
+ {10, 80}, {11, 51}, {16, 20}, {21, 55}, {22, 90}, {23, 21},
+ {24, 61}, {26, 52}, {30, 100}, {31, 33}, {32, 81},
+ {33, 62}, {34, 43}, {36, 91}, {37, 53}, {38, 63}, {39, 72},
+ {41, 101}, {42, 7}, {43, 34}, {45, 73}, {47, 82}, {49, 17},
+ {52, 109}, {53, 102}, {55, 92}, {56, 56}, {57, 57}, {58, 83},
+ {59, 37}, {62, 110}, {63, 111}, {64, 74}, {65, 44}, {66, 93},
+ {67, 58}, {68, 112}, {69, 32}, {70, 54}, {72, 59}, {73, 64},
+ {74, 71}, {78, 31}, {82, 30}, {85, 103}, {86, 38}, {87, 39},
+ {88, 45}, {89, 46}, {90, 47}, {91, 48}, {92, 60}, {93, 49},
+ {94, 84}, {95, 94}, {98, 65}, {101, 66}, {104, 67}, {109, 104},
+ {110, 68}, {113, 69}, {114, 113}, {115, 108}, {116, 121},
+ {117, 114}, {118, 119},
+};
+
+static struct msm_pinctrl_soc_data sc7180_pinctrl = {
.pins = sc7180_pins,
.npins = ARRAY_SIZE(sc7180_pins),
.functions = sc7180_functions,
@@ -1151,6 +1168,10 @@ static const struct msm_pinctrl_soc_data sc7180_pinctrl = {

static int sc7180_pinctrl_probe(struct platform_device *pdev)
{
+ if (of_machine_is_compatible("google,lazor")) {
+ sc7180_pinctrl.wakeirq_map = sc7180_lazor_pdc_map;
+ sc7180_pinctrl.nwakeirq_map = ARRAY_SIZE(sc7180_lazor_pdc_map);
+ }
return msm_pinctrl_probe(pdev, &sc7180_pinctrl);
}

--
QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member
of Code Aurora Forum, hosted by The Linux Foundation