gpio fixes for v6.16-rc3

- correct the ACPI GPIO access mode in gpio-loongson-64bit
 - only obtain the interrupt for a single instance of the chip controlled
   by gpio-mlxbf3
 - fix an invalid value return from probe() in gpio-pca953x
 - add missing MODULE_DEVICE_TABLE() to gpio-spacemit
 - update the HiSilicon GPIO driver maintainer entry
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEFp3rbAvDxGAT0sefEacuoBRx13IFAmhVZb8ACgkQEacuoBRx
 13JphA//c0/UTOqmDcLOlkXinOvvfNkTVDskMw3caX+y9w0Kumms8DbXjHZ83yxz
 x+XqB6kGcYQhQW7RMlptZ+8vCFuRMaaa8H+oWIu9E//0XG3hmQSld46RhYphh047
 HnAcoZQV3cSDBNVxzl9egZORdZvjPUnu3ZC6Ajl6aZ6FkOSmmcjwXI66bteZ4U5m
 W977SVnr41mEVHESz7XYq6Hk0I9gSGjn3vIQrVcD7W+N+vUAaEDcoLNv8I4q0SeU
 8iHEC9Rblb8h9KeRXF55dgUYYcWlelusebhe0rgZxEJLGczkqigzyiqh5w+bm34W
 Qup8CuKxFZzIdYO4cd62sTq5fbNGbh94iIn7tygqm44Al7VZ0M+pxEI1CW/Uj4zV
 qF2rsv9gkc2Z7ei3ksMaVdLmMydHWpgz7bD8qNV8/Z72PnXls3wUOpcONLTPmJbP
 M1M5lS+u3VKTlAnF582b668aKf6Vw61DTOXllRnOMYzDr975aIKoOLFHrKZmUkxN
 AbB93r22TNldDfnQZYwjIo9D/EcONXx2PUjx4Kfv1kvmI11EZIEZOlQ322dIyiHU
 I4dYLYU9wJerZMDC9ZUi3aW9SC/4/fCzwGWG2c8bR/M7kYXgXo3D4YLv5/hqB6cu
 0pOAWj0rCwDx0EaXZGBs7zPv1ONJ9IDBJQrUIvtS8wSmBLm7Fp8=
 =CAzO
 -----END PGP SIGNATURE-----

Merge tag 'gpio-fixes-for-v6.16-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux

Pull gpio fixes from Bartosz Golaszewski:

 - correct the ACPI GPIO access mode in gpio-loongson-64bit

 - only obtain the interrupt for a single instance of the chip
   controlled by gpio-mlxbf3

 - fix an invalid value return from probe() in gpio-pca953x

 - add missing MODULE_DEVICE_TABLE() to gpio-spacemit

 - update the HiSilicon GPIO driver maintainer entry

* tag 'gpio-fixes-for-v6.16-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux:
  gpio: mlxbf3: only get IRQ for device instance 0
  gpio: pca953x: fix wrong error probe return value
  gpio: spacemit: Add missing MODULE_DEVICE_TABLE
  gpio: loongson-64bit: Correct Loongson-7A2000 ACPI GPIO access mode
  MAINTAINERS: Update HiSilicon GPIO driver maintainer
This commit is contained in:
Linus Torvalds 2025-06-20 10:07:56 -07:00
commit 11313e2f78
5 changed files with 38 additions and 21 deletions

View File

@ -10839,7 +10839,7 @@ S: Maintained
F: drivers/dma/hisi_dma.c
HISILICON GPIO DRIVER
M: Jay Fang <f.fangjian@huawei.com>
M: Yang Shen <shenyang39@huawei.com>
L: linux-gpio@vger.kernel.org
S: Maintained
F: Documentation/devicetree/bindings/gpio/hisilicon,ascend910-gpio.yaml

View File

@ -268,7 +268,7 @@ static const struct loongson_gpio_chip_data loongson_gpio_ls7a2000_data0 = {
/* LS7A2000 ACPI GPIO */
static const struct loongson_gpio_chip_data loongson_gpio_ls7a2000_data1 = {
.label = "ls7a2000_gpio",
.mode = BYTE_CTRL_MODE,
.mode = BIT_CTRL_MODE,
.conf_offset = 0x4,
.in_offset = 0x8,
.out_offset = 0x0,

View File

@ -190,7 +190,9 @@ static int mlxbf3_gpio_probe(struct platform_device *pdev)
struct mlxbf3_gpio_context *gs;
struct gpio_irq_chip *girq;
struct gpio_chip *gc;
char *colon_ptr;
int ret, irq;
long num;
gs = devm_kzalloc(dev, sizeof(*gs), GFP_KERNEL);
if (!gs)
@ -227,25 +229,39 @@ static int mlxbf3_gpio_probe(struct platform_device *pdev)
gc->owner = THIS_MODULE;
gc->add_pin_ranges = mlxbf3_gpio_add_pin_ranges;
irq = platform_get_irq(pdev, 0);
if (irq >= 0) {
girq = &gs->gc.irq;
gpio_irq_chip_set_chip(girq, &gpio_mlxbf3_irqchip);
girq->default_type = IRQ_TYPE_NONE;
/* This will let us handle the parent IRQ in the driver */
girq->num_parents = 0;
girq->parents = NULL;
girq->parent_handler = NULL;
girq->handler = handle_bad_irq;
colon_ptr = strchr(dev_name(dev), ':');
if (!colon_ptr) {
dev_err(dev, "invalid device name format\n");
return -EINVAL;
}
/*
* Directly request the irq here instead of passing
* a flow-handler because the irq is shared.
*/
ret = devm_request_irq(dev, irq, mlxbf3_gpio_irq_handler,
IRQF_SHARED, dev_name(dev), gs);
if (ret)
return dev_err_probe(dev, ret, "failed to request IRQ");
ret = kstrtol(++colon_ptr, 16, &num);
if (ret) {
dev_err(dev, "invalid device instance\n");
return ret;
}
if (!num) {
irq = platform_get_irq(pdev, 0);
if (irq >= 0) {
girq = &gs->gc.irq;
gpio_irq_chip_set_chip(girq, &gpio_mlxbf3_irqchip);
girq->default_type = IRQ_TYPE_NONE;
/* This will let us handle the parent IRQ in the driver */
girq->num_parents = 0;
girq->parents = NULL;
girq->parent_handler = NULL;
girq->handler = handle_bad_irq;
/*
* Directly request the irq here instead of passing
* a flow-handler because the irq is shared.
*/
ret = devm_request_irq(dev, irq, mlxbf3_gpio_irq_handler,
IRQF_SHARED, dev_name(dev), gs);
if (ret)
return dev_err_probe(dev, ret, "failed to request IRQ");
}
}
platform_set_drvdata(pdev, gs);

View File

@ -974,7 +974,7 @@ static int pca953x_irq_setup(struct pca953x_chip *chip, int irq_base)
IRQF_ONESHOT | IRQF_SHARED, dev_name(dev),
chip);
if (ret)
return dev_err_probe(dev, client->irq, "failed to request irq\n");
return dev_err_probe(dev, ret, "failed to request irq\n");
return 0;
}

View File

@ -278,6 +278,7 @@ static const struct of_device_id spacemit_gpio_dt_ids[] = {
{ .compatible = "spacemit,k1-gpio" },
{ /* sentinel */ }
};
MODULE_DEVICE_TABLE(of, spacemit_gpio_dt_ids);
static struct platform_driver spacemit_gpio_driver = {
.probe = spacemit_gpio_probe,