Skip to content

Commit f81d992

Browse files
mchehabgregkh
authored andcommitted
staging: hi6421-spmi-pmic: rename GPIO IRQ OF node
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> Link: https://lore.kernel.org/r/8b2cad1e9b9904c6a2aaea8786d5e5a39f09ac19.1626515862.git.mchehab+huawei@kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent b82d45a commit f81d992

3 files changed

Lines changed: 9 additions & 18 deletions

File tree

‎drivers/staging/hikey9xx/hi6421-spmi-pmic.c‎

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,7 @@ static int hi6421_spmi_pmic_probe(struct spmi_device *sdev)
218218
struct device *dev = &sdev->dev;
219219
struct device_node *np = dev->of_node;
220220
struct hi6421_spmi_pmic *ddata;
221+
struct platform_device *pdev;
221222
unsigned int virq;
222223
int ret, i;
223224

@@ -233,21 +234,14 @@ static int hi6421_spmi_pmic_probe(struct spmi_device *sdev)
233234

234235
ddata->dev = dev;
235236

236-
ddata->gpio = of_get_gpio(np, 0);
237-
if (ddata->gpio < 0)
238-
return ddata->gpio;
237+
pdev = container_of(dev, struct platform_device, dev);
239238

240-
if (!gpio_is_valid(ddata->gpio))
241-
return -EINVAL;
242-
243-
ret = devm_gpio_request_one(dev, ddata->gpio, GPIOF_IN, "pmic");
244-
if (ret < 0) {
245-
dev_err(dev, "Failed to request gpio%d\n", ddata->gpio);
246-
return ret;
239+
ddata->irq = platform_get_irq(pdev, 0);
240+
if (ddata->irq < 0) {
241+
dev_err(dev, "Error %d when getting IRQs\n", ddata->irq);
242+
return ddata->irq;
247243
}
248244

249-
ddata->irq = gpio_to_irq(ddata->gpio);
250-
251245
hi6421_spmi_pmic_irq_init(ddata);
252246

253247
ddata->irqs = devm_kzalloc(dev, PMIC_IRQ_LIST_MAX * sizeof(int), GFP_KERNEL);

‎drivers/staging/hikey9xx/hisilicon,hi6421-spmi-pmic.yaml‎

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,7 @@ properties:
3434

3535
interrupt-controller: true
3636

37-
gpios:
38-
maxItems: 1
39-
description: GPIO used for IRQs
37+
interrupts: true
4038

4139
regulators:
4240
type: object
@@ -63,15 +61,15 @@ additionalProperties: false
6361

6462
examples:
6563
- |
66-
/* pmic properties */
6764
6865
pmic: pmic@0 {
6966
compatible = "hisilicon,hi6421-spmi";
7067
reg = <0 0>;
7168
7269
#interrupt-cells = <2>;
7370
interrupt-controller;
74-
gpios = <&gpio28 0 0>;
71+
interrupt-parent = <&gpio28>;
72+
interrupts = <0 0>;
7573
7674
regulators {
7775
#address-cells = <1>;

‎include/linux/mfd/hi6421-spmi-pmic.h‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ struct hi6421_spmi_pmic {
2222
spinlock_t lock;
2323
struct irq_domain *domain;
2424
int irq;
25-
int gpio;
2625
unsigned int *irqs;
2726
struct regmap *regmap;
2827
};

0 commit comments

Comments
 (0)