gpio fixes for v6.13-rc1

- 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
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEFp3rbAvDxGAT0sefEacuoBRx13IFAmdG8OsACgkQEacuoBRx
 13K3BhAAqJBBas7joaAdiGy+28Wqv9uYktjPxLUPY3lDFQqtnmXYg69iS9JycsNx
 C4138zFtMlCS0QU4WXQlfZLlgPiwXuVDGdJ+Wn/oD8ChFtgjL1D/alo9cqRg4MMx
 bN6KtxQdGjSKB0LdRqrIQWtLZEl8LmF8eycDPwXJwzV/R1qmtj3urgihqyQpYfDV
 cTBCVjMhOF9gynSf4J+vdgGOhsDw9wV7v4OG6znizYAzI+Arr9YXwkUnn4BQosTj
 FABM7ZVWS73nR7TGXvO+1FGqHh3JJHZ5Teu9lqYEqWa6ZuKecF4W5ElPWE1lX9gc
 aAB9SopNaYmFV7VWK5zDGnftYhx0TZ1PWMgiECxd8LKJDJRtTVSurm0rLQqxPUTr
 AUs9te7jHXX/57mEm1+l98dfX8DYbbbNCPKpJH4zYt4PPVxGGJEcxCBBxtrPJ9si
 atcNQjIZwO2vpqpJm196wEkJQBqDiYALX7R5wdT88ty6DEBM7ym4uSzS86ymjgUz
 753hpkaGOcbgZ8tZB3r9UvPonPS9iflhScBW8Nu3PYaoyGnFe1GTgt8gjMUfIpq9
 m6hsniy+A9pWiv3ODb418xwxPEXlCNndbxuhZDPul3JG+w0nadxkRL8E9HAcAteT
 5jN4fW1IOKlSyl3kTAxDFIvpSp/B8WI0lLQSgZPDcoYZMK8t+DA=
 =ILxF
 -----END PGP SIGNATURE-----

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
This commit is contained in:
Linus Torvalds 2024-11-27 13:23:13 -08:00
commit 6b867c475e
4 changed files with 19 additions and 6 deletions

View File

@ -261,6 +261,11 @@ static int altera_gpio_probe(struct platform_device *pdev)
altera_gc->gc.set = altera_gpio_set;
altera_gc->gc.owner = THIS_MODULE;
altera_gc->gc.parent = &pdev->dev;
altera_gc->gc.base = -1;
altera_gc->gc.label = devm_kasprintf(dev, GFP_KERNEL, "%pfw", dev_fwnode(dev));
if (!altera_gc->gc.label)
return -ENOMEM;
altera_gc->regs = devm_platform_ioremap_resource(pdev, 0);
if (IS_ERR(altera_gc->regs))

View File

@ -99,11 +99,13 @@ static void exar_set_value(struct gpio_chip *chip, unsigned int offset,
struct exar_gpio_chip *exar_gpio = gpiochip_get_data(chip);
unsigned int addr = exar_offset_to_lvl_addr(exar_gpio, offset);
unsigned int bit = exar_offset_to_bit(exar_gpio, offset);
unsigned int bit_value = value ? BIT(bit) : 0;
if (value)
regmap_set_bits(exar_gpio->regmap, addr, BIT(bit));
else
regmap_clear_bits(exar_gpio->regmap, addr, BIT(bit));
/*
* regmap_write_bits() forces value to be written when an external
* pull up/down might otherwise indicate value was already set.
*/
regmap_write_bits(exar_gpio->regmap, addr, BIT(bit), bit_value);
}
static int exar_direction_output(struct gpio_chip *chip, unsigned int offset,

View File

@ -403,7 +403,7 @@ static void gpio_mpsse_ida_remove(void *data)
{
struct mpsse_priv *priv = data;
ida_simple_remove(&gpio_mpsse_ida, priv->id);
ida_free(&gpio_mpsse_ida, priv->id);
}
static int gpio_mpsse_probe(struct usb_interface *interface,
@ -422,7 +422,7 @@ static int gpio_mpsse_probe(struct usb_interface *interface,
priv->intf = interface;
priv->intf_id = interface->cur_altsetting->desc.bInterfaceNumber;
priv->id = ida_simple_get(&gpio_mpsse_ida, 0, 0, GFP_KERNEL);
priv->id = ida_alloc(&gpio_mpsse_ida, GFP_KERNEL);
if (priv->id < 0)
return priv->id;

View File

@ -11,6 +11,7 @@
#include <linux/io.h>
#include <linux/mod_devicetable.h>
#include <linux/platform_device.h>
#include <linux/property.h>
#include <linux/slab.h>
#include <linux/spinlock.h>
@ -169,6 +170,7 @@ static const struct gpio_chip zevio_gpio_chip = {
/* Initialization */
static int zevio_gpio_probe(struct platform_device *pdev)
{
struct device *dev = &pdev->dev;
struct zevio_gpio *controller;
int status, i;
@ -180,6 +182,10 @@ static int zevio_gpio_probe(struct platform_device *pdev)
controller->chip = zevio_gpio_chip;
controller->chip.parent = &pdev->dev;
controller->chip.label = devm_kasprintf(dev, GFP_KERNEL, "%pfw", dev_fwnode(dev));
if (!controller->chip.label)
return -ENOMEM;
controller->regs = devm_platform_ioremap_resource(pdev, 0);
if (IS_ERR(controller->regs))
return dev_err_probe(&pdev->dev, PTR_ERR(controller->regs),