mirror of
https://github.com/torvalds/linux.git
synced 2024-11-05 19:41:54 +00:00
Merge remote-tracking branches 'asoc/fix/samsung', 'asoc/fix/tlv320dac33', 'asoc/fix/wl1273', 'asoc/fix/wm8753', 'asoc/fix/wm8904', 'asoc/fix/wm8958' and 'asoc/fix/wm8983' into asoc-linus
This commit is contained in:
commit
b23229e4d5
@ -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;
|
||||
}
|
||||
@ -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;
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
@ -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;
|
||||
}
|
||||
@ -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;
|
||||
}
|
||||
@ -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;
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
@ -244,7 +244,7 @@ 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))
|
||||
@ -252,7 +252,7 @@ static int wm8753_set_dai(struct snd_kcontrol *kcontrol,
|
||||
|
||||
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;
|
||||
|
@ -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;
|
||||
@ -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;
|
||||
|
@ -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 */
|
||||
@ -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 */
|
||||
@ -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 */
|
||||
@ -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 */
|
||||
|
@ -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;
|
||||
}
|
||||
@ -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;
|
||||
}
|
||||
@ -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);
|
||||
|
@ -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:
|
||||
@ -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;
|
||||
}
|
||||
@ -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;
|
||||
@ -649,7 +651,7 @@ 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
|
||||
@ -657,7 +659,7 @@ static int i2s_set_fmt(struct snd_soc_dai *dai,
|
||||
*/
|
||||
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;
|
||||
@ -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;
|
||||
}
|
||||
@ -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);
|
||||
@ -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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user