Message ID | 20190829181203.2660-10-ilina@codeaurora.org (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | qcom: support wakeup capable GPIOs | expand |
The subject is misleading. It's not fixing anything, just moving away from deprecated to "supported" APIs. Quoting Lina Iyer (2019-08-29 11:11:58) > Replace gpiochip_irqchip_add() and gpiochip_set_chained_irqchip() calls > by populating the gpio_irq_chip data structures instead. > > Signed-off-by: Lina Iyer <ilina@codeaurora.org>
On Thu, Aug 29, 2019 at 7:35 PM Lina Iyer <ilina@codeaurora.org> wrote: > Replace gpiochip_irqchip_add() and gpiochip_set_chained_irqchip() calls > by populating the gpio_irq_chip data structures instead. > > Signed-off-by: Lina Iyer <ilina@codeaurora.org> This is mostly fixed upstream I think, but: > + chip->irq.fwnode = pctrl->dev->fwnode; This fwnode assignment is missing though. Sorry for the constant churn and required rebasing... Yours, Linus Walleij
On Wed, Sep 11 2019 at 04:19 -0600, Linus Walleij wrote: >On Thu, Aug 29, 2019 at 7:35 PM Lina Iyer <ilina@codeaurora.org> wrote: > >> Replace gpiochip_irqchip_add() and gpiochip_set_chained_irqchip() calls >> by populating the gpio_irq_chip data structures instead. >> >> Signed-off-by: Lina Iyer <ilina@codeaurora.org> > >This is mostly fixed upstream I think, but: > >> + chip->irq.fwnode = pctrl->dev->fwnode; > >This fwnode assignment is missing though. > >Sorry for the constant churn and required rebasing... > Not a problem. Will rebase.
diff --git a/drivers/pinctrl/qcom/pinctrl-msm.c b/drivers/pinctrl/qcom/pinctrl-msm.c index 7f35c196bb3e..76e8528e4d0a 100644 --- a/drivers/pinctrl/qcom/pinctrl-msm.c +++ b/drivers/pinctrl/qcom/pinctrl-msm.c @@ -1027,7 +1027,19 @@ static int msm_gpio_init(struct msm_pinctrl *pctrl) pctrl->irq_chip.irq_request_resources = msm_gpio_irq_reqres; pctrl->irq_chip.irq_release_resources = msm_gpio_irq_relres; - ret = gpiochip_add_data(&pctrl->chip, pctrl); + chip->irq.chip = &pctrl->irq_chip; + chip->irq.default_type = IRQ_TYPE_NONE; + chip->irq.handler = handle_bad_irq; + chip->irq.fwnode = pctrl->dev->fwnode; + chip->irq.parent_handler = msm_gpio_irq_handler; + chip->irq.num_parents = 1; + chip->irq.parents = devm_kcalloc(pctrl->dev, 1, + sizeof(*chip->irq.parents), + GFP_KERNEL); + if (!chip->irq.parents) + return -ENOMEM; + + ret = devm_gpiochip_add_data(pctrl->dev, chip, pctrl); if (ret) { dev_err(pctrl->dev, "Failed register gpiochip\n"); return ret; @@ -1053,20 +1065,6 @@ static int msm_gpio_init(struct msm_pinctrl *pctrl) } } - ret = gpiochip_irqchip_add(chip, - &pctrl->irq_chip, - 0, - handle_edge_irq, - IRQ_TYPE_NONE); - if (ret) { - dev_err(pctrl->dev, "Failed to add irqchip to gpiochip\n"); - gpiochip_remove(&pctrl->chip); - return -ENOSYS; - } - - gpiochip_set_chained_irqchip(chip, &pctrl->irq_chip, pctrl->irq, - msm_gpio_irq_handler); - return 0; }
Replace gpiochip_irqchip_add() and gpiochip_set_chained_irqchip() calls by populating the gpio_irq_chip data structures instead. Signed-off-by: Lina Iyer <ilina@codeaurora.org> --- drivers/pinctrl/qcom/pinctrl-msm.c | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-)