From f656df65743451d77e30e44e014b301721dff7cf Mon Sep 17 00:00:00 2001 From: Fabio Baltieri Date: Tue, 30 Apr 2013 16:09:54 +0200 Subject: ASoC: ux500: register controls to card instead of codec Update mop500_ab8500_machine_init to register mop500_ab8500_ctrls as card control instead of codec control, as it only contains SOC_DAPM_PIN_SWITCH definitions. Signed-off-by: Fabio Baltieri Signed-off-by: Mark Brown --- sound/soc/ux500/mop500_ab8500.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'sound/soc') diff --git a/sound/soc/ux500/mop500_ab8500.c b/sound/soc/ux500/mop500_ab8500.c index 892ad9a05c9..6a33788055f 100644 --- a/sound/soc/ux500/mop500_ab8500.c +++ b/sound/soc/ux500/mop500_ab8500.c @@ -125,9 +125,9 @@ static int mop500_ab8500_set_mclk(struct device *dev, static int mclk_input_control_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { - struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); + struct snd_soc_card *card = snd_kcontrol_chip(kcontrol); struct mop500_ab8500_drvdata *drvdata = - snd_soc_card_get_drvdata(codec->card); + snd_soc_card_get_drvdata(card); ucontrol->value.enumerated.item[0] = drvdata->mclk_sel; @@ -137,9 +137,9 @@ static int mclk_input_control_get(struct snd_kcontrol *kcontrol, static int mclk_input_control_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { - struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); + struct snd_soc_card *card = snd_kcontrol_chip(kcontrol); struct mop500_ab8500_drvdata *drvdata = - snd_soc_card_get_drvdata(codec->card); + snd_soc_card_get_drvdata(card); unsigned int val = ucontrol->value.enumerated.item[0]; if (val > (unsigned int)MCLK_ULPCLK) @@ -385,7 +385,7 @@ int mop500_ab8500_machine_init(struct snd_soc_pcm_runtime *rtd) drvdata->mclk_sel = MCLK_ULPCLK; /* Add controls */ - ret = snd_soc_add_codec_controls(codec, mop500_ab8500_ctrls, + ret = snd_soc_add_card_controls(codec->card, mop500_ab8500_ctrls, ARRAY_SIZE(mop500_ab8500_ctrls)); if (ret < 0) { pr_err("%s: Failed to add machine-controls (%d)!\n", -- cgit v1.2.3-70-g09d2 From 2e8e3880a15efacd21d68f77546ccd09f5e99521 Mon Sep 17 00:00:00 2001 From: Fabio Baltieri Date: Thu, 2 May 2013 11:52:51 +0200 Subject: ASoC: ux500: drop clock gating widgets from machine driver Drop ab8500 clock gating widgets from mop500_ab8500_ctrls, as these bits are already controlled by ab8500 codec driver and should not be exposed to the user. Signed-off-by: Fabio Baltieri Signed-off-by: Mark Brown --- sound/soc/ux500/mop500_ab8500.c | 10 ---------- 1 file changed, 10 deletions(-) (limited to 'sound/soc') diff --git a/sound/soc/ux500/mop500_ab8500.c b/sound/soc/ux500/mop500_ab8500.c index 6a33788055f..44e25a29104 100644 --- a/sound/soc/ux500/mop500_ab8500.c +++ b/sound/soc/ux500/mop500_ab8500.c @@ -160,16 +160,6 @@ static struct snd_kcontrol_new mop500_ab8500_ctrls[] = { SOC_ENUM_EXT("Master Clock Select", soc_enum_mclk, mclk_input_control_get, mclk_input_control_put), - /* Digital interface - Clocks */ - SOC_SINGLE("Digital Interface Master Generator Switch", - AB8500_DIGIFCONF1, AB8500_DIGIFCONF1_ENMASTGEN, - 1, 0), - SOC_SINGLE("Digital Interface 0 Bit-clock Switch", - AB8500_DIGIFCONF1, AB8500_DIGIFCONF1_ENFSBITCLK0, - 1, 0), - SOC_SINGLE("Digital Interface 1 Bit-clock Switch", - AB8500_DIGIFCONF1, AB8500_DIGIFCONF1_ENFSBITCLK1, - 1, 0), SOC_DAPM_PIN_SWITCH("Headset Left"), SOC_DAPM_PIN_SWITCH("Headset Right"), SOC_DAPM_PIN_SWITCH("Earpiece"), -- cgit v1.2.3-70-g09d2 From b9600b4b1cf8b8f06b6a5d025eff160f41950485 Mon Sep 17 00:00:00 2001 From: Fabio Baltieri Date: Wed, 8 May 2013 09:14:16 +0200 Subject: ASoC: ab8500-codec: Add missing ad_to_slot definitions According to the AB8500 user manual AD to Slot register multiplexer accept values from 0 to 15 where: 0 to 7 corresponds to AD_OUTx slots 8 to 11 corresponds to zero output 12 to 15 sets the output in tristate mode Update enum_ad_to_slot_map array to reflect this definition. This also allows alsamixer to properly display the default configuration, as all controls are set to tristate (=12) at reset. Signed-off-by: Fabio Baltieri Acked-by: Lee Jones Signed-off-by: Mark Brown --- sound/soc/codecs/ab8500-codec.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'sound/soc') diff --git a/sound/soc/codecs/ab8500-codec.c b/sound/soc/codecs/ab8500-codec.c index a153b168129..3126cac7b7c 100644 --- a/sound/soc/codecs/ab8500-codec.c +++ b/sound/soc/codecs/ab8500-codec.c @@ -1496,6 +1496,12 @@ static const char * const enum_ad_to_slot_map[] = {"AD_OUT1", "AD_OUT7", "AD_OUT8", "zeroes", + "zeroes", + "zeroes", + "zeroes", + "tristate", + "tristate", + "tristate", "tristate"}; static SOC_ENUM_SINGLE_DECL(soc_enum_adslot0map, AB8500_ADSLOTSEL1, AB8500_ADSLOTSELX_EVEN_SHIFT, -- cgit v1.2.3-70-g09d2 From cdeecac4e610ce1094497740ef84aa837e2e874f Mon Sep 17 00:00:00 2001 From: Lars-Peter Clausen Date: Tue, 14 May 2013 22:19:54 +0200 Subject: ASoC: mop500_ab8500: Staticize non exported functions The mop500_ab8500_startup(), the mop500_ab8500_shutdown() and the mop500_ab8500_hw_params() function are not used outside of mop500_ab8500, so make them static. Signed-off-by: Lars-Peter Clausen Signed-off-by: Mark Brown --- sound/soc/ux500/mop500_ab8500.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'sound/soc') diff --git a/sound/soc/ux500/mop500_ab8500.c b/sound/soc/ux500/mop500_ab8500.c index 44e25a29104..884a36224fb 100644 --- a/sound/soc/ux500/mop500_ab8500.c +++ b/sound/soc/ux500/mop500_ab8500.c @@ -183,7 +183,7 @@ static struct snd_kcontrol_new mop500_ab8500_ctrls[] = { /* ASoC */ -int mop500_ab8500_startup(struct snd_pcm_substream *substream) +static int mop500_ab8500_startup(struct snd_pcm_substream *substream) { struct snd_soc_pcm_runtime *rtd = substream->private_data; @@ -192,7 +192,7 @@ int mop500_ab8500_startup(struct snd_pcm_substream *substream) snd_soc_card_get_drvdata(rtd->card)); } -void mop500_ab8500_shutdown(struct snd_pcm_substream *substream) +static void mop500_ab8500_shutdown(struct snd_pcm_substream *substream) { struct snd_soc_pcm_runtime *rtd = substream->private_data; struct device *dev = rtd->card->dev; @@ -206,7 +206,7 @@ void mop500_ab8500_shutdown(struct snd_pcm_substream *substream) rx_slots = DEF_RX_SLOTS; } -int mop500_ab8500_hw_params(struct snd_pcm_substream *substream, +static int mop500_ab8500_hw_params(struct snd_pcm_substream *substream, struct snd_pcm_hw_params *params) { struct snd_soc_pcm_runtime *rtd = substream->private_data; -- cgit v1.2.3-70-g09d2 From aba1e2be4dcfda7069cc0b82c73b89707595a454 Mon Sep 17 00:00:00 2001 From: Lars-Peter Clausen Date: Tue, 14 May 2013 22:19:55 +0200 Subject: ASoC: mop500: Staticize non exported struct The mop500_dai_links struct is not used outside of mop500.c, so make it static. Signed-off-by: Lars-Peter Clausen Signed-off-by: Mark Brown --- sound/soc/ux500/mop500.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sound/soc') diff --git a/sound/soc/ux500/mop500.c b/sound/soc/ux500/mop500.c index 204b899c231..8f5cd00a6e4 100644 --- a/sound/soc/ux500/mop500.c +++ b/sound/soc/ux500/mop500.c @@ -27,7 +27,7 @@ #include "mop500_ab8500.h" /* Define the whole MOP500 soundcard, linking platform to the codec-drivers */ -struct snd_soc_dai_link mop500_dai_links[] = { +static struct snd_soc_dai_link mop500_dai_links[] = { { .name = "ab8500_0", .stream_name = "ab8500_0", -- cgit v1.2.3-70-g09d2 From 3eb28d3ca8f0c94ae40f57fbd53ef3805c8fdd2d Mon Sep 17 00:00:00 2001 From: Lars-Peter Clausen Date: Tue, 14 May 2013 22:19:56 +0200 Subject: ASoC: sn95031: Staticize non exported struct The sn95031_codec struct is not used outside of sn95031.c, so make it static. Signed-off-by: Lars-Peter Clausen Signed-off-by: Mark Brown --- sound/soc/codecs/sn95031.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sound/soc') diff --git a/sound/soc/codecs/sn95031.c b/sound/soc/codecs/sn95031.c index d1ae869d318..dba26e63844 100644 --- a/sound/soc/codecs/sn95031.c +++ b/sound/soc/codecs/sn95031.c @@ -883,7 +883,7 @@ static int sn95031_codec_remove(struct snd_soc_codec *codec) return 0; } -struct snd_soc_codec_driver sn95031_codec = { +static struct snd_soc_codec_driver sn95031_codec = { .probe = sn95031_codec_probe, .remove = sn95031_codec_remove, .read = sn95031_read, -- cgit v1.2.3-70-g09d2