Skip to content

Commit

Permalink
Merge tag 'sound-4.5' of git://git.kernel.org/pub/scm/linux/kernel/gi…
Browse files Browse the repository at this point in the history
…t/tiwai/sound

Pull sound fixes from Takashi Iwai:
 "It's always an ambivalent feeling to send a large pull request at the
  late stage like this, especially when most of patches came from me.
  Anyway, this is a collection of lots of small fixes that slipped from
  the previous pull request.

  All fixes are about ASoC, and the majority of changes are corrections
  of the wrong access types in ALSA ctl enum items.  They are mostly
  harmless on 32bit architectures, but actually buggy on 64bit.  So we
  addressed all these now in a shot.  The rest are various small ASoC
  driver fixes.

  Among them, only two changes have been done to ASoC core, and both of
  them are trivial.  The rest are all device-specific.  So overall, they
  should be safe to apply"

* tag 'sound-4.5' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: (33 commits)
  ASoC: wm_adsp: Fix enum ctl accesses in a wrong type
  ASoC: wm9081: Fix enum ctl accesses in a wrong type
  ASoC: wm8996: Fix enum ctl accesses in a wrong type
  ASoC: wm8994: Fix enum ctl accesses in a wrong type
  ASoC: wm8985: Fix enum ctl accesses in a wrong type
  ASoC: wm8983: Fix enum ctl accesses in a wrong type
  ASoC: wm8958: Fix enum ctl accesses in a wrong type
  ASoC: wm8904: Fix enum ctl accesses in a wrong type
  ASoC: wm8753: Fix enum ctl accesses in a wrong type
  ASoC: wl1273: Fix enum ctl accesses in a wrong type
  ASoC: tlv320dac33: Fix enum ctl accesses in a wrong type
  ASoC: max98095: Fix enum ctl accesses in a wrong type
  ASoC: max98088: Fix enum ctl accesses in a wrong type
  ASoC: ab8500: Fix enum ctl accesses in a wrong type
  ASoC: da732x: Fix enum ctl accesses in a wrong type
  ASoC: cs42l51: Fix enum ctl accesses in a wrong type
  ASoC: intel: mfld: Fix enum ctl accesses in a wrong type
  ASoC: omap: rx51: Fix enum ctl accesses in a wrong type
  ASoC: omap: n810: Fix enum ctl accesses in a wrong type
  ASoC: pxa: tosa: Fix enum ctl accesses in a wrong type
  ...
  • Loading branch information
torvalds committed Mar 8, 2016
2 parents 1e2a4c7 + ad09ef2 commit 7f02bf6
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 7f02bf6

Please sign in to comment.