alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
* How to apply a SOC_DAPM_MUX if two there are two different input register for left and right channel?
@ 2017-09-06 13:35 Oleksandr Müller
  2017-09-07 12:22 ` Charles Keepax
  0 siblings, 1 reply; 2+ messages in thread
From: Oleksandr Müller @ 2017-09-06 13:35 UTC (permalink / raw)
  To: alsa-devel

Hello guys,

I have some trouble I want to implement a mux within the mixer 
application for the VIN source of my adc. Taking a look into the 
datasheet of the TI-PCM1863 adc I get the information that the VIN left 
register is at the 0x06 and the VIN right register is at the 0x07 
address. Right now my code would look like this and here comes the 
problem it seems that there is only a SOC_ENUM_SINGLE_DECL or a 
SOC_ENUM_DOUBLE_DECL but no SOC_ENUM_DOUBLE_R_DECL because the 
DOUBLE_DECL only allows shiftl and shiftr as the input parameters but I 
would need a regl regr parameter. Is the only option to duplicate the 
code and define a VIN_L_MUX and a VIN_R_MUX?

static const char * const pcm1863_adc_vin_src[] = {
         "VIN1", "VIN2", "VIN3", "VIN4"
};

static SOC_ENUM_SINGLE_DECL(
         pcm1863_adc_vin_enum, PCM1863_ADC1_INPUT_SEL_L,
         PCM1863_SEL_L_SHIFT, pcm1863_vin_src);

static const struct snd_kcontrol_new pcm1863_adc_vin_mux =
         SOC_DAPM_ENUM("ADC VIN Source", pcm1863_adc_vin_enum);

static const struct snd_soc_dapm_widget pcm1863_dapm_widgets[] = {
         [...]
         SND_SOC_DAPM_MUX("ADC VIN Mux", SND_SOC_NOPM, 0, 0,
                                 &pcm1863_adc_vin_mux),
};

- Sanj3k

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

* Re: How to apply a SOC_DAPM_MUX if two there are two different input register for left and right channel?
  2017-09-06 13:35 How to apply a SOC_DAPM_MUX if two there are two different input register for left and right channel? Oleksandr Müller
@ 2017-09-07 12:22 ` Charles Keepax
  0 siblings, 0 replies; 2+ messages in thread
From: Charles Keepax @ 2017-09-07 12:22 UTC (permalink / raw)
  To: Oleksandr Müller; +Cc: alsa-devel

On Wed, Sep 06, 2017 at 03:35:36PM +0200, Oleksandr Müller wrote:
> Hello guys,
> 
> I have some trouble I want to implement a mux within the mixer application
> for the VIN source of my adc. Taking a look into the datasheet of the
> TI-PCM1863 adc I get the information that the VIN left register is at the
> 0x06 and the VIN right register is at the 0x07 address. Right now my code
> would look like this and here comes the problem it seems that there is only
> a SOC_ENUM_SINGLE_DECL or a SOC_ENUM_DOUBLE_DECL but no
> SOC_ENUM_DOUBLE_R_DECL because the DOUBLE_DECL only allows shiftl and shiftr
> as the input parameters but I would need a regl regr parameter. Is the only
> option to duplicate the code and define a VIN_L_MUX and a VIN_R_MUX?
> 
> static const char * const pcm1863_adc_vin_src[] = {
>         "VIN1", "VIN2", "VIN3", "VIN4"
> };
> 
> static SOC_ENUM_SINGLE_DECL(
>         pcm1863_adc_vin_enum, PCM1863_ADC1_INPUT_SEL_L,
>         PCM1863_SEL_L_SHIFT, pcm1863_vin_src);
> 
> static const struct snd_kcontrol_new pcm1863_adc_vin_mux =
>         SOC_DAPM_ENUM("ADC VIN Source", pcm1863_adc_vin_enum);
> 
> static const struct snd_soc_dapm_widget pcm1863_dapm_widgets[] = {
>         [...]
>         SND_SOC_DAPM_MUX("ADC VIN Mux", SND_SOC_NOPM, 0, 0,
>                                 &pcm1863_adc_vin_mux),
> };

Currently yes ASoC does not have support for Stereo muxes that
have a different register for both the left and right channel.
Your two options are add single muxes as you suggest or extend
the framework to support what you require. I would probably
suggest that it seems like something I can see existing in other
devices so extending the framework to support it is probably the
better option.

Thanks,
Charles

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

end of thread, other threads:[~2017-09-07 12:22 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-09-06 13:35 How to apply a SOC_DAPM_MUX if two there are two different input register for left and right channel? Oleksandr Müller
2017-09-07 12:22 ` Charles Keepax

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