summaryrefslogtreecommitdiff
path: root/drivers/pinctrl/qcom
diff options
context:
space:
mode:
authorDmitry Baryshkov <dmitry.baryshkov@linaro.org>2021-10-08 04:25:12 +0300
committerLinus Walleij <linus.walleij@linaro.org>2021-10-17 23:31:59 +0200
commit461030b804fbc615c2931787425e3dc717b03abc (patch)
tree971f851c886c360ae66a80d4b7ab47e694d2c772 /drivers/pinctrl/qcom
parentf9a06b8109516c35be33c4cd6c86c07a8f4a740f (diff)
pinctrl: qcom: ssbi-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,ssbi-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-14-dmitry.baryshkov@linaro.org Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/pinctrl/qcom')
-rw-r--r--drivers/pinctrl/qcom/pinctrl-ssbi-mpp.c22
1 files changed, 8 insertions, 14 deletions
diff --git a/drivers/pinctrl/qcom/pinctrl-ssbi-mpp.c b/drivers/pinctrl/qcom/pinctrl-ssbi-mpp.c
index 92e7f2602847..a90cada1d657 100644
--- a/drivers/pinctrl/qcom/pinctrl-ssbi-mpp.c
+++ b/drivers/pinctrl/qcom/pinctrl-ssbi-mpp.c
@@ -733,13 +733,12 @@ static int pm8xxx_pin_populate(struct pm8xxx_mpp *pctrl,
}
static const struct of_device_id pm8xxx_mpp_of_match[] = {
- { .compatible = "qcom,pm8018-mpp" },
- { .compatible = "qcom,pm8038-mpp" },
- { .compatible = "qcom,pm8058-mpp" },
- { .compatible = "qcom,pm8917-mpp" },
- { .compatible = "qcom,pm8821-mpp" },
- { .compatible = "qcom,pm8921-mpp" },
- { .compatible = "qcom,ssbi-mpp" },
+ { .compatible = "qcom,pm8018-mpp", .data = (void *) 6 },
+ { .compatible = "qcom,pm8038-mpp", .data = (void *) 6 },
+ { .compatible = "qcom,pm8058-mpp", .data = (void *) 12 },
+ { .compatible = "qcom,pm8821-mpp", .data = (void *) 4 },
+ { .compatible = "qcom,pm8917-mpp", .data = (void *) 10 },
+ { .compatible = "qcom,pm8921-mpp", .data = (void *) 12 },
{ },
};
MODULE_DEVICE_TABLE(of, pm8xxx_mpp_of_match);
@@ -750,19 +749,14 @@ static int pm8xxx_mpp_probe(struct platform_device *pdev)
struct pinctrl_pin_desc *pins;
struct pm8xxx_mpp *pctrl;
int ret;
- int i, npins;
+ int i;
pctrl = devm_kzalloc(&pdev->dev, sizeof(*pctrl), GFP_KERNEL);
if (!pctrl)
return -ENOMEM;
pctrl->dev = &pdev->dev;
- npins = platform_irq_count(pdev);
- if (!npins)
- return -EINVAL;
- if (npins < 0)
- return npins;
- pctrl->npins = npins;
+ pctrl->npins = (uintptr_t) device_get_match_data(&pdev->dev);
pctrl->regmap = dev_get_regmap(pdev->dev.parent, NULL);
if (!pctrl->regmap) {