All of lore.kernel.org
 help / color / mirror / Atom feed
From: Brian Masney <masneyb@onstation.org>
To: linus.walleij@linaro.org, sboyd@kernel.org,
	bjorn.andersson@linaro.org, andy.gross@linaro.org,
	marc.zyngier@arm.com, lee.jones@linaro.org
Cc: tglx@linutronix.de, shawnguo@kernel.org, dianders@chromium.org,
	linux-gpio@vger.kernel.org, nicolas.dechesne@linaro.org,
	niklas.cassel@linaro.org, david.brown@linaro.org,
	robh+dt@kernel.org, mark.rutland@arm.com,
	thierry.reding@gmail.com, linux-arm-msm@vger.kernel.org,
	linux-kernel@vger.kernel.org, devicetree@vger.kernel.org
Subject: [PATCH v2 01/11] pinctrl: qcom: ssbi-gpio: hardcode IRQ counts
Date: Thu,  7 Feb 2019 21:16:21 -0500	[thread overview]
Message-ID: <20190208021631.30252-2-masneyb@onstation.org> (raw)
In-Reply-To: <20190208021631.30252-1-masneyb@onstation.org>

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-gpio OF match since we
don't know the number of pins. All of the existing upstream bindings
already include the more-specific binding.

This change was tested on an APQ8060 DragonBoard.

Signed-off-by: Brian Masney <masneyb@onstation.org>
Tested-by: Linus Walleij <linus.walleij@linaro.org>
---
Changes since v1:
- Added pctrl->dev back that was mistakenly removed
- Removed npins local variable from _probe(); populate pctrl->npins
  directly.

 drivers/pinctrl/qcom/pinctrl-ssbi-gpio.c | 21 +++++++--------------
 1 file changed, 7 insertions(+), 14 deletions(-)

diff --git a/drivers/pinctrl/qcom/pinctrl-ssbi-gpio.c b/drivers/pinctrl/qcom/pinctrl-ssbi-gpio.c
index ded7d765af2e..23641e4d4521 100644
--- a/drivers/pinctrl/qcom/pinctrl-ssbi-gpio.c
+++ b/drivers/pinctrl/qcom/pinctrl-ssbi-gpio.c
@@ -665,12 +665,11 @@ static int pm8xxx_pin_populate(struct pm8xxx_gpio *pctrl,
 }
 
 static const struct of_device_id pm8xxx_gpio_of_match[] = {
-	{ .compatible = "qcom,pm8018-gpio" },
-	{ .compatible = "qcom,pm8038-gpio" },
-	{ .compatible = "qcom,pm8058-gpio" },
-	{ .compatible = "qcom,pm8917-gpio" },
-	{ .compatible = "qcom,pm8921-gpio" },
-	{ .compatible = "qcom,ssbi-gpio" },
+	{ .compatible = "qcom,pm8018-gpio", .data = (void *) 6 },
+	{ .compatible = "qcom,pm8038-gpio", .data = (void *) 12 },
+	{ .compatible = "qcom,pm8058-gpio", .data = (void *) 44 },
+	{ .compatible = "qcom,pm8917-gpio", .data = (void *) 38 },
+	{ .compatible = "qcom,pm8921-gpio", .data = (void *) 44 },
 	{ },
 };
 MODULE_DEVICE_TABLE(of, pm8xxx_gpio_of_match);
@@ -680,20 +679,14 @@ static int pm8xxx_gpio_probe(struct platform_device *pdev)
 	struct pm8xxx_pin_data *pin_data;
 	struct pinctrl_pin_desc *pins;
 	struct pm8xxx_gpio *pctrl;
-	int ret;
-	int i, npins;
+	int ret, 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) {
-- 
2.17.2

  reply	other threads:[~2019-02-08  2:16 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-08  2:16 [PATCH v2 00/11] qcom: ssbi-gpio: add support for hierarchical IRQ chip Brian Masney
2019-02-08  2:16 ` Brian Masney [this message]
2019-02-08  2:16 ` [PATCH v2 02/11] genirq: introduce irq_domain_translate_twocell Brian Masney
2019-02-08 13:25   ` Marc Zyngier
2019-02-08  2:16 ` [PATCH v2 03/11] genirq: introduce irq_chip_mask_ack_parent() Brian Masney
2019-02-08  2:16 ` [PATCH v2 04/11] mfd: pm8xxx: convert to v2 irq interfaces to support hierarchical IRQ chips Brian Masney
2019-02-12  8:38   ` Lee Jones
2019-02-08  2:16 ` [PATCH v2 05/11] mfd: pm8xxx: disassociate old virq if hwirq mapping already exists Brian Masney
2019-02-12  8:39   ` Lee Jones
2019-02-15  5:51   ` Stephen Boyd
2019-02-15 13:47     ` Brian Masney
2019-02-15 21:28       ` Stephen Boyd
2019-02-16  0:23         ` Brian Masney
2019-02-21 18:47           ` Stephen Boyd
2019-02-22  8:57             ` Marc Zyngier
2019-02-22  9:07               ` Linus Walleij
2019-02-22  9:07                 ` Linus Walleij
2019-02-08  2:16 ` [PATCH v2 06/11] qcom: ssbi-gpio: add support for hierarchical IRQ chip Brian Masney
2019-02-08  2:16 ` [PATCH v2 07/11] arm: dts: qcom: apq8064: add interrupt controller properties Brian Masney
2019-02-08  2:16 ` [PATCH v2 08/11] arm: dts: qcom: msm8660: " Brian Masney
2019-02-08  2:16 ` [PATCH v2 09/11] arm: dts: qcom: mdm9615: " Brian Masney
2019-02-08  2:16 ` [PATCH v2 10/11] ARM: dts: qcom-apq8060: Fix up interrupt parents Brian Masney
2019-02-08  2:16 ` [PATCH v2 11/11] mfd: pm8xxx: revert "disassociate old virq if hwirq mapping already exists" Brian Masney
2019-02-12  8:20   ` Lee Jones
2019-02-11 13:33 ` [PATCH v2 00/11] qcom: ssbi-gpio: add support for hierarchical IRQ chip Linus Walleij
2019-02-11 13:33   ` Linus Walleij
2019-02-13  8:38 ` Linus Walleij
2019-02-13  8:38   ` Linus Walleij
2019-02-21 11:59 ` Linus Walleij
2019-02-21 11:59   ` Linus Walleij

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190208021631.30252-2-masneyb@onstation.org \
    --to=masneyb@onstation.org \
    --cc=andy.gross@linaro.org \
    --cc=bjorn.andersson@linaro.org \
    --cc=david.brown@linaro.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dianders@chromium.org \
    --cc=lee.jones@linaro.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marc.zyngier@arm.com \
    --cc=mark.rutland@arm.com \
    --cc=nicolas.dechesne@linaro.org \
    --cc=niklas.cassel@linaro.org \
    --cc=robh+dt@kernel.org \
    --cc=sboyd@kernel.org \
    --cc=shawnguo@kernel.org \
    --cc=tglx@linutronix.de \
    --cc=thierry.reding@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.