mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH RFC] ASoC: codecs: aw88261: Remove non-existing reset gpio
@ 2023-09-29 10:28 Luca Weiss
  2023-09-29 12:30 ` Mark Brown
  0 siblings, 1 reply; 4+ messages in thread
From: Luca Weiss @ 2023-09-29 10:28 UTC (permalink / raw)
  To: Weidong Wang, Liam Girdwood, Mark Brown, Jaroslav Kysela, Takashi Iwai
  Cc: ~postmarketos/upstreaming, phone-devel, alsa-devel, linux-kernel,
	Luca Weiss

According to the AW88261 datasheet (V1.1) and device schematics I have
access to, there is no reset gpio present on the AW88261. Remove it.

Signed-off-by: Luca Weiss <luca.weiss@fairphone.com>
---
In case this looks okay, also to the driver author at Awinic, the
binding doc also needs to be updated to include this change and not
require (or even allow) the reset-gpios anymore.

Therefore this is marked RFC for now.
---
 sound/soc/codecs/aw88261.c | 15 ---------------
 1 file changed, 15 deletions(-)

diff --git a/sound/soc/codecs/aw88261.c b/sound/soc/codecs/aw88261.c
index 45eaf931a69c..e7683f70c2ef 100644
--- a/sound/soc/codecs/aw88261.c
+++ b/sound/soc/codecs/aw88261.c
@@ -10,7 +10,6 @@
 
 #include <linux/i2c.h>
 #include <linux/firmware.h>
-#include <linux/of_gpio.h>
 #include <linux/regmap.h>
 #include <sound/soc.h>
 #include "aw88261.h"
@@ -1175,14 +1174,6 @@ static const struct snd_soc_component_driver soc_codec_dev_aw88261 = {
 	.remove = aw88261_codec_remove,
 };
 
-static void aw88261_hw_reset(struct aw88261 *aw88261)
-{
-	gpiod_set_value_cansleep(aw88261->reset_gpio, 0);
-	usleep_range(AW88261_1000_US, AW88261_1000_US + 10);
-	gpiod_set_value_cansleep(aw88261->reset_gpio, 1);
-	usleep_range(AW88261_1000_US, AW88261_1000_US + 10);
-}
-
 static void aw88261_parse_channel_dt(struct aw88261 *aw88261)
 {
 	struct aw_device *aw_dev = aw88261->aw_pa;
@@ -1254,12 +1245,6 @@ static int aw88261_i2c_probe(struct i2c_client *i2c)
 
 	i2c_set_clientdata(i2c, aw88261);
 
-	aw88261->reset_gpio = devm_gpiod_get_optional(&i2c->dev, "reset", GPIOD_OUT_LOW);
-	if (IS_ERR(aw88261->reset_gpio))
-		dev_info(&i2c->dev, "reset gpio not defined\n");
-	else
-		aw88261_hw_reset(aw88261);
-
 	aw88261->regmap = devm_regmap_init_i2c(i2c, &aw88261_remap_config);
 	if (IS_ERR(aw88261->regmap)) {
 		ret = PTR_ERR(aw88261->regmap);

---
base-commit: b216fb8946f819cf1b63dc12c7867cc501bda57e
change-id: 20230929-aw88261-reset-7e00d9e25952

Best regards,
-- 
Luca Weiss <luca.weiss@fairphone.com>


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

* Re: [PATCH RFC] ASoC: codecs: aw88261: Remove non-existing reset gpio
  2023-09-29 10:28 [PATCH RFC] ASoC: codecs: aw88261: Remove non-existing reset gpio Luca Weiss
@ 2023-09-29 12:30 ` Mark Brown
  2023-09-29 12:44   ` Luca Weiss
  0 siblings, 1 reply; 4+ messages in thread
From: Mark Brown @ 2023-09-29 12:30 UTC (permalink / raw)
  To: Luca Weiss
  Cc: Weidong Wang, Liam Girdwood, Jaroslav Kysela, Takashi Iwai,
	~postmarketos/upstreaming, phone-devel, alsa-devel, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 666 bytes --]

On Fri, Sep 29, 2023 at 12:28:10PM +0200, Luca Weiss wrote:
> According to the AW88261 datasheet (V1.1) and device schematics I have
> access to, there is no reset gpio present on the AW88261. Remove it.

That looks to be the case according to

   https://doc.awinic.com/doc/20230609wm/c815e155-60b7-40fb-889b-676b02e67d0a.pdf

(which is v1.5 FWIW), Weidong?

> In case this looks okay, also to the driver author at Awinic, the
> binding doc also needs to be updated to include this change and not
> require (or even allow) the reset-gpios anymore.

It would be easier to just send the proper patch to start off with, no
need to resend if the change is confirmed...

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

* Re: [PATCH RFC] ASoC: codecs: aw88261: Remove non-existing reset gpio
  2023-09-29 12:30 ` Mark Brown
@ 2023-09-29 12:44   ` Luca Weiss
  2023-09-29 12:54     ` Mark Brown
  0 siblings, 1 reply; 4+ messages in thread
From: Luca Weiss @ 2023-09-29 12:44 UTC (permalink / raw)
  To: Mark Brown
  Cc: Weidong Wang, Liam Girdwood, Jaroslav Kysela, Takashi Iwai,
	~postmarketos/upstreaming, phone-devel, alsa-devel, linux-kernel

On Fri Sep 29, 2023 at 2:30 PM CEST, Mark Brown wrote:
> On Fri, Sep 29, 2023 at 12:28:10PM +0200, Luca Weiss wrote:
> > According to the AW88261 datasheet (V1.1) and device schematics I have
> > access to, there is no reset gpio present on the AW88261. Remove it.
>
> That looks to be the case according to
>
>    https://doc.awinic.com/doc/20230609wm/c815e155-60b7-40fb-889b-676b02e67d0a.pdf

Nice to see the doc is also available there. Seems it only shows up on
the site search but not with Google

  https://www.awinic.com/en/search/all?titleSearch=AW88261

>
> (which is v1.5 FWIW), Weidong?
>
> > In case this looks okay, also to the driver author at Awinic, the
> > binding doc also needs to be updated to include this change and not
> > require (or even allow) the reset-gpios anymore.
>
> It would be easier to just send the proper patch to start off with, no
> need to resend if the change is confirmed...

Unfortunately the dt binding is a bit trickier to update since it's made
for both AW88261 and AW88395.

After spending a bit of time using non-Google search machines (Google
seems incapable of finding anything there) I found a datasheet for
AW88395 and that does appear to have a RSTN "Active low hardware reset"
pin so we should not remove that one.

Probably it's easier to separate the two dt bindings then, instead of
trying to keep them together?

Regards
Luca

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

* Re: [PATCH RFC] ASoC: codecs: aw88261: Remove non-existing reset gpio
  2023-09-29 12:44   ` Luca Weiss
@ 2023-09-29 12:54     ` Mark Brown
  0 siblings, 0 replies; 4+ messages in thread
From: Mark Brown @ 2023-09-29 12:54 UTC (permalink / raw)
  To: Luca Weiss
  Cc: Weidong Wang, Liam Girdwood, Jaroslav Kysela, Takashi Iwai,
	~postmarketos/upstreaming, phone-devel, alsa-devel, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 604 bytes --]

On Fri, Sep 29, 2023 at 02:44:47PM +0200, Luca Weiss wrote:

> Unfortunately the dt binding is a bit trickier to update since it's made
> for both AW88261 and AW88395.

> After spending a bit of time using non-Google search machines (Google
> seems incapable of finding anything there) I found a datasheet for
> AW88395 and that does appear to have a RSTN "Active low hardware reset"
> pin so we should not remove that one.

> Probably it's easier to separate the two dt bindings then, instead of
> trying to keep them together?

You can do conditionals based on compatibles so it might not be
required.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

end of thread, other threads:[~2023-09-29 12:54 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-09-29 10:28 [PATCH RFC] ASoC: codecs: aw88261: Remove non-existing reset gpio Luca Weiss
2023-09-29 12:30 ` Mark Brown
2023-09-29 12:44   ` Luca Weiss
2023-09-29 12:54     ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®