[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20191115215737.GG18786@codeaurora.org>
Date: Fri, 15 Nov 2019 14:57:37 -0700
From: Lina Iyer <ilina@...eaurora.org>
To: Stephen Boyd <swboyd@...omium.org>
Cc: bjorn.andersson@...aro.org, linus.walleij@...aro.org,
maz@...nel.org, evgreen@...omium.org, linux-kernel@...r.kernel.org,
linux-arm-msm@...r.kernel.org, mkshah@...eaurora.org,
linux-gpio@...r.kernel.org, agross@...nel.org,
dianders@...omium.org
Subject: Re: [PATCH 08/12] drivers: pinctrl: msm: setup GPIO chip in hierarchy
On Fri, Nov 15 2019 at 13:55 -0700, Lina Iyer wrote:
>>Quoting Lina Iyer (2019-11-14 10:35:17)
>>>+static int msm_gpio_wakeirq(struct gpio_chip *gc,
>>>+ unsigned int child,
>>>+ unsigned int child_type,
>>>+ unsigned int *parent,
>>>+ unsigned int *parent_type)
>>>+{
>>>+ struct msm_pinctrl *pctrl = gpiochip_get_data(gc);
>>>+ const struct msm_gpio_wakeirq_map *map;
>>>+ int i;
>>>+
>>>+ *parent = GPIO_NO_WAKE_IRQ;
>>>+ *parent_type = IRQ_TYPE_EDGE_RISING;
>>>+
>>>+ for (i = 0; i < pctrl->soc->nwakeirq_map; i++) {
>>>+ map = &pctrl->soc->wakeirq_map[i];
>>>+ if (map->gpio == child) {
>>>+ *parent = map->wakeirq;
>>>+ break;
>>>+ }
>>>+ }
>>>+
>>>+ return 0;
>>
>>Shouldn't we return -EINVAL if we can't translate the gpio irq to the
>>parent domain? I would expect to see return -EINVAL here and the above
>>if condition to return 0 instead of break.
>>
>Good catch. Sure.
>>>+}
>>>+
Looking into this, we have been setting GPIO in hierarchy with PDC and
the return 0 is appropriate as it would set the GPIO_NO_WAKE_IRQ as the
parent and setup the IRQ correctly. We fail to setup GPIOs otherwise.
Powered by blists - more mailing lists