[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Z/UcOz7RlWSquLXH@opensource.cirrus.com>
Date: Tue, 8 Apr 2025 13:53:15 +0100
From: Charles Keepax <ckeepax@...nsource.cirrus.com>
To: "Peng Fan (OSS)" <peng.fan@....nxp.com>
Cc: Shenghao Ding <shenghao-ding@...com>, Kevin Lu <kevin-lu@...com>,
Baojun Xu <baojun.xu@...com>, Jaroslav Kysela <perex@...ex.cz>,
Takashi Iwai <tiwai@...e.com>, Liam Girdwood <lgirdwood@...il.com>,
Mark Brown <broonie@...nel.org>,
Linus Walleij <linus.walleij@...aro.org>,
Bartosz Golaszewski <brgl@...ev.pl>,
Peter Ujfalusi <peter.ujfalusi@...il.com>,
David Rhodes <david.rhodes@...rus.com>,
Richard Fitzgerald <rf@...nsource.cirrus.com>,
linux-sound@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-gpio@...r.kernel.org, patches@...nsource.cirrus.com,
Peng Fan <peng.fan@....com>
Subject: Re: [PATCH 4/7] ASoC: codec: cs42l56: Convert to GPIO descriptors
On Tue, Apr 08, 2025 at 09:40:00AM +0800, Peng Fan (OSS) wrote:
> From: Peng Fan <peng.fan@....com>
> Checking the current driver using legacy GPIO API, the
> nreset value is first output HIGH, then LOW, then HIGH.
>
> Checking the datasheet, nreset is should be held low after power
> on, when nreset is high, it starts to work.
>
Does feel like it would have made more sense to request it in
reset at the start certainly, but as you say reasonable to leave
well enough alone.
> Per datasheet, the DTS polarity should be GPIOD_ACTIVE_LOW. The binding
> example use value 0(GPIOD_ACTIVE_HIGH) which seems wrong. There is
> no in-tree DTS has the device, so all should be fine.
Yeah it is technically wrong, discussed more below.
> - pdata->gpio_nreset = of_get_named_gpio(np, "cirrus,gpio-nreset", 0);
> + pdata->gpio_nreset = devm_gpiod_get_optional(&i2c_client->dev, "cirrus,gpio-nreset",
> + GPIOD_OUT_LOW);
Would be nice to call out that this part is already included in
the quirks array in of_find_gpio_rename:
944004eb56dc ("gpiolib: of: add a quirk for reset line for Cirrus CS42L56")
Took me a while to realise this would request the right property.
> - gpio_set_value_cansleep(cs42l56->pdata.gpio_nreset, 0);
> - gpio_set_value_cansleep(cs42l56->pdata.gpio_nreset, 1);
> + gpiod_set_value_cansleep(cs42l56->pdata.gpio_nreset, 1);
> + gpiod_set_value_cansleep(cs42l56->pdata.gpio_nreset, 0);
I can't say I super love this change as it will mean any users
with a DT that worked with the driver before this change will see
things break. As far as I know the parts you are updating in
this series do not have a lot of users, (and none in tree as you
note) so I guess if everyone else is happy, I don't really object.
Thanks,
Charles
Powered by blists - more mailing lists