Skip to contentSkip to conversation

gpio: exar: Allow IO port access

PATCH Applied Andy Shevchenko 4 participants 4 messages Oct 17, 2022 – Oct 25, 2022 GPIO

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 gpio: exar: Allow IO port access

It's possible that PCI device can provide an IO port resource for the device. regmap MMIO currently uses MMIO by default. With an additional flag we enable support for IO port accesses.

---
 drivers/gpio/gpio-exar.c | 1 +
 1 file changed, 1 insertion(+)
drivers/gpio/gpio-exar.c +1 -0
index 482f678c893e..df1bdaae441c 100644
@@ -141,6 +141,7 @@ static const struct regmap_config exar_regmap_config = {
 	.name		= "exar-gpio",
 	.reg_bits	= 16,
 	.val_bits	= 8,
+	.io_port	= true,
 };
 
 static int gpio_exar_probe(struct platform_device *pdev)
Signature · 1 line
2.35.1
Acked-by on v1 1/1
#1 lore raw
Quoted 5 lines · Andy Shevchenko

It's possible that PCI device can provide an IO port resource for the device. regmap MMIO currently uses MMIO by default. With an additional flag we enable support for IO port accesses.

Looks clever to me!

I would let William have a look at it as well, as he's worked extensively with port-mapped I/O.

Yours,
Linus Walleij

#2 lore raw
Quoted 9 lines · Linus Walleij
Quoted 5 lines · Andy Shevchenko

It's possible that PCI device can provide an IO port resource for the device. regmap MMIO currently uses MMIO by default. With an additional flag we enable support for IO port accesses.

Quoted 7 lines

Looks clever to me!

I would let William have a look at it as well, as he's worked extensively with port-mapped I/O.

Yours,
Linus Walleij

I love how simple it is to add IO port support to these drivers now. :-)

I'm hoping to convert several of the port-mapped GPIO drivers to the regmap API later this cycle, so it's good to see other modules making use of this interface as well.

Thanks,

William Breathitt Gray

#3 lore raw
In reply to Andy Shevchenko
Quoted 23 lines · Andy Shevchenko

It's possible that PCI device can provide an IO port resource for the device. regmap MMIO currently uses MMIO by default. With an additional flag we enable support for IO port accesses.

---
 drivers/gpio/gpio-exar.c | 1 +
 1 file changed, 1 insertion(+)
drivers/gpio/gpio-exar.c +1 -1
index 482f678c893e..df1bdaae441c 100644
@@ -141,6 +141,7 @@ static const struct regmap_config exar_regmap_config = {
        .name           = "exar-gpio",
        .reg_bits       = 16,
        .val_bits       = 8,
+       .io_port        = true,
 };
 
 static int gpio_exar_probe(struct platform_device *pdev)
--
Quoted 2 lines

2.35.1

Applied, thanks!

Bartosz