summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--drivers/staging/hikey9xx/hi6421-spmi-pmic.c18
-rw-r--r--drivers/staging/hikey9xx/hisilicon,hi6421-spmi-pmic.yaml8
-rw-r--r--include/linux/mfd/hi6421-spmi-pmic.h1
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;
};