Skip to content

Commit

Permalink
staging: hi6421-spmi-pmic: rename GPIO IRQ OF node
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Mauro Carvalho Chehab authored and Greg Kroah-Hartman committed Jul 21, 2021
1 parent b82d45a commit f81d992
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 18 deletions.
18 changes: 6 additions & 12 deletions drivers/staging/hikey9xx/hi6421-spmi-pmic.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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);
Expand Down
8 changes: 3 additions & 5 deletions drivers/staging/hikey9xx/hisilicon,hi6421-spmi-pmic.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,7 @@ properties:

interrupt-controller: true

gpios:
maxItems: 1
description: GPIO used for IRQs
interrupts: true

regulators:
type: object
Expand All @@ -63,15 +61,15 @@ additionalProperties: false

examples:
- |
/* pmic properties */
pmic: pmic@0 {
compatible = "hisilicon,hi6421-spmi";
reg = <0 0>;
#interrupt-cells = <2>;
interrupt-controller;
gpios = <&gpio28 0 0>;
interrupt-parent = <&gpio28>;
interrupts = <0 0>;
regulators {
#address-cells = <1>;
Expand Down
1 change: 0 additions & 1 deletion include/linux/mfd/hi6421-spmi-pmic.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};
Expand Down

0 comments on commit f81d992

Please sign in to comment.