]> www.infradead.org Git - users/jedix/linux-maple.git/commit
ASoC: codec: cs42l52: Convert to GPIO descriptors
authorPeng Fan <peng.fan@nxp.com>
Tue, 6 May 2025 07:29:39 +0000 (15:29 +0800)
committerMark Brown <broonie@kernel.org>
Tue, 6 May 2025 13:48:18 +0000 (22:48 +0900)
commit5bf5bdfd007e07f2ec5b3e07aa02616f4eebef67
tree40d7f360b3b4006b04fc98633f2cc6c33691f21e
parent772c036befb875c904731fb309fb9d2e065ba3f8
ASoC: codec: cs42l52: Convert to GPIO descriptors

of_gpio.h is deprecated, update the driver to use GPIO descriptors.
 - Use devm_gpiod_get_optional to get GPIO descriptor with default
   polarity GPIOD_OUT_LOW, set consumer name.
 - Use gpiod_set_value_cansleep to configure output value.

Checking the current driver using legacy GPIO API, the
reset value is first output HIGH, then LOW, then HIGH.

Checking the datasheet, the device remains in Power-down state until
RESET pin is brought high.

Since the driver has been here for quite long time and no complain on
the reset flow, still follow original flow when using GPIOD
descriptors.

Per datasheet, the DTS polarity should be GPIOD_ACTIVE_LOW. The binding
example use value 0(GPIOD_ACTIVE_HIGH) which seems wrong.
And the binding use reset-gpio as example, not same as driver using
"cirrus,reset-gpio", and there is no in-tree DTS has the device,
so all should be fine with this patch.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Link: https://patch.msgid.link/20250506-csl42x-v3-9-e9496db544c4@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/codecs/cs42l52.c