diff options
| author | Bartosz Golaszewski <bartosz.golaszewski@linaro.org> | 2025-08-11 15:36:17 +0200 |
|---|---|---|
| committer | Lee Jones <lee@kernel.org> | 2025-09-03 12:45:33 +0100 |
| commit | 9b33bbc084accb4ebde3c6888758b31e3bdf1c57 (patch) | |
| tree | 1f4e2b15adf28a3b2c65f24b609f8a86e5c3c0d0 | |
| parent | 1efbee6852f1ff698a9981bd731308dd027189fb (diff) | |
mfd: vexpress-sysreg: Use new generic GPIO chip API
Convert the driver to using the new generic GPIO chip interfaces from
linux/gpio/generic.h.
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20250811-gpio-mmio-mfd-conv-v1-2-68c5c958cf80@linaro.org
Signed-off-by: Lee Jones <lee@kernel.org>
| -rw-r--r-- | drivers/mfd/vexpress-sysreg.c | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/drivers/mfd/vexpress-sysreg.c b/drivers/mfd/vexpress-sysreg.c index 77245c1e5d7d..9399eb850ca2 100644 --- a/drivers/mfd/vexpress-sysreg.c +++ b/drivers/mfd/vexpress-sysreg.c @@ -5,6 +5,7 @@ */ #include <linux/gpio/driver.h> +#include <linux/gpio/generic.h> #include <linux/err.h> #include <linux/io.h> #include <linux/mfd/core.h> @@ -96,9 +97,10 @@ static struct mfd_cell vexpress_sysreg_cells[] = { static int vexpress_sysreg_probe(struct platform_device *pdev) { + struct gpio_generic_chip *mmc_gpio_chip; + struct gpio_generic_chip_config config; struct resource *mem; void __iomem *base; - struct gpio_chip *mmc_gpio_chip; int ret; mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); @@ -117,11 +119,20 @@ static int vexpress_sysreg_probe(struct platform_device *pdev) GFP_KERNEL); if (!mmc_gpio_chip) return -ENOMEM; - bgpio_init(mmc_gpio_chip, &pdev->dev, 0x4, base + SYS_MCI, - NULL, NULL, NULL, NULL, 0); - mmc_gpio_chip->ngpio = 2; - ret = devm_gpiochip_add_data(&pdev->dev, mmc_gpio_chip, NULL); + config = (typeof(config)){ + .dev = &pdev->dev, + .sz = 4, + .dat = base + SYS_MCI, + }; + + ret = gpio_generic_chip_init(mmc_gpio_chip, &config); + if (ret) + return ret; + + mmc_gpio_chip->gc.ngpio = 2; + + ret = devm_gpiochip_add_data(&pdev->dev, &mmc_gpio_chip->gc, NULL); if (ret) return ret; |
