Skip to content

Commit 11313e2

Browse files
committed
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
2 parents 299f489 + 10af027 commit 11313e2

File tree

5 files changed

+39
-22
lines changed

5 files changed

+39
-22
lines changed

MAINTAINERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10839,7 +10839,7 @@ S: Maintained
1083910839
F: drivers/dma/hisi_dma.c
1084010840

1084110841
HISILICON GPIO DRIVER
10842-
M: Jay Fang <f.fangjian@huawei.com>
10842+
M: Yang Shen <shenyang39@huawei.com>
1084310843
1084410844
S: Maintained
1084510845
F: Documentation/devicetree/bindings/gpio/hisilicon,ascend910-gpio.yaml

drivers/gpio/gpio-loongson-64bit.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ static const struct loongson_gpio_chip_data loongson_gpio_ls7a2000_data0 = {
268268
/* LS7A2000 ACPI GPIO */
269269
static const struct loongson_gpio_chip_data loongson_gpio_ls7a2000_data1 = {
270270
.label = "ls7a2000_gpio",
271-
.mode = BYTE_CTRL_MODE,
271+
.mode = BIT_CTRL_MODE,
272272
.conf_offset = 0x4,
273273
.in_offset = 0x8,
274274
.out_offset = 0x0,

drivers/gpio/gpio-mlxbf3.c

Lines changed: 35 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,9 @@ static int mlxbf3_gpio_probe(struct platform_device *pdev)
190190
struct mlxbf3_gpio_context *gs;
191191
struct gpio_irq_chip *girq;
192192
struct gpio_chip *gc;
193+
char *colon_ptr;
193194
int ret, irq;
195+
long num;
194196

195197
gs = devm_kzalloc(dev, sizeof(*gs), GFP_KERNEL);
196198
if (!gs)
@@ -227,25 +229,39 @@ static int mlxbf3_gpio_probe(struct platform_device *pdev)
227229
gc->owner = THIS_MODULE;
228230
gc->add_pin_ranges = mlxbf3_gpio_add_pin_ranges;
229231

230-
irq = platform_get_irq(pdev, 0);
231-
if (irq >= 0) {
232-
girq = &gs->gc.irq;
233-
gpio_irq_chip_set_chip(girq, &gpio_mlxbf3_irqchip);
234-
girq->default_type = IRQ_TYPE_NONE;
235-
/* This will let us handle the parent IRQ in the driver */
236-
girq->num_parents = 0;
237-
girq->parents = NULL;
238-
girq->parent_handler = NULL;
239-
girq->handler = handle_bad_irq;
240-
241-
/*
242-
* Directly request the irq here instead of passing
243-
* a flow-handler because the irq is shared.
244-
*/
245-
ret = devm_request_irq(dev, irq, mlxbf3_gpio_irq_handler,
246-
IRQF_SHARED, dev_name(dev), gs);
247-
if (ret)
248-
return dev_err_probe(dev, ret, "failed to request IRQ");
232+
colon_ptr = strchr(dev_name(dev), ':');
233+
if (!colon_ptr) {
234+
dev_err(dev, "invalid device name format\n");
235+
return -EINVAL;
236+
}
237+
238+
ret = kstrtol(++colon_ptr, 16, &num);
239+
if (ret) {
240+
dev_err(dev, "invalid device instance\n");
241+
return ret;
242+
}
243+
244+
if (!num) {
245+
irq = platform_get_irq(pdev, 0);
246+
if (irq >= 0) {
247+
girq = &gs->gc.irq;
248+
gpio_irq_chip_set_chip(girq, &gpio_mlxbf3_irqchip);
249+
girq->default_type = IRQ_TYPE_NONE;
250+
/* This will let us handle the parent IRQ in the driver */
251+
girq->num_parents = 0;
252+
girq->parents = NULL;
253+
girq->parent_handler = NULL;
254+
girq->handler = handle_bad_irq;
255+
256+
/*
257+
* Directly request the irq here instead of passing
258+
* a flow-handler because the irq is shared.
259+
*/
260+
ret = devm_request_irq(dev, irq, mlxbf3_gpio_irq_handler,
261+
IRQF_SHARED, dev_name(dev), gs);
262+
if (ret)
263+
return dev_err_probe(dev, ret, "failed to request IRQ");
264+
}
249265
}
250266

251267
platform_set_drvdata(pdev, gs);

drivers/gpio/gpio-pca953x.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -974,7 +974,7 @@ static int pca953x_irq_setup(struct pca953x_chip *chip, int irq_base)
974974
IRQF_ONESHOT | IRQF_SHARED, dev_name(dev),
975975
chip);
976976
if (ret)
977-
return dev_err_probe(dev, client->irq, "failed to request irq\n");
977+
return dev_err_probe(dev, ret, "failed to request irq\n");
978978

979979
return 0;
980980
}

drivers/gpio/gpio-spacemit-k1.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,7 @@ static const struct of_device_id spacemit_gpio_dt_ids[] = {
278278
{ .compatible = "spacemit,k1-gpio" },
279279
{ /* sentinel */ }
280280
};
281+
MODULE_DEVICE_TABLE(of, spacemit_gpio_dt_ids);
281282

282283
static struct platform_driver spacemit_gpio_driver = {
283284
.probe = spacemit_gpio_probe,

0 commit comments

Comments
 (0)