Skip to content

Commit

Permalink
Merge tag 'asoc-fix-v4.5-rc6' into asoc-linus
Browse files Browse the repository at this point in the history
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 <[email protected]>"
# gpg:                 aka "Mark Brown <[email protected]>"
# gpg:                 aka "Mark Brown <[email protected]>"
# gpg:                 aka "Mark Brown <[email protected]>"
# gpg:                 aka "Mark Brown <[email protected]>"
# gpg:                 aka "Mark Brown <[email protected]>"
  • Loading branch information
broonie committed Mar 13, 2016
2 parents f6cede5 + 02db17f commit e87fb3b
Show file tree
Hide file tree
Showing 33 changed files with 162 additions and 160 deletions.
8 changes: 4 additions & 4 deletions include/trace/events/asoc.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
),
Expand All @@ -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;
),

Expand Down
8 changes: 4 additions & 4 deletions sound/soc/codecs/ab8500-codec.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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]);
Expand Down Expand Up @@ -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;
Expand All @@ -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;
Expand Down
6 changes: 3 additions & 3 deletions sound/soc/codecs/adau17x1.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
8 changes: 4 additions & 4 deletions sound/soc/codecs/cs42l51.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand All @@ -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;
Expand Down
8 changes: 4 additions & 4 deletions sound/soc/codecs/da732x.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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;
}

Expand Down
2 changes: 1 addition & 1 deletion sound/soc/codecs/max98088.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions sound/soc/codecs/max98095.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down
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
Loading

0 comments on commit e87fb3b

Please sign in to comment.