devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v1 0/2] ASoC: codecs: ES8326: change members of private structure
@ 2024-03-06  1:34 Zhang Yi
  2024-03-06  1:34 ` [PATCH v1 1/2] ASoC: codecs: ES8326: Changing " Zhang Yi
  2024-03-06  1:34 ` [PATCH v1 2/2] ASoC: codecs: ES8326: change support for ES8326 Zhang Yi
  0 siblings, 2 replies; 6+ messages in thread
From: Zhang Yi @ 2024-03-06  1:34 UTC (permalink / raw)
  To: alsa-devel, broonie, devicetree
  Cc: tiwai, amadeuszx.slawinski, yangxiaohua, zhuning, zhangyi

We found that using 0x45 as the default value for interrupt-clk 
would cause a headset detection error.So we took 0x00 as the default 
value for interrupt-clk and passed the test.
We removed mic1-src and mic2-src, which were not used.

*** BLURB HERE ***

Zhang Yi (2):
  ASoC: codecs: ES8326: Changing members of private structure
  ASoC: codecs: ES8326: change support for ES8326

 .../bindings/sound/everest,es8326.yaml        | 22 ++-----------------
 sound/soc/codecs/es8326.c                     | 18 +--------------
 2 files changed, 3 insertions(+), 37 deletions(-)

-- 
2.17.1


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

* [PATCH v1 1/2] ASoC: codecs: ES8326: Changing members of private structure
  2024-03-06  1:34 [PATCH v1 0/2] ASoC: codecs: ES8326: change members of private structure Zhang Yi
@ 2024-03-06  1:34 ` Zhang Yi
  2024-03-06  1:34 ` [PATCH v1 2/2] ASoC: codecs: ES8326: change support for ES8326 Zhang Yi
  1 sibling, 0 replies; 6+ messages in thread
From: Zhang Yi @ 2024-03-06  1:34 UTC (permalink / raw)
  To: alsa-devel, broonie, devicetree
  Cc: tiwai, amadeuszx.slawinski, yangxiaohua, zhuning, zhangyi

We don't use mic1_src and mic2_src.so we delete these two members.
We changed the default value of interrupt-clk for headphone detection

Signed-off-by: Zhang Yi <zhangyi@everest-semi.com>
---
 sound/soc/codecs/es8326.c | 18 +-----------------
 1 file changed, 1 insertion(+), 17 deletions(-)

diff --git a/sound/soc/codecs/es8326.c b/sound/soc/codecs/es8326.c
index 608862aebd71..15289dadafea 100755
--- a/sound/soc/codecs/es8326.c
+++ b/sound/soc/codecs/es8326.c
@@ -31,8 +31,6 @@ struct es8326_priv {
 	 * while enabling or disabling or during an irq.
 	 */
 	struct mutex lock;
-	u8 mic1_src;
-	u8 mic2_src;
 	u8 jack_pol;
 	u8 interrupt_src;
 	u8 interrupt_clk;
@@ -1092,20 +1090,6 @@ static int es8326_probe(struct snd_soc_component *component)
 	es8326->jd_inverted = device_property_read_bool(component->dev,
 							"everest,jack-detect-inverted");
 
-	ret = device_property_read_u8(component->dev, "everest,mic1-src", &es8326->mic1_src);
-	if (ret != 0) {
-		dev_dbg(component->dev, "mic1-src return %d", ret);
-		es8326->mic1_src = ES8326_ADC_AMIC;
-	}
-	dev_dbg(component->dev, "mic1-src %x", es8326->mic1_src);
-
-	ret = device_property_read_u8(component->dev, "everest,mic2-src", &es8326->mic2_src);
-	if (ret != 0) {
-		dev_dbg(component->dev, "mic2-src return %d", ret);
-		es8326->mic2_src = ES8326_ADC_DMIC;
-	}
-	dev_dbg(component->dev, "mic2-src %x", es8326->mic2_src);
-
 	ret = device_property_read_u8(component->dev, "everest,jack-pol", &es8326->jack_pol);
 	if (ret != 0) {
 		dev_dbg(component->dev, "jack-pol return %d", ret);
@@ -1125,7 +1109,7 @@ static int es8326_probe(struct snd_soc_component *component)
 				      &es8326->interrupt_clk);
 	if (ret != 0) {
 		dev_dbg(component->dev, "interrupt-clk return %d", ret);
-		es8326->interrupt_clk = 0x45;
+		es8326->interrupt_clk = 0x00;
 	}
 	dev_dbg(component->dev, "interrupt-clk %x", es8326->interrupt_clk);
 
-- 
2.17.1


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

* [PATCH v1 2/2] ASoC: codecs: ES8326: change support for ES8326
  2024-03-06  1:34 [PATCH v1 0/2] ASoC: codecs: ES8326: change members of private structure Zhang Yi
  2024-03-06  1:34 ` [PATCH v1 1/2] ASoC: codecs: ES8326: Changing " Zhang Yi
@ 2024-03-06  1:34 ` Zhang Yi
  2024-03-06 12:36   ` Mark Brown
  1 sibling, 1 reply; 6+ messages in thread
From: Zhang Yi @ 2024-03-06  1:34 UTC (permalink / raw)
  To: alsa-devel, broonie, devicetree
  Cc: tiwai, amadeuszx.slawinski, yangxiaohua, zhuning, zhangyi

Removed mic1-src and mic2-src. and changed default value
of interrupt-clk

Signed-off-by: Zhang Yi <zhangyi@everest-semi.com>
---
 .../bindings/sound/everest,es8326.yaml        | 22 ++-----------------
 1 file changed, 2 insertions(+), 20 deletions(-)

diff --git a/Documentation/devicetree/bindings/sound/everest,es8326.yaml b/Documentation/devicetree/bindings/sound/everest,es8326.yaml
index 07781408e788..5c9ee6ba7980 100644
--- a/Documentation/devicetree/bindings/sound/everest,es8326.yaml
+++ b/Documentation/devicetree/bindings/sound/everest,es8326.yaml
@@ -37,22 +37,6 @@ properties:
     maximum: 0x0f
     default: 0x0f
 
-  everest,mic1-src:
-    $ref: /schemas/types.yaml#/definitions/uint8
-    description:
-      the value of reg 2A when headset plugged.
-    minimum: 0x00
-    maximum: 0x77
-    default: 0x22
-
-  everest,mic2-src:
-    $ref: /schemas/types.yaml#/definitions/uint8
-    description:
-      the value of reg 2A when headset unplugged.
-    minimum: 0x00
-    maximum: 0x77
-    default: 0x44
-
   everest,jack-detect-inverted:
     $ref: /schemas/types.yaml#/definitions/flag
     description:
@@ -87,7 +71,7 @@ properties:
        0 means the chip detect jack type again after button released.
     minimum: 0
     maximum: 0x7f
-    default: 0x45
+    default: 0x00
 
 required:
   - compatible
@@ -107,10 +91,8 @@ examples:
         clocks = <&clks 10>;
         clock-names = "mclk";
         #sound-dai-cells = <0>;
-        everest,mic1-src = [22];
-        everest,mic2-src = [44];
         everest,jack-pol = [0e];
         everest,interrupt-src = [08];
-        everest,interrupt-clk = [45];
+        everest,interrupt-clk = [00];
       };
     };
-- 
2.17.1


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

* Re: [PATCH v1 2/2] ASoC: codecs: ES8326: change support for ES8326
  2024-03-06  1:34 ` [PATCH v1 2/2] ASoC: codecs: ES8326: change support for ES8326 Zhang Yi
@ 2024-03-06 12:36   ` Mark Brown
  2024-03-06 21:35     ` Rob Herring
  0 siblings, 1 reply; 6+ messages in thread
From: Mark Brown @ 2024-03-06 12:36 UTC (permalink / raw)
  To: Zhang Yi
  Cc: alsa-devel, devicetree, tiwai, amadeuszx.slawinski, yangxiaohua,
	zhuning

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

On Wed, Mar 06, 2024 at 09:34:14AM +0800, Zhang Yi wrote:
> Removed mic1-src and mic2-src. and changed default value
> of interrupt-clk

We could do with a better changelog here.

> -  everest,mic1-src:
> -    $ref: /schemas/types.yaml#/definitions/uint8
> -    description:
> -      the value of reg 2A when headset plugged.
> -    minimum: 0x00
> -    maximum: 0x77
> -    default: 0x22
> -
> -  everest,mic2-src:
> -    $ref: /schemas/types.yaml#/definitions/uint8
> -    description:
> -      the value of reg 2A when headset unplugged.
> -    minimum: 0x00
> -    maximum: 0x77
> -    default: 0x44

This will make any DTs using the properties instantly buggy.  I believe
there's a way of marking properties as deprecated, you should use that
instead.  Or we could just leave the properties there and ignore them at
runtime.

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

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

* Re: [PATCH v1 2/2] ASoC: codecs: ES8326: change support for ES8326
  2024-03-06 12:36   ` Mark Brown
@ 2024-03-06 21:35     ` Rob Herring
  0 siblings, 0 replies; 6+ messages in thread
From: Rob Herring @ 2024-03-06 21:35 UTC (permalink / raw)
  To: Mark Brown, Zhang Yi
  Cc: alsa-devel, devicetree, tiwai, amadeuszx.slawinski, yangxiaohua,
	zhuning

On Wed, Mar 06, 2024 at 12:36:50PM +0000, Mark Brown wrote:
> On Wed, Mar 06, 2024 at 09:34:14AM +0800, Zhang Yi wrote:
> > Removed mic1-src and mic2-src. and changed default value
> > of interrupt-clk
> 
> We could do with a better changelog here.
> 
> > -  everest,mic1-src:
> > -    $ref: /schemas/types.yaml#/definitions/uint8
> > -    description:
> > -      the value of reg 2A when headset plugged.
> > -    minimum: 0x00
> > -    maximum: 0x77
> > -    default: 0x22
> > -
> > -  everest,mic2-src:
> > -    $ref: /schemas/types.yaml#/definitions/uint8
> > -    description:
> > -      the value of reg 2A when headset unplugged.
> > -    minimum: 0x00
> > -    maximum: 0x77
> > -    default: 0x44
> 
> This will make any DTs using the properties instantly buggy.  I believe
> there's a way of marking properties as deprecated, you should use that
> instead.  Or we could just leave the properties there and ignore them at
> runtime.

'deprecated: true' is the way.

Rob

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

* [PATCH v1 2/2] ASoC: codecs: ES8326: change support for ES8326
@ 2024-03-07  3:04 Zhang Yi
  0 siblings, 0 replies; 6+ messages in thread
From: Zhang Yi @ 2024-03-07  3:04 UTC (permalink / raw)
  To: alsa-devel, broonie, devicetree
  Cc: tiwai, amadeuszx.slawinski, yangxiaohua, zhuning, zhangyi

> > On Wed, Mar 06, 2024 at 09:34:14AM +0800, Zhang Yi wrote:
> > > Removed mic1-src and mic2-src. and changed default value
> > > of interrupt-clk
> >
> > We could do with a better changelog here.
> >
> > > - everest,mic1-src:
> > > - $ref: /schemas/types.yaml#/definitions/uint8
> > > - description:
> > > - the value of reg 2A when headset plugged.
> > > - minimum: 0x00
> > > - maximum: 0x77
> > > - default: 0x22
> > > -
> > > - everest,mic2-src:
> > > - $ref: /schemas/types.yaml#/definitions/uint8
> > > - description:
> > > - the value of reg 2A when headset unplugged.
> > > - minimum: 0x00
> > > - maximum: 0x77
> > > - default: 0x44
> >
> > This will make any DTs using the properties instantly buggy. I believe
> > there's a way of marking properties as deprecated, you should use that
> > instead. Or we could just leave the properties there and ignore them at
> > runtime.
> 'deprecated: true' is the way.

OK.I will modify the properties, thank you for your support

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

end of thread, other threads:[~2024-03-07  3:07 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-03-06  1:34 [PATCH v1 0/2] ASoC: codecs: ES8326: change members of private structure Zhang Yi
2024-03-06  1:34 ` [PATCH v1 1/2] ASoC: codecs: ES8326: Changing " Zhang Yi
2024-03-06  1:34 ` [PATCH v1 2/2] ASoC: codecs: ES8326: change support for ES8326 Zhang Yi
2024-03-06 12:36   ` Mark Brown
2024-03-06 21:35     ` Rob Herring
  -- strict thread matches above, loose matches on Subject: below --
2024-03-07  3:04 Zhang Yi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).