Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'gpio-v5.5-2' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio

Pull GPIO fixes from Linus Walleij:
"A set of fixes for the v5.5 series:

- Fix the build for the Xtensa driver.

- Make sure to set up the parent device for mpc8xxx.

- Clarify the look-up error message.

- Fix the usage of the line direction in the mockup device.

- Fix a type warning on the Aspeed driver.

- Remove the pointless __exit annotation on the xgs-iproc which is
causing a compilation problem.

- Fix up emultation of open drain outputs .get_direction()

- Fix the IRQ callbacks on the PCA953xx to use bitops and work
properly.

- Fix the Kconfig on the Tegra driver"

* tag 'gpio-v5.5-2' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio:
gpio: tegra186: Allow building on Tegra194-only configurations
gpio: pca953x: Switch to bitops in IRQ callbacks
gpiolib: fix up emulated open drain outputs
MAINTAINERS: Append missed file to the database
gpio: xgs-iproc: remove __exit annotation for iproc_gpio_remove
gpio: aspeed: avoid return type warning
gpio: mockup: Fix usage of new GPIO_LINE_DIRECTION
gpio: Fix error message on out-of-range GPIO in lookup table
gpio: mpc8xxx: Add platform device to gpiochip->parent
gpio: xtensa: fix driver build

+35 -28
+1
MAINTAINERS
··· 7034 7034 S: Maintained 7035 7035 F: Documentation/firmware-guide/acpi/gpio-properties.rst 7036 7036 F: drivers/gpio/gpiolib-acpi.c 7037 + F: drivers/gpio/gpiolib-acpi.h 7037 7038 7038 7039 GPIO IR Transmitter 7039 7040 M: Sean Young <sean@mess.org>
+2 -2
drivers/gpio/Kconfig
··· 553 553 554 554 config GPIO_TEGRA186 555 555 tristate "NVIDIA Tegra186 GPIO support" 556 - default ARCH_TEGRA_186_SOC 557 - depends on ARCH_TEGRA_186_SOC || COMPILE_TEST 556 + default ARCH_TEGRA_186_SOC || ARCH_TEGRA_194_SOC 557 + depends on ARCH_TEGRA_186_SOC || ARCH_TEGRA_194_SOC || COMPILE_TEST 558 558 depends on OF_GPIO 559 559 select GPIOLIB_IRQCHIP 560 560 select IRQ_DOMAIN_HIERARCHY
+1 -1
drivers/gpio/gpio-aspeed-sgpio.c
··· 107 107 return gpio->base + bank->irq_regs + GPIO_IRQ_STATUS; 108 108 default: 109 109 /* acturally if code runs to here, it's an error case */ 110 - BUG_ON(1); 110 + BUG(); 111 111 } 112 112 } 113 113
+5 -2
drivers/gpio/gpio-mockup.c
··· 226 226 int direction; 227 227 228 228 mutex_lock(&chip->lock); 229 - direction = !chip->lines[offset].dir; 229 + direction = chip->lines[offset].dir; 230 230 mutex_unlock(&chip->lock); 231 231 232 232 return direction; ··· 395 395 struct gpio_chip *gc; 396 396 struct device *dev; 397 397 const char *name; 398 - int rv, base; 398 + int rv, base, i; 399 399 u16 ngpio; 400 400 401 401 dev = &pdev->dev; ··· 446 446 sizeof(*chip->lines), GFP_KERNEL); 447 447 if (!chip->lines) 448 448 return -ENOMEM; 449 + 450 + for (i = 0; i < gc->ngpio; i++) 451 + chip->lines[i].dir = GPIO_LINE_DIRECTION_IN; 449 452 450 453 if (device_property_read_bool(dev, "named-gpio-lines")) { 451 454 rv = gpio_mockup_name_lines(dev, chip);
+1
drivers/gpio/gpio-mpc8xxx.c
··· 346 346 return -ENOMEM; 347 347 348 348 gc = &mpc8xxx_gc->gc; 349 + gc->parent = &pdev->dev; 349 350 350 351 if (of_property_read_bool(np, "little-endian")) { 351 352 ret = bgpio_init(gc, &pdev->dev, 4,
+10 -16
drivers/gpio/gpio-pca953x.c
··· 568 568 { 569 569 struct gpio_chip *gc = irq_data_get_irq_chip_data(d); 570 570 struct pca953x_chip *chip = gpiochip_get_data(gc); 571 + irq_hw_number_t hwirq = irqd_to_hwirq(d); 571 572 572 - chip->irq_mask[d->hwirq / BANK_SZ] &= ~BIT(d->hwirq % BANK_SZ); 573 + clear_bit(hwirq, chip->irq_mask); 573 574 } 574 575 575 576 static void pca953x_irq_unmask(struct irq_data *d) 576 577 { 577 578 struct gpio_chip *gc = irq_data_get_irq_chip_data(d); 578 579 struct pca953x_chip *chip = gpiochip_get_data(gc); 580 + irq_hw_number_t hwirq = irqd_to_hwirq(d); 579 581 580 - chip->irq_mask[d->hwirq / BANK_SZ] |= BIT(d->hwirq % BANK_SZ); 582 + set_bit(hwirq, chip->irq_mask); 581 583 } 582 584 583 585 static int pca953x_irq_set_wake(struct irq_data *d, unsigned int on) ··· 637 635 { 638 636 struct gpio_chip *gc = irq_data_get_irq_chip_data(d); 639 637 struct pca953x_chip *chip = gpiochip_get_data(gc); 640 - int bank_nb = d->hwirq / BANK_SZ; 641 - u8 mask = BIT(d->hwirq % BANK_SZ); 638 + irq_hw_number_t hwirq = irqd_to_hwirq(d); 642 639 643 640 if (!(type & IRQ_TYPE_EDGE_BOTH)) { 644 641 dev_err(&chip->client->dev, "irq %d: unsupported type %d\n", ··· 645 644 return -EINVAL; 646 645 } 647 646 648 - if (type & IRQ_TYPE_EDGE_FALLING) 649 - chip->irq_trig_fall[bank_nb] |= mask; 650 - else 651 - chip->irq_trig_fall[bank_nb] &= ~mask; 652 - 653 - if (type & IRQ_TYPE_EDGE_RISING) 654 - chip->irq_trig_raise[bank_nb] |= mask; 655 - else 656 - chip->irq_trig_raise[bank_nb] &= ~mask; 647 + assign_bit(hwirq, chip->irq_trig_fall, type & IRQ_TYPE_EDGE_FALLING); 648 + assign_bit(hwirq, chip->irq_trig_raise, type & IRQ_TYPE_EDGE_RISING); 657 649 658 650 return 0; 659 651 } ··· 655 661 { 656 662 struct gpio_chip *gc = irq_data_get_irq_chip_data(d); 657 663 struct pca953x_chip *chip = gpiochip_get_data(gc); 658 - u8 mask = BIT(d->hwirq % BANK_SZ); 664 + irq_hw_number_t hwirq = irqd_to_hwirq(d); 659 665 660 - chip->irq_trig_raise[d->hwirq / BANK_SZ] &= ~mask; 661 - chip->irq_trig_fall[d->hwirq / BANK_SZ] &= ~mask; 666 + clear_bit(hwirq, chip->irq_trig_raise); 667 + clear_bit(hwirq, chip->irq_trig_fall); 662 668 } 663 669 664 670 static bool pca953x_irq_pending(struct pca953x_chip *chip, unsigned long *pending)
+1 -1
drivers/gpio/gpio-xgs-iproc.c
··· 280 280 return 0; 281 281 } 282 282 283 - static int __exit iproc_gpio_remove(struct platform_device *pdev) 283 + static int iproc_gpio_remove(struct platform_device *pdev) 284 284 { 285 285 struct iproc_gpio_chip *chip; 286 286
+3 -4
drivers/gpio/gpio-xtensa.c
··· 44 44 unsigned long flags; 45 45 46 46 local_irq_save(flags); 47 - RSR_CPENABLE(*cpenable); 48 - WSR_CPENABLE(*cpenable | BIT(XCHAL_CP_ID_XTIOP)); 49 - 47 + *cpenable = xtensa_get_sr(cpenable); 48 + xtensa_set_sr(*cpenable | BIT(XCHAL_CP_ID_XTIOP), cpenable); 50 49 return flags; 51 50 } 52 51 53 52 static inline void disable_cp(unsigned long flags, unsigned long cpenable) 54 53 { 55 - WSR_CPENABLE(cpenable); 54 + xtensa_set_sr(cpenable, cpenable); 56 55 local_irq_restore(flags); 57 56 } 58 57
+11 -2
drivers/gpio/gpiolib.c
··· 220 220 chip = gpiod_to_chip(desc); 221 221 offset = gpio_chip_hwgpio(desc); 222 222 223 + /* 224 + * Open drain emulation using input mode may incorrectly report 225 + * input here, fix that up. 226 + */ 227 + if (test_bit(FLAG_OPEN_DRAIN, &desc->flags) && 228 + test_bit(FLAG_IS_OUT, &desc->flags)) 229 + return 0; 230 + 223 231 if (!chip->get_direction) 224 232 return -ENOTSUPP; 225 233 ··· 4480 4472 4481 4473 if (chip->ngpio <= p->chip_hwnum) { 4482 4474 dev_err(dev, 4483 - "requested GPIO %d is out of range [0..%d] for chip %s\n", 4484 - idx, chip->ngpio, chip->label); 4475 + "requested GPIO %u (%u) is out of range [0..%u] for chip %s\n", 4476 + idx, p->chip_hwnum, chip->ngpio - 1, 4477 + chip->label); 4485 4478 return ERR_PTR(-EINVAL); 4486 4479 } 4487 4480