Commit f24dbaaa authored by Dmitry Baryshkov's avatar Dmitry Baryshkov Committed by Linus Walleij

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: default avatarDmitry Baryshkov <dmitry.baryshkov@linaro.org>
Reviewed-by: default avatarBjorn Andersson <bjorn.andersson@linaro.org>
Link: https://lore.kernel.org/r/20211008012524.481877-16-dmitry.baryshkov@linaro.orgSigned-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
parent 56b2443f
...@@ -812,11 +812,7 @@ static int pmic_mpp_probe(struct platform_device *pdev) ...@@ -812,11 +812,7 @@ static int pmic_mpp_probe(struct platform_device *pdev)
return ret; return ret;
} }
npins = platform_irq_count(pdev); npins = (uintptr_t) device_get_match_data(&pdev->dev);
if (!npins)
return -EINVAL;
if (npins < 0)
return npins;
BUG_ON(npins > ARRAY_SIZE(pmic_mpp_groups)); BUG_ON(npins > ARRAY_SIZE(pmic_mpp_groups));
...@@ -912,16 +908,15 @@ static int pmic_mpp_remove(struct platform_device *pdev) ...@@ -912,16 +908,15 @@ static int pmic_mpp_remove(struct platform_device *pdev)
} }
static const struct of_device_id pmic_mpp_of_match[] = { static const struct of_device_id pmic_mpp_of_match[] = {
{ .compatible = "qcom,pm8019-mpp" }, /* 6 MPP's */ { .compatible = "qcom,pm8019-mpp", .data = (void *) 6 },
{ .compatible = "qcom,pm8841-mpp" }, /* 4 MPP's */ { .compatible = "qcom,pm8841-mpp", .data = (void *) 4 },
{ .compatible = "qcom,pm8916-mpp" }, /* 4 MPP's */ { .compatible = "qcom,pm8916-mpp", .data = (void *) 4 },
{ .compatible = "qcom,pm8941-mpp" }, /* 8 MPP's */ { .compatible = "qcom,pm8941-mpp", .data = (void *) 8 },
{ .compatible = "qcom,pm8950-mpp" }, /* 4 MPP's */ { .compatible = "qcom,pm8950-mpp", .data = (void *) 4 },
{ .compatible = "qcom,pmi8950-mpp" }, /* 4 MPP's */ { .compatible = "qcom,pmi8950-mpp", .data = (void *) 4 },
{ .compatible = "qcom,pm8994-mpp" }, /* 8 MPP's */ { .compatible = "qcom,pm8994-mpp", .data = (void *) 8 },
{ .compatible = "qcom,pma8084-mpp" }, /* 8 MPP's */ { .compatible = "qcom,pma8084-mpp", .data = (void *) 8 },
{ .compatible = "qcom,pmi8994-mpp" }, /* 4 MPP's */ { .compatible = "qcom,pmi8994-mpp", .data = (void *) 4 },
{ .compatible = "qcom,spmi-mpp" }, /* Generic */
{ }, { },
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment