Skip to content

Commit e9d99a1

Browse files
committed
Merge tag 'sound-3.17-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound
Pull sound fixes from Takashi Iwai: "A bunch of ASoC fixes with a few HD-audio fixes in this pull request. All fairly small, boring and device-specific fixes, in addition to MAINTAINERS update for better reviewing" * tag 'sound-3.17-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: ALSA: hda/hdmi - apply Valleyview fix-ups to Cherryview display codec ALSA: hda/hdmi - set depop_delay for haswell plus ALSA: hda - restore the gpio led after resume ALSA: hda/realtek - Avoid setting wrong COEF on ALC269 & co ASoC: pxa-ssp: drop SNDRV_PCM_FMTBIT_S24_LE ASoC: fsl-esai: Revert .xlate_tdm_slot_mask() support ASoC: mcasp: Fix implicit BLCK divider setting ASoC: arizona: Fix TDM slot length handling in arizona_hw_params ASoC: pcm512x: Correct Digital Playback control names ASoC: dapm: Fix uninitialized variable in snd_soc_dapm_get_enum_double() ASoC: Intel: Restore Baytrail ADSP streams only when ADSP was in reset ASoC: Intel: Wait Baytrail ADSP boot at resume_early stage ASoC: Intel: Merge Baytrail ADSP suspend_noirq into suspend_late MAINTAINERS: Add i.MX maintainers and paths to Freescale ASoC entry ASoC: Intel: Update Baytrail ADSP firmware name
2 parents 29fdd5b + ca2e722 commit e9d99a1

File tree

14 files changed

+74
-68
lines changed

14 files changed

+74
-68
lines changed

MAINTAINERS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3843,10 +3843,13 @@ F: drivers/tty/serial/ucc_uart.c
38433843

38443844
FREESCALE SOC SOUND DRIVERS
38453845
M: Timur Tabi <timur@tabi.org>
3846+
M: Nicolin Chen <nicoleotsuka@gmail.com>
3847+
M: Xiubo Li <Li.Xiubo@freescale.com>
38463848
L: alsa-devel@alsa-project.org (moderated for non-subscribers)
38473849
L: linuxppc-dev@lists.ozlabs.org
38483850
S: Maintained
38493851
F: sound/soc/fsl/fsl*
3852+
F: sound/soc/fsl/imx*
38503853
F: sound/soc/fsl/mpc8610_hpcd.c
38513854

38523855
FREEVXFS FILESYSTEM

sound/pci/hda/patch_hdmi.c

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ MODULE_PARM_DESC(static_hdmi_pcm, "Don't restrict PCM parameters per ELD info");
5050
#define is_haswell_plus(codec) (is_haswell(codec) || is_broadwell(codec))
5151

5252
#define is_valleyview(codec) ((codec)->vendor_id == 0x80862882)
53+
#define is_cherryview(codec) ((codec)->vendor_id == 0x80862883)
54+
#define is_valleyview_plus(codec) (is_valleyview(codec) || is_cherryview(codec))
5355

5456
struct hdmi_spec_per_cvt {
5557
hda_nid_t cvt_nid;
@@ -1459,7 +1461,7 @@ static int hdmi_pcm_open(struct hda_pcm_stream *hinfo,
14591461
mux_idx);
14601462

14611463
/* configure unused pins to choose other converters */
1462-
if (is_haswell_plus(codec) || is_valleyview(codec))
1464+
if (is_haswell_plus(codec) || is_valleyview_plus(codec))
14631465
intel_not_share_assigned_cvt(codec, per_pin->pin_nid, mux_idx);
14641466

14651467
snd_hda_spdif_ctls_assign(codec, pin_idx, per_cvt->cvt_nid);
@@ -1598,7 +1600,8 @@ static bool hdmi_present_sense(struct hdmi_spec_per_pin *per_pin, int repoll)
15981600
* and this can make HW reset converter selection on a pin.
15991601
*/
16001602
if (eld->eld_valid && !old_eld_valid && per_pin->setup) {
1601-
if (is_haswell_plus(codec) || is_valleyview(codec)) {
1603+
if (is_haswell_plus(codec) ||
1604+
is_valleyview_plus(codec)) {
16021605
intel_verify_pin_cvt_connect(codec, per_pin);
16031606
intel_not_share_assigned_cvt(codec, pin_nid,
16041607
per_pin->mux_idx);
@@ -1779,7 +1782,7 @@ static int generic_hdmi_playback_pcm_prepare(struct hda_pcm_stream *hinfo,
17791782
bool non_pcm;
17801783
int pinctl;
17811784

1782-
if (is_haswell_plus(codec) || is_valleyview(codec)) {
1785+
if (is_haswell_plus(codec) || is_valleyview_plus(codec)) {
17831786
/* Verify pin:cvt selections to avoid silent audio after S3.
17841787
* After S3, the audio driver restores pin:cvt selections
17851788
* but this can happen before gfx is ready and such selection
@@ -2330,9 +2333,8 @@ static int patch_generic_hdmi(struct hda_codec *codec)
23302333
intel_haswell_fixup_enable_dp12(codec);
23312334
}
23322335

2333-
if (is_haswell(codec) || is_valleyview(codec)) {
2336+
if (is_haswell_plus(codec) || is_valleyview_plus(codec))
23342337
codec->depop_delay = 0;
2335-
}
23362338

23372339
if (hdmi_parse_codec(codec) < 0) {
23382340
codec->spec = NULL;

sound/pci/hda/patch_realtek.c

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,8 @@ static void alc_fix_pll(struct hda_codec *codec)
181181
spec->pll_coef_idx);
182182
val = snd_hda_codec_read(codec, spec->pll_nid, 0,
183183
AC_VERB_GET_PROC_COEF, 0);
184+
if (val == -1)
185+
return;
184186
snd_hda_codec_write(codec, spec->pll_nid, 0, AC_VERB_SET_COEF_INDEX,
185187
spec->pll_coef_idx);
186188
snd_hda_codec_write(codec, spec->pll_nid, 0, AC_VERB_SET_PROC_COEF,
@@ -2806,6 +2808,8 @@ static void alc286_shutup(struct hda_codec *codec)
28062808
static void alc269vb_toggle_power_output(struct hda_codec *codec, int power_up)
28072809
{
28082810
int val = alc_read_coef_idx(codec, 0x04);
2811+
if (val == -1)
2812+
return;
28092813
if (power_up)
28102814
val |= 1 << 11;
28112815
else
@@ -3264,6 +3268,15 @@ static int alc269_resume(struct hda_codec *codec)
32643268
snd_hda_codec_resume_cache(codec);
32653269
alc_inv_dmic_sync(codec, true);
32663270
hda_call_check_power_status(codec, 0x01);
3271+
3272+
/* on some machine, the BIOS will clear the codec gpio data when enter
3273+
* suspend, and won't restore the data after resume, so we restore it
3274+
* in the driver.
3275+
*/
3276+
if (spec->gpio_led)
3277+
snd_hda_codec_write(codec, codec->afg, 0, AC_VERB_SET_GPIO_DATA,
3278+
spec->gpio_led);
3279+
32673280
if (spec->has_alc5505_dsp)
32683281
alc5505_dsp_resume(codec);
32693282

@@ -5311,27 +5324,30 @@ static void alc269_fill_coef(struct hda_codec *codec)
53115324
if ((alc_get_coef0(codec) & 0x00ff) == 0x017) {
53125325
val = alc_read_coef_idx(codec, 0x04);
53135326
/* Power up output pin */
5314-
alc_write_coef_idx(codec, 0x04, val | (1<<11));
5327+
if (val != -1)
5328+
alc_write_coef_idx(codec, 0x04, val | (1<<11));
53155329
}
53165330

53175331
if ((alc_get_coef0(codec) & 0x00ff) == 0x018) {
53185332
val = alc_read_coef_idx(codec, 0xd);
5319-
if ((val & 0x0c00) >> 10 != 0x1) {
5333+
if (val != -1 && (val & 0x0c00) >> 10 != 0x1) {
53205334
/* Capless ramp up clock control */
53215335
alc_write_coef_idx(codec, 0xd, val | (1<<10));
53225336
}
53235337
val = alc_read_coef_idx(codec, 0x17);
5324-
if ((val & 0x01c0) >> 6 != 0x4) {
5338+
if (val != -1 && (val & 0x01c0) >> 6 != 0x4) {
53255339
/* Class D power on reset */
53265340
alc_write_coef_idx(codec, 0x17, val | (1<<7));
53275341
}
53285342
}
53295343

53305344
val = alc_read_coef_idx(codec, 0xd); /* Class D */
5331-
alc_write_coef_idx(codec, 0xd, val | (1<<14));
5345+
if (val != -1)
5346+
alc_write_coef_idx(codec, 0xd, val | (1<<14));
53325347

53335348
val = alc_read_coef_idx(codec, 0x4); /* HP */
5334-
alc_write_coef_idx(codec, 0x4, val | (1<<11));
5349+
if (val != -1)
5350+
alc_write_coef_idx(codec, 0x4, val | (1<<11));
53355351
}
53365352

53375353
/*

sound/soc/codecs/arizona.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1278,13 +1278,16 @@ static int arizona_hw_params(struct snd_pcm_substream *substream,
12781278
else
12791279
rates = &arizona_48k_bclk_rates[0];
12801280

1281+
wl = snd_pcm_format_width(params_format(params));
1282+
12811283
if (tdm_slots) {
12821284
arizona_aif_dbg(dai, "Configuring for %d %d bit TDM slots\n",
12831285
tdm_slots, tdm_width);
12841286
bclk_target = tdm_slots * tdm_width * params_rate(params);
12851287
channels = tdm_slots;
12861288
} else {
12871289
bclk_target = snd_soc_params_to_bclk(params);
1290+
tdm_width = wl;
12881291
}
12891292

12901293
if (chan_limit && chan_limit < channels) {
@@ -1319,8 +1322,7 @@ static int arizona_hw_params(struct snd_pcm_substream *substream,
13191322
arizona_aif_dbg(dai, "BCLK %dHz LRCLK %dHz\n",
13201323
rates[bclk], rates[bclk] / lrclk);
13211324

1322-
wl = snd_pcm_format_width(params_format(params));
1323-
frame = wl << ARIZONA_AIF1TX_WL_SHIFT | wl;
1325+
frame = wl << ARIZONA_AIF1TX_WL_SHIFT | tdm_width;
13241326

13251327
reconfig = arizona_aif_cfg_changed(codec, base, bclk, lrclk, frame);
13261328

sound/soc/codecs/pcm512x.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -259,13 +259,13 @@ static const struct soc_enum pcm512x_veds =
259259
pcm512x_ramp_step_text);
260260

261261
static const struct snd_kcontrol_new pcm512x_controls[] = {
262-
SOC_DOUBLE_R_TLV("Playback Digital Volume", PCM512x_DIGITAL_VOLUME_2,
262+
SOC_DOUBLE_R_TLV("Digital Playback Volume", PCM512x_DIGITAL_VOLUME_2,
263263
PCM512x_DIGITAL_VOLUME_3, 0, 255, 1, digital_tlv),
264264
SOC_DOUBLE_TLV("Playback Volume", PCM512x_ANALOG_GAIN_CTRL,
265265
PCM512x_LAGN_SHIFT, PCM512x_RAGN_SHIFT, 1, 1, analog_tlv),
266266
SOC_DOUBLE_TLV("Playback Boost Volume", PCM512x_ANALOG_GAIN_BOOST,
267267
PCM512x_AGBL_SHIFT, PCM512x_AGBR_SHIFT, 1, 0, boost_tlv),
268-
SOC_DOUBLE("Playback Digital Switch", PCM512x_MUTE, PCM512x_RQML_SHIFT,
268+
SOC_DOUBLE("Digital Playback Switch", PCM512x_MUTE, PCM512x_RQML_SHIFT,
269269
PCM512x_RQMR_SHIFT, 1, 1),
270270

271271
SOC_SINGLE("Deemphasis Switch", PCM512x_DSP, PCM512x_DEMP_SHIFT, 1, 1),

sound/soc/davinci/davinci-mcasp.c

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -403,7 +403,8 @@ static int davinci_mcasp_set_dai_fmt(struct snd_soc_dai *cpu_dai,
403403
return ret;
404404
}
405405

406-
static int davinci_mcasp_set_clkdiv(struct snd_soc_dai *dai, int div_id, int div)
406+
static int __davinci_mcasp_set_clkdiv(struct snd_soc_dai *dai, int div_id,
407+
int div, bool explicit)
407408
{
408409
struct davinci_mcasp *mcasp = snd_soc_dai_get_drvdata(dai);
409410

@@ -420,7 +421,8 @@ static int davinci_mcasp_set_clkdiv(struct snd_soc_dai *dai, int div_id, int div
420421
ACLKXDIV(div - 1), ACLKXDIV_MASK);
421422
mcasp_mod_bits(mcasp, DAVINCI_MCASP_ACLKRCTL_REG,
422423
ACLKRDIV(div - 1), ACLKRDIV_MASK);
423-
mcasp->bclk_div = div;
424+
if (explicit)
425+
mcasp->bclk_div = div;
424426
break;
425427

426428
case 2: /* BCLK/LRCLK ratio */
@@ -434,6 +436,12 @@ static int davinci_mcasp_set_clkdiv(struct snd_soc_dai *dai, int div_id, int div
434436
return 0;
435437
}
436438

439+
static int davinci_mcasp_set_clkdiv(struct snd_soc_dai *dai, int div_id,
440+
int div)
441+
{
442+
return __davinci_mcasp_set_clkdiv(dai, div_id, div, 1);
443+
}
444+
437445
static int davinci_mcasp_set_sysclk(struct snd_soc_dai *dai, int clk_id,
438446
unsigned int freq, int dir)
439447
{
@@ -738,7 +746,7 @@ static int davinci_mcasp_hw_params(struct snd_pcm_substream *substream,
738746
"Inaccurate BCLK: %u Hz / %u != %u Hz\n",
739747
mcasp->sysclk_freq, div, bclk_freq);
740748
}
741-
davinci_mcasp_set_clkdiv(cpu_dai, 1, div);
749+
__davinci_mcasp_set_clkdiv(cpu_dai, 1, div, 0);
742750
}
743751

744752
ret = mcasp_common_hw_param(mcasp, substream->stream,

sound/soc/fsl/Kconfig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ config SND_SOC_FSL_ESAI
4949
tristate "Enhanced Serial Audio Interface (ESAI) module support"
5050
select REGMAP_MMIO
5151
select SND_SOC_IMX_PCM_DMA if SND_IMX_SOC != n
52-
select SND_SOC_FSL_UTILS
5352
help
5453
Say Y if you want to add Enhanced Synchronous Audio Interface
5554
(ESAI) support for the Freescale CPUs.

sound/soc/fsl/fsl_esai.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818

1919
#include "fsl_esai.h"
2020
#include "imx-pcm.h"
21-
#include "fsl_utils.h"
2221

2322
#define FSL_ESAI_RATES SNDRV_PCM_RATE_8000_192000
2423
#define FSL_ESAI_FORMATS (SNDRV_PCM_FMTBIT_S8 | \
@@ -607,7 +606,6 @@ static struct snd_soc_dai_ops fsl_esai_dai_ops = {
607606
.hw_params = fsl_esai_hw_params,
608607
.set_sysclk = fsl_esai_set_dai_sysclk,
609608
.set_fmt = fsl_esai_set_dai_fmt,
610-
.xlate_tdm_slot_mask = fsl_asoc_xlate_tdm_slot_mask,
611609
.set_tdm_slot = fsl_esai_set_dai_tdm_slot,
612610
};
613611

sound/soc/intel/sst-acpi.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -246,8 +246,8 @@ static struct sst_acpi_desc sst_acpi_broadwell_desc = {
246246
};
247247

248248
static struct sst_acpi_mach baytrail_machines[] = {
249-
{ "10EC5640", "byt-rt5640", "intel/fw_sst_0f28.bin-i2s_master" },
250-
{ "193C9890", "byt-max98090", "intel/fw_sst_0f28.bin-i2s_master" },
249+
{ "10EC5640", "byt-rt5640", "intel/fw_sst_0f28.bin-48kHz_i2s_master" },
250+
{ "193C9890", "byt-max98090", "intel/fw_sst_0f28.bin-48kHz_i2s_master" },
251251
{}
252252
};
253253

sound/soc/intel/sst-baytrail-ipc.c

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -817,7 +817,7 @@ static struct sst_dsp_device byt_dev = {
817817
.ops = &sst_byt_ops,
818818
};
819819

820-
int sst_byt_dsp_suspend_noirq(struct device *dev, struct sst_pdata *pdata)
820+
int sst_byt_dsp_suspend_late(struct device *dev, struct sst_pdata *pdata)
821821
{
822822
struct sst_byt *byt = pdata->dsp;
823823

@@ -826,14 +826,6 @@ int sst_byt_dsp_suspend_noirq(struct device *dev, struct sst_pdata *pdata)
826826
sst_byt_drop_all(byt);
827827
dev_dbg(byt->dev, "dsp in reset\n");
828828

829-
return 0;
830-
}
831-
EXPORT_SYMBOL_GPL(sst_byt_dsp_suspend_noirq);
832-
833-
int sst_byt_dsp_suspend_late(struct device *dev, struct sst_pdata *pdata)
834-
{
835-
struct sst_byt *byt = pdata->dsp;
836-
837829
dev_dbg(byt->dev, "free all blocks and unload fw\n");
838830
sst_fw_unload(byt->fw);
839831

sound/soc/intel/sst-baytrail-ipc.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@ int sst_byt_get_dsp_position(struct sst_byt *byt,
6666
int sst_byt_dsp_init(struct device *dev, struct sst_pdata *pdata);
6767
void sst_byt_dsp_free(struct device *dev, struct sst_pdata *pdata);
6868
struct sst_dsp *sst_byt_get_dsp(struct sst_byt *byt);
69-
int sst_byt_dsp_suspend_noirq(struct device *dev, struct sst_pdata *pdata);
7069
int sst_byt_dsp_suspend_late(struct device *dev, struct sst_pdata *pdata);
7170
int sst_byt_dsp_boot(struct device *dev, struct sst_pdata *pdata);
7271
int sst_byt_dsp_wait_for_ready(struct device *dev, struct sst_pdata *pdata);

sound/soc/intel/sst-baytrail-pcm.c

Lines changed: 15 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,9 @@ struct sst_byt_priv_data {
5959

6060
/* DAI data */
6161
struct sst_byt_pcm_data pcm[BYT_PCM_COUNT];
62+
63+
/* flag indicating is stream context restore needed after suspend */
64+
bool restore_stream;
6265
};
6366

6467
/* this may get called several times by oss emulation */
@@ -184,7 +187,10 @@ static int sst_byt_pcm_trigger(struct snd_pcm_substream *substream, int cmd)
184187
sst_byt_stream_start(byt, pcm_data->stream, 0);
185188
break;
186189
case SNDRV_PCM_TRIGGER_RESUME:
187-
schedule_work(&pcm_data->work);
190+
if (pdata->restore_stream == true)
191+
schedule_work(&pcm_data->work);
192+
else
193+
sst_byt_stream_resume(byt, pcm_data->stream);
188194
break;
189195
case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
190196
sst_byt_stream_resume(byt, pcm_data->stream);
@@ -193,6 +199,7 @@ static int sst_byt_pcm_trigger(struct snd_pcm_substream *substream, int cmd)
193199
sst_byt_stream_stop(byt, pcm_data->stream);
194200
break;
195201
case SNDRV_PCM_TRIGGER_SUSPEND:
202+
pdata->restore_stream = false;
196203
case SNDRV_PCM_TRIGGER_PAUSE_PUSH:
197204
sst_byt_stream_pause(byt, pcm_data->stream);
198205
break;
@@ -404,26 +411,10 @@ static const struct snd_soc_component_driver byt_dai_component = {
404411
};
405412

406413
#ifdef CONFIG_PM
407-
static int sst_byt_pcm_dev_suspend_noirq(struct device *dev)
408-
{
409-
struct sst_pdata *sst_pdata = dev_get_platdata(dev);
410-
int ret;
411-
412-
dev_dbg(dev, "suspending noirq\n");
413-
414-
/* at this point all streams will be stopped and context saved */
415-
ret = sst_byt_dsp_suspend_noirq(dev, sst_pdata);
416-
if (ret < 0) {
417-
dev_err(dev, "failed to suspend %d\n", ret);
418-
return ret;
419-
}
420-
421-
return ret;
422-
}
423-
424414
static int sst_byt_pcm_dev_suspend_late(struct device *dev)
425415
{
426416
struct sst_pdata *sst_pdata = dev_get_platdata(dev);
417+
struct sst_byt_priv_data *priv_data = dev_get_drvdata(dev);
427418
int ret;
428419

429420
dev_dbg(dev, "suspending late\n");
@@ -434,34 +425,30 @@ static int sst_byt_pcm_dev_suspend_late(struct device *dev)
434425
return ret;
435426
}
436427

428+
priv_data->restore_stream = true;
429+
437430
return ret;
438431
}
439432

440433
static int sst_byt_pcm_dev_resume_early(struct device *dev)
441434
{
442435
struct sst_pdata *sst_pdata = dev_get_platdata(dev);
436+
int ret;
443437

444438
dev_dbg(dev, "resume early\n");
445439

446440
/* load fw and boot DSP */
447-
return sst_byt_dsp_boot(dev, sst_pdata);
448-
}
449-
450-
static int sst_byt_pcm_dev_resume(struct device *dev)
451-
{
452-
struct sst_pdata *sst_pdata = dev_get_platdata(dev);
453-
454-
dev_dbg(dev, "resume\n");
441+
ret = sst_byt_dsp_boot(dev, sst_pdata);
442+
if (ret)
443+
return ret;
455444

456445
/* wait for FW to finish booting */
457446
return sst_byt_dsp_wait_for_ready(dev, sst_pdata);
458447
}
459448

460449
static const struct dev_pm_ops sst_byt_pm_ops = {
461-
.suspend_noirq = sst_byt_pcm_dev_suspend_noirq,
462450
.suspend_late = sst_byt_pcm_dev_suspend_late,
463451
.resume_early = sst_byt_pcm_dev_resume_early,
464-
.resume = sst_byt_pcm_dev_resume,
465452
};
466453

467454
#define SST_BYT_PM_OPS (&sst_byt_pm_ops)

sound/soc/pxa/pxa-ssp.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -765,9 +765,7 @@ static int pxa_ssp_remove(struct snd_soc_dai *dai)
765765
SNDRV_PCM_RATE_48000 | SNDRV_PCM_RATE_64000 | \
766766
SNDRV_PCM_RATE_88200 | SNDRV_PCM_RATE_96000)
767767

768-
#define PXA_SSP_FORMATS (SNDRV_PCM_FMTBIT_S16_LE |\
769-
SNDRV_PCM_FMTBIT_S24_LE | \
770-
SNDRV_PCM_FMTBIT_S32_LE)
768+
#define PXA_SSP_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S32_LE)
771769

772770
static const struct snd_soc_dai_ops pxa_ssp_dai_ops = {
773771
.startup = pxa_ssp_startup,

0 commit comments

Comments
 (0)