aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2012-04-30 15:18:27 -0400
committerMark Brown <broonie@opensource.wolfsonmicro.com>2012-04-30 18:36:47 -0400
commit3e4ba82cacbe0d00449833f587fa871a431fc044 (patch)
tree5f776b750a6ec5e9548c9d2bb6fbb2bc9c5c6ce3 /sound/soc
parentb9c374b26cfb8a052e846f77482c5e4e0548e081 (diff)
ASoC: wm8350: Remove check for clocks in trigger()
This is now very standard behaviour for CODECs so shouldn't be device specific and we shouldn't really be trying to peer into the register cache from atomic context anyway. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound/soc')
-rw-r--r--sound/soc/codecs/wm8350.c40
1 files changed, 0 insertions, 40 deletions
diff --git a/sound/soc/codecs/wm8350.c b/sound/soc/codecs/wm8350.c
index 8c4c9591ec05..1dee57e67a1b 100644
--- a/sound/soc/codecs/wm8350.c
+++ b/sound/soc/codecs/wm8350.c
@@ -71,13 +71,6 @@ struct wm8350_data {
71 int fll_freq_in; 71 int fll_freq_in;
72}; 72};
73 73
74static unsigned int wm8350_codec_cache_read(struct snd_soc_codec *codec,
75 unsigned int reg)
76{
77 struct wm8350 *wm8350 = codec->control_data;
78 return wm8350->reg_cache[reg];
79}
80
81static unsigned int wm8350_codec_read(struct snd_soc_codec *codec, 74static unsigned int wm8350_codec_read(struct snd_soc_codec *codec,
82 unsigned int reg) 75 unsigned int reg)
83{ 76{
@@ -929,38 +922,6 @@ static int wm8350_set_dai_fmt(struct snd_soc_dai *codec_dai, unsigned int fmt)
929 return 0; 922 return 0;
930} 923}
931 924
932static int wm8350_pcm_trigger(struct snd_pcm_substream *substream,
933 int cmd, struct snd_soc_dai *codec_dai)
934{
935 struct snd_soc_codec *codec = codec_dai->codec;
936 int master = wm8350_codec_cache_read(codec, WM8350_AI_DAC_CONTROL) &
937 WM8350_BCLK_MSTR;
938 int enabled = 0;
939
940 /* Check that the DACs or ADCs are enabled since they are
941 * required for LRC in master mode. The DACs or ADCs need a
942 * valid audio path i.e. pin -> ADC or DAC -> pin before
943 * the LRC will be enabled in master mode. */
944 if (!master || cmd != SNDRV_PCM_TRIGGER_START)
945 return 0;
946
947 if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) {
948 enabled = wm8350_codec_cache_read(codec, WM8350_POWER_MGMT_4) &
949 (WM8350_ADCR_ENA | WM8350_ADCL_ENA);
950 } else {
951 enabled = wm8350_codec_cache_read(codec, WM8350_POWER_MGMT_4) &
952 (WM8350_DACR_ENA | WM8350_DACL_ENA);
953 }
954
955 if (!enabled) {
956 dev_err(codec->dev,
957 "%s: invalid audio path - no clocks available\n",
958 __func__);
959 return -EINVAL;
960 }
961 return 0;
962}
963
964static int wm8350_pcm_hw_params(struct snd_pcm_substream *substream, 925static int wm8350_pcm_hw_params(struct snd_pcm_substream *substream,
965 struct snd_pcm_hw_params *params, 926 struct snd_pcm_hw_params *params,
966 struct snd_soc_dai *codec_dai) 927 struct snd_soc_dai *codec_dai)
@@ -1491,7 +1452,6 @@ EXPORT_SYMBOL_GPL(wm8350_mic_jack_detect);
1491static const struct snd_soc_dai_ops wm8350_dai_ops = { 1452static const struct snd_soc_dai_ops wm8350_dai_ops = {
1492 .hw_params = wm8350_pcm_hw_params, 1453 .hw_params = wm8350_pcm_hw_params,
1493 .digital_mute = wm8350_mute, 1454 .digital_mute = wm8350_mute,
1494 .trigger = wm8350_pcm_trigger,
1495 .set_fmt = wm8350_set_dai_fmt, 1455 .set_fmt = wm8350_set_dai_fmt,
1496 .set_sysclk = wm8350_set_dai_sysclk, 1456 .set_sysclk = wm8350_set_dai_sysclk,
1497 .set_pll = wm8350_set_fll, 1457 .set_pll = wm8350_set_fll,