2023-10-06 13:47:42

by Linus Walleij

[permalink] [raw]
Subject: [PATCH 1/8] gpiolib: of: Add quirk for mt2701-cs42448 ASoC sound

These gpio names are due to old DT bindings not following the
"-gpio"/"-gpios" conventions. Handle it using a quirk so the
driver can just look up the GPIOs.

Signed-off-by: Linus Walleij <[email protected]>
---
drivers/gpio/gpiolib-of.c | 4 ++++
1 file changed, 4 insertions(+)

diff --git a/drivers/gpio/gpiolib-of.c b/drivers/gpio/gpiolib-of.c
index 531faabead0f..d9525d95e818 100644
--- a/drivers/gpio/gpiolib-of.c
+++ b/drivers/gpio/gpiolib-of.c
@@ -512,6 +512,10 @@ static struct gpio_desc *of_find_gpio_rename(struct device_node *np,
#if IS_ENABLED(CONFIG_SND_SOC_CS42L56)
{ "reset", "cirrus,gpio-nreset", "cirrus,cs42l56" },
#endif
+#if IS_ENABLED(CONFIG_SND_SOC_MT2701_CS42448)
+ { "i2s1-in-sel-gpio1", NULL, "mediatek,mt2701-cs42448-machine" },
+ { "i2s1-in-sel-gpio2", NULL, "mediatek,mt2701-cs42448-machine" },
+#endif
#if IS_ENABLED(CONFIG_SND_SOC_TLV320AIC3X)
{ "reset", "gpio-reset", "ti,tlv320aic3x" },
{ "reset", "gpio-reset", "ti,tlv320aic33" },

--
2.34.1


2023-10-09 07:10:14

by Bartosz Golaszewski

[permalink] [raw]
Subject: Re: [PATCH 1/8] gpiolib: of: Add quirk for mt2701-cs42448 ASoC sound

On Fri, Oct 6, 2023 at 3:46 PM Linus Walleij <[email protected]> wrote:
>
> These gpio names are due to old DT bindings not following the
> "-gpio"/"-gpios" conventions. Handle it using a quirk so the
> driver can just look up the GPIOs.
>
> Signed-off-by: Linus Walleij <[email protected]>
> ---
> drivers/gpio/gpiolib-of.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/drivers/gpio/gpiolib-of.c b/drivers/gpio/gpiolib-of.c
> index 531faabead0f..d9525d95e818 100644
> --- a/drivers/gpio/gpiolib-of.c
> +++ b/drivers/gpio/gpiolib-of.c
> @@ -512,6 +512,10 @@ static struct gpio_desc *of_find_gpio_rename(struct device_node *np,
> #if IS_ENABLED(CONFIG_SND_SOC_CS42L56)
> { "reset", "cirrus,gpio-nreset", "cirrus,cs42l56" },
> #endif
> +#if IS_ENABLED(CONFIG_SND_SOC_MT2701_CS42448)
> + { "i2s1-in-sel-gpio1", NULL, "mediatek,mt2701-cs42448-machine" },
> + { "i2s1-in-sel-gpio2", NULL, "mediatek,mt2701-cs42448-machine" },
> +#endif
> #if IS_ENABLED(CONFIG_SND_SOC_TLV320AIC3X)
> { "reset", "gpio-reset", "ti,tlv320aic3x" },
> { "reset", "gpio-reset", "ti,tlv320aic33" },
>
> --
> 2.34.1
>

I suppose this is a run-time dependency only for the other patches?
Can I just pick it up into my tree?

Bart

2023-10-09 07:34:06

by Linus Walleij

[permalink] [raw]
Subject: Re: [PATCH 1/8] gpiolib: of: Add quirk for mt2701-cs42448 ASoC sound

On Mon, Oct 9, 2023 at 9:09 AM Bartosz Golaszewski <[email protected]> wrote:

> > +#if IS_ENABLED(CONFIG_SND_SOC_MT2701_CS42448)
> > + { "i2s1-in-sel-gpio1", NULL, "mediatek,mt2701-cs42448-machine" },
> > + { "i2s1-in-sel-gpio2", NULL, "mediatek,mt2701-cs42448-machine" },
> > +#endif
>
> I suppose this is a run-time dependency only for the other patches?
> Can I just pick it up into my tree?

You can, I was just thinking about bisectability and the low risk of collisions
with other patches. (Actually no-one gets hurt if it's applied to both trees
either, which IMO is perfectly fine in cases like this.)

Yours,
Linus Walleij

Subject: Re: [PATCH 1/8] gpiolib: of: Add quirk for mt2701-cs42448 ASoC sound

Il 06/10/23 15:46, Linus Walleij ha scritto:
> These gpio names are due to old DT bindings not following the
> "-gpio"/"-gpios" conventions. Handle it using a quirk so the
> driver can just look up the GPIOs.
>
> Signed-off-by: Linus Walleij <[email protected]>

Reviewed-by: AngeloGioacchino Del Regno <[email protected]>

2023-10-09 12:58:27

by Bartosz Golaszewski

[permalink] [raw]
Subject: Re: [PATCH 1/8] gpiolib: of: Add quirk for mt2701-cs42448 ASoC sound

On Mon, Oct 9, 2023 at 9:33 AM Linus Walleij <[email protected]> wrote:
>
> On Mon, Oct 9, 2023 at 9:09 AM Bartosz Golaszewski <[email protected]> wrote:
>
> > > +#if IS_ENABLED(CONFIG_SND_SOC_MT2701_CS42448)
> > > + { "i2s1-in-sel-gpio1", NULL, "mediatek,mt2701-cs42448-machine" },
> > > + { "i2s1-in-sel-gpio2", NULL, "mediatek,mt2701-cs42448-machine" },
> > > +#endif
> >
> > I suppose this is a run-time dependency only for the other patches?
> > Can I just pick it up into my tree?
>
> You can, I was just thinking about bisectability and the low risk of collisions
> with other patches. (Actually no-one gets hurt if it's applied to both trees
> either, which IMO is perfectly fine in cases like this.)
>

Nah, Stephen Rothwell will auto-yell at you for that. I'm fine either way.

Acked-by: Bartosz Golaszewski <[email protected]>

If we get any conflicts in next, then we'll deal with it with immutable tags.

Bart