Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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

+83 -74
+9 -2
sound/pci/hda/hda_codec.c
··· 228 228 } 229 229 mutex_unlock(&bus->cmd_mutex); 230 230 snd_hda_power_down(codec); 231 - if (res && *res == -1 && bus->rirb_error) { 231 + if (!codec->in_pm && res && *res == -1 && bus->rirb_error) { 232 232 if (bus->response_reset) { 233 233 snd_printd("hda_codec: resetting BUS due to " 234 234 "fatal communication error\n"); ··· 238 238 goto again; 239 239 } 240 240 /* clear reset-flag when the communication gets recovered */ 241 - if (!err) 241 + if (!err || codec->in_pm) 242 242 bus->response_reset = 0; 243 243 return err; 244 244 } ··· 3616 3616 { 3617 3617 unsigned int state; 3618 3618 3619 + codec->in_pm = 1; 3620 + 3619 3621 if (codec->patch_ops.suspend) 3620 3622 codec->patch_ops.suspend(codec); 3621 3623 hda_cleanup_all_streams(codec); ··· 3632 3630 codec->power_transition = 0; 3633 3631 codec->power_jiffies = jiffies; 3634 3632 spin_unlock(&codec->power_lock); 3633 + codec->in_pm = 0; 3635 3634 return state; 3636 3635 } 3637 3636 ··· 3641 3638 */ 3642 3639 static void hda_call_codec_resume(struct hda_codec *codec) 3643 3640 { 3641 + codec->in_pm = 1; 3642 + 3644 3643 /* set as if powered on for avoiding re-entering the resume 3645 3644 * in the resume / power-save sequence 3646 3645 */ ··· 3661 3656 snd_hda_codec_resume_cache(codec); 3662 3657 } 3663 3658 snd_hda_jack_report_sync(codec); 3659 + 3660 + codec->in_pm = 0; 3664 3661 snd_hda_power_down(codec); /* flag down before returning */ 3665 3662 } 3666 3663 #endif /* CONFIG_PM */
+1
sound/pci/hda/hda_codec.h
··· 869 869 unsigned int power_on :1; /* current (global) power-state */ 870 870 unsigned int d3_stop_clk:1; /* support D3 operation without BCLK */ 871 871 unsigned int pm_down_notified:1; /* PM notified to controller */ 872 + unsigned int in_pm:1; /* suspend/resume being performed */ 872 873 int power_transition; /* power-state in transition */ 873 874 int power_count; /* current (global) power refcount */ 874 875 struct delayed_work power_work; /* delayed task for powerdown */
+20 -19
sound/pci/hda/hda_intel.c
··· 556 556 #define AZX_DCAPS_ALIGN_BUFSIZE (1 << 22) /* buffer size alignment */ 557 557 #define AZX_DCAPS_4K_BDLE_BOUNDARY (1 << 23) /* BDLE in 4k boundary */ 558 558 #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) 559 565 560 566 /* quirks for ATI SB / AMD Hudson */ 561 567 #define AZX_DCAPS_PRESET_ATI_SB \ ··· 2439 2433 { 2440 2434 struct azx *chip = bus->private_data; 2441 2435 2436 + if (!(chip->driver_caps & AZX_DCAPS_PM_RUNTIME)) 2437 + return; 2438 + 2442 2439 if (power_up) 2443 2440 pm_runtime_get_sync(&chip->pci->dev); 2444 2441 else ··· 2557 2548 struct snd_card *card = dev_get_drvdata(dev); 2558 2549 struct azx *chip = card->private_data; 2559 2550 2560 - if (!power_save_controller) 2551 + if (!power_save_controller || 2552 + !(chip->driver_caps & AZX_DCAPS_PM_RUNTIME)) 2561 2553 return -EAGAIN; 2562 2554 2563 2555 azx_stop_chip(chip); ··· 3439 3429 static DEFINE_PCI_DEVICE_TABLE(azx_ids) = { 3440 3430 /* CPT */ 3441 3431 { PCI_DEVICE(0x8086, 0x1c20), 3442 - .driver_data = AZX_DRIVER_PCH | AZX_DCAPS_SCH_SNOOP | 3443 - AZX_DCAPS_BUFSIZE | AZX_DCAPS_COUNT_LPIB_DELAY }, 3432 + .driver_data = AZX_DRIVER_PCH | AZX_DCAPS_INTEL_PCH }, 3444 3433 /* PBG */ 3445 3434 { PCI_DEVICE(0x8086, 0x1d20), 3446 - .driver_data = AZX_DRIVER_PCH | AZX_DCAPS_SCH_SNOOP | 3447 - AZX_DCAPS_BUFSIZE}, 3435 + .driver_data = AZX_DRIVER_PCH | AZX_DCAPS_INTEL_PCH }, 3448 3436 /* Panther Point */ 3449 3437 { PCI_DEVICE(0x8086, 0x1e20), 3450 - .driver_data = AZX_DRIVER_PCH | AZX_DCAPS_SCH_SNOOP | 3451 - AZX_DCAPS_BUFSIZE | AZX_DCAPS_COUNT_LPIB_DELAY }, 3438 + .driver_data = AZX_DRIVER_PCH | AZX_DCAPS_INTEL_PCH }, 3452 3439 /* Lynx Point */ 3453 3440 { PCI_DEVICE(0x8086, 0x8c20), 3454 - .driver_data = AZX_DRIVER_PCH | AZX_DCAPS_SCH_SNOOP | 3455 - AZX_DCAPS_BUFSIZE | AZX_DCAPS_COUNT_LPIB_DELAY }, 3441 + .driver_data = AZX_DRIVER_PCH | AZX_DCAPS_INTEL_PCH }, 3456 3442 /* Lynx Point-LP */ 3457 3443 { PCI_DEVICE(0x8086, 0x9c20), 3458 - .driver_data = AZX_DRIVER_PCH | AZX_DCAPS_SCH_SNOOP | 3459 - AZX_DCAPS_BUFSIZE | AZX_DCAPS_COUNT_LPIB_DELAY }, 3444 + .driver_data = AZX_DRIVER_PCH | AZX_DCAPS_INTEL_PCH }, 3460 3445 /* Lynx Point-LP */ 3461 3446 { PCI_DEVICE(0x8086, 0x9c21), 3462 - .driver_data = AZX_DRIVER_PCH | AZX_DCAPS_SCH_SNOOP | 3463 - AZX_DCAPS_BUFSIZE | AZX_DCAPS_COUNT_LPIB_DELAY }, 3447 + .driver_data = AZX_DRIVER_PCH | AZX_DCAPS_INTEL_PCH }, 3464 3448 /* Haswell */ 3465 3449 { PCI_DEVICE(0x8086, 0x0c0c), 3466 - .driver_data = AZX_DRIVER_SCH | AZX_DCAPS_SCH_SNOOP | 3467 - AZX_DCAPS_BUFSIZE | AZX_DCAPS_COUNT_LPIB_DELAY }, 3450 + .driver_data = AZX_DRIVER_SCH | AZX_DCAPS_INTEL_PCH }, 3468 3451 { PCI_DEVICE(0x8086, 0x0d0c), 3469 - .driver_data = AZX_DRIVER_SCH | AZX_DCAPS_SCH_SNOOP | 3470 - AZX_DCAPS_BUFSIZE | AZX_DCAPS_COUNT_LPIB_DELAY }, 3452 + .driver_data = AZX_DRIVER_SCH | AZX_DCAPS_INTEL_PCH }, 3471 3453 /* 5 Series/3400 */ 3472 3454 { PCI_DEVICE(0x8086, 0x3b56), 3473 - .driver_data = AZX_DRIVER_SCH | AZX_DCAPS_SCH_SNOOP | 3474 - AZX_DCAPS_BUFSIZE | AZX_DCAPS_COUNT_LPIB_DELAY }, 3455 + .driver_data = AZX_DRIVER_SCH | AZX_DCAPS_INTEL_PCH }, 3475 3456 /* SCH */ 3476 3457 { PCI_DEVICE(0x8086, 0x811b), 3477 3458 .driver_data = AZX_DRIVER_SCH | AZX_DCAPS_SCH_SNOOP |
+1
sound/pci/hda/patch_cirrus.c
··· 466 466 memcpy(cfg->speaker_pins, cfg->line_out_pins, 467 467 sizeof(cfg->speaker_pins)); 468 468 cfg->line_outs = 0; 469 + memset(cfg->line_out_pins, 0, sizeof(cfg->line_out_pins)); 469 470 } 470 471 471 472 return 0;
+1
sound/pci/hda/patch_realtek.c
··· 7065 7065 { .id = 0x10ec0282, .name = "ALC282", .patch = patch_alc269 }, 7066 7066 { .id = 0x10ec0283, .name = "ALC283", .patch = patch_alc269 }, 7067 7067 { .id = 0x10ec0290, .name = "ALC290", .patch = patch_alc269 }, 7068 + { .id = 0x10ec0292, .name = "ALC292", .patch = patch_alc269 }, 7068 7069 { .id = 0x10ec0861, .rev = 0x100340, .name = "ALC660", 7069 7070 .patch = patch_alc861 }, 7070 7071 { .id = 0x10ec0660, .name = "ALC660-VD", .patch = patch_alc861vd },
+2 -2
sound/soc/codecs/arizona.c
··· 268 268 static unsigned int arizona_sysclk_48k_rates[] = { 269 269 6144000, 270 270 12288000, 271 - 22579200, 271 + 24576000, 272 272 49152000, 273 273 73728000, 274 274 98304000, ··· 278 278 static unsigned int arizona_sysclk_44k1_rates[] = { 279 279 5644800, 280 280 11289600, 281 - 24576000, 281 + 22579200, 282 282 45158400, 283 283 67737600, 284 284 90316800,
+3 -8
sound/soc/codecs/cs4271.c
··· 485 485 gpio_nreset = cs4271plat->gpio_nreset; 486 486 487 487 if (gpio_nreset >= 0) 488 - if (gpio_request(gpio_nreset, "CS4271 Reset")) 488 + if (devm_gpio_request(codec->dev, gpio_nreset, "CS4271 Reset")) 489 489 gpio_nreset = -EINVAL; 490 490 if (gpio_nreset >= 0) { 491 491 /* Reset codec */ ··· 535 535 static int cs4271_remove(struct snd_soc_codec *codec) 536 536 { 537 537 struct cs4271_private *cs4271 = snd_soc_codec_get_drvdata(codec); 538 - int gpio_nreset; 539 538 540 - gpio_nreset = cs4271->gpio_nreset; 541 - 542 - if (gpio_is_valid(gpio_nreset)) { 539 + if (gpio_is_valid(cs4271->gpio_nreset)) 543 540 /* 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); 547 542 548 543 return 0; 549 544 };
+1 -2
sound/soc/kirkwood/kirkwood-dma.c
··· 71 71 printk(KERN_WARNING "%s: got err interrupt 0x%lx\n", 72 72 __func__, cause); 73 73 writel(cause, priv->io + KIRKWOOD_ERR_CAUSE); 74 - return IRQ_HANDLED; 75 74 } 76 75 77 76 /* we've enabled only bytes interrupts ... */ ··· 177 178 } 178 179 179 180 dram = mv_mbus_dram_info(); 180 - addr = virt_to_phys(substream->dma_buffer.area); 181 + addr = substream->dma_buffer.addr; 181 182 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { 182 183 prdata->play_stream = substream; 183 184 kirkwood_dma_conf_mbus_windows(priv->io,
+36 -36
sound/soc/kirkwood/kirkwood-i2s.c
··· 95 95 do { 96 96 cpu_relax(); 97 97 value = readl(io + KIRKWOOD_DCO_SPCR_STATUS); 98 - value &= KIRKWOOD_DCO_SPCR_STATUS; 98 + value &= KIRKWOOD_DCO_SPCR_STATUS_DCO_LOCK; 99 99 } while (value == 0); 100 100 } 101 101 ··· 180 180 int cmd, struct snd_soc_dai *dai) 181 181 { 182 182 struct kirkwood_dma_data *priv = snd_soc_dai_get_drvdata(dai); 183 - unsigned long value; 183 + uint32_t ctl, value; 184 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); 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 + } 190 205 191 206 switch (cmd) { 192 207 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 - 198 208 value = readl(priv->io + KIRKWOOD_INT_MASK); 199 209 value |= KIRKWOOD_INT_CAUSE_PLAY_BYTES; 200 210 writel(value, priv->io + KIRKWOOD_INT_MASK); 201 211 202 212 /* 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 206 215 | KIRKWOOD_PLAYCTL_SPDIF_EN); 207 216 208 217 if (priv->burst == 32) 209 - value |= KIRKWOOD_PLAYCTL_BURST_32; 218 + ctl |= KIRKWOOD_PLAYCTL_BURST_32; 210 219 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); 214 223 break; 215 224 216 225 case SNDRV_PCM_TRIGGER_STOP: 217 226 /* 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); 221 229 222 230 value = readl(priv->io + KIRKWOOD_INT_MASK); 223 231 value &= ~KIRKWOOD_INT_CAUSE_PLAY_BYTES; 224 232 writel(value, priv->io + KIRKWOOD_INT_MASK); 225 233 226 234 /* 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); 230 237 break; 231 238 232 239 case SNDRV_PCM_TRIGGER_PAUSE_PUSH: 233 240 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); 237 243 break; 238 244 239 245 case SNDRV_PCM_TRIGGER_RESUME: 240 246 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); 244 249 break; 245 250 246 251 default: ··· 265 260 266 261 switch (cmd) { 267 262 case SNDRV_PCM_TRIGGER_START: 268 - /* stop audio, enable interrupts */ 269 - value = readl(priv->io + KIRKWOOD_RECCTL); 270 - value |= KIRKWOOD_RECCTL_PAUSE; 271 - writel(value, priv->io + KIRKWOOD_RECCTL); 272 - 273 263 value = readl(priv->io + KIRKWOOD_INT_MASK); 274 264 value |= KIRKWOOD_INT_CAUSE_REC_BYTES; 275 265 writel(value, priv->io + KIRKWOOD_INT_MASK);
+2 -2
sound/soc/samsung/bells.c
··· 212 212 { 213 213 .name = "Sub", 214 214 .stream_name = "Sub", 215 - .cpu_dai_name = "wm5110-aif3", 215 + .cpu_dai_name = "wm5102-aif3", 216 216 .codec_dai_name = "wm9081-hifi", 217 217 .codec_name = "wm9081.1-006c", 218 218 .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF ··· 247 247 { 248 248 .name = "Sub", 249 249 .stream_name = "Sub", 250 - .cpu_dai_name = "wm5102-aif3", 250 + .cpu_dai_name = "wm5110-aif3", 251 251 .codec_dai_name = "wm9081-hifi", 252 252 .codec_name = "wm9081.1-006c", 253 253 .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF
+6 -2
sound/usb/midi.c
··· 148 148 struct snd_usb_midi_out_endpoint* ep; 149 149 struct snd_rawmidi_substream *substream; 150 150 int active; 151 + bool autopm_reference; 151 152 uint8_t cable; /* cable number << 4 */ 152 153 uint8_t state; 153 154 #define STATE_UNKNOWN 0 ··· 1077 1076 return -ENXIO; 1078 1077 } 1079 1078 err = usb_autopm_get_interface(umidi->iface); 1080 - if (err < 0) 1079 + port->autopm_reference = err >= 0; 1080 + if (err < 0 && err != -EACCES) 1081 1081 return -EIO; 1082 1082 substream->runtime->private_data = port; 1083 1083 port->state = STATE_UNKNOWN; ··· 1089 1087 static int snd_usbmidi_output_close(struct snd_rawmidi_substream *substream) 1090 1088 { 1091 1089 struct snd_usb_midi* umidi = substream->rmidi->private_data; 1090 + struct usbmidi_out_port *port = substream->runtime->private_data; 1092 1091 1093 1092 substream_open(substream, 0); 1094 - usb_autopm_put_interface(umidi->iface); 1093 + if (port->autopm_reference) 1094 + usb_autopm_put_interface(umidi->iface); 1095 1095 return 0; 1096 1096 } 1097 1097
+1 -1
sound/usb/pcm.c
··· 459 459 return ret; 460 460 461 461 if (subs->sync_endpoint) 462 - ret = snd_usb_endpoint_set_params(subs->data_endpoint, 462 + ret = snd_usb_endpoint_set_params(subs->sync_endpoint, 463 463 subs->pcm_format, 464 464 subs->channels, 465 465 subs->period_bytes,