summaryrefslogtreecommitdiffstats
path: root/drivers/pinctrl
diff options
context:
space:
mode:
authorDmitry Baryshkov <dmitry.baryshkov@linaro.org>2021-10-08 03:25:14 +0200
committerLinus Walleij <linus.walleij@linaro.org>2021-10-17 23:32:33 +0200
commitf24dbaaab48a2fadefa27071580b6d1aeb9378b6 (patch)
treec22254b1b12e86e53858d20bb92d6cbdd328de54 /drivers/pinctrl
parentpinctrl: qcom: ssbi-mpp: add support for hierarchical IRQ chip (diff)
downloadlinux-f24dbaaab48a2fadefa27071580b6d1aeb9378b6.tar.xz
linux-f24dbaaab48a2fadefa27071580b6d1aeb9378b6.zip
pinctrl: qcom: spmi-mpp: hardcode IRQ counts
The probing of this driver calls platform_irq_count, which will setup all of the IRQs that are configured in device tree. In preparation for converting this driver to be a hierarchical IRQ chip, hardcode the IRQ count based on the hardware type so that all the IRQs are not configured immediately and are configured on an as-needed basis later in the boot process. This change will also allow for the removal of the interrupts property later in this patch series once the hierarchical IRQ chip support is in. This patch also removes the generic qcom,spmi-mpp OF match since we don't know the number of pins. All of the existing upstream bindings already include the more-specific binding. Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org> Link: https://lore.kernel.org/r/20211008012524.481877-16-dmitry.baryshkov@linaro.org Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/pinctrl')
-rw-r--r--drivers/pinctrl/qcom/pinctrl-spmi-mpp.c25
1 files changed, 10 insertions, 15 deletions
diff --git a/drivers/pinctrl/qcom/pinctrl-spmi-mpp.c b/drivers/pinctrl/qcom/pinctrl-spmi-mpp.c
index 2da9b5f68f3f..a9f994863126 100644
--- a/drivers/pinctrl/qcom/pinctrl-spmi-mpp.c
+++ b/drivers/pinctrl/qcom/pinctrl-spmi-mpp.c
@@ -812,11 +812,7 @@ static int pmic_mpp_probe(struct platform_device *pdev)
return ret;
}
- npins = platform_irq_count(pdev);
- if (!npins)
- return -EINVAL;
- if (npins < 0)
- return npins;
+ npins = (uintptr_t) device_get_match_data(&pdev->dev);
BUG_ON(npins > ARRAY_SIZE(pmic_mpp_groups));
@@ -912,16 +908,15 @@ static int pmic_mpp_remove(struct platform_device *pdev)
}
static const struct of_device_id pmic_mpp_of_match[] = {
- { .compatible = "qcom,pm8019-mpp" }, /* 6 MPP's */
- { .compatible = "qcom,pm8841-mpp" }, /* 4 MPP's */
- { .compatible = "qcom,pm8916-mpp" }, /* 4 MPP's */
- { .compatible = "qcom,pm8941-mpp" }, /* 8 MPP's */
- { .compatible = "qcom,pm8950-mpp" }, /* 4 MPP's */
- { .compatible = "qcom,pmi8950-mpp" }, /* 4 MPP's */
- { .compatible = "qcom,pm8994-mpp" }, /* 8 MPP's */
- { .compatible = "qcom,pma8084-mpp" }, /* 8 MPP's */
- { .compatible = "qcom,pmi8994-mpp" }, /* 4 MPP's */
- { .compatible = "qcom,spmi-mpp" }, /* Generic */
+ { .compatible = "qcom,pm8019-mpp", .data = (void *) 6 },
+ { .compatible = "qcom,pm8841-mpp", .data = (void *) 4 },
+ { .compatible = "qcom,pm8916-mpp", .data = (void *) 4 },
+ { .compatible = "qcom,pm8941-mpp", .data = (void *) 8 },
+ { .compatible = "qcom,pm8950-mpp", .data = (void *) 4 },
+ { .compatible = "qcom,pmi8950-mpp", .data = (void *) 4 },
+ { .compatible = "qcom,pm8994-mpp", .data = (void *) 8 },
+ { .compatible = "qcom,pma8084-mpp", .data = (void *) 8 },
+ { .compatible = "qcom,pmi8994-mpp", .data = (void *) 4 },
{ },
};