Skip to content

Commit f470b8c

Browse files
committed
Merge tag 'sound-3.7' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound
Pull sound fixes from Takashi Iwai: "The highlight of this update is the fixes for ASoC kirkwood by Russell. In addition to that, a couple of regression fixes for HD-audio due to the runtime PM support on 3.7, and other driver- specific regression fixes like USB MIDI on non-standard USB audio drivers." * tag 'sound-3.7' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: ALSA: snd-usb: properly initialize the sync endpoint ALSA: hda - Cirrus: Correctly clear line_out_pins when moving to speaker ALSA: hda - Add support for Realtek ALC292 ASoC: kirkwood-i2s: more pause-mode fixes ASoC: kirkwood-i2s: fix DMA underruns ASoC: kirkwood-i2s: fix DCO lock detection ASoC: kirkwood-dma: don't ignore other irq causes on error ASoC: kirkwood-dma: fix use of virt_to_phys() ALSA: hda - Limit runtime PM support only to known Intel chips ALSA: hda - Fix recursive suspend/resume call ALSA: ua101, usx2y: fix broken MIDI output ASoC: arizona: Fix typo - Swap value in 48k_rates[] and 44k1_rates[] ASoC: bells: Fix up git patch application failure ASoC: cs4271: free allocated GPIO
2 parents eb5aaed + 947d299 commit f470b8c

12 files changed

Lines changed: 84 additions & 75 deletions

File tree

sound/pci/hda/hda_codec.c

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ static int codec_exec_verb(struct hda_codec *codec, unsigned int cmd,
228228
}
229229
mutex_unlock(&bus->cmd_mutex);
230230
snd_hda_power_down(codec);
231-
if (res && *res == -1 && bus->rirb_error) {
231+
if (!codec->in_pm && res && *res == -1 && bus->rirb_error) {
232232
if (bus->response_reset) {
233233
snd_printd("hda_codec: resetting BUS due to "
234234
"fatal communication error\n");
@@ -238,7 +238,7 @@ static int codec_exec_verb(struct hda_codec *codec, unsigned int cmd,
238238
goto again;
239239
}
240240
/* clear reset-flag when the communication gets recovered */
241-
if (!err)
241+
if (!err || codec->in_pm)
242242
bus->response_reset = 0;
243243
return err;
244244
}
@@ -3616,6 +3616,8 @@ static unsigned int hda_call_codec_suspend(struct hda_codec *codec, bool in_wq)
36163616
{
36173617
unsigned int state;
36183618

3619+
codec->in_pm = 1;
3620+
36193621
if (codec->patch_ops.suspend)
36203622
codec->patch_ops.suspend(codec);
36213623
hda_cleanup_all_streams(codec);
@@ -3630,6 +3632,7 @@ static unsigned int hda_call_codec_suspend(struct hda_codec *codec, bool in_wq)
36303632
codec->power_transition = 0;
36313633
codec->power_jiffies = jiffies;
36323634
spin_unlock(&codec->power_lock);
3635+
codec->in_pm = 0;
36333636
return state;
36343637
}
36353638

@@ -3638,6 +3641,8 @@ static unsigned int hda_call_codec_suspend(struct hda_codec *codec, bool in_wq)
36383641
*/
36393642
static void hda_call_codec_resume(struct hda_codec *codec)
36403643
{
3644+
codec->in_pm = 1;
3645+
36413646
/* set as if powered on for avoiding re-entering the resume
36423647
* in the resume / power-save sequence
36433648
*/
@@ -3656,6 +3661,8 @@ static void hda_call_codec_resume(struct hda_codec *codec)
36563661
snd_hda_codec_resume_cache(codec);
36573662
}
36583663
snd_hda_jack_report_sync(codec);
3664+
3665+
codec->in_pm = 0;
36593666
snd_hda_power_down(codec); /* flag down before returning */
36603667
}
36613668
#endif /* CONFIG_PM */

sound/pci/hda/hda_codec.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -869,6 +869,7 @@ struct hda_codec {
869869
unsigned int power_on :1; /* current (global) power-state */
870870
unsigned int d3_stop_clk:1; /* support D3 operation without BCLK */
871871
unsigned int pm_down_notified:1; /* PM notified to controller */
872+
unsigned int in_pm:1; /* suspend/resume being performed */
872873
int power_transition; /* power-state in transition */
873874
int power_count; /* current (global) power refcount */
874875
struct delayed_work power_work; /* delayed task for powerdown */

sound/pci/hda/hda_intel.c

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -556,6 +556,12 @@ enum {
556556
#define AZX_DCAPS_ALIGN_BUFSIZE (1 << 22) /* buffer size alignment */
557557
#define AZX_DCAPS_4K_BDLE_BOUNDARY (1 << 23) /* BDLE in 4k boundary */
558558
#define AZX_DCAPS_COUNT_LPIB_DELAY (1 << 25) /* Take LPIB as delay */
559+
#define AZX_DCAPS_PM_RUNTIME (1 << 26) /* runtime PM support */
560+
561+
/* quirks for Intel PCH */
562+
#define AZX_DCAPS_INTEL_PCH \
563+
(AZX_DCAPS_SCH_SNOOP | AZX_DCAPS_BUFSIZE | \
564+
AZX_DCAPS_COUNT_LPIB_DELAY | AZX_DCAPS_PM_RUNTIME)
559565

560566
/* quirks for ATI SB / AMD Hudson */
561567
#define AZX_DCAPS_PRESET_ATI_SB \
@@ -2433,6 +2439,9 @@ static void azx_power_notify(struct hda_bus *bus, bool power_up)
24332439
{
24342440
struct azx *chip = bus->private_data;
24352441

2442+
if (!(chip->driver_caps & AZX_DCAPS_PM_RUNTIME))
2443+
return;
2444+
24362445
if (power_up)
24372446
pm_runtime_get_sync(&chip->pci->dev);
24382447
else
@@ -2548,7 +2557,8 @@ static int azx_runtime_suspend(struct device *dev)
25482557
struct snd_card *card = dev_get_drvdata(dev);
25492558
struct azx *chip = card->private_data;
25502559

2551-
if (!power_save_controller)
2560+
if (!power_save_controller ||
2561+
!(chip->driver_caps & AZX_DCAPS_PM_RUNTIME))
25522562
return -EAGAIN;
25532563

25542564
azx_stop_chip(chip);
@@ -3429,39 +3439,30 @@ static void __devexit azx_remove(struct pci_dev *pci)
34293439
static DEFINE_PCI_DEVICE_TABLE(azx_ids) = {
34303440
/* CPT */
34313441
{ PCI_DEVICE(0x8086, 0x1c20),
3432-
.driver_data = AZX_DRIVER_PCH | AZX_DCAPS_SCH_SNOOP |
3433-
AZX_DCAPS_BUFSIZE | AZX_DCAPS_COUNT_LPIB_DELAY },
3442+
.driver_data = AZX_DRIVER_PCH | AZX_DCAPS_INTEL_PCH },
34343443
/* PBG */
34353444
{ PCI_DEVICE(0x8086, 0x1d20),
3436-
.driver_data = AZX_DRIVER_PCH | AZX_DCAPS_SCH_SNOOP |
3437-
AZX_DCAPS_BUFSIZE},
3445+
.driver_data = AZX_DRIVER_PCH | AZX_DCAPS_INTEL_PCH },
34383446
/* Panther Point */
34393447
{ PCI_DEVICE(0x8086, 0x1e20),
3440-
.driver_data = AZX_DRIVER_PCH | AZX_DCAPS_SCH_SNOOP |
3441-
AZX_DCAPS_BUFSIZE | AZX_DCAPS_COUNT_LPIB_DELAY },
3448+
.driver_data = AZX_DRIVER_PCH | AZX_DCAPS_INTEL_PCH },
34423449
/* Lynx Point */
34433450
{ PCI_DEVICE(0x8086, 0x8c20),
3444-
.driver_data = AZX_DRIVER_PCH | AZX_DCAPS_SCH_SNOOP |
3445-
AZX_DCAPS_BUFSIZE | AZX_DCAPS_COUNT_LPIB_DELAY },
3451+
.driver_data = AZX_DRIVER_PCH | AZX_DCAPS_INTEL_PCH },
34463452
/* Lynx Point-LP */
34473453
{ PCI_DEVICE(0x8086, 0x9c20),
3448-
.driver_data = AZX_DRIVER_PCH | AZX_DCAPS_SCH_SNOOP |
3449-
AZX_DCAPS_BUFSIZE | AZX_DCAPS_COUNT_LPIB_DELAY },
3454+
.driver_data = AZX_DRIVER_PCH | AZX_DCAPS_INTEL_PCH },
34503455
/* Lynx Point-LP */
34513456
{ PCI_DEVICE(0x8086, 0x9c21),
3452-
.driver_data = AZX_DRIVER_PCH | AZX_DCAPS_SCH_SNOOP |
3453-
AZX_DCAPS_BUFSIZE | AZX_DCAPS_COUNT_LPIB_DELAY },
3457+
.driver_data = AZX_DRIVER_PCH | AZX_DCAPS_INTEL_PCH },
34543458
/* Haswell */
34553459
{ PCI_DEVICE(0x8086, 0x0c0c),
3456-
.driver_data = AZX_DRIVER_SCH | AZX_DCAPS_SCH_SNOOP |
3457-
AZX_DCAPS_BUFSIZE | AZX_DCAPS_COUNT_LPIB_DELAY },
3460+
.driver_data = AZX_DRIVER_SCH | AZX_DCAPS_INTEL_PCH },
34583461
{ PCI_DEVICE(0x8086, 0x0d0c),
3459-
.driver_data = AZX_DRIVER_SCH | AZX_DCAPS_SCH_SNOOP |
3460-
AZX_DCAPS_BUFSIZE | AZX_DCAPS_COUNT_LPIB_DELAY },
3462+
.driver_data = AZX_DRIVER_SCH | AZX_DCAPS_INTEL_PCH },
34613463
/* 5 Series/3400 */
34623464
{ PCI_DEVICE(0x8086, 0x3b56),
3463-
.driver_data = AZX_DRIVER_SCH | AZX_DCAPS_SCH_SNOOP |
3464-
AZX_DCAPS_BUFSIZE | AZX_DCAPS_COUNT_LPIB_DELAY },
3465+
.driver_data = AZX_DRIVER_SCH | AZX_DCAPS_INTEL_PCH },
34653466
/* SCH */
34663467
{ PCI_DEVICE(0x8086, 0x811b),
34673468
.driver_data = AZX_DRIVER_SCH | AZX_DCAPS_SCH_SNOOP |

sound/pci/hda/patch_cirrus.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -466,6 +466,7 @@ static int parse_output(struct hda_codec *codec)
466466
memcpy(cfg->speaker_pins, cfg->line_out_pins,
467467
sizeof(cfg->speaker_pins));
468468
cfg->line_outs = 0;
469+
memset(cfg->line_out_pins, 0, sizeof(cfg->line_out_pins));
469470
}
470471

471472
return 0;

sound/pci/hda/patch_realtek.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7065,6 +7065,7 @@ static const struct hda_codec_preset snd_hda_preset_realtek[] = {
70657065
{ .id = 0x10ec0282, .name = "ALC282", .patch = patch_alc269 },
70667066
{ .id = 0x10ec0283, .name = "ALC283", .patch = patch_alc269 },
70677067
{ .id = 0x10ec0290, .name = "ALC290", .patch = patch_alc269 },
7068+
{ .id = 0x10ec0292, .name = "ALC292", .patch = patch_alc269 },
70687069
{ .id = 0x10ec0861, .rev = 0x100340, .name = "ALC660",
70697070
.patch = patch_alc861 },
70707071
{ .id = 0x10ec0660, .name = "ALC660-VD", .patch = patch_alc861vd },

sound/soc/codecs/arizona.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ EXPORT_SYMBOL_GPL(arizona_out_ev);
268268
static unsigned int arizona_sysclk_48k_rates[] = {
269269
6144000,
270270
12288000,
271-
22579200,
271+
24576000,
272272
49152000,
273273
73728000,
274274
98304000,
@@ -278,7 +278,7 @@ static unsigned int arizona_sysclk_48k_rates[] = {
278278
static unsigned int arizona_sysclk_44k1_rates[] = {
279279
5644800,
280280
11289600,
281-
24576000,
281+
22579200,
282282
45158400,
283283
67737600,
284284
90316800,

sound/soc/codecs/cs4271.c

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -485,7 +485,7 @@ static int cs4271_probe(struct snd_soc_codec *codec)
485485
gpio_nreset = cs4271plat->gpio_nreset;
486486

487487
if (gpio_nreset >= 0)
488-
if (gpio_request(gpio_nreset, "CS4271 Reset"))
488+
if (devm_gpio_request(codec->dev, gpio_nreset, "CS4271 Reset"))
489489
gpio_nreset = -EINVAL;
490490
if (gpio_nreset >= 0) {
491491
/* Reset codec */
@@ -535,15 +535,10 @@ static int cs4271_probe(struct snd_soc_codec *codec)
535535
static int cs4271_remove(struct snd_soc_codec *codec)
536536
{
537537
struct cs4271_private *cs4271 = snd_soc_codec_get_drvdata(codec);
538-
int gpio_nreset;
539538

540-
gpio_nreset = cs4271->gpio_nreset;
541-
542-
if (gpio_is_valid(gpio_nreset)) {
539+
if (gpio_is_valid(cs4271->gpio_nreset))
543540
/* Set codec to the reset state */
544-
gpio_set_value(gpio_nreset, 0);
545-
gpio_free(gpio_nreset);
546-
}
541+
gpio_set_value(cs4271->gpio_nreset, 0);
547542

548543
return 0;
549544
};

sound/soc/kirkwood/kirkwood-dma.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@ static irqreturn_t kirkwood_dma_irq(int irq, void *dev_id)
7171
printk(KERN_WARNING "%s: got err interrupt 0x%lx\n",
7272
__func__, cause);
7373
writel(cause, priv->io + KIRKWOOD_ERR_CAUSE);
74-
return IRQ_HANDLED;
7574
}
7675

7776
/* we've enabled only bytes interrupts ... */
@@ -178,7 +177,7 @@ static int kirkwood_dma_open(struct snd_pcm_substream *substream)
178177
}
179178

180179
dram = mv_mbus_dram_info();
181-
addr = virt_to_phys(substream->dma_buffer.area);
180+
addr = substream->dma_buffer.addr;
182181
if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
183182
prdata->play_stream = substream;
184183
kirkwood_dma_conf_mbus_windows(priv->io,

sound/soc/kirkwood/kirkwood-i2s.c

Lines changed: 37 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ static inline void kirkwood_set_dco(void __iomem *io, unsigned long rate)
9595
do {
9696
cpu_relax();
9797
value = readl(io + KIRKWOOD_DCO_SPCR_STATUS);
98-
value &= KIRKWOOD_DCO_SPCR_STATUS;
98+
value &= KIRKWOOD_DCO_SPCR_STATUS_DCO_LOCK;
9999
} while (value == 0);
100100
}
101101

@@ -180,67 +180,72 @@ static int kirkwood_i2s_play_trigger(struct snd_pcm_substream *substream,
180180
int cmd, struct snd_soc_dai *dai)
181181
{
182182
struct kirkwood_dma_data *priv = snd_soc_dai_get_drvdata(dai);
183-
unsigned long value;
184-
185-
/*
186-
* specs says KIRKWOOD_PLAYCTL must be read 2 times before
187-
* changing it. So read 1 time here and 1 later.
188-
*/
189-
value = readl(priv->io + KIRKWOOD_PLAYCTL);
183+
uint32_t ctl, value;
184+
185+
ctl = readl(priv->io + KIRKWOOD_PLAYCTL);
186+
if (ctl & KIRKWOOD_PLAYCTL_PAUSE) {
187+
unsigned timeout = 5000;
188+
/*
189+
* The Armada510 spec says that if we enter pause mode, the
190+
* busy bit must be read back as clear _twice_. Make sure
191+
* we respect that otherwise we get DMA underruns.
192+
*/
193+
do {
194+
value = ctl;
195+
ctl = readl(priv->io + KIRKWOOD_PLAYCTL);
196+
if (!((ctl | value) & KIRKWOOD_PLAYCTL_PLAY_BUSY))
197+
break;
198+
udelay(1);
199+
} while (timeout--);
200+
201+
if ((ctl | value) & KIRKWOOD_PLAYCTL_PLAY_BUSY)
202+
dev_notice(dai->dev, "timed out waiting for busy to deassert: %08x\n",
203+
ctl);
204+
}
190205

191206
switch (cmd) {
192207
case SNDRV_PCM_TRIGGER_START:
193-
/* stop audio, enable interrupts */
194-
value = readl(priv->io + KIRKWOOD_PLAYCTL);
195-
value |= KIRKWOOD_PLAYCTL_PAUSE;
196-
writel(value, priv->io + KIRKWOOD_PLAYCTL);
197-
198208
value = readl(priv->io + KIRKWOOD_INT_MASK);
199209
value |= KIRKWOOD_INT_CAUSE_PLAY_BYTES;
200210
writel(value, priv->io + KIRKWOOD_INT_MASK);
201211

202212
/* configure audio & enable i2s playback */
203-
value = readl(priv->io + KIRKWOOD_PLAYCTL);
204-
value &= ~KIRKWOOD_PLAYCTL_BURST_MASK;
205-
value &= ~(KIRKWOOD_PLAYCTL_PAUSE | KIRKWOOD_PLAYCTL_I2S_MUTE
213+
ctl &= ~KIRKWOOD_PLAYCTL_BURST_MASK;
214+
ctl &= ~(KIRKWOOD_PLAYCTL_PAUSE | KIRKWOOD_PLAYCTL_I2S_MUTE
206215
| KIRKWOOD_PLAYCTL_SPDIF_EN);
207216

208217
if (priv->burst == 32)
209-
value |= KIRKWOOD_PLAYCTL_BURST_32;
218+
ctl |= KIRKWOOD_PLAYCTL_BURST_32;
210219
else
211-
value |= KIRKWOOD_PLAYCTL_BURST_128;
212-
value |= KIRKWOOD_PLAYCTL_I2S_EN;
213-
writel(value, priv->io + KIRKWOOD_PLAYCTL);
220+
ctl |= KIRKWOOD_PLAYCTL_BURST_128;
221+
ctl |= KIRKWOOD_PLAYCTL_I2S_EN;
222+
writel(ctl, priv->io + KIRKWOOD_PLAYCTL);
214223
break;
215224

216225
case SNDRV_PCM_TRIGGER_STOP:
217226
/* stop audio, disable interrupts */
218-
value = readl(priv->io + KIRKWOOD_PLAYCTL);
219-
value |= KIRKWOOD_PLAYCTL_PAUSE | KIRKWOOD_PLAYCTL_I2S_MUTE;
220-
writel(value, priv->io + KIRKWOOD_PLAYCTL);
227+
ctl |= KIRKWOOD_PLAYCTL_PAUSE | KIRKWOOD_PLAYCTL_I2S_MUTE;
228+
writel(ctl, priv->io + KIRKWOOD_PLAYCTL);
221229

222230
value = readl(priv->io + KIRKWOOD_INT_MASK);
223231
value &= ~KIRKWOOD_INT_CAUSE_PLAY_BYTES;
224232
writel(value, priv->io + KIRKWOOD_INT_MASK);
225233

226234
/* disable all playbacks */
227-
value = readl(priv->io + KIRKWOOD_PLAYCTL);
228-
value &= ~(KIRKWOOD_PLAYCTL_I2S_EN | KIRKWOOD_PLAYCTL_SPDIF_EN);
229-
writel(value, priv->io + KIRKWOOD_PLAYCTL);
235+
ctl &= ~(KIRKWOOD_PLAYCTL_I2S_EN | KIRKWOOD_PLAYCTL_SPDIF_EN);
236+
writel(ctl, priv->io + KIRKWOOD_PLAYCTL);
230237
break;
231238

232239
case SNDRV_PCM_TRIGGER_PAUSE_PUSH:
233240
case SNDRV_PCM_TRIGGER_SUSPEND:
234-
value = readl(priv->io + KIRKWOOD_PLAYCTL);
235-
value |= KIRKWOOD_PLAYCTL_PAUSE | KIRKWOOD_PLAYCTL_I2S_MUTE;
236-
writel(value, priv->io + KIRKWOOD_PLAYCTL);
241+
ctl |= KIRKWOOD_PLAYCTL_PAUSE | KIRKWOOD_PLAYCTL_I2S_MUTE;
242+
writel(ctl, priv->io + KIRKWOOD_PLAYCTL);
237243
break;
238244

239245
case SNDRV_PCM_TRIGGER_RESUME:
240246
case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
241-
value = readl(priv->io + KIRKWOOD_PLAYCTL);
242-
value &= ~(KIRKWOOD_PLAYCTL_PAUSE | KIRKWOOD_PLAYCTL_I2S_MUTE);
243-
writel(value, priv->io + KIRKWOOD_PLAYCTL);
247+
ctl &= ~(KIRKWOOD_PLAYCTL_PAUSE | KIRKWOOD_PLAYCTL_I2S_MUTE);
248+
writel(ctl, priv->io + KIRKWOOD_PLAYCTL);
244249
break;
245250

246251
default:
@@ -260,11 +265,6 @@ static int kirkwood_i2s_rec_trigger(struct snd_pcm_substream *substream,
260265

261266
switch (cmd) {
262267
case SNDRV_PCM_TRIGGER_START:
263-
/* stop audio, enable interrupts */
264-
value = readl(priv->io + KIRKWOOD_RECCTL);
265-
value |= KIRKWOOD_RECCTL_PAUSE;
266-
writel(value, priv->io + KIRKWOOD_RECCTL);
267-
268268
value = readl(priv->io + KIRKWOOD_INT_MASK);
269269
value |= KIRKWOOD_INT_CAUSE_REC_BYTES;
270270
writel(value, priv->io + KIRKWOOD_INT_MASK);

sound/soc/samsung/bells.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ static struct snd_soc_dai_link bells_dai_wm5102[] = {
212212
{
213213
.name = "Sub",
214214
.stream_name = "Sub",
215-
.cpu_dai_name = "wm5110-aif3",
215+
.cpu_dai_name = "wm5102-aif3",
216216
.codec_dai_name = "wm9081-hifi",
217217
.codec_name = "wm9081.1-006c",
218218
.dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF
@@ -247,7 +247,7 @@ static struct snd_soc_dai_link bells_dai_wm5110[] = {
247247
{
248248
.name = "Sub",
249249
.stream_name = "Sub",
250-
.cpu_dai_name = "wm5102-aif3",
250+
.cpu_dai_name = "wm5110-aif3",
251251
.codec_dai_name = "wm9081-hifi",
252252
.codec_name = "wm9081.1-006c",
253253
.dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF

0 commit comments

Comments
 (0)