From: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: linuxarm@huawei.com, mauro.chehab@huawei.com,
Mauro Carvalho Chehab <mchehab+huawei@kernel.org>,
Lee Jones <lee.jones@linaro.org>,
linux-kernel@vger.kernel.org, linux-staging@lists.linux.dev,
Rob Herring <robh@kernel.org>
Subject: [PATCH v14 2/9] staging: hi6421-spmi-pmic: rename GPIO IRQ OF node
Date: Sat, 17 Jul 2021 11:58:13 +0200 [thread overview]
Message-ID: <8b2cad1e9b9904c6a2aaea8786d5e5a39f09ac19.1626515862.git.mchehab+huawei@kernel.org> (raw)
In-Reply-To: <cover.1626515862.git.mchehab+huawei@kernel.org>
Instead of using the standard name ("gpios"), use "interrupts".
Suggested-by: Rob Herring <robh@kernel.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
---
drivers/staging/hikey9xx/hi6421-spmi-pmic.c | 18 ++++++------------
.../hikey9xx/hisilicon,hi6421-spmi-pmic.yaml | 8 +++-----
include/linux/mfd/hi6421-spmi-pmic.h | 1 -
3 files changed, 9 insertions(+), 18 deletions(-)
diff --git a/drivers/staging/hikey9xx/hi6421-spmi-pmic.c b/drivers/staging/hikey9xx/hi6421-spmi-pmic.c
index dd7ff63214d3..61cbd2e62f68 100644
--- a/drivers/staging/hikey9xx/hi6421-spmi-pmic.c
+++ b/drivers/staging/hikey9xx/hi6421-spmi-pmic.c
@@ -218,6 +218,7 @@ static int hi6421_spmi_pmic_probe(struct spmi_device *sdev)
struct device *dev = &sdev->dev;
struct device_node *np = dev->of_node;
struct hi6421_spmi_pmic *ddata;
+ struct platform_device *pdev;
unsigned int virq;
int ret, i;
@@ -233,21 +234,14 @@ static int hi6421_spmi_pmic_probe(struct spmi_device *sdev)
ddata->dev = dev;
- ddata->gpio = of_get_gpio(np, 0);
- if (ddata->gpio < 0)
- return ddata->gpio;
+ pdev = container_of(dev, struct platform_device, dev);
- if (!gpio_is_valid(ddata->gpio))
- return -EINVAL;
-
- ret = devm_gpio_request_one(dev, ddata->gpio, GPIOF_IN, "pmic");
- if (ret < 0) {
- dev_err(dev, "Failed to request gpio%d\n", ddata->gpio);
- return ret;
+ ddata->irq = platform_get_irq(pdev, 0);
+ if (ddata->irq < 0) {
+ dev_err(dev, "Error %d when getting IRQs\n", ddata->irq);
+ return ddata->irq;
}
- ddata->irq = gpio_to_irq(ddata->gpio);
-
hi6421_spmi_pmic_irq_init(ddata);
ddata->irqs = devm_kzalloc(dev, PMIC_IRQ_LIST_MAX * sizeof(int), GFP_KERNEL);
diff --git a/drivers/staging/hikey9xx/hisilicon,hi6421-spmi-pmic.yaml b/drivers/staging/hikey9xx/hisilicon,hi6421-spmi-pmic.yaml
index 8e355cddd437..5a3b1cbfd639 100644
--- a/drivers/staging/hikey9xx/hisilicon,hi6421-spmi-pmic.yaml
+++ b/drivers/staging/hikey9xx/hisilicon,hi6421-spmi-pmic.yaml
@@ -34,9 +34,7 @@ properties:
interrupt-controller: true
- gpios:
- maxItems: 1
- description: GPIO used for IRQs
+ interrupts: true
regulators:
type: object
@@ -63,7 +61,6 @@ additionalProperties: false
examples:
- |
- /* pmic properties */
pmic: pmic@0 {
compatible = "hisilicon,hi6421-spmi";
@@ -71,7 +68,8 @@ examples:
#interrupt-cells = <2>;
interrupt-controller;
- gpios = <&gpio28 0 0>;
+ interrupt-parent = <&gpio28>;
+ interrupts = <0 0>;
regulators {
#address-cells = <1>;
diff --git a/include/linux/mfd/hi6421-spmi-pmic.h b/include/linux/mfd/hi6421-spmi-pmic.h
index 2660226138b8..254430c897d6 100644
--- a/include/linux/mfd/hi6421-spmi-pmic.h
+++ b/include/linux/mfd/hi6421-spmi-pmic.h
@@ -22,7 +22,6 @@ struct hi6421_spmi_pmic {
spinlock_t lock;
struct irq_domain *domain;
int irq;
- int gpio;
unsigned int *irqs;
struct regmap *regmap;
};
--
2.31.1
next prev parent reply other threads:[~2021-07-17 9:58 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-07-17 9:58 [PATCH v14 0/9] Move Hisilicon 6421v600 SPMI and USB drivers out of staging Mauro Carvalho Chehab
2021-07-17 9:58 ` [PATCH v14 1/9] staging: hi6421-spmi-pmic: rename spmi_device struct Mauro Carvalho Chehab
2021-07-17 9:58 ` Mauro Carvalho Chehab [this message]
2021-07-17 9:58 ` [PATCH v14 3/9] staging: hi6421-spmi-pmic: add a missing dot at copyright Mauro Carvalho Chehab
2021-07-17 9:58 ` [PATCH v14 4/9] staging: hikey9xx: split hi6421v600 irq into a separate driver Mauro Carvalho Chehab
2021-07-17 9:58 ` [PATCH v14 5/9] staging: hi6421-spmi-pmic: cleanup drvdata Mauro Carvalho Chehab
2021-07-21 9:25 ` Greg Kroah-Hartman
2021-07-21 10:10 ` Mauro Carvalho Chehab
2021-07-17 9:58 ` [PATCH v14 6/9] staging: hisilicon,hi6421-spmi-pmic.yaml: fix patternProperties Mauro Carvalho Chehab
2021-07-17 9:58 ` [PATCH v14 7/9] mfd: hi6421-spmi-pmic: move driver from staging Mauro Carvalho Chehab
2021-07-19 10:55 ` Lee Jones
2021-07-19 11:45 ` Mauro Carvalho Chehab
2021-07-19 13:26 ` Lee Jones
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=8b2cad1e9b9904c6a2aaea8786d5e5a39f09ac19.1626515862.git.mchehab+huawei@kernel.org \
--to=mchehab+huawei@kernel.org \
--cc=gregkh@linuxfoundation.org \
--cc=lee.jones@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-staging@lists.linux.dev \
--cc=linuxarm@huawei.com \
--cc=mauro.chehab@huawei.com \
--cc=robh@kernel.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).