* [PATCH v6 2/8] i2c: i801: Use GPIO_LOOKUP() helper macro
[not found] ` <20200324135653.6676-1-geert+renesas@glider.be>
@ 2020-03-24 13:56 ` Geert Uytterhoeven
2020-03-25 9:14 ` Jean Delvare
2020-04-15 10:57 ` Wolfram Sang
0 siblings, 2 replies; 3+ messages in thread
From: Geert Uytterhoeven @ 2020-03-24 13:56 UTC (permalink / raw)
To: Linus Walleij, Bartosz Golaszewski, Jonathan Corbet,
Harish Jenny K N, Eugeniu Rosca
Cc: Alexander Graf, Peter Maydell, Paolo Bonzini, Phil Reid,
Marc Zyngier, Christoffer Dall, Magnus Damm, Rob Herring,
Mark Rutland, linux-gpio, linux-doc, linux-renesas-soc,
linux-kernel, qemu-devel, Geert Uytterhoeven, Jean Delvare,
linux-i2c
i801_add_mux() fills in the GPIO lookup table by manually populating an
array of gpiod_lookup structures. Use the existing GPIO_LOOKUP() helper
macro instead, to relax a dependency on the gpiod_lookup structure's
member names.
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Cc: Jean Delvare <jdelvare@suse.com>
Cc: linux-i2c@vger.kernel.org
---
While this patch is a dependency for "[PATCH v6 4/8] gpiolib: Add
support for GPIO lookup by line name", it can be applied independently.
But an Acked-by would be nice, too.
Cover letter and full series at
https://lore.kernel.org/r/20200324135328.5796-1-geert+renesas@glider.be/
v6:
- New.
---
drivers/i2c/busses/i2c-i801.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/i2c/busses/i2c-i801.c b/drivers/i2c/busses/i2c-i801.c
index ca4f096fef749302..8e64a71bea684cc7 100644
--- a/drivers/i2c/busses/i2c-i801.c
+++ b/drivers/i2c/busses/i2c-i801.c
@@ -1444,9 +1444,9 @@ static int i801_add_mux(struct i801_priv *priv)
return -ENOMEM;
lookup->dev_id = "i2c-mux-gpio";
for (i = 0; i < mux_config->n_gpios; i++) {
- lookup->table[i].chip_label = mux_config->gpio_chip;
- lookup->table[i].chip_hwnum = mux_config->gpios[i];
- lookup->table[i].con_id = "mux";
+ lookup->table[i] = (struct gpiod_lookup)
+ GPIO_LOOKUP(mux_config->gpio_chip,
+ mux_config->gpios[i], "mux", 0);
}
gpiod_add_lookup_table(lookup);
priv->lookup = lookup;
--
2.17.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH v6 2/8] i2c: i801: Use GPIO_LOOKUP() helper macro
2020-03-24 13:56 ` [PATCH v6 2/8] i2c: i801: Use GPIO_LOOKUP() helper macro Geert Uytterhoeven
@ 2020-03-25 9:14 ` Jean Delvare
2020-04-15 10:57 ` Wolfram Sang
1 sibling, 0 replies; 3+ messages in thread
From: Jean Delvare @ 2020-03-25 9:14 UTC (permalink / raw)
To: Geert Uytterhoeven
Cc: Linus Walleij, Bartosz Golaszewski, Jonathan Corbet,
Harish Jenny K N, Eugeniu Rosca, Alexander Graf, Peter Maydell,
Paolo Bonzini, Phil Reid, Marc Zyngier, Christoffer Dall,
Magnus Damm, Rob Herring, Mark Rutland, linux-gpio, linux-doc,
linux-renesas-soc, linux-kernel, qemu-devel, linux-i2c
On Tue, 24 Mar 2020 14:56:47 +0100, Geert Uytterhoeven wrote:
> i801_add_mux() fills in the GPIO lookup table by manually populating an
> array of gpiod_lookup structures. Use the existing GPIO_LOOKUP() helper
> macro instead, to relax a dependency on the gpiod_lookup structure's
> member names.
>
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
> Cc: Jean Delvare <jdelvare@suse.com>
> Cc: linux-i2c@vger.kernel.org
> ---
> While this patch is a dependency for "[PATCH v6 4/8] gpiolib: Add
> support for GPIO lookup by line name", it can be applied independently.
> But an Acked-by would be nice, too.
>
> Cover letter and full series at
> https://lore.kernel.org/r/20200324135328.5796-1-geert+renesas@glider.be/
>
> v6:
> - New.
> ---
> drivers/i2c/busses/i2c-i801.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/i2c/busses/i2c-i801.c b/drivers/i2c/busses/i2c-i801.c
> index ca4f096fef749302..8e64a71bea684cc7 100644
> --- a/drivers/i2c/busses/i2c-i801.c
> +++ b/drivers/i2c/busses/i2c-i801.c
> @@ -1444,9 +1444,9 @@ static int i801_add_mux(struct i801_priv *priv)
> return -ENOMEM;
> lookup->dev_id = "i2c-mux-gpio";
> for (i = 0; i < mux_config->n_gpios; i++) {
> - lookup->table[i].chip_label = mux_config->gpio_chip;
> - lookup->table[i].chip_hwnum = mux_config->gpios[i];
> - lookup->table[i].con_id = "mux";
> + lookup->table[i] = (struct gpiod_lookup)
> + GPIO_LOOKUP(mux_config->gpio_chip,
> + mux_config->gpios[i], "mux", 0);
> }
> gpiod_add_lookup_table(lookup);
> priv->lookup = lookup;
Reviewed-by: Jean Delvare <jdelvare@suse.de>
--
Jean Delvare
SUSE L3 Support
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v6 2/8] i2c: i801: Use GPIO_LOOKUP() helper macro
2020-03-24 13:56 ` [PATCH v6 2/8] i2c: i801: Use GPIO_LOOKUP() helper macro Geert Uytterhoeven
2020-03-25 9:14 ` Jean Delvare
@ 2020-04-15 10:57 ` Wolfram Sang
1 sibling, 0 replies; 3+ messages in thread
From: Wolfram Sang @ 2020-04-15 10:57 UTC (permalink / raw)
To: Geert Uytterhoeven
Cc: Linus Walleij, Bartosz Golaszewski, Jonathan Corbet,
Harish Jenny K N, Eugeniu Rosca, Alexander Graf, Peter Maydell,
Paolo Bonzini, Phil Reid, Marc Zyngier, Christoffer Dall,
Magnus Damm, Rob Herring, Mark Rutland, linux-gpio, linux-doc,
linux-renesas-soc, linux-kernel, qemu-devel, Jean Delvare,
linux-i2c
[-- Attachment #1: Type: text/plain, Size: 483 bytes --]
On Tue, Mar 24, 2020 at 02:56:47PM +0100, Geert Uytterhoeven wrote:
> i801_add_mux() fills in the GPIO lookup table by manually populating an
> array of gpiod_lookup structures. Use the existing GPIO_LOOKUP() helper
> macro instead, to relax a dependency on the gpiod_lookup structure's
> member names.
>
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
> Cc: Jean Delvare <jdelvare@suse.com>
> Cc: linux-i2c@vger.kernel.org
Applied to for-next, thanks!
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-04-15 10:57 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20200324135328.5796-1-geert+renesas@glider.be>
[not found] ` <20200324135653.6676-1-geert+renesas@glider.be>
2020-03-24 13:56 ` [PATCH v6 2/8] i2c: i801: Use GPIO_LOOKUP() helper macro Geert Uytterhoeven
2020-03-25 9:14 ` Jean Delvare
2020-04-15 10:57 ` Wolfram Sang
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).