All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ASoC: cs4265: Add a MIC pre. switch
@ 2018-09-07  3:27 Matt Flax
  2018-09-07  8:26 ` Charles Keepax
  0 siblings, 1 reply; 5+ messages in thread
From: Matt Flax @ 2018-09-07  3:27 UTC (permalink / raw)
  To: alsa-devel; +Cc: brian.austin, broonie, ckeepax, paul.handrigan, Matt Flax

This patch adds a MIC preamp enable switch as a SOC_SINGLE.

Signed-off-by: Matt Flax <flatmax@flatmax.org>
---
 sound/soc/codecs/cs4265.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/sound/soc/codecs/cs4265.c b/sound/soc/codecs/cs4265.c
index d9eebf6a..03476f93 100644
--- a/sound/soc/codecs/cs4265.c
+++ b/sound/soc/codecs/cs4265.c
@@ -161,6 +161,7 @@ static const struct snd_kcontrol_new cs4265_snd_controls[] = {
 	SOC_SINGLE("MMTLR Data Switch", CS4265_SPDIF_CTL2, 0, 1, 0),
 	SOC_ENUM("Mono Channel Select", spdif_mono_select_enum),
 	SND_SOC_BYTES("C Data Buffer", CS4265_C_DATA_BUFF, 24),
+	SOC_SINGLE("MIC Preamp", CS4265_PWRCTL, 3, 1, 1),
 };
 
 static const struct snd_soc_dapm_widget cs4265_dapm_widgets[] = {
-- 
2.17.1

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

* Re: [PATCH] ASoC: cs4265: Add a MIC pre. switch
  2018-09-07  3:27 [PATCH] ASoC: cs4265: Add a MIC pre. switch Matt Flax
@ 2018-09-07  8:26 ` Charles Keepax
  2018-09-07 10:18   ` Matt Flax
  0 siblings, 1 reply; 5+ messages in thread
From: Charles Keepax @ 2018-09-07  8:26 UTC (permalink / raw)
  To: Matt Flax; +Cc: alsa-devel, broonie, brian.austin, paul.handrigan

On Fri, Sep 07, 2018 at 01:27:29PM +1000, Matt Flax wrote:
> This patch adds a MIC preamp enable switch as a SOC_SINGLE.
> 
> Signed-off-by: Matt Flax <flatmax@flatmax.org>
> ---
>  sound/soc/codecs/cs4265.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/sound/soc/codecs/cs4265.c b/sound/soc/codecs/cs4265.c
> index d9eebf6a..03476f93 100644
> --- a/sound/soc/codecs/cs4265.c
> +++ b/sound/soc/codecs/cs4265.c
> @@ -161,6 +161,7 @@ static const struct snd_kcontrol_new cs4265_snd_controls[] = {
>  	SOC_SINGLE("MMTLR Data Switch", CS4265_SPDIF_CTL2, 0, 1, 0),
>  	SOC_ENUM("Mono Channel Select", spdif_mono_select_enum),
>  	SND_SOC_BYTES("C Data Buffer", CS4265_C_DATA_BUFF, 24),
> +	SOC_SINGLE("MIC Preamp", CS4265_PWRCTL, 3, 1, 1),
>  };

Is this the correct way to control this bit? There is already
a SND_SOC_DAPM_PGA widget called "Pre-amp MIC" that controls
the bit, it looks like this widget is not connected to the
rest of the DAPM graph. Should we just be hooking that widget
up instead?  The datasheet isn't abundantly clear but it looks
like the bit needs to be set whenever the mic is in use:

"The microphone preamplifier block will enter a low-power state
whenever this bit is set."

Which would really make DAPM a better fit, unless there are valid
use-cases for using the mic with the preamp powered down?

Thanks,
Charles

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

* Re: [PATCH] ASoC: cs4265: Add a MIC pre. switch
  2018-09-07  8:26 ` Charles Keepax
@ 2018-09-07 10:18   ` Matt Flax
  2018-09-07 10:55     ` Charles Keepax
  0 siblings, 1 reply; 5+ messages in thread
From: Matt Flax @ 2018-09-07 10:18 UTC (permalink / raw)
  To: Charles Keepax; +Cc: alsa-devel, broonie, brian.austin, paul.handrigan



On 07/09/18 18:26, Charles Keepax wrote:
> On Fri, Sep 07, 2018 at 01:27:29PM +1000, Matt Flax wrote:
>> This patch adds a MIC preamp enable switch as a SOC_SINGLE.
>>
>> Signed-off-by: Matt Flax <flatmax@flatmax.org>
>> ---
>>   sound/soc/codecs/cs4265.c | 1 +
>>   1 file changed, 1 insertion(+)
>>
>> diff --git a/sound/soc/codecs/cs4265.c b/sound/soc/codecs/cs4265.c
>> index d9eebf6a..03476f93 100644
>> --- a/sound/soc/codecs/cs4265.c
>> +++ b/sound/soc/codecs/cs4265.c
>> @@ -161,6 +161,7 @@ static const struct snd_kcontrol_new cs4265_snd_controls[] = {
>>   	SOC_SINGLE("MMTLR Data Switch", CS4265_SPDIF_CTL2, 0, 1, 0),
>>   	SOC_ENUM("Mono Channel Select", spdif_mono_select_enum),
>>   	SND_SOC_BYTES("C Data Buffer", CS4265_C_DATA_BUFF, 24),
>> +	SOC_SINGLE("MIC Preamp", CS4265_PWRCTL, 3, 1, 1),
>>   };
> Is this the correct way to control this bit? There is already
> a SND_SOC_DAPM_PGA widget called "Pre-amp MIC" that controls
> the bit, it looks like this widget is not connected to the
> rest of the DAPM graph. Should we just be hooking that widget
> up instead?  The datasheet isn't abundantly clear but it looks
> like the bit needs to be set whenever the mic is in use:
>
> "The microphone preamplifier block will enter a low-power state
> whenever this bit is set."
>
> Which would really make DAPM a better fit, unless there are valid
> use-cases for using the mic with the preamp powered down?
>
>

Agreed, when you switch to the MIC rather then LINEIN it should be 
turned on.

This is the DAPM_MUX :
https://github.com/torvalds/linux/blob/master/sound/soc/codecs/cs4265.c#L178
This is the ENUM_SINGLE :
https://github.com/torvalds/linux/blob/master/sound/soc/codecs/cs4265.c#L98

What is the best way to do this ?

Matt

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

* Re: [PATCH] ASoC: cs4265: Add a MIC pre. switch
  2018-09-07 10:18   ` Matt Flax
@ 2018-09-07 10:55     ` Charles Keepax
  2018-09-07 11:06       ` Matt Flax
  0 siblings, 1 reply; 5+ messages in thread
From: Charles Keepax @ 2018-09-07 10:55 UTC (permalink / raw)
  To: Matt Flax; +Cc: alsa-devel, broonie, brian.austin, paul.handrigan

On Fri, Sep 07, 2018 at 08:18:05PM +1000, Matt Flax wrote:
> On 07/09/18 18:26, Charles Keepax wrote:
> >On Fri, Sep 07, 2018 at 01:27:29PM +1000, Matt Flax wrote:
> >Which would really make DAPM a better fit, unless there are valid
> >use-cases for using the mic with the preamp powered down?
> 
> Agreed, when you switch to the MIC rather then LINEIN it should be
> turned on.
> 
> This is the DAPM_MUX :
> https://github.com/torvalds/linux/blob/master/sound/soc/codecs/cs4265.c#L178
> This is the ENUM_SINGLE :
> https://github.com/torvalds/linux/blob/master/sound/soc/codecs/cs4265.c#L98
> 
> What is the best way to do this ?

Apologies not sure I entirely follow, don't you just want to
update the routes such that the existing "Pre-amp MIC" widget
is between the MICL,R and the ADC Mux. Something like:

{ "Pre-amp MIC", NULL, "MICL" },
{ "Pre-amp MIC", NULL, "MICR" },
{ "ADC Mux", "MIC", "Pre-amp MIC" },

Thanks,
Charles

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

* Re: [PATCH] ASoC: cs4265: Add a MIC pre. switch
  2018-09-07 10:55     ` Charles Keepax
@ 2018-09-07 11:06       ` Matt Flax
  0 siblings, 0 replies; 5+ messages in thread
From: Matt Flax @ 2018-09-07 11:06 UTC (permalink / raw)
  To: Charles Keepax; +Cc: alsa-devel, broonie, brian.austin, paul.handrigan


On 07/09/18 20:55, Charles Keepax wrote:
> On Fri, Sep 07, 2018 at 08:18:05PM +1000, Matt Flax wrote:
>> On 07/09/18 18:26, Charles Keepax wrote:
>>> On Fri, Sep 07, 2018 at 01:27:29PM +1000, Matt Flax wrote:
>>> Which would really make DAPM a better fit, unless there are valid
>>> use-cases for using the mic with the preamp powered down?
>> Agreed, when you switch to the MIC rather then LINEIN it should be
>> turned on.
>>
>> This is the DAPM_MUX :
>> https://github.com/torvalds/linux/blob/master/sound/soc/codecs/cs4265.c#L178
>> This is the ENUM_SINGLE :
>> https://github.com/torvalds/linux/blob/master/sound/soc/codecs/cs4265.c#L98
>>
>> What is the best way to do this ?
> Apologies not sure I entirely follow, don't you just want to
> update the routes such that the existing "Pre-amp MIC" widget
> is between the MICL,R and the ADC Mux. Something like:
>
> { "Pre-amp MIC", NULL, "MICL" },
> { "Pre-amp MIC", NULL, "MICR" },
> { "ADC Mux", "MIC", "Pre-amp MIC" },
>
>

ok - will do.

Matt

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

end of thread, other threads:[~2018-09-07 11:06 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-07  3:27 [PATCH] ASoC: cs4265: Add a MIC pre. switch Matt Flax
2018-09-07  8:26 ` Charles Keepax
2018-09-07 10:18   ` Matt Flax
2018-09-07 10:55     ` Charles Keepax
2018-09-07 11:06       ` Matt Flax

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.