From fc7dfc9dc0f683f723ac1c231e1f344aaf00044d Mon Sep 17 00:00:00 2001 From: Peter Ujfalusi Date: Mon, 1 Jun 2009 14:06:40 +0300 Subject: [PATCH] --- yaml --- r: 148319 b: refs/heads/master c: eaf1ac8bb58888e0773c0b81dfedb9d7c0123a1d h: refs/heads/master i: 148317: eaa23f10ab5b0cccbc9f7026e502f35cc7b64305 148315: f03c2701dc0e9d13cdde07470031e253955861b5 148311: 64d30655bf5348234d215574d16ba2db5ed818bd 148303: 7362dd23957ba6ca2f40a55923d84a9bda566300 148287: 08a258e9c0d8b9304b89046e73beb63d80c33a6a v: v3 --- [refs] | 2 +- trunk/sound/soc/codecs/twl4030.c | 12 +++++++++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/[refs] b/[refs] index 690b7db01877..fb38c4c7ff86 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 16a30fbb0d3aa4ee829a2dd3d0e314e2b5ae96a9 +refs/heads/master: eaf1ac8bb58888e0773c0b81dfedb9d7c0123a1d diff --git a/trunk/sound/soc/codecs/twl4030.c b/trunk/sound/soc/codecs/twl4030.c index df474a5dd357..c53c7cabbd27 100644 --- a/trunk/sound/soc/codecs/twl4030.c +++ b/trunk/sound/soc/codecs/twl4030.c @@ -1608,9 +1608,15 @@ static int twl4030_hw_params(struct snd_pcm_substream *substream, /* If the substream has 4 channel, do the necessary setup */ if (params_channels(params) == 4) { - /* Safety check: are we in the correct operating mode? */ - if ((twl4030_read_reg_cache(codec, TWL4030_REG_CODEC_MODE) & - TWL4030_OPTION_1)) + u8 format, mode; + + format = twl4030_read_reg_cache(codec, TWL4030_REG_AUDIO_IF); + mode = twl4030_read_reg_cache(codec, TWL4030_REG_CODEC_MODE); + + /* Safety check: are we in the correct operating mode and + * the interface is in TDM mode? */ + if ((mode & TWL4030_OPTION_1) && + ((format & TWL4030_AIF_FORMAT) == TWL4030_AIF_FORMAT_TDM)) twl4030_tdm_enable(codec, substream->stream, 1); else return -EINVAL;