Skip to content

Commit 27bcd37

Browse files
committed
Merge tag 'sound-4.9-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound
Pull sound fixes from Takashi Iwai: "This became a largish pull-request, as we've got a bunch of pending ASoC fixes at this time. One noticeable change is the removal of error directive in uapi/sound/asoc.h. We found that the API has been already used on Chromebooks, so we need to support it even now. A slight big LOC is found in Qualcomm lpass driver, but the rest are all small and easy fixes for ASoC drivers (sti, sun4i, Realtek codecs, Intel, tas571x, etc) in addition to the patches to harden the ALSA core proc file accesses" * tag 'sound-4.9-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: (26 commits) ALSA: info: Return error for invalid read/write ALSA: info: Limit the proc text input size ASoC: samsung: spdif: Fix DMA filter initialization ASoC: sun4i-codec: Enable bus clock after getting GPIO ASoC: lpass-cpu: add module licence and description ASoC: lpass-platform: Fix broken pcm data usage ASoC: sun4i-codec: return error code instead of NULL when create_card fails ASoC: hdmi-codec: Fix hdmi_of_xlate_dai_name when #sound-dai-cells = <0> ASoC: samsung: get access to DMA engine early to defer probe properly ASoC: da7219: Connect output enable register to DAIOUT ASoC: Intel: Skylake: Fix to turn off hdmi power on probe failure ASoC: sti-sas: enable fast io for regmap ASoC: sti: fix channel status update after playback start ASoC: PXA: Brownstone needs I2C ASoC: Intel: Skylake: Always acquire runtime pm ref on unload ASoC: Intel: Atom: add terminate entry for dmi_system_id tables ASoC: rt298: fix jack type detect error ASoC: rt5663: fix a debug statement ASoC: cs4270: fix DAPM stream name mismatch ASoC: Intel: haswell depends on sst-firmware ...
2 parents 3c6106d + 6809cd6 commit 27bcd37

File tree

25 files changed

+196
-194
lines changed

25 files changed

+196
-194
lines changed

include/uapi/sound/asoc.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,6 @@
1818
#include <linux/types.h>
1919
#include <sound/asound.h>
2020

21-
#ifndef __KERNEL__
22-
#error This API is an early revision and not enabled in the current
23-
#error kernel release, it will be enabled in a future kernel version
24-
#error with incompatible changes to what is here.
25-
#endif
26-
2721
/*
2822
* Maximum number of channels topology kcontrol can represent.
2923
*/

sound/core/info.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -325,10 +325,15 @@ static ssize_t snd_info_text_entry_write(struct file *file,
325325
size_t next;
326326
int err = 0;
327327

328+
if (!entry->c.text.write)
329+
return -EIO;
328330
pos = *offset;
329331
if (!valid_pos(pos, count))
330332
return -EIO;
331333
next = pos + count;
334+
/* don't handle too large text inputs */
335+
if (next > 16 * 1024)
336+
return -EIO;
332337
mutex_lock(&entry->access);
333338
buf = data->wbuffer;
334339
if (!buf) {
@@ -366,7 +371,9 @@ static int snd_info_seq_show(struct seq_file *seq, void *p)
366371
struct snd_info_private_data *data = seq->private;
367372
struct snd_info_entry *entry = data->entry;
368373

369-
if (entry->c.text.read) {
374+
if (!entry->c.text.read) {
375+
return -EIO;
376+
} else {
370377
data->rbuffer->buffer = (char *)seq; /* XXX hack! */
371378
entry->c.text.read(entry, data->rbuffer);
372379
}

sound/soc/codecs/cs4270.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -148,11 +148,11 @@ SND_SOC_DAPM_OUTPUT("AOUTR"),
148148
};
149149

150150
static const struct snd_soc_dapm_route cs4270_dapm_routes[] = {
151-
{ "Capture", NULL, "AINA" },
152-
{ "Capture", NULL, "AINB" },
151+
{ "Capture", NULL, "AINL" },
152+
{ "Capture", NULL, "AINR" },
153153

154-
{ "AOUTA", NULL, "Playback" },
155-
{ "AOUTB", NULL, "Playback" },
154+
{ "AOUTL", NULL, "Playback" },
155+
{ "AOUTR", NULL, "Playback" },
156156
};
157157

158158
/**

sound/soc/codecs/da7219.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -880,7 +880,8 @@ static const struct snd_soc_dapm_widget da7219_dapm_widgets[] = {
880880
SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMD),
881881

882882
/* DAI */
883-
SND_SOC_DAPM_AIF_OUT("DAIOUT", "Capture", 0, SND_SOC_NOPM, 0, 0),
883+
SND_SOC_DAPM_AIF_OUT("DAIOUT", "Capture", 0, DA7219_DAI_TDM_CTRL,
884+
DA7219_DAI_OE_SHIFT, DA7219_NO_INVERT),
884885
SND_SOC_DAPM_AIF_IN("DAIIN", "Playback", 0, SND_SOC_NOPM, 0, 0),
885886

886887
/* Output Muxes */

sound/soc/codecs/hdmi-codec.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,12 @@ static int hdmi_of_xlate_dai_name(struct snd_soc_component *component,
364364
struct of_phandle_args *args,
365365
const char **dai_name)
366366
{
367-
int id = args->args[0];
367+
int id;
368+
369+
if (args->args_count)
370+
id = args->args[0];
371+
else
372+
id = 0;
368373

369374
if (id < ARRAY_SIZE(hdmi_dai_name)) {
370375
*dai_name = hdmi_dai_name[id];

sound/soc/codecs/rt298.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,11 @@ static int rt298_jack_detect(struct rt298_priv *rt298, bool *hp, bool *mic)
249249
snd_soc_dapm_force_enable_pin(dapm, "LDO1");
250250
snd_soc_dapm_sync(dapm);
251251

252+
regmap_update_bits(rt298->regmap,
253+
RT298_POWER_CTRL1, 0x1001, 0);
254+
regmap_update_bits(rt298->regmap,
255+
RT298_POWER_CTRL2, 0x4, 0x4);
256+
252257
regmap_write(rt298->regmap, RT298_SET_MIC1, 0x24);
253258
msleep(50);
254259

sound/soc/codecs/rt5663.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1547,11 +1547,11 @@ static int rt5663_jack_detect(struct snd_soc_codec *codec, int jack_insert)
15471547
msleep(sleep_time[i]);
15481548
val = snd_soc_read(codec, RT5663_EM_JACK_TYPE_2) &
15491549
0x0003;
1550+
dev_dbg(codec->dev, "%s: MX-00e7 val=%x sleep %d\n",
1551+
__func__, val, sleep_time[i]);
15501552
i++;
15511553
if (val == 0x1 || val == 0x2 || val == 0x3)
15521554
break;
1553-
dev_dbg(codec->dev, "%s: MX-00e7 val=%x sleep %d\n",
1554-
__func__, val, sleep_time[i]);
15551555
}
15561556
dev_dbg(codec->dev, "%s val = %d\n", __func__, val);
15571557
switch (val) {

sound/soc/codecs/sti-sas.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -424,7 +424,7 @@ static const struct snd_soc_dai_ops stih407_dac_ops = {
424424
static const struct regmap_config stih407_sas_regmap = {
425425
.reg_bits = 32,
426426
.val_bits = 32,
427-
427+
.fast_io = true,
428428
.max_register = STIH407_AUDIO_DAC_CTRL,
429429
.reg_defaults = stih407_sas_reg_defaults,
430430
.num_reg_defaults = ARRAY_SIZE(stih407_sas_reg_defaults),

sound/soc/codecs/tas571x.c

Lines changed: 12 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -341,20 +341,9 @@ static int tas571x_set_bias_level(struct snd_soc_codec *codec,
341341
return ret;
342342
}
343343
}
344-
345-
gpiod_set_value(priv->pdn_gpio, 0);
346-
usleep_range(5000, 6000);
347-
348-
regcache_cache_only(priv->regmap, false);
349-
ret = regcache_sync(priv->regmap);
350-
if (ret)
351-
return ret;
352344
}
353345
break;
354346
case SND_SOC_BIAS_OFF:
355-
regcache_cache_only(priv->regmap, true);
356-
gpiod_set_value(priv->pdn_gpio, 1);
357-
358347
if (!IS_ERR(priv->mclk))
359348
clk_disable_unprepare(priv->mclk);
360349
break;
@@ -401,16 +390,6 @@ static const struct snd_kcontrol_new tas5711_controls[] = {
401390
TAS571X_SOFT_MUTE_REG,
402391
TAS571X_SOFT_MUTE_CH1_SHIFT, TAS571X_SOFT_MUTE_CH2_SHIFT,
403392
1, 1),
404-
405-
SOC_DOUBLE_R_RANGE("CH1 Mixer Volume",
406-
TAS5717_CH1_LEFT_CH_MIX_REG,
407-
TAS5717_CH1_RIGHT_CH_MIX_REG,
408-
16, 0, 0x80, 0),
409-
410-
SOC_DOUBLE_R_RANGE("CH2 Mixer Volume",
411-
TAS5717_CH2_LEFT_CH_MIX_REG,
412-
TAS5717_CH2_RIGHT_CH_MIX_REG,
413-
16, 0, 0x80, 0),
414393
};
415394

416395
static const struct regmap_range tas571x_readonly_regs_range[] = {
@@ -488,6 +467,16 @@ static const struct snd_kcontrol_new tas5717_controls[] = {
488467
TAS571X_SOFT_MUTE_CH1_SHIFT, TAS571X_SOFT_MUTE_CH2_SHIFT,
489468
1, 1),
490469

470+
SOC_DOUBLE_R_RANGE("CH1 Mixer Volume",
471+
TAS5717_CH1_LEFT_CH_MIX_REG,
472+
TAS5717_CH1_RIGHT_CH_MIX_REG,
473+
16, 0, 0x80, 0),
474+
475+
SOC_DOUBLE_R_RANGE("CH2 Mixer Volume",
476+
TAS5717_CH2_LEFT_CH_MIX_REG,
477+
TAS5717_CH2_RIGHT_CH_MIX_REG,
478+
16, 0, 0x80, 0),
479+
491480
/*
492481
* The biquads are named according to the register names.
493482
* Please note that TI's TAS57xx Graphical Development Environment
@@ -747,13 +736,14 @@ static int tas571x_i2c_probe(struct i2c_client *client,
747736
/* pulse the active low reset line for ~100us */
748737
usleep_range(100, 200);
749738
gpiod_set_value(priv->reset_gpio, 0);
750-
usleep_range(12000, 20000);
739+
usleep_range(13500, 20000);
751740
}
752741

753742
ret = regmap_write(priv->regmap, TAS571X_OSC_TRIM_REG, 0);
754743
if (ret)
755744
return ret;
756745

746+
usleep_range(50000, 60000);
757747

758748
memcpy(&priv->codec_driver, &tas571x_codec, sizeof(priv->codec_driver));
759749
priv->codec_driver.component_driver.controls = priv->chip->controls;
@@ -770,9 +760,6 @@ static int tas571x_i2c_probe(struct i2c_client *client,
770760
return ret;
771761
}
772762

773-
regcache_cache_only(priv->regmap, true);
774-
gpiod_set_value(priv->pdn_gpio, 1);
775-
776763
return snd_soc_register_codec(&client->dev, &priv->codec_driver,
777764
&tas571x_dai, 1);
778765
}

sound/soc/intel/Kconfig

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ config SND_SOC_INTEL_SST_MATCH
4747

4848
config SND_SOC_INTEL_HASWELL
4949
tristate
50+
select SND_SOC_INTEL_SST_FIRMWARE
5051

5152
config SND_SOC_INTEL_BAYTRAIL
5253
tristate
@@ -56,7 +57,6 @@ config SND_SOC_INTEL_HASWELL_MACH
5657
depends on X86_INTEL_LPSS && I2C && I2C_DESIGNWARE_PLATFORM
5758
depends on DW_DMAC_CORE
5859
select SND_SOC_INTEL_SST
59-
select SND_SOC_INTEL_SST_FIRMWARE
6060
select SND_SOC_INTEL_HASWELL
6161
select SND_SOC_RT5640
6262
help
@@ -138,7 +138,6 @@ config SND_SOC_INTEL_BROADWELL_MACH
138138
I2C_DESIGNWARE_PLATFORM
139139
depends on DW_DMAC_CORE
140140
select SND_SOC_INTEL_SST
141-
select SND_SOC_INTEL_SST_FIRMWARE
142141
select SND_SOC_INTEL_HASWELL
143142
select SND_SOC_RT286
144143
help

0 commit comments

Comments
 (0)