All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3] ASoC: cs4265: Add a remove() function
@ 2022-01-04 18:06 Fabio Estevam
  2022-01-05  9:51 ` Charles Keepax
  2022-01-05 16:12 ` Mark Brown
  0 siblings, 2 replies; 3+ messages in thread
From: Fabio Estevam @ 2022-01-04 18:06 UTC (permalink / raw)
  To: broonie; +Cc: alsa-devel, Fabio Estevam, ckeepax

From: Fabio Estevam <festevam@denx.de>

When the reset_gpio GPIO is used, it is better to put the codec
back into reset state when the driver unbinds.

Add a remove() function to accomplish that.

Suggested-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Signed-off-by: Fabio Estevam <festevam@denx.de>
---
Changes since v2:
- Keep using the current polarity logic.

 sound/soc/codecs/cs4265.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/sound/soc/codecs/cs4265.c b/sound/soc/codecs/cs4265.c
index 294fa7ac16cb..8fa166e4b2a9 100644
--- a/sound/soc/codecs/cs4265.c
+++ b/sound/soc/codecs/cs4265.c
@@ -626,6 +626,16 @@ static int cs4265_i2c_probe(struct i2c_client *i2c_client,
 			ARRAY_SIZE(cs4265_dai));
 }
 
+static int cs4265_i2c_remove(struct i2c_client *i2c)
+{
+	struct cs4265_private *cs4265 = i2c_get_clientdata(i2c);
+
+	if (cs4265->reset_gpio)
+		gpiod_set_value_cansleep(cs4265->reset_gpio, 0);
+
+	return 0;
+}
+
 static const struct of_device_id cs4265_of_match[] = {
 	{ .compatible = "cirrus,cs4265", },
 	{ }
@@ -645,6 +655,7 @@ static struct i2c_driver cs4265_i2c_driver = {
 	},
 	.id_table = cs4265_id,
 	.probe =    cs4265_i2c_probe,
+	.remove =   cs4265_i2c_remove,
 };
 
 module_i2c_driver(cs4265_i2c_driver);
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH v3] ASoC: cs4265: Add a remove() function
  2022-01-04 18:06 [PATCH v3] ASoC: cs4265: Add a remove() function Fabio Estevam
@ 2022-01-05  9:51 ` Charles Keepax
  2022-01-05 16:12 ` Mark Brown
  1 sibling, 0 replies; 3+ messages in thread
From: Charles Keepax @ 2022-01-05  9:51 UTC (permalink / raw)
  To: Fabio Estevam; +Cc: Fabio Estevam, alsa-devel, broonie

On Tue, Jan 04, 2022 at 03:06:13PM -0300, Fabio Estevam wrote:
> From: Fabio Estevam <festevam@denx.de>
> 
> When the reset_gpio GPIO is used, it is better to put the codec
> back into reset state when the driver unbinds.
> 
> Add a remove() function to accomplish that.
> 
> Suggested-by: Charles Keepax <ckeepax@opensource.cirrus.com>
> Signed-off-by: Fabio Estevam <festevam@denx.de>
> ---

Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>

Thanks,
Charles

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v3] ASoC: cs4265: Add a remove() function
  2022-01-04 18:06 [PATCH v3] ASoC: cs4265: Add a remove() function Fabio Estevam
  2022-01-05  9:51 ` Charles Keepax
@ 2022-01-05 16:12 ` Mark Brown
  1 sibling, 0 replies; 3+ messages in thread
From: Mark Brown @ 2022-01-05 16:12 UTC (permalink / raw)
  To: Fabio Estevam; +Cc: alsa-devel, Fabio Estevam, ckeepax

On Tue, 4 Jan 2022 15:06:13 -0300, Fabio Estevam wrote:
> From: Fabio Estevam <festevam@denx.de>
> 
> When the reset_gpio GPIO is used, it is better to put the codec
> back into reset state when the driver unbinds.
> 
> Add a remove() function to accomplish that.
> 
> [...]

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next

Thanks!

[1/1] ASoC: cs4265: Add a remove() function
      commit: a319cb32e7cfd2703db3a883ce260a7b06729895

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-01-05 16:14 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-04 18:06 [PATCH v3] ASoC: cs4265: Add a remove() function Fabio Estevam
2022-01-05  9:51 ` Charles Keepax
2022-01-05 16:12 ` Mark Brown

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.