linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ASoC: max98390: Remove unnecessary amp on/off conrtol
@ 2022-08-26  2:35 Steve Lee
  2022-08-31 16:36 ` Mark Brown
  0 siblings, 1 reply; 5+ messages in thread
From: Steve Lee @ 2022-08-26  2:35 UTC (permalink / raw)
  To: lgirdwood, broonie, perex, tiwai, linux-kernel, alsa-devel
  Cc: krzk, ryans.lee, Steve Lee

 The Amp is already control in userspace before trigger calibrate function.
Remove unnecessary control in calibrate function.

Signed-off-by: Steve Lee <steve.lee.analog@gmail.com>
---
 sound/soc/codecs/max98390.c | 6 ------
 1 file changed, 6 deletions(-)

diff --git a/sound/soc/codecs/max98390.c b/sound/soc/codecs/max98390.c
index 91c0bf3d76fc..99e769190568 100644
--- a/sound/soc/codecs/max98390.c
+++ b/sound/soc/codecs/max98390.c
@@ -826,9 +826,6 @@ static int max98390_dsm_calibrate(struct snd_soc_component *component)
 	struct max98390_priv *max98390 =
 		snd_soc_component_get_drvdata(component);
 
-	regmap_write(max98390->regmap, MAX98390_R203A_AMP_EN, 0x81);
-	regmap_write(max98390->regmap, MAX98390_R23FF_GLOBAL_EN, 0x01);
-
 	regmap_read(max98390->regmap,
 		THERMAL_RDC_RD_BACK_BYTE1, &rdc);
 	regmap_read(max98390->regmap,
@@ -847,9 +844,6 @@ static int max98390_dsm_calibrate(struct snd_soc_component *component)
 	dev_info(component->dev, "rdc resistance about %d.%02d ohm, reg=0x%X temp reg=0x%X\n",
 		 rdc_integer, rdc_factor, rdc_cal_result, temp);
 
-	regmap_write(max98390->regmap, MAX98390_R23FF_GLOBAL_EN, 0x00);
-	regmap_write(max98390->regmap, MAX98390_R203A_AMP_EN, 0x80);
-
 	return 0;
 }
 
-- 
2.17.1


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

* Re: [PATCH] ASoC: max98390: Remove unnecessary amp on/off conrtol
  2022-08-26  2:35 [PATCH] ASoC: max98390: Remove unnecessary amp on/off conrtol Steve Lee
@ 2022-08-31 16:36 ` Mark Brown
  2022-09-01  5:57   ` Lee Steve
  0 siblings, 1 reply; 5+ messages in thread
From: Mark Brown @ 2022-08-31 16:36 UTC (permalink / raw)
  To: Steve Lee
  Cc: lgirdwood, perex, tiwai, linux-kernel, alsa-devel, krzk, ryans.lee

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

On Fri, Aug 26, 2022 at 11:35:04AM +0900, Steve Lee wrote:

>  The Amp is already control in userspace before trigger calibrate function.
> Remove unnecessary control in calibrate function.

I can't see anything which ensures that this is the case?  Should there
be a check which returns an error if the output is not enabled, or
should the function check the current state and preserve it at the end?
I can see that this would fix problems with it being disabled when
callibrating.

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

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

* Re: [PATCH] ASoC: max98390: Remove unnecessary amp on/off conrtol
  2022-08-31 16:36 ` Mark Brown
@ 2022-09-01  5:57   ` Lee Steve
  2022-09-01 10:54     ` Mark Brown
  0 siblings, 1 reply; 5+ messages in thread
From: Lee Steve @ 2022-09-01  5:57 UTC (permalink / raw)
  To: Mark Brown
  Cc: lgirdwood, perex, tiwai, linux-kernel, alsa-devel, krzk, ryans.lee

On Thu, Sep 1, 2022 at 1:36 AM Mark Brown <broonie@kernel.org> wrote:
>
> On Fri, Aug 26, 2022 at 11:35:04AM +0900, Steve Lee wrote:
>
> >  The Amp is already control in userspace before trigger calibrate function.
> > Remove unnecessary control in calibrate function.
>
> I can't see anything which ensures that this is the case?  Should there
> be a check which returns an error if the output is not enabled, or
> should the function check the current state and preserve it at the end?
> I can see that this would fix problems with it being disabled when
> callibrating.

 As your comment, this can fix amp being disabled when calibrating.
And this also fix the case that music play right after calibration.
Actually, calibration process should start mute playback before
trigger this function.
AMP disable/enable control in calibration function can break sync with
userspace enable/disable control.

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

* Re: [PATCH] ASoC: max98390: Remove unnecessary amp on/off conrtol
  2022-09-01  5:57   ` Lee Steve
@ 2022-09-01 10:54     ` Mark Brown
  2022-09-06  5:17       ` Lee Steve
  0 siblings, 1 reply; 5+ messages in thread
From: Mark Brown @ 2022-09-01 10:54 UTC (permalink / raw)
  To: Lee Steve
  Cc: lgirdwood, perex, tiwai, linux-kernel, alsa-devel, krzk, ryans.lee

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

On Thu, Sep 01, 2022 at 02:57:19PM +0900, Lee Steve wrote:
> On Thu, Sep 1, 2022 at 1:36 AM Mark Brown <broonie@kernel.org> wrote:

> > I can't see anything which ensures that this is the case?  Should there
> > be a check which returns an error if the output is not enabled, or
> > should the function check the current state and preserve it at the end?
> > I can see that this would fix problems with it being disabled when
> > callibrating.

>  As your comment, this can fix amp being disabled when calibrating.
> And this also fix the case that music play right after calibration.
> Actually, calibration process should start mute playback before
> trigger this function.
> AMP disable/enable control in calibration function can break sync with
> userspace enable/disable control.

Right, so that sounds like there should be something which checks the
current state and doesn't start callibration unless the device is in a
sensible state.

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

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

* Re: [PATCH] ASoC: max98390: Remove unnecessary amp on/off conrtol
  2022-09-01 10:54     ` Mark Brown
@ 2022-09-06  5:17       ` Lee Steve
  0 siblings, 0 replies; 5+ messages in thread
From: Lee Steve @ 2022-09-06  5:17 UTC (permalink / raw)
  To: Mark Brown
  Cc: lgirdwood, perex, tiwai, linux-kernel, alsa-devel, krzk, ryans.lee

On Thu, Sep 1, 2022 at 7:54 PM Mark Brown <broonie@kernel.org> wrote:
>
> On Thu, Sep 01, 2022 at 02:57:19PM +0900, Lee Steve wrote:
> > On Thu, Sep 1, 2022 at 1:36 AM Mark Brown <broonie@kernel.org> wrote:
>
> > > I can't see anything which ensures that this is the case?  Should there
> > > be a check which returns an error if the output is not enabled, or
> > > should the function check the current state and preserve it at the end?
> > > I can see that this would fix problems with it being disabled when
> > > callibrating.
>
> >  As your comment, this can fix amp being disabled when calibrating.
> > And this also fix the case that music play right after calibration.
> > Actually, calibration process should start mute playback before
> > trigger this function.
> > AMP disable/enable control in calibration function can break sync with
> > userspace enable/disable control.
>
> Right, so that sounds like there should be something which checks the
> current state and doesn't start callibration unless the device is in a
> sensible state.

 I will send v2 patch adding check before start calibration.
Thanks.

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

end of thread, other threads:[~2022-09-06  5:19 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-26  2:35 [PATCH] ASoC: max98390: Remove unnecessary amp on/off conrtol Steve Lee
2022-08-31 16:36 ` Mark Brown
2022-09-01  5:57   ` Lee Steve
2022-09-01 10:54     ` Mark Brown
2022-09-06  5:17       ` Lee Steve

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).