mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-11-26 01:50:54 +07:00
ASoC: Fixes for v4.5
This is far too big a set of fixes for this late in the release cycle but the overwhelming bulk is essentially the same simple fix from Takashi for a cut'n'pasted 64 bit cleanliness issue in the userspace interface where drivers were accessing things using the wrong element in a union which worked OK on 32 bit platforms as the correct element happened to be aligned the same way but with 64 bit platforms ABIs are different and the two members of the union are laid out in different places. They aren't all tagged to stable since some of these chips have vanishingly little chance of being used in 64 bit systems. The other changes are: - A fix for Qualcomm devices to work on big endian systems. The original change is actually correct but triggered a bug in regmap which is too invasive to fix for this cycle and can be worked around by just letting regmap pick the default. - A fix for the Samsung I2S driver locking which wasn't using IRQ safe spinlocks when it needed to. - A fix for the new Intel Sky Lake driver forgetting that C pointer arithmetic takes the type of the pointer into consideration. - A revert of a change to the FSL SSI driver that broke some systems. - A fix for the cleanup path of the wm9713 driver. - A fix for some incorrect register definitions in the ADAU17x1 driver that caused misclocking in some configurations. - A fix for the tracepoints for jack detection to avoid using an internal field of the core jack structure which is no longer present in all configurations. - A fix for another of the new Intel drivers which tried to write to a string literal. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAABAgAGBQJW3OpsAAoJECTWi3JdVIfQ/lMH/05/atIZLFI3tfxpp9P1zCD2 6BH6aUtGEz8uh7wpfLlgUKvBhFZxZmr2aYHiuD2c2UQYWJ5L14GavkUvrohQ1oBp 6LGN2pJ/0uhQ6XnFHcYnJt5C3pdQspNxaNZBCTdLQZDjjki13Q8jXVL2vToFFbpK vFEHLqeuwtSLgtgNJMHHLR6o5QpfX7lcMGKwsfNI8k5b+2j5UDh+fwGQcnU9wueU FyxIy9FNlHd1nWwQDNyGL06pMKazsPV6KaPDXa/rG6RsOBxpjz+5JgCVKmAh7EUp /qUS2Xy0DVTkedtunnA9EIIHyfC1zuFjeH6lU2UyP/A2kcMlzpNyt7uMRK0dolg= =+Y7p -----END PGP SIGNATURE----- Merge tag 'asoc-fix-v4.5-rc6' into asoc-linus ASoC: Fixes for v4.5 This is far too big a set of fixes for this late in the release cycle but the overwhelming bulk is essentially the same simple fix from Takashi for a cut'n'pasted 64 bit cleanliness issue in the userspace interface where drivers were accessing things using the wrong element in a union which worked OK on 32 bit platforms as the correct element happened to be aligned the same way but with 64 bit platforms ABIs are different and the two members of the union are laid out in different places. They aren't all tagged to stable since some of these chips have vanishingly little chance of being used in 64 bit systems. The other changes are: - A fix for Qualcomm devices to work on big endian systems. The original change is actually correct but triggered a bug in regmap which is too invasive to fix for this cycle and can be worked around by just letting regmap pick the default. - A fix for the Samsung I2S driver locking which wasn't using IRQ safe spinlocks when it needed to. - A fix for the new Intel Sky Lake driver forgetting that C pointer arithmetic takes the type of the pointer into consideration. - A revert of a change to the FSL SSI driver that broke some systems. - A fix for the cleanup path of the wm9713 driver. - A fix for some incorrect register definitions in the ADAU17x1 driver that caused misclocking in some configurations. - A fix for the tracepoints for jack detection to avoid using an internal field of the core jack structure which is no longer present in all configurations. - A fix for another of the new Intel drivers which tried to write to a string literal. # gpg: Signature made Mon 07 Mar 2016 09:41:48 ICT using RSA key ID 5D5487D0 # gpg: key CD7BEEBC: no public key for trusted key - skipped # gpg: key CD7BEEBC marked as ultimately trusted # gpg: key AF88CD16: no public key for trusted key - skipped # gpg: key AF88CD16 marked as ultimately trusted # gpg: key 16005C11: no public key for trusted key - skipped # gpg: key 16005C11 marked as ultimately trusted # gpg: key 5621E907: no public key for trusted key - skipped # gpg: key 5621E907 marked as ultimately trusted # gpg: key 5C6153AD: no public key for trusted key - skipped # gpg: key 5C6153AD marked as ultimately trusted # gpg: Good signature from "Mark Brown <broonie@sirena.org.uk>" # gpg: aka "Mark Brown <broonie@debian.org>" # gpg: aka "Mark Brown <broonie@kernel.org>" # gpg: aka "Mark Brown <broonie@tardis.ed.ac.uk>" # gpg: aka "Mark Brown <broonie@linaro.org>" # gpg: aka "Mark Brown <Mark.Brown@linaro.org>"
This commit is contained in:
commit
e87fb3b117
@ -231,13 +231,13 @@ TRACE_EVENT(snd_soc_jack_report,
|
||||
TP_ARGS(jack, mask, val),
|
||||
|
||||
TP_STRUCT__entry(
|
||||
__string( name, jack->jack->name )
|
||||
__string( name, jack->jack->id )
|
||||
__field( int, mask )
|
||||
__field( int, val )
|
||||
),
|
||||
|
||||
TP_fast_assign(
|
||||
__assign_str(name, jack->jack->name);
|
||||
__assign_str(name, jack->jack->id);
|
||||
__entry->mask = mask;
|
||||
__entry->val = val;
|
||||
),
|
||||
@ -253,12 +253,12 @@ TRACE_EVENT(snd_soc_jack_notify,
|
||||
TP_ARGS(jack, val),
|
||||
|
||||
TP_STRUCT__entry(
|
||||
__string( name, jack->jack->name )
|
||||
__string( name, jack->jack->id )
|
||||
__field( int, val )
|
||||
),
|
||||
|
||||
TP_fast_assign(
|
||||
__assign_str(name, jack->jack->name);
|
||||
__assign_str(name, jack->jack->id);
|
||||
__entry->val = val;
|
||||
),
|
||||
|
||||
|
@ -1130,7 +1130,7 @@ static int sid_status_control_get(struct snd_kcontrol *kcontrol,
|
||||
struct ab8500_codec_drvdata *drvdata = dev_get_drvdata(codec->dev);
|
||||
|
||||
mutex_lock(&drvdata->ctrl_lock);
|
||||
ucontrol->value.integer.value[0] = drvdata->sid_status;
|
||||
ucontrol->value.enumerated.item[0] = drvdata->sid_status;
|
||||
mutex_unlock(&drvdata->ctrl_lock);
|
||||
|
||||
return 0;
|
||||
@ -1147,7 +1147,7 @@ static int sid_status_control_put(struct snd_kcontrol *kcontrol,
|
||||
|
||||
dev_dbg(codec->dev, "%s: Enter\n", __func__);
|
||||
|
||||
if (ucontrol->value.integer.value[0] != SID_APPLY_FIR) {
|
||||
if (ucontrol->value.enumerated.item[0] != SID_APPLY_FIR) {
|
||||
dev_err(codec->dev,
|
||||
"%s: ERROR: This control supports '%s' only!\n",
|
||||
__func__, enum_sid_state[SID_APPLY_FIR]);
|
||||
@ -1199,7 +1199,7 @@ static int anc_status_control_get(struct snd_kcontrol *kcontrol,
|
||||
struct ab8500_codec_drvdata *drvdata = dev_get_drvdata(codec->dev);
|
||||
|
||||
mutex_lock(&drvdata->ctrl_lock);
|
||||
ucontrol->value.integer.value[0] = drvdata->anc_status;
|
||||
ucontrol->value.enumerated.item[0] = drvdata->anc_status;
|
||||
mutex_unlock(&drvdata->ctrl_lock);
|
||||
|
||||
return 0;
|
||||
@ -1220,7 +1220,7 @@ static int anc_status_control_put(struct snd_kcontrol *kcontrol,
|
||||
|
||||
mutex_lock(&drvdata->ctrl_lock);
|
||||
|
||||
req = ucontrol->value.integer.value[0];
|
||||
req = ucontrol->value.enumerated.item[0];
|
||||
if (req >= ARRAY_SIZE(enum_anc_state)) {
|
||||
status = -EINVAL;
|
||||
goto cleanup;
|
||||
|
@ -103,9 +103,9 @@ bool adau17x1_has_dsp(struct adau *adau);
|
||||
#define ADAU17X1_CLOCK_CONTROL_CORECLK_SRC_PLL BIT(3)
|
||||
#define ADAU17X1_CLOCK_CONTROL_SYSCLK_EN BIT(0)
|
||||
|
||||
#define ADAU17X1_SERIAL_PORT1_BCLK32 (0x0 << 5)
|
||||
#define ADAU17X1_SERIAL_PORT1_BCLK48 (0x1 << 5)
|
||||
#define ADAU17X1_SERIAL_PORT1_BCLK64 (0x2 << 5)
|
||||
#define ADAU17X1_SERIAL_PORT1_BCLK64 (0x0 << 5)
|
||||
#define ADAU17X1_SERIAL_PORT1_BCLK32 (0x1 << 5)
|
||||
#define ADAU17X1_SERIAL_PORT1_BCLK48 (0x2 << 5)
|
||||
#define ADAU17X1_SERIAL_PORT1_BCLK128 (0x3 << 5)
|
||||
#define ADAU17X1_SERIAL_PORT1_BCLK256 (0x4 << 5)
|
||||
#define ADAU17X1_SERIAL_PORT1_BCLK_MASK (0x7 << 5)
|
||||
|
@ -60,15 +60,15 @@ static int cs42l51_get_chan_mix(struct snd_kcontrol *kcontrol,
|
||||
switch (value) {
|
||||
default:
|
||||
case 0:
|
||||
ucontrol->value.integer.value[0] = 0;
|
||||
ucontrol->value.enumerated.item[0] = 0;
|
||||
break;
|
||||
/* same value : (L+R)/2 and (R+L)/2 */
|
||||
case 1:
|
||||
case 2:
|
||||
ucontrol->value.integer.value[0] = 1;
|
||||
ucontrol->value.enumerated.item[0] = 1;
|
||||
break;
|
||||
case 3:
|
||||
ucontrol->value.integer.value[0] = 2;
|
||||
ucontrol->value.enumerated.item[0] = 2;
|
||||
break;
|
||||
}
|
||||
|
||||
@ -85,7 +85,7 @@ static int cs42l51_set_chan_mix(struct snd_kcontrol *kcontrol,
|
||||
struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
|
||||
unsigned char val;
|
||||
|
||||
switch (ucontrol->value.integer.value[0]) {
|
||||
switch (ucontrol->value.enumerated.item[0]) {
|
||||
default:
|
||||
case 0:
|
||||
val = CHAN_MIX_NORMAL;
|
||||
|
@ -334,7 +334,7 @@ static int da732x_hpf_set(struct snd_kcontrol *kcontrol,
|
||||
struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
|
||||
struct soc_enum *enum_ctrl = (struct soc_enum *)kcontrol->private_value;
|
||||
unsigned int reg = enum_ctrl->reg;
|
||||
unsigned int sel = ucontrol->value.integer.value[0];
|
||||
unsigned int sel = ucontrol->value.enumerated.item[0];
|
||||
unsigned int bits;
|
||||
|
||||
switch (sel) {
|
||||
@ -368,13 +368,13 @@ static int da732x_hpf_get(struct snd_kcontrol *kcontrol,
|
||||
|
||||
switch (val) {
|
||||
case DA732X_HPF_VOICE_EN:
|
||||
ucontrol->value.integer.value[0] = DA732X_HPF_VOICE;
|
||||
ucontrol->value.enumerated.item[0] = DA732X_HPF_VOICE;
|
||||
break;
|
||||
case DA732X_HPF_MUSIC_EN:
|
||||
ucontrol->value.integer.value[0] = DA732X_HPF_MUSIC;
|
||||
ucontrol->value.enumerated.item[0] = DA732X_HPF_MUSIC;
|
||||
break;
|
||||
default:
|
||||
ucontrol->value.integer.value[0] = DA732X_HPF_DISABLED;
|
||||
ucontrol->value.enumerated.item[0] = DA732X_HPF_DISABLED;
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -1496,7 +1496,7 @@ static int max98088_put_eq_enum(struct snd_kcontrol *kcontrol,
|
||||
struct max98088_pdata *pdata = max98088->pdata;
|
||||
int channel = max98088_get_channel(codec, kcontrol->id.name);
|
||||
struct max98088_cdata *cdata;
|
||||
int sel = ucontrol->value.integer.value[0];
|
||||
int sel = ucontrol->value.enumerated.item[0];
|
||||
|
||||
if (channel < 0)
|
||||
return channel;
|
||||
|
@ -1499,7 +1499,7 @@ static int max98095_put_eq_enum(struct snd_kcontrol *kcontrol,
|
||||
struct max98095_pdata *pdata = max98095->pdata;
|
||||
int channel = max98095_get_eq_channel(kcontrol->id.name);
|
||||
struct max98095_cdata *cdata;
|
||||
unsigned int sel = ucontrol->value.integer.value[0];
|
||||
unsigned int sel = ucontrol->value.enumerated.item[0];
|
||||
struct max98095_eq_cfg *coef_set;
|
||||
int fs, best, best_val, i;
|
||||
int regmask, regsave;
|
||||
@ -1653,7 +1653,7 @@ static int max98095_put_bq_enum(struct snd_kcontrol *kcontrol,
|
||||
struct max98095_pdata *pdata = max98095->pdata;
|
||||
int channel = max98095_get_bq_channel(codec, kcontrol->id.name);
|
||||
struct max98095_cdata *cdata;
|
||||
unsigned int sel = ucontrol->value.integer.value[0];
|
||||
unsigned int sel = ucontrol->value.enumerated.item[0];
|
||||
struct max98095_biquad_cfg *coef_set;
|
||||
int fs, best, best_val, i;
|
||||
int regmask, regsave;
|
||||
|
@ -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);
|
||||
|
@ -531,9 +531,9 @@ static int eqmode_get(struct snd_kcontrol *kcontrol,
|
||||
|
||||
reg = snd_soc_read(codec, WM8985_EQ1_LOW_SHELF);
|
||||
if (reg & WM8985_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;
|
||||
}
|
||||
@ -545,18 +545,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, WM8985_EQ1_LOW_SHELF);
|
||||
switch ((reg_eq & WM8985_EQ3DMODE) >> WM8985_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;
|
||||
}
|
||||
@ -573,7 +573,7 @@ static int eqmode_put(struct snd_kcontrol *kcontrol,
|
||||
/* set the desired eqmode */
|
||||
snd_soc_update_bits(codec, WM8985_EQ1_LOW_SHELF,
|
||||
WM8985_EQ3DMODE_MASK,
|
||||
ucontrol->value.integer.value[0]
|
||||
ucontrol->value.enumerated.item[0]
|
||||
<< WM8985_EQ3DMODE_SHIFT);
|
||||
/* restore DAC/ADC configuration */
|
||||
snd_soc_write(codec, WM8985_POWER_MANAGEMENT_2, regpwr2);
|
||||
|
@ -362,7 +362,7 @@ static int wm8994_put_drc_enum(struct snd_kcontrol *kcontrol,
|
||||
struct wm8994 *control = wm8994->wm8994;
|
||||
struct wm8994_pdata *pdata = &control->pdata;
|
||||
int drc = wm8994_get_drc(kcontrol->id.name);
|
||||
int value = ucontrol->value.integer.value[0];
|
||||
int value = ucontrol->value.enumerated.item[0];
|
||||
|
||||
if (drc < 0)
|
||||
return drc;
|
||||
@ -469,7 +469,7 @@ static int wm8994_put_retune_mobile_enum(struct snd_kcontrol *kcontrol,
|
||||
struct wm8994 *control = wm8994->wm8994;
|
||||
struct wm8994_pdata *pdata = &control->pdata;
|
||||
int block = wm8994_get_retune_mobile_block(kcontrol->id.name);
|
||||
int value = ucontrol->value.integer.value[0];
|
||||
int value = ucontrol->value.enumerated.item[0];
|
||||
|
||||
if (block < 0)
|
||||
return block;
|
||||
|
@ -416,7 +416,7 @@ static int wm8996_put_retune_mobile_enum(struct snd_kcontrol *kcontrol,
|
||||
struct wm8996_priv *wm8996 = snd_soc_codec_get_drvdata(codec);
|
||||
struct wm8996_pdata *pdata = &wm8996->pdata;
|
||||
int block = wm8996_get_retune_mobile_block(kcontrol->id.name);
|
||||
int value = ucontrol->value.integer.value[0];
|
||||
int value = ucontrol->value.enumerated.item[0];
|
||||
|
||||
if (block < 0)
|
||||
return block;
|
||||
|
@ -344,9 +344,9 @@ static int speaker_mode_get(struct snd_kcontrol *kcontrol,
|
||||
|
||||
reg = snd_soc_read(codec, WM9081_ANALOGUE_SPEAKER_2);
|
||||
if (reg & WM9081_SPK_MODE)
|
||||
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;
|
||||
}
|
||||
@ -365,7 +365,7 @@ static int speaker_mode_put(struct snd_kcontrol *kcontrol,
|
||||
unsigned int reg2 = snd_soc_read(codec, WM9081_ANALOGUE_SPEAKER_2);
|
||||
|
||||
/* Are we changing anything? */
|
||||
if (ucontrol->value.integer.value[0] ==
|
||||
if (ucontrol->value.enumerated.item[0] ==
|
||||
((reg2 & WM9081_SPK_MODE) != 0))
|
||||
return 0;
|
||||
|
||||
@ -373,7 +373,7 @@ static int speaker_mode_put(struct snd_kcontrol *kcontrol,
|
||||
if (reg_pwr & WM9081_SPK_ENA)
|
||||
return -EINVAL;
|
||||
|
||||
if (ucontrol->value.integer.value[0]) {
|
||||
if (ucontrol->value.enumerated.item[0]) {
|
||||
/* Class AB */
|
||||
reg2 &= ~(WM9081_SPK_INV_MUTE | WM9081_OUT_SPK_CTRL);
|
||||
reg2 |= WM9081_SPK_MODE;
|
||||
|
@ -1212,7 +1212,7 @@ static int wm9713_soc_probe(struct snd_soc_codec *codec)
|
||||
if (IS_ERR(wm9713->ac97))
|
||||
return PTR_ERR(wm9713->ac97);
|
||||
|
||||
regmap = devm_regmap_init_ac97(wm9713->ac97, &wm9713_regmap_config);
|
||||
regmap = regmap_init_ac97(wm9713->ac97, &wm9713_regmap_config);
|
||||
if (IS_ERR(regmap)) {
|
||||
snd_soc_free_ac97_codec(wm9713->ac97);
|
||||
return PTR_ERR(regmap);
|
||||
|
@ -586,7 +586,7 @@ static int wm_adsp_fw_get(struct snd_kcontrol *kcontrol,
|
||||
struct soc_enum *e = (struct soc_enum *)kcontrol->private_value;
|
||||
struct wm_adsp *dsp = snd_soc_codec_get_drvdata(codec);
|
||||
|
||||
ucontrol->value.integer.value[0] = dsp[e->shift_l].fw;
|
||||
ucontrol->value.enumerated.item[0] = dsp[e->shift_l].fw;
|
||||
|
||||
return 0;
|
||||
}
|
||||
@ -599,10 +599,10 @@ static int wm_adsp_fw_put(struct snd_kcontrol *kcontrol,
|
||||
struct wm_adsp *dsp = snd_soc_codec_get_drvdata(codec);
|
||||
int ret = 0;
|
||||
|
||||
if (ucontrol->value.integer.value[0] == dsp[e->shift_l].fw)
|
||||
if (ucontrol->value.enumerated.item[0] == dsp[e->shift_l].fw)
|
||||
return 0;
|
||||
|
||||
if (ucontrol->value.integer.value[0] >= WM_ADSP_NUM_FW)
|
||||
if (ucontrol->value.enumerated.item[0] >= WM_ADSP_NUM_FW)
|
||||
return -EINVAL;
|
||||
|
||||
mutex_lock(&dsp[e->shift_l].pwr_lock);
|
||||
@ -610,7 +610,7 @@ static int wm_adsp_fw_put(struct snd_kcontrol *kcontrol,
|
||||
if (dsp[e->shift_l].running || dsp[e->shift_l].compr)
|
||||
ret = -EBUSY;
|
||||
else
|
||||
dsp[e->shift_l].fw = ucontrol->value.integer.value[0];
|
||||
dsp[e->shift_l].fw = ucontrol->value.enumerated.item[0];
|
||||
|
||||
mutex_unlock(&dsp[e->shift_l].pwr_lock);
|
||||
|
||||
|
@ -112,6 +112,20 @@ struct fsl_ssi_rxtx_reg_val {
|
||||
struct fsl_ssi_reg_val tx;
|
||||
};
|
||||
|
||||
static const struct reg_default fsl_ssi_reg_defaults[] = {
|
||||
{CCSR_SSI_SCR, 0x00000000},
|
||||
{CCSR_SSI_SIER, 0x00003003},
|
||||
{CCSR_SSI_STCR, 0x00000200},
|
||||
{CCSR_SSI_SRCR, 0x00000200},
|
||||
{CCSR_SSI_STCCR, 0x00040000},
|
||||
{CCSR_SSI_SRCCR, 0x00040000},
|
||||
{CCSR_SSI_SACNT, 0x00000000},
|
||||
{CCSR_SSI_STMSK, 0x00000000},
|
||||
{CCSR_SSI_SRMSK, 0x00000000},
|
||||
{CCSR_SSI_SACCEN, 0x00000000},
|
||||
{CCSR_SSI_SACCDIS, 0x00000000},
|
||||
};
|
||||
|
||||
static bool fsl_ssi_readable_reg(struct device *dev, unsigned int reg)
|
||||
{
|
||||
switch (reg) {
|
||||
@ -176,7 +190,8 @@ static const struct regmap_config fsl_ssi_regconfig = {
|
||||
.val_bits = 32,
|
||||
.reg_stride = 4,
|
||||
.val_format_endian = REGMAP_ENDIAN_NATIVE,
|
||||
.num_reg_defaults_raw = CCSR_SSI_SACCDIS / sizeof(uint32_t) + 1,
|
||||
.reg_defaults = fsl_ssi_reg_defaults,
|
||||
.num_reg_defaults = ARRAY_SIZE(fsl_ssi_reg_defaults),
|
||||
.readable_reg = fsl_ssi_readable_reg,
|
||||
.volatile_reg = fsl_ssi_volatile_reg,
|
||||
.precious_reg = fsl_ssi_precious_reg,
|
||||
@ -186,7 +201,6 @@ static const struct regmap_config fsl_ssi_regconfig = {
|
||||
|
||||
struct fsl_ssi_soc_data {
|
||||
bool imx;
|
||||
bool imx21regs; /* imx21-class SSI - no SACC{ST,EN,DIS} regs */
|
||||
bool offline_config;
|
||||
u32 sisr_write_mask;
|
||||
};
|
||||
@ -289,7 +303,6 @@ static struct fsl_ssi_soc_data fsl_ssi_mpc8610 = {
|
||||
|
||||
static struct fsl_ssi_soc_data fsl_ssi_imx21 = {
|
||||
.imx = true,
|
||||
.imx21regs = true,
|
||||
.offline_config = true,
|
||||
.sisr_write_mask = 0,
|
||||
};
|
||||
@ -573,12 +586,8 @@ static void fsl_ssi_setup_ac97(struct fsl_ssi_private *ssi_private)
|
||||
*/
|
||||
regmap_write(regs, CCSR_SSI_SACNT,
|
||||
CCSR_SSI_SACNT_AC97EN | CCSR_SSI_SACNT_FV);
|
||||
|
||||
/* no SACC{ST,EN,DIS} regs on imx21-class SSI */
|
||||
if (!ssi_private->soc->imx21regs) {
|
||||
regmap_write(regs, CCSR_SSI_SACCDIS, 0xff);
|
||||
regmap_write(regs, CCSR_SSI_SACCEN, 0x300);
|
||||
}
|
||||
regmap_write(regs, CCSR_SSI_SACCDIS, 0xff);
|
||||
regmap_write(regs, CCSR_SSI_SACCEN, 0x300);
|
||||
|
||||
/*
|
||||
* Enable SSI, Transmit and Receive. AC97 has to communicate with the
|
||||
@ -1388,7 +1397,6 @@ static int fsl_ssi_probe(struct platform_device *pdev)
|
||||
struct resource *res;
|
||||
void __iomem *iomem;
|
||||
char name[64];
|
||||
struct regmap_config regconfig = fsl_ssi_regconfig;
|
||||
|
||||
of_id = of_match_device(fsl_ssi_ids, &pdev->dev);
|
||||
if (!of_id || !of_id->data)
|
||||
@ -1436,25 +1444,15 @@ static int fsl_ssi_probe(struct platform_device *pdev)
|
||||
return PTR_ERR(iomem);
|
||||
ssi_private->ssi_phys = res->start;
|
||||
|
||||
if (ssi_private->soc->imx21regs) {
|
||||
/*
|
||||
* According to datasheet imx21-class SSI
|
||||
* don't have SACC{ST,EN,DIS} regs.
|
||||
*/
|
||||
regconfig.max_register = CCSR_SSI_SRMSK;
|
||||
regconfig.num_reg_defaults_raw =
|
||||
CCSR_SSI_SRMSK / sizeof(uint32_t) + 1;
|
||||
}
|
||||
|
||||
ret = of_property_match_string(np, "clock-names", "ipg");
|
||||
if (ret < 0) {
|
||||
ssi_private->has_ipg_clk_name = false;
|
||||
ssi_private->regs = devm_regmap_init_mmio(&pdev->dev, iomem,
|
||||
®config);
|
||||
&fsl_ssi_regconfig);
|
||||
} else {
|
||||
ssi_private->has_ipg_clk_name = true;
|
||||
ssi_private->regs = devm_regmap_init_mmio_clk(&pdev->dev,
|
||||
"ipg", iomem, ®config);
|
||||
"ipg", iomem, &fsl_ssi_regconfig);
|
||||
}
|
||||
if (IS_ERR(ssi_private->regs)) {
|
||||
dev_err(&pdev->dev, "Failed to init register map\n");
|
||||
|
@ -367,8 +367,12 @@ static int snd_cht_mc_probe(struct platform_device *pdev)
|
||||
}
|
||||
card->dev = &pdev->dev;
|
||||
sprintf(codec_name, "i2c-%s:00", drv->acpi_card->codec_id);
|
||||
|
||||
/* set correct codec name */
|
||||
strcpy((char *)card->dai_link[2].codec_name, codec_name);
|
||||
for (i = 0; i < ARRAY_SIZE(cht_dailink); i++)
|
||||
if (!strcmp(card->dai_link[i].codec_name, "i2c-10EC5645:00"))
|
||||
card->dai_link[i].codec_name = kstrdup(codec_name, GFP_KERNEL);
|
||||
|
||||
snd_soc_card_set_drvdata(card, drv);
|
||||
ret_val = devm_snd_soc_register_card(&pdev->dev, card);
|
||||
if (ret_val) {
|
||||
|
@ -94,7 +94,7 @@ static const struct soc_enum lo_enum =
|
||||
static int headset_get_switch(struct snd_kcontrol *kcontrol,
|
||||
struct snd_ctl_elem_value *ucontrol)
|
||||
{
|
||||
ucontrol->value.integer.value[0] = hs_switch;
|
||||
ucontrol->value.enumerated.item[0] = hs_switch;
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -104,12 +104,12 @@ static int headset_set_switch(struct snd_kcontrol *kcontrol,
|
||||
struct snd_soc_card *card = snd_kcontrol_chip(kcontrol);
|
||||
struct snd_soc_dapm_context *dapm = &card->dapm;
|
||||
|
||||
if (ucontrol->value.integer.value[0] == hs_switch)
|
||||
if (ucontrol->value.enumerated.item[0] == hs_switch)
|
||||
return 0;
|
||||
|
||||
snd_soc_dapm_mutex_lock(dapm);
|
||||
|
||||
if (ucontrol->value.integer.value[0]) {
|
||||
if (ucontrol->value.enumerated.item[0]) {
|
||||
pr_debug("hs_set HS path\n");
|
||||
snd_soc_dapm_enable_pin_unlocked(dapm, "Headphones");
|
||||
snd_soc_dapm_disable_pin_unlocked(dapm, "EPOUT");
|
||||
@ -123,7 +123,7 @@ static int headset_set_switch(struct snd_kcontrol *kcontrol,
|
||||
|
||||
snd_soc_dapm_mutex_unlock(dapm);
|
||||
|
||||
hs_switch = ucontrol->value.integer.value[0];
|
||||
hs_switch = ucontrol->value.enumerated.item[0];
|
||||
|
||||
return 0;
|
||||
}
|
||||
@ -148,7 +148,7 @@ static void lo_enable_out_pins(struct snd_soc_dapm_context *dapm)
|
||||
static int lo_get_switch(struct snd_kcontrol *kcontrol,
|
||||
struct snd_ctl_elem_value *ucontrol)
|
||||
{
|
||||
ucontrol->value.integer.value[0] = lo_dac;
|
||||
ucontrol->value.enumerated.item[0] = lo_dac;
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -158,7 +158,7 @@ static int lo_set_switch(struct snd_kcontrol *kcontrol,
|
||||
struct snd_soc_card *card = snd_kcontrol_chip(kcontrol);
|
||||
struct snd_soc_dapm_context *dapm = &card->dapm;
|
||||
|
||||
if (ucontrol->value.integer.value[0] == lo_dac)
|
||||
if (ucontrol->value.enumerated.item[0] == lo_dac)
|
||||
return 0;
|
||||
|
||||
snd_soc_dapm_mutex_lock(dapm);
|
||||
@ -168,7 +168,7 @@ static int lo_set_switch(struct snd_kcontrol *kcontrol,
|
||||
*/
|
||||
lo_enable_out_pins(dapm);
|
||||
|
||||
switch (ucontrol->value.integer.value[0]) {
|
||||
switch (ucontrol->value.enumerated.item[0]) {
|
||||
case 0:
|
||||
pr_debug("set vibra path\n");
|
||||
snd_soc_dapm_disable_pin_unlocked(dapm, "VIB1OUT");
|
||||
@ -202,7 +202,7 @@ static int lo_set_switch(struct snd_kcontrol *kcontrol,
|
||||
|
||||
snd_soc_dapm_mutex_unlock(dapm);
|
||||
|
||||
lo_dac = ucontrol->value.integer.value[0];
|
||||
lo_dac = ucontrol->value.enumerated.item[0];
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -978,7 +978,7 @@ static int skl_tplg_tlv_control_set(struct snd_kcontrol *kcontrol,
|
||||
return -EFAULT;
|
||||
} else {
|
||||
if (copy_from_user(ac->params,
|
||||
data + 2 * sizeof(u32), size))
|
||||
data + 2, size))
|
||||
return -EFAULT;
|
||||
}
|
||||
|
||||
|
@ -133,7 +133,7 @@ static struct snd_soc_ops n810_ops = {
|
||||
static int n810_get_spk(struct snd_kcontrol *kcontrol,
|
||||
struct snd_ctl_elem_value *ucontrol)
|
||||
{
|
||||
ucontrol->value.integer.value[0] = n810_spk_func;
|
||||
ucontrol->value.enumerated.item[0] = n810_spk_func;
|
||||
|
||||
return 0;
|
||||
}
|
||||
@ -143,10 +143,10 @@ static int n810_set_spk(struct snd_kcontrol *kcontrol,
|
||||
{
|
||||
struct snd_soc_card *card = snd_kcontrol_chip(kcontrol);
|
||||
|
||||
if (n810_spk_func == ucontrol->value.integer.value[0])
|
||||
if (n810_spk_func == ucontrol->value.enumerated.item[0])
|
||||
return 0;
|
||||
|
||||
n810_spk_func = ucontrol->value.integer.value[0];
|
||||
n810_spk_func = ucontrol->value.enumerated.item[0];
|
||||
n810_ext_control(&card->dapm);
|
||||
|
||||
return 1;
|
||||
@ -155,7 +155,7 @@ static int n810_set_spk(struct snd_kcontrol *kcontrol,
|
||||
static int n810_get_jack(struct snd_kcontrol *kcontrol,
|
||||
struct snd_ctl_elem_value *ucontrol)
|
||||
{
|
||||
ucontrol->value.integer.value[0] = n810_jack_func;
|
||||
ucontrol->value.enumerated.item[0] = n810_jack_func;
|
||||
|
||||
return 0;
|
||||
}
|
||||
@ -165,10 +165,10 @@ static int n810_set_jack(struct snd_kcontrol *kcontrol,
|
||||
{
|
||||
struct snd_soc_card *card = snd_kcontrol_chip(kcontrol);
|
||||
|
||||
if (n810_jack_func == ucontrol->value.integer.value[0])
|
||||
if (n810_jack_func == ucontrol->value.enumerated.item[0])
|
||||
return 0;
|
||||
|
||||
n810_jack_func = ucontrol->value.integer.value[0];
|
||||
n810_jack_func = ucontrol->value.enumerated.item[0];
|
||||
n810_ext_control(&card->dapm);
|
||||
|
||||
return 1;
|
||||
@ -177,7 +177,7 @@ static int n810_set_jack(struct snd_kcontrol *kcontrol,
|
||||
static int n810_get_input(struct snd_kcontrol *kcontrol,
|
||||
struct snd_ctl_elem_value *ucontrol)
|
||||
{
|
||||
ucontrol->value.integer.value[0] = n810_dmic_func;
|
||||
ucontrol->value.enumerated.item[0] = n810_dmic_func;
|
||||
|
||||
return 0;
|
||||
}
|
||||
@ -187,10 +187,10 @@ static int n810_set_input(struct snd_kcontrol *kcontrol,
|
||||
{
|
||||
struct snd_soc_card *card = snd_kcontrol_chip(kcontrol);
|
||||
|
||||
if (n810_dmic_func == ucontrol->value.integer.value[0])
|
||||
if (n810_dmic_func == ucontrol->value.enumerated.item[0])
|
||||
return 0;
|
||||
|
||||
n810_dmic_func = ucontrol->value.integer.value[0];
|
||||
n810_dmic_func = ucontrol->value.enumerated.item[0];
|
||||
n810_ext_control(&card->dapm);
|
||||
|
||||
return 1;
|
||||
|
@ -132,7 +132,7 @@ static struct snd_soc_ops rx51_ops = {
|
||||
static int rx51_get_spk(struct snd_kcontrol *kcontrol,
|
||||
struct snd_ctl_elem_value *ucontrol)
|
||||
{
|
||||
ucontrol->value.integer.value[0] = rx51_spk_func;
|
||||
ucontrol->value.enumerated.item[0] = rx51_spk_func;
|
||||
|
||||
return 0;
|
||||
}
|
||||
@ -142,10 +142,10 @@ static int rx51_set_spk(struct snd_kcontrol *kcontrol,
|
||||
{
|
||||
struct snd_soc_card *card = snd_kcontrol_chip(kcontrol);
|
||||
|
||||
if (rx51_spk_func == ucontrol->value.integer.value[0])
|
||||
if (rx51_spk_func == ucontrol->value.enumerated.item[0])
|
||||
return 0;
|
||||
|
||||
rx51_spk_func = ucontrol->value.integer.value[0];
|
||||
rx51_spk_func = ucontrol->value.enumerated.item[0];
|
||||
rx51_ext_control(&card->dapm);
|
||||
|
||||
return 1;
|
||||
@ -180,7 +180,7 @@ static int rx51_hp_event(struct snd_soc_dapm_widget *w,
|
||||
static int rx51_get_input(struct snd_kcontrol *kcontrol,
|
||||
struct snd_ctl_elem_value *ucontrol)
|
||||
{
|
||||
ucontrol->value.integer.value[0] = rx51_dmic_func;
|
||||
ucontrol->value.enumerated.item[0] = rx51_dmic_func;
|
||||
|
||||
return 0;
|
||||
}
|
||||
@ -190,10 +190,10 @@ static int rx51_set_input(struct snd_kcontrol *kcontrol,
|
||||
{
|
||||
struct snd_soc_card *card = snd_kcontrol_chip(kcontrol);
|
||||
|
||||
if (rx51_dmic_func == ucontrol->value.integer.value[0])
|
||||
if (rx51_dmic_func == ucontrol->value.enumerated.item[0])
|
||||
return 0;
|
||||
|
||||
rx51_dmic_func = ucontrol->value.integer.value[0];
|
||||
rx51_dmic_func = ucontrol->value.enumerated.item[0];
|
||||
rx51_ext_control(&card->dapm);
|
||||
|
||||
return 1;
|
||||
@ -202,7 +202,7 @@ static int rx51_set_input(struct snd_kcontrol *kcontrol,
|
||||
static int rx51_get_jack(struct snd_kcontrol *kcontrol,
|
||||
struct snd_ctl_elem_value *ucontrol)
|
||||
{
|
||||
ucontrol->value.integer.value[0] = rx51_jack_func;
|
||||
ucontrol->value.enumerated.item[0] = rx51_jack_func;
|
||||
|
||||
return 0;
|
||||
}
|
||||
@ -212,10 +212,10 @@ static int rx51_set_jack(struct snd_kcontrol *kcontrol,
|
||||
{
|
||||
struct snd_soc_card *card = snd_kcontrol_chip(kcontrol);
|
||||
|
||||
if (rx51_jack_func == ucontrol->value.integer.value[0])
|
||||
if (rx51_jack_func == ucontrol->value.enumerated.item[0])
|
||||
return 0;
|
||||
|
||||
rx51_jack_func = ucontrol->value.integer.value[0];
|
||||
rx51_jack_func = ucontrol->value.enumerated.item[0];
|
||||
rx51_ext_control(&card->dapm);
|
||||
|
||||
return 1;
|
||||
|
@ -163,7 +163,7 @@ static struct snd_soc_ops corgi_ops = {
|
||||
static int corgi_get_jack(struct snd_kcontrol *kcontrol,
|
||||
struct snd_ctl_elem_value *ucontrol)
|
||||
{
|
||||
ucontrol->value.integer.value[0] = corgi_jack_func;
|
||||
ucontrol->value.enumerated.item[0] = corgi_jack_func;
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -172,10 +172,10 @@ static int corgi_set_jack(struct snd_kcontrol *kcontrol,
|
||||
{
|
||||
struct snd_soc_card *card = snd_kcontrol_chip(kcontrol);
|
||||
|
||||
if (corgi_jack_func == ucontrol->value.integer.value[0])
|
||||
if (corgi_jack_func == ucontrol->value.enumerated.item[0])
|
||||
return 0;
|
||||
|
||||
corgi_jack_func = ucontrol->value.integer.value[0];
|
||||
corgi_jack_func = ucontrol->value.enumerated.item[0];
|
||||
corgi_ext_control(&card->dapm);
|
||||
return 1;
|
||||
}
|
||||
@ -183,7 +183,7 @@ static int corgi_set_jack(struct snd_kcontrol *kcontrol,
|
||||
static int corgi_get_spk(struct snd_kcontrol *kcontrol,
|
||||
struct snd_ctl_elem_value *ucontrol)
|
||||
{
|
||||
ucontrol->value.integer.value[0] = corgi_spk_func;
|
||||
ucontrol->value.enumerated.item[0] = corgi_spk_func;
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -192,10 +192,10 @@ static int corgi_set_spk(struct snd_kcontrol *kcontrol,
|
||||
{
|
||||
struct snd_soc_card *card = snd_kcontrol_chip(kcontrol);
|
||||
|
||||
if (corgi_spk_func == ucontrol->value.integer.value[0])
|
||||
if (corgi_spk_func == ucontrol->value.enumerated.item[0])
|
||||
return 0;
|
||||
|
||||
corgi_spk_func = ucontrol->value.integer.value[0];
|
||||
corgi_spk_func = ucontrol->value.enumerated.item[0];
|
||||
corgi_ext_control(&card->dapm);
|
||||
return 1;
|
||||
}
|
||||
|
@ -308,17 +308,17 @@ static int magician_set_spk(struct snd_kcontrol *kcontrol,
|
||||
static int magician_get_input(struct snd_kcontrol *kcontrol,
|
||||
struct snd_ctl_elem_value *ucontrol)
|
||||
{
|
||||
ucontrol->value.integer.value[0] = magician_in_sel;
|
||||
ucontrol->value.enumerated.item[0] = magician_in_sel;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int magician_set_input(struct snd_kcontrol *kcontrol,
|
||||
struct snd_ctl_elem_value *ucontrol)
|
||||
{
|
||||
if (magician_in_sel == ucontrol->value.integer.value[0])
|
||||
if (magician_in_sel == ucontrol->value.enumerated.item[0])
|
||||
return 0;
|
||||
|
||||
magician_in_sel = ucontrol->value.integer.value[0];
|
||||
magician_in_sel = ucontrol->value.enumerated.item[0];
|
||||
|
||||
switch (magician_in_sel) {
|
||||
case MAGICIAN_MIC:
|
||||
|
@ -138,7 +138,7 @@ static struct snd_soc_ops poodle_ops = {
|
||||
static int poodle_get_jack(struct snd_kcontrol *kcontrol,
|
||||
struct snd_ctl_elem_value *ucontrol)
|
||||
{
|
||||
ucontrol->value.integer.value[0] = poodle_jack_func;
|
||||
ucontrol->value.enumerated.item[0] = poodle_jack_func;
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -147,10 +147,10 @@ static int poodle_set_jack(struct snd_kcontrol *kcontrol,
|
||||
{
|
||||
struct snd_soc_card *card = snd_kcontrol_chip(kcontrol);
|
||||
|
||||
if (poodle_jack_func == ucontrol->value.integer.value[0])
|
||||
if (poodle_jack_func == ucontrol->value.enumerated.item[0])
|
||||
return 0;
|
||||
|
||||
poodle_jack_func = ucontrol->value.integer.value[0];
|
||||
poodle_jack_func = ucontrol->value.enumerated.item[0];
|
||||
poodle_ext_control(&card->dapm);
|
||||
return 1;
|
||||
}
|
||||
@ -158,7 +158,7 @@ static int poodle_set_jack(struct snd_kcontrol *kcontrol,
|
||||
static int poodle_get_spk(struct snd_kcontrol *kcontrol,
|
||||
struct snd_ctl_elem_value *ucontrol)
|
||||
{
|
||||
ucontrol->value.integer.value[0] = poodle_spk_func;
|
||||
ucontrol->value.enumerated.item[0] = poodle_spk_func;
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -167,10 +167,10 @@ static int poodle_set_spk(struct snd_kcontrol *kcontrol,
|
||||
{
|
||||
struct snd_soc_card *card = snd_kcontrol_chip(kcontrol);
|
||||
|
||||
if (poodle_spk_func == ucontrol->value.integer.value[0])
|
||||
if (poodle_spk_func == ucontrol->value.enumerated.item[0])
|
||||
return 0;
|
||||
|
||||
poodle_spk_func = ucontrol->value.integer.value[0];
|
||||
poodle_spk_func = ucontrol->value.enumerated.item[0];
|
||||
poodle_ext_control(&card->dapm);
|
||||
return 1;
|
||||
}
|
||||
|
@ -164,7 +164,7 @@ static struct snd_soc_ops spitz_ops = {
|
||||
static int spitz_get_jack(struct snd_kcontrol *kcontrol,
|
||||
struct snd_ctl_elem_value *ucontrol)
|
||||
{
|
||||
ucontrol->value.integer.value[0] = spitz_jack_func;
|
||||
ucontrol->value.enumerated.item[0] = spitz_jack_func;
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -173,10 +173,10 @@ static int spitz_set_jack(struct snd_kcontrol *kcontrol,
|
||||
{
|
||||
struct snd_soc_card *card = snd_kcontrol_chip(kcontrol);
|
||||
|
||||
if (spitz_jack_func == ucontrol->value.integer.value[0])
|
||||
if (spitz_jack_func == ucontrol->value.enumerated.item[0])
|
||||
return 0;
|
||||
|
||||
spitz_jack_func = ucontrol->value.integer.value[0];
|
||||
spitz_jack_func = ucontrol->value.enumerated.item[0];
|
||||
spitz_ext_control(&card->dapm);
|
||||
return 1;
|
||||
}
|
||||
@ -184,7 +184,7 @@ static int spitz_set_jack(struct snd_kcontrol *kcontrol,
|
||||
static int spitz_get_spk(struct snd_kcontrol *kcontrol,
|
||||
struct snd_ctl_elem_value *ucontrol)
|
||||
{
|
||||
ucontrol->value.integer.value[0] = spitz_spk_func;
|
||||
ucontrol->value.enumerated.item[0] = spitz_spk_func;
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -193,10 +193,10 @@ static int spitz_set_spk(struct snd_kcontrol *kcontrol,
|
||||
{
|
||||
struct snd_soc_card *card = snd_kcontrol_chip(kcontrol);
|
||||
|
||||
if (spitz_spk_func == ucontrol->value.integer.value[0])
|
||||
if (spitz_spk_func == ucontrol->value.enumerated.item[0])
|
||||
return 0;
|
||||
|
||||
spitz_spk_func = ucontrol->value.integer.value[0];
|
||||
spitz_spk_func = ucontrol->value.enumerated.item[0];
|
||||
spitz_ext_control(&card->dapm);
|
||||
return 1;
|
||||
}
|
||||
|
@ -95,7 +95,7 @@ static struct snd_soc_ops tosa_ops = {
|
||||
static int tosa_get_jack(struct snd_kcontrol *kcontrol,
|
||||
struct snd_ctl_elem_value *ucontrol)
|
||||
{
|
||||
ucontrol->value.integer.value[0] = tosa_jack_func;
|
||||
ucontrol->value.enumerated.item[0] = tosa_jack_func;
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -104,10 +104,10 @@ static int tosa_set_jack(struct snd_kcontrol *kcontrol,
|
||||
{
|
||||
struct snd_soc_card *card = snd_kcontrol_chip(kcontrol);
|
||||
|
||||
if (tosa_jack_func == ucontrol->value.integer.value[0])
|
||||
if (tosa_jack_func == ucontrol->value.enumerated.item[0])
|
||||
return 0;
|
||||
|
||||
tosa_jack_func = ucontrol->value.integer.value[0];
|
||||
tosa_jack_func = ucontrol->value.enumerated.item[0];
|
||||
tosa_ext_control(&card->dapm);
|
||||
return 1;
|
||||
}
|
||||
@ -115,7 +115,7 @@ static int tosa_set_jack(struct snd_kcontrol *kcontrol,
|
||||
static int tosa_get_spk(struct snd_kcontrol *kcontrol,
|
||||
struct snd_ctl_elem_value *ucontrol)
|
||||
{
|
||||
ucontrol->value.integer.value[0] = tosa_spk_func;
|
||||
ucontrol->value.enumerated.item[0] = tosa_spk_func;
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -124,10 +124,10 @@ static int tosa_set_spk(struct snd_kcontrol *kcontrol,
|
||||
{
|
||||
struct snd_soc_card *card = snd_kcontrol_chip(kcontrol);
|
||||
|
||||
if (tosa_spk_func == ucontrol->value.integer.value[0])
|
||||
if (tosa_spk_func == ucontrol->value.enumerated.item[0])
|
||||
return 0;
|
||||
|
||||
tosa_spk_func = ucontrol->value.integer.value[0];
|
||||
tosa_spk_func = ucontrol->value.enumerated.item[0];
|
||||
tosa_ext_control(&card->dapm);
|
||||
return 1;
|
||||
}
|
||||
|
@ -355,7 +355,6 @@ static struct regmap_config lpass_cpu_regmap_config = {
|
||||
.readable_reg = lpass_cpu_regmap_readable,
|
||||
.volatile_reg = lpass_cpu_regmap_volatile,
|
||||
.cache_type = REGCACHE_FLAT,
|
||||
.val_format_endian = REGMAP_ENDIAN_LITTLE,
|
||||
};
|
||||
|
||||
int asoc_qcom_lpass_cpu_platform_probe(struct platform_device *pdev)
|
||||
|
@ -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);
|
||||
|
||||
|
@ -3573,7 +3573,7 @@ static int snd_soc_dapm_dai_link_get(struct snd_kcontrol *kcontrol,
|
||||
{
|
||||
struct snd_soc_dapm_widget *w = snd_kcontrol_chip(kcontrol);
|
||||
|
||||
ucontrol->value.integer.value[0] = w->params_select;
|
||||
ucontrol->value.enumerated.item[0] = w->params_select;
|
||||
|
||||
return 0;
|
||||
}
|
||||
@ -3587,13 +3587,13 @@ static int snd_soc_dapm_dai_link_put(struct snd_kcontrol *kcontrol,
|
||||
if (w->power)
|
||||
return -EBUSY;
|
||||
|
||||
if (ucontrol->value.integer.value[0] == w->params_select)
|
||||
if (ucontrol->value.enumerated.item[0] == w->params_select)
|
||||
return 0;
|
||||
|
||||
if (ucontrol->value.integer.value[0] >= w->num_params)
|
||||
if (ucontrol->value.enumerated.item[0] >= w->num_params)
|
||||
return -EINVAL;
|
||||
|
||||
w->params_select = ucontrol->value.integer.value[0];
|
||||
w->params_select = ucontrol->value.enumerated.item[0];
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user