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

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

Pull gpio fixes from Bartosz Golaszewski:
"Apart from the gpio-exar fix which addresses an older issue, they all
fix regressions from this release cycle:

- fix missing GPIO chip labels in gpio-zevio and gpio-altera

- for the latter: also set GPIO base to -1 to use dynamic range
allocation

- fix value setting with external pull-up/down resistor in gpio-exar

- use the recommended IDA interfaces in gpio-mpsse"

* tag 'gpio-fixes-for-v6.13-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux:
gpio: mpsse: Remove usage of the deprecated ida_simple_xx() API
gpio: exar: set value when external pull-up or pull-down is present
gpio: altera: Add missed base and label initialisations
gpio: zevio: Add missed label initialisation

+19 -6
+5
drivers/gpio/gpio-altera.c
··· 261 261 altera_gc->gc.set = altera_gpio_set; 262 262 altera_gc->gc.owner = THIS_MODULE; 263 263 altera_gc->gc.parent = &pdev->dev; 264 + altera_gc->gc.base = -1; 265 + 266 + altera_gc->gc.label = devm_kasprintf(dev, GFP_KERNEL, "%pfw", dev_fwnode(dev)); 267 + if (!altera_gc->gc.label) 268 + return -ENOMEM; 264 269 265 270 altera_gc->regs = devm_platform_ioremap_resource(pdev, 0); 266 271 if (IS_ERR(altera_gc->regs))
+6 -4
drivers/gpio/gpio-exar.c
··· 99 99 struct exar_gpio_chip *exar_gpio = gpiochip_get_data(chip); 100 100 unsigned int addr = exar_offset_to_lvl_addr(exar_gpio, offset); 101 101 unsigned int bit = exar_offset_to_bit(exar_gpio, offset); 102 + unsigned int bit_value = value ? BIT(bit) : 0; 102 103 103 - if (value) 104 - regmap_set_bits(exar_gpio->regmap, addr, BIT(bit)); 105 - else 106 - regmap_clear_bits(exar_gpio->regmap, addr, BIT(bit)); 104 + /* 105 + * regmap_write_bits() forces value to be written when an external 106 + * pull up/down might otherwise indicate value was already set. 107 + */ 108 + regmap_write_bits(exar_gpio->regmap, addr, BIT(bit), bit_value); 107 109 } 108 110 109 111 static int exar_direction_output(struct gpio_chip *chip, unsigned int offset,
+2 -2
drivers/gpio/gpio-mpsse.c
··· 403 403 { 404 404 struct mpsse_priv *priv = data; 405 405 406 - ida_simple_remove(&gpio_mpsse_ida, priv->id); 406 + ida_free(&gpio_mpsse_ida, priv->id); 407 407 } 408 408 409 409 static int gpio_mpsse_probe(struct usb_interface *interface, ··· 422 422 priv->intf = interface; 423 423 priv->intf_id = interface->cur_altsetting->desc.bInterfaceNumber; 424 424 425 - priv->id = ida_simple_get(&gpio_mpsse_ida, 0, 0, GFP_KERNEL); 425 + priv->id = ida_alloc(&gpio_mpsse_ida, GFP_KERNEL); 426 426 if (priv->id < 0) 427 427 return priv->id; 428 428
+6
drivers/gpio/gpio-zevio.c
··· 11 11 #include <linux/io.h> 12 12 #include <linux/mod_devicetable.h> 13 13 #include <linux/platform_device.h> 14 + #include <linux/property.h> 14 15 #include <linux/slab.h> 15 16 #include <linux/spinlock.h> 16 17 ··· 170 169 /* Initialization */ 171 170 static int zevio_gpio_probe(struct platform_device *pdev) 172 171 { 172 + struct device *dev = &pdev->dev; 173 173 struct zevio_gpio *controller; 174 174 int status, i; 175 175 ··· 181 179 /* Copy our reference */ 182 180 controller->chip = zevio_gpio_chip; 183 181 controller->chip.parent = &pdev->dev; 182 + 183 + controller->chip.label = devm_kasprintf(dev, GFP_KERNEL, "%pfw", dev_fwnode(dev)); 184 + if (!controller->chip.label) 185 + return -ENOMEM; 184 186 185 187 controller->regs = devm_platform_ioremap_resource(pdev, 0); 186 188 if (IS_ERR(controller->regs))