Skip to content

Commit

Permalink
Merge remote-tracking branches 'asoc/fix/samsung', 'asoc/fix/tlv320da…
Browse files Browse the repository at this point in the history
…c33', 'asoc/fix/wl1273', 'asoc/fix/wm8753', 'asoc/fix/wm8904', 'asoc/fix/wm8958' and 'asoc/fix/wm8983' into asoc-linus
  • Loading branch information
Mark Brown committed Mar 5, 2016
8 parents 3b22371 + 316fa9e + 8733f99 + 154a0fd + 0cad105 + c41a024 + d078482 + b5ab265 commit b23229e
Show file tree
Hide file tree
Showing 7 changed files with 38 additions and 37 deletions.
9 changes: 4 additions & 5 deletions sound/soc/codecs/tlv320dac33.c
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,7 @@ static int dac33_get_fifo_mode(struct snd_kcontrol *kcontrol,
struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
struct tlv320dac33_priv *dac33 = snd_soc_codec_get_drvdata(codec);

ucontrol->value.integer.value[0] = dac33->fifo_mode;
ucontrol->value.enumerated.item[0] = dac33->fifo_mode;

return 0;
}
Expand All @@ -458,17 +458,16 @@ static int dac33_set_fifo_mode(struct snd_kcontrol *kcontrol,
struct tlv320dac33_priv *dac33 = snd_soc_codec_get_drvdata(codec);
int ret = 0;

if (dac33->fifo_mode == ucontrol->value.integer.value[0])
if (dac33->fifo_mode == ucontrol->value.enumerated.item[0])
return 0;
/* Do not allow changes while stream is running*/
if (snd_soc_codec_is_active(codec))
return -EPERM;

if (ucontrol->value.integer.value[0] < 0 ||
ucontrol->value.integer.value[0] >= DAC33_FIFO_LAST_MODE)
if (ucontrol->value.enumerated.item[0] >= DAC33_FIFO_LAST_MODE)
ret = -EINVAL;
else
dac33->fifo_mode = ucontrol->value.integer.value[0];
dac33->fifo_mode = ucontrol->value.enumerated.item[0];

return ret;
}
Expand Down
13 changes: 6 additions & 7 deletions sound/soc/codecs/wl1273.c
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ static int snd_wl1273_get_audio_route(struct snd_kcontrol *kcontrol,
struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
struct wl1273_priv *wl1273 = snd_soc_codec_get_drvdata(codec);

ucontrol->value.integer.value[0] = wl1273->mode;
ucontrol->value.enumerated.item[0] = wl1273->mode;

return 0;
}
Expand All @@ -193,18 +193,17 @@ static int snd_wl1273_set_audio_route(struct snd_kcontrol *kcontrol,
struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
struct wl1273_priv *wl1273 = snd_soc_codec_get_drvdata(codec);

if (wl1273->mode == ucontrol->value.integer.value[0])
if (wl1273->mode == ucontrol->value.enumerated.item[0])
return 0;

/* Do not allow changes while stream is running */
if (snd_soc_codec_is_active(codec))
return -EPERM;

if (ucontrol->value.integer.value[0] < 0 ||
ucontrol->value.integer.value[0] >= ARRAY_SIZE(wl1273_audio_route))
if (ucontrol->value.enumerated.item[0] >= ARRAY_SIZE(wl1273_audio_route))
return -EINVAL;

wl1273->mode = ucontrol->value.integer.value[0];
wl1273->mode = ucontrol->value.enumerated.item[0];

return 1;
}
Expand All @@ -219,7 +218,7 @@ static int snd_wl1273_fm_audio_get(struct snd_kcontrol *kcontrol,

dev_dbg(codec->dev, "%s: enter.\n", __func__);

ucontrol->value.integer.value[0] = wl1273->core->audio_mode;
ucontrol->value.enumerated.item[0] = wl1273->core->audio_mode;

return 0;
}
Expand All @@ -233,7 +232,7 @@ static int snd_wl1273_fm_audio_put(struct snd_kcontrol *kcontrol,

dev_dbg(codec->dev, "%s: enter.\n", __func__);

val = ucontrol->value.integer.value[0];
val = ucontrol->value.enumerated.item[0];
if (wl1273->core->audio_mode == val)
return 0;

Expand Down
6 changes: 3 additions & 3 deletions sound/soc/codecs/wm8753.c
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ static int wm8753_get_dai(struct snd_kcontrol *kcontrol,
struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
struct wm8753_priv *wm8753 = snd_soc_codec_get_drvdata(codec);

ucontrol->value.integer.value[0] = wm8753->dai_func;
ucontrol->value.enumerated.item[0] = wm8753->dai_func;
return 0;
}

Expand All @@ -244,15 +244,15 @@ static int wm8753_set_dai(struct snd_kcontrol *kcontrol,
struct wm8753_priv *wm8753 = snd_soc_codec_get_drvdata(codec);
u16 ioctl;

if (wm8753->dai_func == ucontrol->value.integer.value[0])
if (wm8753->dai_func == ucontrol->value.enumerated.item[0])
return 0;

if (snd_soc_codec_is_active(codec))
return -EBUSY;

ioctl = snd_soc_read(codec, WM8753_IOCTL);

wm8753->dai_func = ucontrol->value.integer.value[0];
wm8753->dai_func = ucontrol->value.enumerated.item[0];

if (((ioctl >> 2) & 0x3) == wm8753->dai_func)
return 1;
Expand Down
4 changes: 2 additions & 2 deletions sound/soc/codecs/wm8904.c
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ static int wm8904_put_drc_enum(struct snd_kcontrol *kcontrol,
struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
struct wm8904_priv *wm8904 = snd_soc_codec_get_drvdata(codec);
struct wm8904_pdata *pdata = wm8904->pdata;
int value = ucontrol->value.integer.value[0];
int value = ucontrol->value.enumerated.item[0];

if (value >= pdata->num_drc_cfgs)
return -EINVAL;
Expand Down Expand Up @@ -467,7 +467,7 @@ static int wm8904_put_retune_mobile_enum(struct snd_kcontrol *kcontrol,
struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
struct wm8904_priv *wm8904 = snd_soc_codec_get_drvdata(codec);
struct wm8904_pdata *pdata = wm8904->pdata;
int value = ucontrol->value.integer.value[0];
int value = ucontrol->value.enumerated.item[0];

if (value >= pdata->num_retune_mobile_cfgs)
return -EINVAL;
Expand Down
8 changes: 4 additions & 4 deletions sound/soc/codecs/wm8958-dsp2.c
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,7 @@ static int wm8958_put_mbc_enum(struct snd_kcontrol *kcontrol,
struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec);
struct wm8994 *control = wm8994->wm8994;
int value = ucontrol->value.integer.value[0];
int value = ucontrol->value.enumerated.item[0];
int reg;

/* Don't allow on the fly reconfiguration */
Expand Down Expand Up @@ -549,7 +549,7 @@ static int wm8958_put_vss_enum(struct snd_kcontrol *kcontrol,
struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec);
struct wm8994 *control = wm8994->wm8994;
int value = ucontrol->value.integer.value[0];
int value = ucontrol->value.enumerated.item[0];
int reg;

/* Don't allow on the fly reconfiguration */
Expand Down Expand Up @@ -582,7 +582,7 @@ static int wm8958_put_vss_hpf_enum(struct snd_kcontrol *kcontrol,
struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec);
struct wm8994 *control = wm8994->wm8994;
int value = ucontrol->value.integer.value[0];
int value = ucontrol->value.enumerated.item[0];
int reg;

/* Don't allow on the fly reconfiguration */
Expand Down Expand Up @@ -749,7 +749,7 @@ static int wm8958_put_enh_eq_enum(struct snd_kcontrol *kcontrol,
struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec);
struct wm8994 *control = wm8994->wm8994;
int value = ucontrol->value.integer.value[0];
int value = ucontrol->value.enumerated.item[0];
int reg;

/* Don't allow on the fly reconfiguration */
Expand Down
14 changes: 7 additions & 7 deletions sound/soc/codecs/wm8983.c
Original file line number Diff line number Diff line change
Expand Up @@ -497,9 +497,9 @@ static int eqmode_get(struct snd_kcontrol *kcontrol,

reg = snd_soc_read(codec, WM8983_EQ1_LOW_SHELF);
if (reg & WM8983_EQ3DMODE)
ucontrol->value.integer.value[0] = 1;
ucontrol->value.enumerated.item[0] = 1;
else
ucontrol->value.integer.value[0] = 0;
ucontrol->value.enumerated.item[0] = 0;

return 0;
}
Expand All @@ -511,18 +511,18 @@ static int eqmode_put(struct snd_kcontrol *kcontrol,
unsigned int regpwr2, regpwr3;
unsigned int reg_eq;

if (ucontrol->value.integer.value[0] != 0
&& ucontrol->value.integer.value[0] != 1)
if (ucontrol->value.enumerated.item[0] != 0
&& ucontrol->value.enumerated.item[0] != 1)
return -EINVAL;

reg_eq = snd_soc_read(codec, WM8983_EQ1_LOW_SHELF);
switch ((reg_eq & WM8983_EQ3DMODE) >> WM8983_EQ3DMODE_SHIFT) {
case 0:
if (!ucontrol->value.integer.value[0])
if (!ucontrol->value.enumerated.item[0])
return 0;
break;
case 1:
if (ucontrol->value.integer.value[0])
if (ucontrol->value.enumerated.item[0])
return 0;
break;
}
Expand All @@ -537,7 +537,7 @@ static int eqmode_put(struct snd_kcontrol *kcontrol,
/* set the desired eqmode */
snd_soc_update_bits(codec, WM8983_EQ1_LOW_SHELF,
WM8983_EQ3DMODE_MASK,
ucontrol->value.integer.value[0]
ucontrol->value.enumerated.item[0]
<< WM8983_EQ3DMODE_SHIFT);
/* restore DAC/ADC configuration */
snd_soc_write(codec, WM8983_POWER_MANAGEMENT_2, regpwr2);
Expand Down
21 changes: 12 additions & 9 deletions sound/soc/samsung/i2s.c
Original file line number Diff line number Diff line change
Expand Up @@ -481,10 +481,11 @@ static int i2s_set_sysclk(struct snd_soc_dai *dai,
unsigned int cdcon_mask = 1 << i2s_regs->cdclkcon_off;
unsigned int rsrc_mask = 1 << i2s_regs->rclksrc_off;
u32 mod, mask, val = 0;
unsigned long flags;

spin_lock(i2s->lock);
spin_lock_irqsave(i2s->lock, flags);
mod = readl(i2s->addr + I2SMOD);
spin_unlock(i2s->lock);
spin_unlock_irqrestore(i2s->lock, flags);

switch (clk_id) {
case SAMSUNG_I2S_OPCLK:
Expand Down Expand Up @@ -575,11 +576,11 @@ static int i2s_set_sysclk(struct snd_soc_dai *dai,
return -EINVAL;
}

spin_lock(i2s->lock);
spin_lock_irqsave(i2s->lock, flags);
mod = readl(i2s->addr + I2SMOD);
mod = (mod & ~mask) | val;
writel(mod, i2s->addr + I2SMOD);
spin_unlock(i2s->lock);
spin_unlock_irqrestore(i2s->lock, flags);

return 0;
}
Expand All @@ -590,6 +591,7 @@ static int i2s_set_fmt(struct snd_soc_dai *dai,
struct i2s_dai *i2s = to_info(dai);
int lrp_shift, sdf_shift, sdf_mask, lrp_rlow, mod_slave;
u32 mod, tmp = 0;
unsigned long flags;

lrp_shift = i2s->variant_regs->lrp_off;
sdf_shift = i2s->variant_regs->sdf_off;
Expand Down Expand Up @@ -649,15 +651,15 @@ static int i2s_set_fmt(struct snd_soc_dai *dai,
return -EINVAL;
}

spin_lock(i2s->lock);
spin_lock_irqsave(i2s->lock, flags);
mod = readl(i2s->addr + I2SMOD);
/*
* Don't change the I2S mode if any controller is active on this
* channel.
*/
if (any_active(i2s) &&
((mod & (sdf_mask | lrp_rlow | mod_slave)) != tmp)) {
spin_unlock(i2s->lock);
spin_unlock_irqrestore(i2s->lock, flags);
dev_err(&i2s->pdev->dev,
"%s:%d Other DAI busy\n", __func__, __LINE__);
return -EAGAIN;
Expand All @@ -666,7 +668,7 @@ static int i2s_set_fmt(struct snd_soc_dai *dai,
mod &= ~(sdf_mask | lrp_rlow | mod_slave);
mod |= tmp;
writel(mod, i2s->addr + I2SMOD);
spin_unlock(i2s->lock);
spin_unlock_irqrestore(i2s->lock, flags);

return 0;
}
Expand All @@ -676,6 +678,7 @@ static int i2s_hw_params(struct snd_pcm_substream *substream,
{
struct i2s_dai *i2s = to_info(dai);
u32 mod, mask = 0, val = 0;
unsigned long flags;

if (!is_secondary(i2s))
mask |= (MOD_DC2_EN | MOD_DC1_EN);
Expand Down Expand Up @@ -744,11 +747,11 @@ static int i2s_hw_params(struct snd_pcm_substream *substream,
return -EINVAL;
}

spin_lock(i2s->lock);
spin_lock_irqsave(i2s->lock, flags);
mod = readl(i2s->addr + I2SMOD);
mod = (mod & ~mask) | val;
writel(mod, i2s->addr + I2SMOD);
spin_unlock(i2s->lock);
spin_unlock_irqrestore(i2s->lock, flags);

samsung_asoc_init_dma_data(dai, &i2s->dma_playback, &i2s->dma_capture);

Expand Down

0 comments on commit b23229e

Please sign in to comment.