[v1,1/1] gpio: exar: Allow IO port access

Message ID 20221017170600.88480-1-andriy.shevchenko@linux.intel.com
State New
Headers
Series [v1,1/1] gpio: exar: Allow IO port access |

Commit Message

Andy Shevchenko Oct. 17, 2022, 5:06 p.m. UTC
  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.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/gpio/gpio-exar.c | 1 +
 1 file changed, 1 insertion(+)
  

Comments

Linus Walleij Oct. 18, 2022, 8:29 a.m. UTC | #1
On Mon, Oct 17, 2022 at 7:05 PM Andy Shevchenko
<andriy.shevchenko@linux.intel.com> wrote:

> 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.
>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

Looks clever to me!
Acked-by: Linus Walleij <linus.walleij@linaro.org>
I would let William have a look at it as well, as he's worked extensively
with port-mapped I/O.

Yours,
Linus Walleij
  
William Breathitt Gray Oct. 18, 2022, 12:17 p.m. UTC | #2
On Tue, Oct 18, 2022 at 10:29:13AM +0200, Linus Walleij wrote:
> On Mon, Oct 17, 2022 at 7:05 PM Andy Shevchenko
> <andriy.shevchenko@linux.intel.com> wrote:
> 
> > 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.
> >
> > Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> 
> Looks clever to me!
> Acked-by: Linus Walleij <linus.walleij@linaro.org>
> 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. :-)

Acked-by: William Breathitt Gray <william.gray@linaro.org>

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
  
Bartosz Golaszewski Oct. 25, 2022, 3:41 p.m. UTC | #3
On Mon, Oct 17, 2022 at 7:05 PM Andy Shevchenko
<andriy.shevchenko@linux.intel.com> wrote:
>
> 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.
>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> ---
>  drivers/gpio/gpio-exar.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/drivers/gpio/gpio-exar.c b/drivers/gpio/gpio-exar.c
> index 482f678c893e..df1bdaae441c 100644
> --- a/drivers/gpio/gpio-exar.c
> +++ b/drivers/gpio/gpio-exar.c
> @@ -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)
> --
> 2.35.1
>

Applied, thanks!

Bartosz
  

Patch

diff --git a/drivers/gpio/gpio-exar.c b/drivers/gpio/gpio-exar.c
index 482f678c893e..df1bdaae441c 100644
--- a/drivers/gpio/gpio-exar.c
+++ b/drivers/gpio/gpio-exar.c
@@ -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)