diff options
author | Jyri Sarha <jsarha@ti.com> | 2012-08-27 18:39:04 +0300 |
---|---|---|
committer | Gerrit Code Review <gerrit2@git.omapzoom.org> | 2012-09-26 09:31:01 -0500 |
commit | 6a8c30252b4d7635e55628e40240888da52b406c (patch) | |
tree | d12b077c9695ec24b4bc69a0439b9712e9f40a91 /sound/soc/omap | |
parent | 98f69968ec29317cf2c21ba25fd9673c14970269 (diff) | |
download | kernel_samsung_espresso10-6a8c30252b4d7635e55628e40240888da52b406c.zip kernel_samsung_espresso10-6a8c30252b4d7635e55628e40240888da52b406c.tar.gz kernel_samsung_espresso10-6a8c30252b4d7635e55628e40240888da52b406c.tar.bz2 |
ASoC: ABE: Hide DL2 equalizers if DL2 is not configured
Change-Id: I5935a7d338c10c1b739cbd531d2340a21264689c
Signed-off-by: Jyri Sarha <jsarha@ti.com>
Diffstat (limited to 'sound/soc/omap')
-rw-r--r-- | sound/soc/omap/omap-abe-dsp.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/sound/soc/omap/omap-abe-dsp.c b/sound/soc/omap/omap-abe-dsp.c index 1de4627..75caf0f 100644 --- a/sound/soc/omap/omap-abe-dsp.c +++ b/sound/soc/omap/omap-abe-dsp.c @@ -2603,14 +2603,20 @@ static int abe_add_widgets(struct snd_soc_platform *platform) { struct abe_data *abe = snd_soc_platform_get_drvdata(platform); struct fw_header *hdr = &abe->hdr; - int i, j; + int i, ii, j; /* create equalizer controls */ - for (i = 0; i < hdr->num_equ; i++) { - struct soc_enum *equalizer_enum = &abe->equalizer_enum[i]; + for (i = 0, ii = 0; i < hdr->num_equ; i++) { + struct soc_enum *equalizer_enum = &abe->equalizer_enum[ii]; struct snd_kcontrol_new *equalizer_control = - &abe->equalizer_control[i]; + &abe->equalizer_control[ii]; +#if !defined(CONFIG_SND_OMAP_SOC_ABE_DL2) + if (i+1 == EQ2L || i+1 == EQ2R) + continue; +#endif + + ii++; equalizer_enum->reg = i; equalizer_enum->max = abe->equ_texts[i].count; for (j = 0; j < abe->equ_texts[i].count; j++) @@ -2630,8 +2636,7 @@ static int abe_add_widgets(struct snd_soc_platform *platform) dev_dbg(platform->dev, " %s\n", equalizer_enum->dtexts[j]); } - snd_soc_add_platform_controls(platform, abe->equalizer_control, - hdr->num_equ); + snd_soc_add_platform_controls(platform, abe->equalizer_control, ii); snd_soc_add_platform_controls(platform, abe_controls, ARRAY_SIZE(abe_controls)); |