summaryrefslogtreecommitdiff
path: root/sound/soc/codecs/wm8903.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/soc/codecs/wm8903.c')
-rw-r--r--sound/soc/codecs/wm8903.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/sound/soc/codecs/wm8903.c b/sound/soc/codecs/wm8903.c
index b84940c359a1..aa0984864e76 100644
--- a/sound/soc/codecs/wm8903.c
+++ b/sound/soc/codecs/wm8903.c
@@ -281,8 +281,7 @@ static int wm8903_dcs_event(struct snd_soc_dapm_widget *w,
static void wm8903_seq_notifier(struct snd_soc_dapm_context *dapm,
enum snd_soc_dapm_type event, int subseq)
{
- struct snd_soc_codec *codec = container_of(dapm,
- struct snd_soc_codec, dapm);
+ struct snd_soc_codec *codec = snd_soc_dapm_to_codec(dapm);
struct wm8903_priv *wm8903 = snd_soc_codec_get_drvdata(codec);
int dcs_mode = WM8903_DCS_MODE_WRITE_STOP;
int i, val;
@@ -1477,19 +1476,19 @@ static int wm8903_hw_params(struct snd_pcm_substream *substream,
aif1 &= ~WM8903_AIF_WL_MASK;
bclk = 2 * fs;
- switch (params_format(params)) {
- case SNDRV_PCM_FORMAT_S16_LE:
+ switch (params_width(params)) {
+ case 16:
bclk *= 16;
break;
- case SNDRV_PCM_FORMAT_S20_3LE:
+ case 20:
bclk *= 20;
aif1 |= 0x4;
break;
- case SNDRV_PCM_FORMAT_S24_LE:
+ case 24:
bclk *= 24;
aif1 |= 0x8;
break;
- case SNDRV_PCM_FORMAT_S32_LE:
+ case 32:
bclk *= 32;
aif1 |= 0xc;
break;