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

Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6: (41 commits)
ALSA: hda - Identify more variants for ALC269
ALSA: hda - Fix wrong ALC269 variant check
ALSA: hda - Enable jack sense for Thinkpad Edge 11
ALSA: Revert "ALSA: hda - Fix switching between dmic and mic using the same mux on IDT/STAC"
ALSA: hda - Fixed ALC887-VD initial error
ALSA: atmel - Fix the return value in error path
ALSA: hda: Use hp-laptop quirk to enable headphones automute for Asus A52J
ALSA: snd-atmel-abdac: test wrong variable
ALSA: azt3328: period bug fix (for PA), add missing ACK on stop timer
ALSA: hda: Add Samsung R720 SSID for subwoofer pin fixup
ALSA: sound/pci/asihpi/hpioctl.c: Remove unnecessary casts of pci_get_drvdata
ALSA: sound/core/pcm_lib.c: Remove unnecessary semicolons
ALSA: sound/ppc: Use printf extension %pR for struct resource
ALSA: ac97: Apply quirk for Dell Latitude D610 binding Master and Headphone controls
ASoC: uda134x - set reg_cache_default to uda134x_reg
ASoC: Add support for MAX98089 CODEC
ASoC: davinci: fixes for multi-component
ASoC: Fix register cache setup WM8994 for multi-component
ASoC: Fix dapm_seq_compare() for multi-component
ASoC: RX1950: Fix hw_params function
...

+382 -266
+3 -3
arch/arm/mach-davinci/dm355.c
··· 359 359 CLK(NULL, "uart1", &uart1_clk), 360 360 CLK(NULL, "uart2", &uart2_clk), 361 361 CLK("i2c_davinci.1", NULL, &i2c_clk), 362 - CLK("davinci-asp.0", NULL, &asp0_clk), 363 - CLK("davinci-asp.1", NULL, &asp1_clk), 362 + CLK("davinci-mcbsp.0", NULL, &asp0_clk), 363 + CLK("davinci-mcbsp.1", NULL, &asp1_clk), 364 364 CLK("davinci_mmc.0", NULL, &mmcsd0_clk), 365 365 CLK("davinci_mmc.1", NULL, &mmcsd1_clk), 366 366 CLK("spi_davinci.0", NULL, &spi0_clk), ··· 664 664 }; 665 665 666 666 static struct platform_device dm355_asp1_device = { 667 - .name = "davinci-asp", 667 + .name = "davinci-mcbsp", 668 668 .id = 1, 669 669 .num_resources = ARRAY_SIZE(dm355_asp1_resources), 670 670 .resource = dm355_asp1_resources,
+3 -3
arch/arm/mach-davinci/dm365.c
··· 459 459 CLK(NULL, "usb", &usb_clk), 460 460 CLK("davinci_emac.1", NULL, &emac_clk), 461 461 CLK("davinci_voicecodec", NULL, &voicecodec_clk), 462 - CLK("davinci-asp.0", NULL, &asp0_clk), 462 + CLK("davinci-mcbsp", NULL, &asp0_clk), 463 463 CLK(NULL, "rto", &rto_clk), 464 464 CLK(NULL, "mjcp", &mjcp_clk), 465 465 CLK(NULL, NULL, NULL), ··· 922 922 }; 923 923 924 924 static struct platform_device dm365_asp_device = { 925 - .name = "davinci-asp", 926 - .id = 0, 925 + .name = "davinci-mcbsp", 926 + .id = -1, 927 927 .num_resources = ARRAY_SIZE(dm365_asp_resources), 928 928 .resource = dm365_asp_resources, 929 929 };
+2 -2
arch/arm/mach-davinci/dm644x.c
··· 302 302 CLK("davinci_emac.1", NULL, &emac_clk), 303 303 CLK("i2c_davinci.1", NULL, &i2c_clk), 304 304 CLK("palm_bk3710", NULL, &ide_clk), 305 - CLK("davinci-asp", NULL, &asp_clk), 305 + CLK("davinci-mcbsp", NULL, &asp_clk), 306 306 CLK("davinci_mmc.0", NULL, &mmcsd_clk), 307 307 CLK(NULL, "spi", &spi_clk), 308 308 CLK(NULL, "gpio", &gpio_clk), ··· 580 580 }; 581 581 582 582 static struct platform_device dm644x_asp_device = { 583 - .name = "davinci-asp", 583 + .name = "davinci-mcbsp", 584 584 .id = -1, 585 585 .num_resources = ARRAY_SIZE(dm644x_asp_resources), 586 586 .resource = dm644x_asp_resources,
-3
include/linux/mfd/wm8350/audio.h
··· 522 522 #define WM8350_MCLK_SEL_PLL_32K 3 523 523 #define WM8350_MCLK_SEL_MCLK 5 524 524 525 - #define WM8350_MCLK_DIR_OUT 0 526 - #define WM8350_MCLK_DIR_IN 1 527 - 528 525 /* clock divider id's */ 529 526 #define WM8350_ADC_CLKDIV 0 530 527 #define WM8350_DAC_CLKDIV 1
+2 -2
sound/atmel/abdac.c
··· 420 420 return PTR_ERR(pclk); 421 421 } 422 422 sample_clk = clk_get(&pdev->dev, "sample_clk"); 423 - if (IS_ERR(pclk)) { 423 + if (IS_ERR(sample_clk)) { 424 424 dev_dbg(&pdev->dev, "no sample clock\n"); 425 - retval = PTR_ERR(pclk); 425 + retval = PTR_ERR(sample_clk); 426 426 goto out_put_pclk; 427 427 } 428 428 clk_enable(pclk);
+1 -1
sound/core/pcm_lib.c
··· 223 223 entry->jiffies = jiffies; 224 224 entry->pos = pos; 225 225 entry->period_size = runtime->period_size; 226 - entry->buffer_size = runtime->buffer_size;; 226 + entry->buffer_size = runtime->buffer_size; 227 227 entry->old_hw_ptr = runtime->status->hw_ptr; 228 228 entry->hw_ptr_base = runtime->hw_ptr_base; 229 229 log->idx = (log->idx + 1) % XRUN_LOG_CNT;
+2 -4
sound/oss/dev_table.c
··· 71 71 if (sound_nblocks >= MAX_MEM_BLOCKS) 72 72 sound_nblocks = MAX_MEM_BLOCKS - 1; 73 73 74 - op = (struct audio_operations *) (sound_mem_blocks[sound_nblocks] = vmalloc(sizeof(struct audio_operations))); 74 + op = (struct audio_operations *) (sound_mem_blocks[sound_nblocks] = vzalloc(sizeof(struct audio_operations))); 75 75 sound_nblocks++; 76 76 if (sound_nblocks >= MAX_MEM_BLOCKS) 77 77 sound_nblocks = MAX_MEM_BLOCKS - 1; ··· 81 81 sound_unload_audiodev(num); 82 82 return -(ENOMEM); 83 83 } 84 - memset((char *) op, 0, sizeof(struct audio_operations)); 85 84 init_waitqueue_head(&op->in_sleeper); 86 85 init_waitqueue_head(&op->out_sleeper); 87 86 init_waitqueue_head(&op->poll_sleeper); ··· 127 128 /* FIXME: This leaks a mixer_operations struct every time its called 128 129 until you unload sound! */ 129 130 130 - op = (struct mixer_operations *) (sound_mem_blocks[sound_nblocks] = vmalloc(sizeof(struct mixer_operations))); 131 + op = (struct mixer_operations *) (sound_mem_blocks[sound_nblocks] = vzalloc(sizeof(struct mixer_operations))); 131 132 sound_nblocks++; 132 133 if (sound_nblocks >= MAX_MEM_BLOCKS) 133 134 sound_nblocks = MAX_MEM_BLOCKS - 1; ··· 136 137 printk(KERN_ERR "Sound: Can't allocate mixer driver for (%s)\n", name); 137 138 return -ENOMEM; 138 139 } 139 - memset((char *) op, 0, sizeof(struct mixer_operations)); 140 140 memcpy((char *) op, (char *) driver, driver_size); 141 141 142 142 strlcpy(op->name, name, sizeof(op->name));
+2 -2
sound/oss/midibuf.c
··· 178 178 return err; 179 179 180 180 parms[dev].prech_timeout = MAX_SCHEDULE_TIMEOUT; 181 - midi_in_buf[dev] = (struct midi_buf *) vmalloc(sizeof(struct midi_buf)); 181 + midi_in_buf[dev] = vmalloc(sizeof(struct midi_buf)); 182 182 183 183 if (midi_in_buf[dev] == NULL) 184 184 { ··· 188 188 } 189 189 midi_in_buf[dev]->len = midi_in_buf[dev]->head = midi_in_buf[dev]->tail = 0; 190 190 191 - midi_out_buf[dev] = (struct midi_buf *) vmalloc(sizeof(struct midi_buf)); 191 + midi_out_buf[dev] = vmalloc(sizeof(struct midi_buf)); 192 192 193 193 if (midi_out_buf[dev] == NULL) 194 194 {
+3 -3
sound/oss/pss.c
··· 859 859 return 0; 860 860 861 861 case SNDCTL_COPR_LOAD: 862 - buf = (copr_buffer *) vmalloc(sizeof(copr_buffer)); 862 + buf = vmalloc(sizeof(copr_buffer)); 863 863 if (buf == NULL) 864 864 return -ENOSPC; 865 865 if (copy_from_user(buf, arg, sizeof(copr_buffer))) { ··· 871 871 return err; 872 872 873 873 case SNDCTL_COPR_SENDMSG: 874 - mbuf = (copr_msg *)vmalloc(sizeof(copr_msg)); 874 + mbuf = vmalloc(sizeof(copr_msg)); 875 875 if (mbuf == NULL) 876 876 return -ENOSPC; 877 877 if (copy_from_user(mbuf, arg, sizeof(copr_msg))) { ··· 895 895 896 896 case SNDCTL_COPR_RCVMSG: 897 897 err = 0; 898 - mbuf = (copr_msg *)vmalloc(sizeof(copr_msg)); 898 + mbuf = vmalloc(sizeof(copr_msg)); 899 899 if (mbuf == NULL) 900 900 return -ENOSPC; 901 901 data = (unsigned short *)mbuf->data;
+2 -2
sound/oss/sequencer.c
··· 1646 1646 { 1647 1647 if (sequencer_ok) 1648 1648 return; 1649 - queue = (unsigned char *)vmalloc(SEQ_MAX_QUEUE * EV_SZ); 1649 + queue = vmalloc(SEQ_MAX_QUEUE * EV_SZ); 1650 1650 if (queue == NULL) 1651 1651 { 1652 1652 printk(KERN_ERR "sequencer: Can't allocate memory for sequencer output queue\n"); 1653 1653 return; 1654 1654 } 1655 - iqueue = (unsigned char *)vmalloc(SEQ_MAX_QUEUE * IEV_SZ); 1655 + iqueue = vmalloc(SEQ_MAX_QUEUE * IEV_SZ); 1656 1656 if (iqueue == NULL) 1657 1657 { 1658 1658 printk(KERN_ERR "sequencer: Can't allocate memory for sequencer input queue\n");
+1 -1
sound/pci/asihpi/hpioctl.c
··· 435 435 struct hpi_message hm; 436 436 struct hpi_response hr; 437 437 struct hpi_adapter *pa; 438 - pa = (struct hpi_adapter *)pci_get_drvdata(pci_dev); 438 + pa = pci_get_drvdata(pci_dev); 439 439 440 440 hpi_init_message_response(&hm, &hr, HPI_OBJ_SUBSYSTEM, 441 441 HPI_SUBSYS_DELETE_ADAPTER);
+18 -8
sound/pci/azt3328.c
··· 1129 1129 1130 1130 count_areas = size/2; 1131 1131 addr_area2 = addr+count_areas; 1132 - count_areas--; /* max. index */ 1133 1132 snd_azf3328_dbgcodec("setdma: buffers %08lx[%u] / %08lx[%u]\n", 1134 1133 addr, count_areas, addr_area2, count_areas); 1134 + 1135 + count_areas--; /* max. index */ 1135 1136 1136 1137 /* build combined I/O buffer length word */ 1137 1138 lengths = (count_areas << 16) | (count_areas); ··· 1741 1740 .rate_max = AZF_FREQ_66200, 1742 1741 .channels_min = 1, 1743 1742 .channels_max = 2, 1744 - .buffer_bytes_max = 65536, 1745 - .period_bytes_min = 64, 1746 - .period_bytes_max = 65536, 1747 - .periods_min = 1, 1748 - .periods_max = 1024, 1743 + .buffer_bytes_max = (64*1024), 1744 + .period_bytes_min = 1024, 1745 + .period_bytes_max = (32*1024), 1746 + /* We simply have two DMA areas (instead of a list of descriptors 1747 + such as other cards); I believe that this is a fixed hardware 1748 + attribute and there isn't much driver magic to be done to expand it. 1749 + Thus indicate that we have at least and at most 2 periods. */ 1750 + .periods_min = 2, 1751 + .periods_max = 2, 1749 1752 /* FIXME: maybe that card actually has a FIFO? 1750 1753 * Hmm, it seems newer revisions do have one, but we still don't know 1751 1754 * its size... */ ··· 1985 1980 chip = snd_timer_chip(timer); 1986 1981 spin_lock_irqsave(&chip->reg_lock, flags); 1987 1982 /* disable timer countdown and interrupt */ 1988 - /* FIXME: should we write TIMER_IRQ_ACK here? */ 1989 - snd_azf3328_ctrl_outb(chip, IDX_IO_TIMER_VALUE + 3, 0); 1983 + /* Hmm, should we write TIMER_IRQ_ACK here? 1984 + YES indeed, otherwise a rogue timer operation - which prompts 1985 + ALSA(?) to call repeated stop() in vain, but NOT start() - 1986 + will never end (value 0x03 is kept shown in control byte). 1987 + Simply manually poking 0x04 _once_ immediately successfully stops 1988 + the hardware/ALSA interrupt activity. */ 1989 + snd_azf3328_ctrl_outb(chip, IDX_IO_TIMER_VALUE + 3, 0x04); 1990 1990 spin_unlock_irqrestore(&chip->reg_lock, flags); 1991 1991 snd_azf3328_dbgcallleave(); 1992 1992 return 0;
+10 -6
sound/pci/ctxfi/ctpcm.c
··· 129 129 130 130 apcm->substream = substream; 131 131 apcm->interrupt = ct_atc_pcm_interrupt; 132 - runtime->private_data = apcm; 133 - runtime->private_free = ct_atc_pcm_free_substream; 134 132 if (IEC958 == substream->pcm->device) { 135 133 runtime->hw = ct_spdif_passthru_playback_hw; 136 134 atc->spdif_out_passthru(atc, 1); ··· 153 155 } 154 156 155 157 apcm->timer = ct_timer_instance_new(atc->timer, apcm); 156 - if (!apcm->timer) 158 + if (!apcm->timer) { 159 + kfree(apcm); 157 160 return -ENOMEM; 161 + } 162 + runtime->private_data = apcm; 163 + runtime->private_free = ct_atc_pcm_free_substream; 158 164 159 165 return 0; 160 166 } ··· 280 278 apcm->started = 0; 281 279 apcm->substream = substream; 282 280 apcm->interrupt = ct_atc_pcm_interrupt; 283 - runtime->private_data = apcm; 284 - runtime->private_free = ct_atc_pcm_free_substream; 285 281 runtime->hw = ct_pcm_capture_hw; 286 282 runtime->hw.rate_max = atc->rsr * atc->msr; 287 283 ··· 298 298 } 299 299 300 300 apcm->timer = ct_timer_instance_new(atc->timer, apcm); 301 - if (!apcm->timer) 301 + if (!apcm->timer) { 302 + kfree(apcm); 302 303 return -ENOMEM; 304 + } 305 + runtime->private_data = apcm; 306 + runtime->private_free = ct_atc_pcm_free_substream; 303 307 304 308 return 0; 305 309 }
+2
sound/pci/hda/patch_conexant.c
··· 3100 3100 SND_PCI_QUIRK(0x1028, 0x0402, "Dell Vostro", CXT5066_DELL_VOSTRO), 3101 3101 SND_PCI_QUIRK(0x1028, 0x0408, "Dell Inspiron One 19T", CXT5066_IDEAPAD), 3102 3102 SND_PCI_QUIRK(0x103c, 0x360b, "HP G60", CXT5066_HP_LAPTOP), 3103 + SND_PCI_QUIRK(0x1043, 0x13f3, "Asus A52J", CXT5066_HP_LAPTOP), 3103 3104 SND_PCI_QUIRK(0x1179, 0xff1e, "Toshiba Satellite C650D", CXT5066_IDEAPAD), 3104 3105 SND_PCI_QUIRK(0x1179, 0xff50, "Toshiba Satellite P500-PSPGSC-01800T", CXT5066_OLPC_XO_1_5), 3105 3106 SND_PCI_QUIRK(0x1179, 0xffe0, "Toshiba Satellite Pro T130-15F", CXT5066_OLPC_XO_1_5), ··· 3111 3110 SND_PCI_QUIRK(0x17aa, 0x21b2, "Thinkpad X100e", CXT5066_IDEAPAD), 3112 3111 SND_PCI_QUIRK(0x17aa, 0x21b3, "Thinkpad Edge 13 (197)", CXT5066_IDEAPAD), 3113 3112 SND_PCI_QUIRK(0x17aa, 0x21b4, "Thinkpad Edge", CXT5066_IDEAPAD), 3113 + SND_PCI_QUIRK(0x17aa, 0x21c8, "Thinkpad Edge 11", CXT5066_IDEAPAD), 3114 3114 SND_PCI_QUIRK(0x17aa, 0x215e, "Lenovo Thinkpad", CXT5066_THINKPAD), 3115 3115 SND_PCI_QUIRK(0x17aa, 0x38af, "Lenovo G series", CXT5066_IDEAPAD), 3116 3116 SND_PCI_QUIRK(0x17aa, 0x390a, "Lenovo S10-3t", CXT5066_IDEAPAD),
+22 -6
sound/pci/hda/patch_realtek.c
··· 14623 14623 /* different alc269-variants */ 14624 14624 enum { 14625 14625 ALC269_TYPE_NORMAL, 14626 + ALC269_TYPE_ALC258, 14626 14627 ALC269_TYPE_ALC259, 14628 + ALC269_TYPE_ALC269VB, 14629 + ALC269_TYPE_ALC270, 14627 14630 ALC269_TYPE_ALC271X, 14628 14631 }; 14629 14632 ··· 15026 15023 static int patch_alc269(struct hda_codec *codec) 15027 15024 { 15028 15025 struct alc_spec *spec; 15029 - int board_config; 15026 + int board_config, coef; 15030 15027 int err; 15031 15028 15032 15029 spec = kzalloc(sizeof(*spec), GFP_KERNEL); ··· 15037 15034 15038 15035 alc_auto_parse_customize_define(codec); 15039 15036 15040 - if ((alc_read_coef_idx(codec, 0) & 0x00f0) == 0x0010){ 15037 + coef = alc_read_coef_idx(codec, 0); 15038 + if ((coef & 0x00f0) == 0x0010) { 15041 15039 if (codec->bus->pci->subsystem_vendor == 0x1025 && 15042 15040 spec->cdefine.platform_type == 1) { 15043 15041 alc_codec_rename(codec, "ALC271X"); 15044 15042 spec->codec_variant = ALC269_TYPE_ALC271X; 15045 - } else { 15043 + } else if ((coef & 0xf000) == 0x1000) { 15044 + spec->codec_variant = ALC269_TYPE_ALC270; 15045 + } else if ((coef & 0xf000) == 0x2000) { 15046 15046 alc_codec_rename(codec, "ALC259"); 15047 15047 spec->codec_variant = ALC269_TYPE_ALC259; 15048 + } else if ((coef & 0xf000) == 0x3000) { 15049 + alc_codec_rename(codec, "ALC258"); 15050 + spec->codec_variant = ALC269_TYPE_ALC258; 15051 + } else { 15052 + alc_codec_rename(codec, "ALC269VB"); 15053 + spec->codec_variant = ALC269_TYPE_ALC269VB; 15048 15054 } 15049 15055 } else 15050 15056 alc_fix_pll_init(codec, 0x20, 0x04, 15); ··· 15116 15104 spec->stream_digital_capture = &alc269_pcm_digital_capture; 15117 15105 15118 15106 if (!spec->adc_nids) { /* wasn't filled automatically? use default */ 15119 - if (spec->codec_variant != ALC269_TYPE_NORMAL) { 15107 + if (spec->codec_variant == ALC269_TYPE_NORMAL) { 15120 15108 spec->adc_nids = alc269_adc_nids; 15121 15109 spec->num_adc_nids = ARRAY_SIZE(alc269_adc_nids); 15122 15110 spec->capsrc_nids = alc269_capsrc_nids; ··· 19310 19298 19311 19299 static struct snd_pci_quirk alc662_fixup_tbl[] = { 19312 19300 SND_PCI_QUIRK(0x1025, 0x038b, "Acer Aspire 8943G", ALC662_FIXUP_ASPIRE), 19301 + SND_PCI_QUIRK(0x144d, 0xc051, "Samsung R720", ALC662_FIXUP_IDEAPAD), 19313 19302 SND_PCI_QUIRK(0x17aa, 0x38af, "Lenovo Ideapad Y550P", ALC662_FIXUP_IDEAPAD), 19314 19303 SND_PCI_QUIRK(0x17aa, 0x3a0d, "Lenovo Ideapad Y550", ALC662_FIXUP_IDEAPAD), 19315 19304 {} ··· 19432 19419 { 19433 19420 if ((alc_read_coef_idx(codec, 0) & 0x00f0)==0x0030){ 19434 19421 kfree(codec->chip_name); 19435 - codec->chip_name = kstrdup("ALC888-VD", GFP_KERNEL); 19422 + if (codec->vendor_id == 0x10ec0887) 19423 + codec->chip_name = kstrdup("ALC887-VD", GFP_KERNEL); 19424 + else 19425 + codec->chip_name = kstrdup("ALC888-VD", GFP_KERNEL); 19436 19426 if (!codec->chip_name) { 19437 19427 alc_free(codec); 19438 19428 return -ENOMEM; ··· 19925 19909 { .id = 0x10ec0885, .rev = 0x100103, .name = "ALC889A", 19926 19910 .patch = patch_alc882 }, 19927 19911 { .id = 0x10ec0885, .name = "ALC885", .patch = patch_alc882 }, 19928 - { .id = 0x10ec0887, .name = "ALC887", .patch = patch_alc882 }, 19912 + { .id = 0x10ec0887, .name = "ALC887", .patch = patch_alc888 }, 19929 19913 { .id = 0x10ec0888, .rev = 0x100101, .name = "ALC1200", 19930 19914 .patch = patch_alc882 }, 19931 19915 { .id = 0x10ec0888, .name = "ALC888", .patch = patch_alc888 },
+13 -5
sound/pci/hda/patch_sigmatel.c
··· 389 389 0x11, 0x20, 0 390 390 }; 391 391 392 + #define STAC92HD87B_NUM_DMICS 1 393 + static hda_nid_t stac92hd87b_dmic_nids[STAC92HD87B_NUM_DMICS + 1] = { 394 + 0x11, 0 395 + }; 396 + 392 397 #define STAC92HD83XXX_NUM_CAPS 2 393 398 static unsigned long stac92hd83xxx_capvols[] = { 394 399 HDA_COMPOSE_AMP_VAL(0x17, 3, 0, HDA_OUTPUT), ··· 3491 3486 return err; 3492 3487 } 3493 3488 3494 - if (snd_hda_get_bool_hint(codec, "separate_dmux") != 1) { 3489 + if (snd_hda_get_bool_hint(codec, "separate_dmux") != 1) 3495 3490 snd_hda_add_imux_item(imux, label, index, NULL); 3496 - spec->num_analog_muxes++; 3497 - } 3498 3491 } 3499 3492 3500 3493 return 0; ··· 5455 5452 stac92hd83xxx_brd_tbl[spec->board_config]); 5456 5453 5457 5454 switch (codec->vendor_id) { 5455 + case 0x111d76d1: 5456 + case 0x111d76d9: 5457 + spec->dmic_nids = stac92hd87b_dmic_nids; 5458 + spec->num_dmics = stac92xx_connected_ports(codec, 5459 + stac92hd87b_dmic_nids, 5460 + STAC92HD87B_NUM_DMICS); 5461 + /* Fall through */ 5458 5462 case 0x111d7666: 5459 5463 case 0x111d7667: 5460 5464 case 0x111d7668: 5461 5465 case 0x111d7669: 5462 - case 0x111d76d1: 5463 - case 0x111d76d9: 5464 5466 spec->num_pins = ARRAY_SIZE(stac92hd88xxx_pin_nids); 5465 5467 spec->pin_nids = stac92hd88xxx_pin_nids; 5466 5468 spec->mono_nid = 0;
+6
sound/pci/intel8x0.c
··· 1866 1866 }, 1867 1867 { 1868 1868 .subvendor = 0x1028, 1869 + .subdevice = 0x0182, 1870 + .name = "Dell Latitude D610", /* STAC9750/51 */ 1871 + .type = AC97_TUNE_HP_ONLY 1872 + }, 1873 + { 1874 + .subvendor = 0x1028, 1869 1875 .subdevice = 0x0186, 1870 1876 .name = "Dell Latitude D810", /* cf. Malone #41015 */ 1871 1877 .type = AC97_TUNE_HP_MUTE_LED
+11 -1
sound/pci/mixart/mixart_hwdep.h
··· 25 25 26 26 #include <sound/hwdep.h> 27 27 28 + #ifndef readl_be 28 29 #define readl_be(x) be32_to_cpu(__raw_readl(x)) 29 - #define writel_be(data,addr) __raw_writel(cpu_to_be32(data),addr) 30 + #endif 30 31 32 + #ifndef writel_be 33 + #define writel_be(data,addr) __raw_writel(cpu_to_be32(data),addr) 34 + #endif 35 + 36 + #ifndef readl_le 31 37 #define readl_le(x) le32_to_cpu(__raw_readl(x)) 38 + #endif 39 + 40 + #ifndef writel_le 32 41 #define writel_le(data,addr) __raw_writel(cpu_to_le32(data),addr) 42 + #endif 33 43 34 44 #define MIXART_MEM(mgr,x) ((mgr)->mem[0].virt + (x)) 35 45 #define MIXART_REG(mgr,x) ((mgr)->mem[1].virt + (x))
+4 -8
sound/ppc/pmac.c
··· 1228 1228 chip->rsrc[i].start + 1, 1229 1229 rnames[i]) == NULL) { 1230 1230 printk(KERN_ERR "snd: can't request rsrc " 1231 - " %d (%s: 0x%016llx:%016llx)\n", 1232 - i, rnames[i], 1233 - (unsigned long long)chip->rsrc[i].start, 1234 - (unsigned long long)chip->rsrc[i].end); 1231 + " %d (%s: %pR)\n", 1232 + i, rnames[i], &chip->rsrc[i]); 1235 1233 err = -ENODEV; 1236 1234 goto __error; 1237 1235 } ··· 1254 1256 chip->rsrc[i].start + 1, 1255 1257 rnames[i]) == NULL) { 1256 1258 printk(KERN_ERR "snd: can't request rsrc " 1257 - " %d (%s: 0x%016llx:%016llx)\n", 1258 - i, rnames[i], 1259 - (unsigned long long)chip->rsrc[i].start, 1260 - (unsigned long long)chip->rsrc[i].end); 1259 + " %d (%s: %pR)\n", 1260 + i, rnames[i], &chip->rsrc[i]); 1261 1261 err = -ENODEV; 1262 1262 goto __error; 1263 1263 }
+3 -2
sound/soc/atmel/Kconfig
··· 16 16 17 17 config SND_AT91_SOC_SAM9G20_WM8731 18 18 tristate "SoC Audio support for WM8731-based At91sam9g20 evaluation board" 19 - depends on ATMEL_SSC && ARCH_AT91SAM9G20 && SND_ATMEL_SOC 19 + depends on ATMEL_SSC && ARCH_AT91SAM9G20 && SND_ATMEL_SOC && \ 20 + AT91_PROGRAMMABLE_CLOCKS 20 21 select SND_ATMEL_SOC_SSC 21 22 select SND_SOC_WM8731 22 23 help ··· 26 25 27 26 config SND_AT32_SOC_PLAYPAQ 28 27 tristate "SoC Audio support for PlayPaq with WM8510" 29 - depends on SND_ATMEL_SOC && BOARD_PLAYPAQ 28 + depends on SND_ATMEL_SOC && BOARD_PLAYPAQ && AT91_PROGRAMMABLE_CLOCKS 30 29 select SND_ATMEL_SOC_SSC 31 30 select SND_SOC_WM8510 32 31 help
+10 -1
sound/soc/codecs/max98088.c
··· 28 28 #include <sound/max98088.h> 29 29 #include "max98088.h" 30 30 31 + enum max98088_type { 32 + MAX98088, 33 + MAX98089, 34 + }; 35 + 31 36 struct max98088_cdata { 32 37 unsigned int rate; 33 38 unsigned int fmt; ··· 41 36 42 37 struct max98088_priv { 43 38 u8 reg_cache[M98088_REG_CNT]; 39 + enum max98088_type devtype; 44 40 void *control_data; 45 41 struct max98088_pdata *pdata; 46 42 unsigned int sysclk; ··· 2046 2040 if (max98088 == NULL) 2047 2041 return -ENOMEM; 2048 2042 2043 + max98088->devtype = id->driver_data; 2044 + 2049 2045 i2c_set_clientdata(i2c, max98088); 2050 2046 max98088->control_data = i2c; 2051 2047 max98088->pdata = i2c->dev.platform_data; ··· 2067 2059 } 2068 2060 2069 2061 static const struct i2c_device_id max98088_i2c_id[] = { 2070 - { "max98088", 0 }, 2062 + { "max98088", MAX98088 }, 2063 + { "max98089", MAX98089 }, 2071 2064 { } 2072 2065 }; 2073 2066 MODULE_DEVICE_TABLE(i2c, max98088_i2c_id);
+1
sound/soc/codecs/uda134x.c
··· 597 597 .resume = uda134x_soc_resume, 598 598 .reg_cache_size = sizeof(uda134x_reg), 599 599 .reg_word_size = sizeof(u8), 600 + .reg_cache_default = uda134x_reg, 600 601 .reg_cache_step = 1, 601 602 .read = uda134x_read_reg_cache, 602 603 .write = uda134x_write,
+8 -1
sound/soc/codecs/wm8350.c
··· 831 831 } 832 832 833 833 /* MCLK direction */ 834 - if (dir == WM8350_MCLK_DIR_OUT) 834 + if (dir == SND_SOC_CLOCK_OUT) 835 835 wm8350_set_bits(wm8350, WM8350_CLOCK_CONTROL_2, 836 836 WM8350_MCLK_DIR); 837 837 else ··· 1585 1585 WM8350_OUT1_VU | WM8350_OUT1R_MUTE); 1586 1586 wm8350_set_bits(wm8350, WM8350_ROUT2_VOLUME, 1587 1587 WM8350_OUT2_VU | WM8350_OUT2R_MUTE); 1588 + 1589 + /* Make sure AIF tristating is disabled by default */ 1590 + wm8350_clear_bits(wm8350, WM8350_AI_FORMATING, WM8350_AIF_TRI); 1591 + 1592 + /* Make sure we've got a sane companding setup too */ 1593 + wm8350_clear_bits(wm8350, WM8350_ADC_DAC_COMP, 1594 + WM8350_DAC_COMP | WM8350_LOOPBACK); 1588 1595 1589 1596 /* Make sure jack detect is disabled to start off with */ 1590 1597 wm8350_clear_bits(wm8350, WM8350_JACK_DETECT,
-1
sound/soc/codecs/wm8776.c
··· 34 34 /* codec private data */ 35 35 struct wm8776_priv { 36 36 enum snd_soc_control_type control_type; 37 - u16 reg_cache[WM8776_CACHEREGNUM]; 38 37 int sysclk[2]; 39 38 }; 40 39
+4 -1
sound/soc/codecs/wm8962.c
··· 3500 3500 { 3501 3501 struct wm8962_priv *wm8962 = dev_get_drvdata(dev); 3502 3502 long int time; 3503 + int ret; 3503 3504 3504 - strict_strtol(buf, 10, &time); 3505 + ret = strict_strtol(buf, 10, &time); 3506 + if (ret != 0) 3507 + return ret; 3505 3508 3506 3509 input_event(wm8962->beep, EV_SND, SND_TONE, time); 3507 3510
+2
sound/soc/codecs/wm8994.c
··· 3903 3903 return -ENOMEM; 3904 3904 snd_soc_codec_set_drvdata(codec, wm8994); 3905 3905 3906 + codec->reg_cache = &wm8994->reg_cache; 3907 + 3906 3908 wm8994->pdata = dev_get_platdata(codec->dev->parent); 3907 3909 wm8994->codec = codec; 3908 3910
+29 -11
sound/soc/davinci/davinci-evm.c
··· 157 157 } 158 158 159 159 /* davinci-evm digital audio interface glue - connects codec <--> CPU */ 160 - static struct snd_soc_dai_link evm_dai = { 160 + static struct snd_soc_dai_link dm6446_evm_dai = { 161 161 .name = "TLV320AIC3X", 162 162 .stream_name = "AIC3X", 163 - .cpu_dai_name = "davinci-mcasp.0", 163 + .cpu_dai_name = "davinci-mcbsp", 164 164 .codec_dai_name = "tlv320aic3x-hifi", 165 - .codec_name = "tlv320aic3x-codec.0-001a", 165 + .codec_name = "tlv320aic3x-codec.1-001b", 166 + .platform_name = "davinci-pcm-audio", 167 + .init = evm_aic3x_init, 168 + .ops = &evm_ops, 169 + }; 170 + 171 + static struct snd_soc_dai_link dm355_evm_dai = { 172 + .name = "TLV320AIC3X", 173 + .stream_name = "AIC3X", 174 + .cpu_dai_name = "davinci-mcbsp.1", 175 + .codec_dai_name = "tlv320aic3x-hifi", 176 + .codec_name = "tlv320aic3x-codec.1-001b", 166 177 .platform_name = "davinci-pcm-audio", 167 178 .init = evm_aic3x_init, 168 179 .ops = &evm_ops, ··· 183 172 #ifdef CONFIG_SND_DM365_AIC3X_CODEC 184 173 .name = "TLV320AIC3X", 185 174 .stream_name = "AIC3X", 186 - .cpu_dai_name = "davinci-i2s", 175 + .cpu_dai_name = "davinci-mcbsp", 187 176 .codec_dai_name = "tlv320aic3x-hifi", 188 177 .init = evm_aic3x_init, 189 - .codec_name = "tlv320aic3x-codec.0-001a", 178 + .codec_name = "tlv320aic3x-codec.1-0018", 190 179 .ops = &evm_ops, 191 180 #elif defined(CONFIG_SND_DM365_VOICE_CODEC) 192 181 .name = "Voice Codec - CQ93VC", ··· 230 219 .ops = &evm_ops, 231 220 }; 232 221 233 - /* davinci dm6446, dm355 evm audio machine driver */ 234 - static struct snd_soc_card snd_soc_card_evm = { 235 - .name = "DaVinci EVM", 236 - .dai_link = &evm_dai, 222 + /* davinci dm6446 evm audio machine driver */ 223 + static struct snd_soc_card dm6446_snd_soc_card_evm = { 224 + .name = "DaVinci DM6446 EVM", 225 + .dai_link = &dm6446_evm_dai, 226 + .num_links = 1, 227 + }; 228 + 229 + /* davinci dm355 evm audio machine driver */ 230 + static struct snd_soc_card dm355_snd_soc_card_evm = { 231 + .name = "DaVinci DM355 EVM", 232 + .dai_link = &dm355_evm_dai, 237 233 .num_links = 1, 238 234 }; 239 235 ··· 279 261 int ret; 280 262 281 263 if (machine_is_davinci_evm()) { 282 - evm_snd_dev_data = &snd_soc_card_evm; 264 + evm_snd_dev_data = &dm6446_snd_soc_card_evm; 283 265 index = 0; 284 266 } else if (machine_is_davinci_dm355_evm()) { 285 - evm_snd_dev_data = &snd_soc_card_evm; 267 + evm_snd_dev_data = &dm355_snd_soc_card_evm; 286 268 index = 1; 287 269 } else if (machine_is_davinci_dm365_evm()) { 288 270 evm_snd_dev_data = &dm365_snd_soc_card_evm;
+11 -4
sound/soc/davinci/davinci-i2s.c
··· 426 426 snd_pcm_format_t fmt; 427 427 unsigned element_cnt = 1; 428 428 429 - dai->capture_dma_data = dev->dma_params; 430 - dai->playback_dma_data = dev->dma_params; 431 - 432 429 /* general line settings */ 433 430 spcr = davinci_mcbsp_read_reg(dev, DAVINCI_MCBSP_SPCR_REG); 434 431 if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) { ··· 598 601 return ret; 599 602 } 600 603 604 + static int davinci_i2s_startup(struct snd_pcm_substream *substream, 605 + struct snd_soc_dai *dai) 606 + { 607 + struct davinci_mcbsp_dev *dev = snd_soc_dai_get_drvdata(dai); 608 + 609 + snd_soc_dai_set_dma_data(dai, substream, dev->dma_params); 610 + return 0; 611 + } 612 + 601 613 static void davinci_i2s_shutdown(struct snd_pcm_substream *substream, 602 614 struct snd_soc_dai *dai) 603 615 { ··· 618 612 #define DAVINCI_I2S_RATES SNDRV_PCM_RATE_8000_96000 619 613 620 614 static struct snd_soc_dai_ops davinci_i2s_dai_ops = { 615 + .startup = davinci_i2s_startup, 621 616 .shutdown = davinci_i2s_shutdown, 622 617 .prepare = davinci_i2s_prepare, 623 618 .trigger = davinci_i2s_trigger, ··· 756 749 .probe = davinci_i2s_probe, 757 750 .remove = davinci_i2s_remove, 758 751 .driver = { 759 - .name = "davinci-i2s", 752 + .name = "davinci-mcbsp", 760 753 .owner = THIS_MODULE, 761 754 }, 762 755 };
+10 -3
sound/soc/davinci/davinci-mcasp.c
··· 715 715 int word_length; 716 716 u8 fifo_level; 717 717 718 - cpu_dai->capture_dma_data = dev->dma_params; 719 - cpu_dai->playback_dma_data = dev->dma_params; 720 - 721 718 davinci_hw_common_param(dev, substream->stream); 722 719 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) 723 720 fifo_level = dev->txnumevt; ··· 796 799 return ret; 797 800 } 798 801 802 + static int davinci_mcasp_startup(struct snd_pcm_substream *substream, 803 + struct snd_soc_dai *dai) 804 + { 805 + struct davinci_audio_dev *dev = snd_soc_dai_get_drvdata(dai); 806 + 807 + snd_soc_dai_set_dma_data(dai, substream, dev->dma_params); 808 + return 0; 809 + } 810 + 799 811 static struct snd_soc_dai_ops davinci_mcasp_dai_ops = { 812 + .startup = davinci_mcasp_startup, 800 813 .trigger = davinci_mcasp_trigger, 801 814 .hw_params = davinci_mcasp_hw_params, 802 815 .set_fmt = davinci_mcasp_set_dai_fmt,
+1 -1
sound/soc/davinci/davinci-sffsdr.c
··· 84 84 static struct snd_soc_dai_link sffsdr_dai = { 85 85 .name = "PCM3008", /* Codec name */ 86 86 .stream_name = "PCM3008 HiFi", 87 - .cpu_dai_name = "davinci-asp.0", 87 + .cpu_dai_name = "davinci-mcbsp", 88 88 .codec_dai_name = "pcm3008-hifi", 89 89 .codec_name = "pcm3008-codec", 90 90 .platform_name = "davinci-pcm-audio",
+10 -3
sound/soc/davinci/davinci-vcif.c
··· 97 97 &davinci_vcif_dev->dma_params[substream->stream]; 98 98 u32 w; 99 99 100 - dai->capture_dma_data = davinci_vcif_dev->dma_params; 101 - dai->playback_dma_data = davinci_vcif_dev->dma_params; 102 - 103 100 /* Restart the codec before setup */ 104 101 davinci_vcif_stop(substream); 105 102 davinci_vcif_start(substream); ··· 171 174 return ret; 172 175 } 173 176 177 + static int davinci_vcif_startup(struct snd_pcm_substream *substream, 178 + struct snd_soc_dai *dai) 179 + { 180 + struct davinci_vcif_dev *dev = snd_soc_dai_get_drvdata(dai); 181 + 182 + snd_soc_dai_set_dma_data(dai, substream, dev->dma_params); 183 + return 0; 184 + } 185 + 174 186 #define DAVINCI_VCIF_RATES SNDRV_PCM_RATE_8000_48000 175 187 176 188 static struct snd_soc_dai_ops davinci_vcif_dai_ops = { 189 + .startup = davinci_vcif_startup, 177 190 .trigger = davinci_vcif_trigger, 178 191 .hw_params = davinci_vcif_hw_params, 179 192 };
+1 -1
sound/soc/fsl/mpc5200_psc_i2s.c
··· 160 160 rc = snd_soc_register_dais(&op->dev, psc_i2s_dai, ARRAY_SIZE(psc_i2s_dai)); 161 161 if (rc != 0) { 162 162 pr_err("Failed to register DAI\n"); 163 - return 0; 163 + return rc; 164 164 } 165 165 166 166 psc_dma = dev_get_drvdata(&op->dev);
+4 -4
sound/soc/imx/eukrea-tlv320.c
··· 34 34 struct snd_pcm_hw_params *params) 35 35 { 36 36 struct snd_soc_pcm_runtime *rtd = substream->private_data; 37 - struct snd_soc_dai *codec_dai = rtd->dai->codec_dai; 38 - struct snd_soc_dai *cpu_dai = rtd->dai->cpu_dai; 37 + struct snd_soc_dai *codec_dai = rtd->codec_dai; 38 + struct snd_soc_dai *cpu_dai = rtd->cpu_dai; 39 39 int ret; 40 40 41 41 ret = snd_soc_dai_set_fmt(cpu_dai, SND_SOC_DAIFMT_I2S | ··· 79 79 static struct snd_soc_dai_link eukrea_tlv320_dai = { 80 80 .name = "tlv320aic23", 81 81 .stream_name = "TLV320AIC23", 82 - .codec_dai = "tlv320aic23-hifi", 82 + .codec_dai_name = "tlv320aic23-hifi", 83 83 .platform_name = "imx-pcm-audio.0", 84 84 .codec_name = "tlv320aic23-codec.0-001a", 85 - .cpu_dai = "imx-ssi.0", 85 + .cpu_dai_name = "imx-ssi.0", 86 86 .ops = &eukrea_tlv320_snd_ops, 87 87 }; 88 88
+104 -129
sound/soc/imx/imx-pcm-dma-mx2.c
··· 20 20 #include <linux/module.h> 21 21 #include <linux/platform_device.h> 22 22 #include <linux/slab.h> 23 + #include <linux/dmaengine.h> 23 24 24 25 #include <sound/core.h> 25 26 #include <sound/initval.h> ··· 28 27 #include <sound/pcm_params.h> 29 28 #include <sound/soc.h> 30 29 31 - #include <mach/dma-mx1-mx2.h> 30 + #include <mach/dma.h> 32 31 33 32 #include "imx-ssi.h" 34 33 35 34 struct imx_pcm_runtime_data { 36 - int sg_count; 37 - struct scatterlist *sg_list; 38 - int period; 35 + int period_bytes; 39 36 int periods; 40 - unsigned long dma_addr; 41 37 int dma; 42 - struct snd_pcm_substream *substream; 43 38 unsigned long offset; 44 39 unsigned long size; 45 - unsigned long period_cnt; 46 40 void *buf; 47 41 int period_time; 42 + struct dma_async_tx_descriptor *desc; 43 + struct dma_chan *dma_chan; 44 + struct imx_dma_data dma_data; 48 45 }; 49 46 50 - /* Called by the DMA framework when a period has elapsed */ 51 - static void imx_ssi_dma_progression(int channel, void *data, 52 - struct scatterlist *sg) 47 + static void audio_dma_irq(void *data) 53 48 { 54 - struct snd_pcm_substream *substream = data; 49 + struct snd_pcm_substream *substream = (struct snd_pcm_substream *)data; 55 50 struct snd_pcm_runtime *runtime = substream->runtime; 56 51 struct imx_pcm_runtime_data *iprtd = runtime->private_data; 57 52 58 - if (!sg) 59 - return; 53 + iprtd->offset += iprtd->period_bytes; 54 + iprtd->offset %= iprtd->period_bytes * iprtd->periods; 60 55 61 - runtime = iprtd->substream->runtime; 62 - 63 - iprtd->offset = sg->dma_address - runtime->dma_addr; 64 - 65 - snd_pcm_period_elapsed(iprtd->substream); 56 + snd_pcm_period_elapsed(substream); 66 57 } 67 58 68 - static void imx_ssi_dma_callback(int channel, void *data) 59 + static bool filter(struct dma_chan *chan, void *param) 69 60 { 70 - pr_err("%s shouldn't be called\n", __func__); 61 + struct imx_pcm_runtime_data *iprtd = param; 62 + 63 + if (!imx_dma_is_general_purpose(chan)) 64 + return false; 65 + 66 + chan->private = &iprtd->dma_data; 67 + 68 + return true; 71 69 } 72 70 73 - static void snd_imx_dma_err_callback(int channel, void *data, int err) 74 - { 75 - struct snd_pcm_substream *substream = data; 76 - struct snd_soc_pcm_runtime *rtd = substream->private_data; 77 - struct imx_pcm_dma_params *dma_params = 78 - snd_soc_dai_get_dma_data(rtd->dai->cpu_dai, substream); 79 - struct snd_pcm_runtime *runtime = substream->runtime; 80 - struct imx_pcm_runtime_data *iprtd = runtime->private_data; 81 - int ret; 82 - 83 - pr_err("DMA timeout on channel %d -%s%s%s%s\n", 84 - channel, 85 - err & IMX_DMA_ERR_BURST ? " burst" : "", 86 - err & IMX_DMA_ERR_REQUEST ? " request" : "", 87 - err & IMX_DMA_ERR_TRANSFER ? " transfer" : "", 88 - err & IMX_DMA_ERR_BUFFER ? " buffer" : ""); 89 - 90 - imx_dma_disable(iprtd->dma); 91 - ret = imx_dma_setup_sg(iprtd->dma, iprtd->sg_list, iprtd->sg_count, 92 - IMX_DMA_LENGTH_LOOP, dma_params->dma_addr, 93 - substream->stream == SNDRV_PCM_STREAM_PLAYBACK ? 94 - DMA_MODE_WRITE : DMA_MODE_READ); 95 - if (!ret) 96 - imx_dma_enable(iprtd->dma); 97 - } 98 - 99 - static int imx_ssi_dma_alloc(struct snd_pcm_substream *substream) 71 + static int imx_ssi_dma_alloc(struct snd_pcm_substream *substream, 72 + struct snd_pcm_hw_params *params) 100 73 { 101 74 struct snd_soc_pcm_runtime *rtd = substream->private_data; 102 75 struct imx_pcm_dma_params *dma_params; 103 76 struct snd_pcm_runtime *runtime = substream->runtime; 104 77 struct imx_pcm_runtime_data *iprtd = runtime->private_data; 78 + struct dma_slave_config slave_config; 79 + dma_cap_mask_t mask; 80 + enum dma_slave_buswidth buswidth; 105 81 int ret; 106 82 107 83 dma_params = snd_soc_dai_get_dma_data(rtd->cpu_dai, substream); 108 84 109 - iprtd->dma = imx_dma_request_by_prio(DRV_NAME, DMA_PRIO_HIGH); 110 - if (iprtd->dma < 0) { 111 - pr_err("Failed to claim the audio DMA\n"); 112 - return -ENODEV; 85 + iprtd->dma_data.peripheral_type = IMX_DMATYPE_SSI; 86 + iprtd->dma_data.priority = DMA_PRIO_HIGH; 87 + iprtd->dma_data.dma_request = dma_params->dma; 88 + 89 + /* Try to grab a DMA channel */ 90 + dma_cap_zero(mask); 91 + dma_cap_set(DMA_SLAVE, mask); 92 + iprtd->dma_chan = dma_request_channel(mask, filter, iprtd); 93 + if (!iprtd->dma_chan) 94 + return -EINVAL; 95 + 96 + switch (params_format(params)) { 97 + case SNDRV_PCM_FORMAT_S16_LE: 98 + buswidth = DMA_SLAVE_BUSWIDTH_2_BYTES; 99 + break; 100 + case SNDRV_PCM_FORMAT_S20_3LE: 101 + case SNDRV_PCM_FORMAT_S24_LE: 102 + buswidth = DMA_SLAVE_BUSWIDTH_4_BYTES; 103 + break; 104 + default: 105 + return 0; 113 106 } 114 107 115 - ret = imx_dma_setup_handlers(iprtd->dma, 116 - imx_ssi_dma_callback, 117 - snd_imx_dma_err_callback, substream); 108 + if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { 109 + slave_config.direction = DMA_TO_DEVICE; 110 + slave_config.dst_addr = dma_params->dma_addr; 111 + slave_config.dst_addr_width = buswidth; 112 + slave_config.dst_maxburst = dma_params->burstsize; 113 + } else { 114 + slave_config.direction = DMA_FROM_DEVICE; 115 + slave_config.src_addr = dma_params->dma_addr; 116 + slave_config.src_addr_width = buswidth; 117 + slave_config.src_maxburst = dma_params->burstsize; 118 + } 119 + 120 + ret = dmaengine_slave_config(iprtd->dma_chan, &slave_config); 118 121 if (ret) 119 - goto out; 120 - 121 - ret = imx_dma_setup_progression_handler(iprtd->dma, 122 - imx_ssi_dma_progression); 123 - if (ret) { 124 - pr_err("Failed to setup the DMA handler\n"); 125 - goto out; 126 - } 127 - 128 - ret = imx_dma_config_channel(iprtd->dma, 129 - IMX_DMA_MEMSIZE_16 | IMX_DMA_TYPE_FIFO, 130 - IMX_DMA_MEMSIZE_32 | IMX_DMA_TYPE_LINEAR, 131 - dma_params->dma, 1); 132 - if (ret < 0) { 133 - pr_err("Cannot configure DMA channel: %d\n", ret); 134 - goto out; 135 - } 136 - 137 - imx_dma_config_burstlen(iprtd->dma, dma_params->burstsize * 2); 122 + return ret; 138 123 139 124 return 0; 140 - out: 141 - imx_dma_free(iprtd->dma); 142 - return ret; 143 125 } 144 126 145 127 static int snd_imx_pcm_hw_params(struct snd_pcm_substream *substream, 146 128 struct snd_pcm_hw_params *params) 147 129 { 130 + struct snd_soc_pcm_runtime *rtd = substream->private_data; 148 131 struct snd_pcm_runtime *runtime = substream->runtime; 149 132 struct imx_pcm_runtime_data *iprtd = runtime->private_data; 150 - int i; 151 133 unsigned long dma_addr; 134 + struct dma_chan *chan; 135 + struct imx_pcm_dma_params *dma_params; 136 + int ret; 152 137 153 - imx_ssi_dma_alloc(substream); 138 + dma_params = snd_soc_dai_get_dma_data(rtd->cpu_dai, substream); 139 + ret = imx_ssi_dma_alloc(substream, params); 140 + if (ret) 141 + return ret; 142 + chan = iprtd->dma_chan; 154 143 155 144 iprtd->size = params_buffer_bytes(params); 156 145 iprtd->periods = params_periods(params); 157 - iprtd->period = params_period_bytes(params); 146 + iprtd->period_bytes = params_period_bytes(params); 158 147 iprtd->offset = 0; 159 148 iprtd->period_time = HZ / (params_rate(params) / 160 149 params_period_size(params)); 161 150 162 151 snd_pcm_set_runtime_buffer(substream, &substream->dma_buffer); 163 152 164 - if (iprtd->sg_count != iprtd->periods) { 165 - kfree(iprtd->sg_list); 166 - 167 - iprtd->sg_list = kcalloc(iprtd->periods + 1, 168 - sizeof(struct scatterlist), GFP_KERNEL); 169 - if (!iprtd->sg_list) 170 - return -ENOMEM; 171 - iprtd->sg_count = iprtd->periods + 1; 172 - } 173 - 174 - sg_init_table(iprtd->sg_list, iprtd->sg_count); 175 153 dma_addr = runtime->dma_addr; 176 154 177 - for (i = 0; i < iprtd->periods; i++) { 178 - iprtd->sg_list[i].page_link = 0; 179 - iprtd->sg_list[i].offset = 0; 180 - iprtd->sg_list[i].dma_address = dma_addr; 181 - iprtd->sg_list[i].length = iprtd->period; 182 - dma_addr += iprtd->period; 155 + iprtd->buf = (unsigned int *)substream->dma_buffer.area; 156 + 157 + iprtd->desc = chan->device->device_prep_dma_cyclic(chan, dma_addr, 158 + iprtd->period_bytes * iprtd->periods, 159 + iprtd->period_bytes, 160 + substream->stream == SNDRV_PCM_STREAM_PLAYBACK ? 161 + DMA_TO_DEVICE : DMA_FROM_DEVICE); 162 + if (!iprtd->desc) { 163 + dev_err(&chan->dev->device, "cannot prepare slave dma\n"); 164 + return -EINVAL; 183 165 } 184 166 185 - /* close the loop */ 186 - iprtd->sg_list[iprtd->sg_count - 1].offset = 0; 187 - iprtd->sg_list[iprtd->sg_count - 1].length = 0; 188 - iprtd->sg_list[iprtd->sg_count - 1].page_link = 189 - ((unsigned long) iprtd->sg_list | 0x01) & ~0x02; 167 + iprtd->desc->callback = audio_dma_irq; 168 + iprtd->desc->callback_param = substream; 169 + 190 170 return 0; 191 171 } 192 172 ··· 176 194 struct snd_pcm_runtime *runtime = substream->runtime; 177 195 struct imx_pcm_runtime_data *iprtd = runtime->private_data; 178 196 179 - if (iprtd->dma >= 0) { 180 - imx_dma_free(iprtd->dma); 181 - iprtd->dma = -EINVAL; 197 + if (iprtd->dma_chan) { 198 + dma_release_channel(iprtd->dma_chan); 199 + iprtd->dma_chan = NULL; 182 200 } 183 - 184 - kfree(iprtd->sg_list); 185 - iprtd->sg_list = NULL; 186 201 187 202 return 0; 188 203 } 189 204 190 205 static int snd_imx_pcm_prepare(struct snd_pcm_substream *substream) 191 206 { 192 - struct snd_pcm_runtime *runtime = substream->runtime; 193 207 struct snd_soc_pcm_runtime *rtd = substream->private_data; 194 208 struct imx_pcm_dma_params *dma_params; 195 - struct imx_pcm_runtime_data *iprtd = runtime->private_data; 196 - int err; 197 209 198 210 dma_params = snd_soc_dai_get_dma_data(rtd->cpu_dai, substream); 199 - 200 - iprtd->substream = substream; 201 - iprtd->buf = (unsigned int *)substream->dma_buffer.area; 202 - iprtd->period_cnt = 0; 203 - 204 - pr_debug("%s: buf: %p period: %d periods: %d\n", 205 - __func__, iprtd->buf, iprtd->period, iprtd->periods); 206 - 207 - err = imx_dma_setup_sg(iprtd->dma, iprtd->sg_list, iprtd->sg_count, 208 - IMX_DMA_LENGTH_LOOP, dma_params->dma_addr, 209 - substream->stream == SNDRV_PCM_STREAM_PLAYBACK ? 210 - DMA_MODE_WRITE : DMA_MODE_READ); 211 - if (err) 212 - return err; 213 211 214 212 return 0; 215 213 } ··· 203 241 case SNDRV_PCM_TRIGGER_START: 204 242 case SNDRV_PCM_TRIGGER_RESUME: 205 243 case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: 206 - imx_dma_enable(iprtd->dma); 244 + dmaengine_submit(iprtd->desc); 207 245 208 246 break; 209 247 210 248 case SNDRV_PCM_TRIGGER_STOP: 211 249 case SNDRV_PCM_TRIGGER_SUSPEND: 212 250 case SNDRV_PCM_TRIGGER_PAUSE_PUSH: 213 - imx_dma_disable(iprtd->dma); 251 + dmaengine_terminate_all(iprtd->dma_chan); 214 252 215 253 break; 216 254 default: ··· 224 262 { 225 263 struct snd_pcm_runtime *runtime = substream->runtime; 226 264 struct imx_pcm_runtime_data *iprtd = runtime->private_data; 265 + 266 + pr_debug("%s: %ld %ld\n", __func__, iprtd->offset, 267 + bytes_to_frames(substream->runtime, iprtd->offset)); 227 268 228 269 return bytes_to_frames(substream->runtime, iprtd->offset); 229 270 } ··· 244 279 .channels_max = 2, 245 280 .buffer_bytes_max = IMX_SSI_DMABUF_SIZE, 246 281 .period_bytes_min = 128, 247 - .period_bytes_max = 16 * 1024, 282 + .period_bytes_max = 65535, /* Limited by SDMA engine */ 248 283 .periods_min = 2, 249 284 .periods_max = 255, 250 285 .fifo_size = 0, ··· 269 304 } 270 305 271 306 snd_soc_set_runtime_hwparams(substream, &snd_imx_hardware); 307 + 308 + return 0; 309 + } 310 + 311 + static int snd_imx_close(struct snd_pcm_substream *substream) 312 + { 313 + struct snd_pcm_runtime *runtime = substream->runtime; 314 + struct imx_pcm_runtime_data *iprtd = runtime->private_data; 315 + 316 + kfree(iprtd); 317 + 272 318 return 0; 273 319 } 274 320 275 321 static struct snd_pcm_ops imx_pcm_ops = { 276 322 .open = snd_imx_open, 323 + .close = snd_imx_close, 277 324 .ioctl = snd_pcm_lib_ioctl, 278 325 .hw_params = snd_imx_pcm_hw_params, 279 326 .hw_free = snd_imx_pcm_hw_free, ··· 317 340 .name = "imx-pcm-audio", 318 341 .owner = THIS_MODULE, 319 342 }, 320 - 321 343 .probe = imx_soc_platform_probe, 322 344 .remove = __devexit_p(imx_soc_platform_remove), 323 345 }; ··· 332 356 platform_driver_unregister(&imx_pcm_driver); 333 357 } 334 358 module_exit(snd_imx_pcm_exit); 335 -
+29 -15
sound/soc/imx/imx-ssi.c
··· 439 439 } 440 440 EXPORT_SYMBOL_GPL(imx_pcm_free); 441 441 442 + static int imx_ssi_dai_probe(struct snd_soc_dai *dai) 443 + { 444 + struct imx_ssi *ssi = dev_get_drvdata(dai->dev); 445 + uint32_t val; 446 + 447 + snd_soc_dai_set_drvdata(dai, ssi); 448 + 449 + val = SSI_SFCSR_TFWM0(ssi->dma_params_tx.burstsize) | 450 + SSI_SFCSR_RFWM0(ssi->dma_params_rx.burstsize); 451 + writel(val, ssi->base + SSI_SFCSR); 452 + 453 + return 0; 454 + } 455 + 442 456 static struct snd_soc_dai_driver imx_ssi_dai = { 457 + .probe = imx_ssi_dai_probe, 443 458 .playback = { 444 459 .channels_min = 2, 445 460 .channels_max = 2, ··· 469 454 }, 470 455 .ops = &imx_ssi_pcm_dai_ops, 471 456 }; 472 - 473 - static int imx_ssi_dai_probe(struct snd_soc_dai *dai) 474 - { 475 - struct imx_ssi *ssi = dev_get_drvdata(dai->dev); 476 - uint32_t val; 477 - 478 - snd_soc_dai_set_drvdata(dai, ssi); 479 - 480 - val = SSI_SFCSR_TFWM0(ssi->dma_params_tx.burstsize) | 481 - SSI_SFCSR_RFWM0(ssi->dma_params_rx.burstsize); 482 - writel(val, ssi->base + SSI_SFCSR); 483 - 484 - return 0; 485 - } 486 457 487 458 static struct snd_soc_dai_driver imx_ac97_dai = { 488 459 .probe = imx_ssi_dai_probe, ··· 678 677 goto failed_register; 679 678 } 680 679 681 - ssi->soc_platform_pdev = platform_device_alloc("imx-fiq-pcm-audio", pdev->id); 680 + ssi->soc_platform_pdev_fiq = platform_device_alloc("imx-fiq-pcm-audio", pdev->id); 681 + if (!ssi->soc_platform_pdev_fiq) 682 + goto failed_pdev_fiq_alloc; 683 + platform_set_drvdata(ssi->soc_platform_pdev_fiq, ssi); 684 + ret = platform_device_add(ssi->soc_platform_pdev_fiq); 685 + if (ret) { 686 + dev_err(&pdev->dev, "failed to add platform device\n"); 687 + goto failed_pdev_fiq_add; 688 + } 689 + 690 + ssi->soc_platform_pdev = platform_device_alloc("imx-pcm-audio", pdev->id); 682 691 if (!ssi->soc_platform_pdev) 683 692 goto failed_pdev_alloc; 684 693 platform_set_drvdata(ssi->soc_platform_pdev, ssi); ··· 703 692 failed_pdev_add: 704 693 platform_device_put(ssi->soc_platform_pdev); 705 694 failed_pdev_alloc: 695 + failed_pdev_fiq_add: 696 + platform_device_put(ssi->soc_platform_pdev_fiq); 697 + failed_pdev_fiq_alloc: 706 698 snd_soc_unregister_dai(&pdev->dev); 707 699 failed_register: 708 700 failed_ac97:
+4
sound/soc/imx/imx-ssi.h
··· 185 185 186 186 #define DRV_NAME "imx-ssi" 187 187 188 + #include <linux/dmaengine.h> 189 + #include <mach/dma.h> 190 + 188 191 struct imx_pcm_dma_params { 189 192 int dma; 190 193 unsigned long dma_addr; ··· 215 212 int enabled; 216 213 217 214 struct platform_device *soc_platform_pdev; 215 + struct platform_device *soc_platform_pdev_fiq; 218 216 }; 219 217 220 218 struct snd_soc_platform *imx_ssi_fiq_init(struct platform_device *pdev,
+1 -4
sound/soc/imx/phycore-ac97.c
··· 20 20 #include <sound/soc-dapm.h> 21 21 #include <asm/mach-types.h> 22 22 23 - #include "../codecs/wm9712.h" 24 - #include "imx-ssi.h" 25 - 26 23 static struct snd_soc_card imx_phycore; 27 24 28 25 static struct snd_soc_ops imx_phycore_hifi_ops = { ··· 38 41 }; 39 42 40 43 static struct snd_soc_card imx_phycore = { 41 - .name = "PhyCORE-audio", 44 + .name = "PhyCORE-ac97-audio", 42 45 .dai_link = imx_phycore_dai_ac97, 43 46 .num_links = ARRAY_SIZE(imx_phycore_dai_ac97), 44 47 };
+8
sound/soc/omap/omap-mcbsp.c
··· 644 644 645 645 646 646 case OMAP_MCBSP_CLKR_SRC_CLKR: 647 + if (cpu_class_is_omap1()) 648 + break; 647 649 omap2_mcbsp1_mux_clkr_src(CLKR_SRC_CLKR); 648 650 break; 649 651 case OMAP_MCBSP_CLKR_SRC_CLKX: 652 + if (cpu_class_is_omap1()) 653 + break; 650 654 omap2_mcbsp1_mux_clkr_src(CLKR_SRC_CLKX); 651 655 break; 652 656 case OMAP_MCBSP_FSR_SRC_FSR: 657 + if (cpu_class_is_omap1()) 658 + break; 653 659 omap2_mcbsp1_mux_fsr_src(FSR_SRC_FSR); 654 660 break; 655 661 case OMAP_MCBSP_FSR_SRC_FSX: 662 + if (cpu_class_is_omap1()) 663 + break; 656 664 omap2_mcbsp1_mux_fsr_src(FSR_SRC_FSX); 657 665 break; 658 666 default:
+5
sound/soc/pxa/corgi.c
··· 100 100 struct snd_soc_pcm_runtime *rtd = substream->private_data; 101 101 struct snd_soc_codec *codec = rtd->codec; 102 102 103 + mutex_lock(&codec->mutex); 104 + 103 105 /* check the jack status at stream startup */ 104 106 corgi_ext_control(codec); 107 + 108 + mutex_unlock(&codec->mutex); 109 + 105 110 return 0; 106 111 } 107 112
+4
sound/soc/pxa/magician.c
··· 72 72 struct snd_soc_pcm_runtime *rtd = substream->private_data; 73 73 struct snd_soc_codec *codec = rtd->codec; 74 74 75 + mutex_lock(&codec->mutex); 76 + 75 77 /* check the jack status at stream startup */ 76 78 magician_ext_control(codec); 79 + 80 + mutex_unlock(&codec->mutex); 77 81 78 82 return 0; 79 83 }
+5
sound/soc/pxa/poodle.c
··· 77 77 struct snd_soc_pcm_runtime *rtd = substream->private_data; 78 78 struct snd_soc_codec *codec = rtd->codec; 79 79 80 + mutex_lock(&codec->mutex); 81 + 80 82 /* check the jack status at stream startup */ 81 83 poodle_ext_control(codec); 84 + 85 + mutex_unlock(&codec->mutex); 86 + 82 87 return 0; 83 88 } 84 89
+5
sound/soc/pxa/spitz.c
··· 108 108 struct snd_soc_pcm_runtime *rtd = substream->private_data; 109 109 struct snd_soc_codec *codec = rtd->codec; 110 110 111 + mutex_lock(&codec->mutex); 112 + 111 113 /* check the jack status at stream startup */ 112 114 spitz_ext_control(codec); 115 + 116 + mutex_unlock(&codec->mutex); 117 + 113 118 return 0; 114 119 } 115 120
+5
sound/soc/pxa/tosa.c
··· 81 81 struct snd_soc_pcm_runtime *rtd = substream->private_data; 82 82 struct snd_soc_codec *codec = rtd->codec; 83 83 84 + mutex_lock(&codec->mutex); 85 + 84 86 /* check the jack status at stream startup */ 85 87 tosa_ext_control(codec); 88 + 89 + mutex_unlock(&codec->mutex); 90 + 86 91 return 0; 87 92 } 88 93
+1
sound/soc/s3c24xx/Kconfig
··· 2 2 tristate "SoC Audio for the Samsung S3CXXXX chips" 3 3 depends on ARCH_S3C2410 || ARCH_S3C64XX || ARCH_S5PC100 || ARCH_S5PV210 4 4 select S3C64XX_DMA if ARCH_S3C64XX 5 + select S3C2410_DMA if ARCH_S3C2410 5 6 help 6 7 Say Y or M if you want to add support for codecs attached to 7 8 the S3C24XX AC97 or I2S interfaces. You will also need to
+3 -17
sound/soc/s3c24xx/rx1950_uda1380.c
··· 50 50 16000, 51 51 44100, 52 52 48000, 53 - 88200, 54 53 }; 55 54 56 55 static struct snd_pcm_hw_constraint_list hw_rates = { ··· 129 130 }; 130 131 131 132 static struct platform_device *s3c24xx_snd_device; 132 - static struct clk *xtal; 133 133 134 134 static int rx1950_startup(struct snd_pcm_substream *substream) 135 135 { ··· 177 179 case 44100: 178 180 case 88200: 179 181 clk_source = S3C24XX_CLKSRC_MPLL; 180 - fs_mode = S3C2410_IISMOD_256FS; 181 - div = clk_get_rate(xtal) / (256 * rate); 182 - if (clk_get_rate(xtal) % (256 * rate) > (128 * rate)) 183 - div++; 182 + fs_mode = S3C2410_IISMOD_384FS; 183 + div = 1; 184 184 break; 185 185 default: 186 186 printk(KERN_ERR "%s: rate %d is not supported\n", ··· 206 210 207 211 /* set MCLK division for sample rate */ 208 212 ret = snd_soc_dai_set_clkdiv(cpu_dai, S3C24XX_DIV_MCLK, 209 - S3C2410_IISMOD_384FS); 213 + fs_mode); 210 214 if (ret < 0) 211 215 return ret; 212 216 ··· 291 295 goto err_plat_add; 292 296 } 293 297 294 - xtal = clk_get(&s3c24xx_snd_device->dev, "xtal"); 295 - 296 - if (IS_ERR(xtal)) { 297 - ret = PTR_ERR(xtal); 298 - platform_device_unregister(s3c24xx_snd_device); 299 - goto err_clk; 300 - } 301 - 302 298 return 0; 303 299 304 - err_clk: 305 300 err_plat_add: 306 301 err_plat_alloc: 307 302 err_gpio_conf: ··· 307 320 platform_device_unregister(s3c24xx_snd_device); 308 321 snd_soc_jack_free_gpios(&hp_jack, ARRAY_SIZE(hp_jack_gpios), 309 322 hp_jack_gpios); 310 - clk_put(xtal); 311 323 gpio_free(S3C2410_GPA(1)); 312 324 } 313 325
+4 -5
sound/soc/soc-core.c
··· 3043 3043 for (i = 0; i < count; i++) { 3044 3044 3045 3045 dai = kzalloc(sizeof(struct snd_soc_dai), GFP_KERNEL); 3046 - if (dai == NULL) 3047 - return -ENOMEM; 3046 + if (dai == NULL) { 3047 + ret = -ENOMEM; 3048 + goto err; 3049 + } 3048 3050 3049 3051 /* create DAI component name */ 3050 3052 dai->name = fmt_multiple_name(dev, &dai_drv[i]); ··· 3265 3263 return 0; 3266 3264 3267 3265 error: 3268 - for (i--; i >= 0; i--) 3269 - snd_soc_unregister_dai(dev); 3270 - 3271 3266 if (codec->reg_cache) 3272 3267 kfree(codec->reg_cache); 3273 3268 kfree(codec->name);
+2 -2
sound/soc/soc-dapm.c
··· 683 683 struct snd_soc_dapm_widget *b, 684 684 int sort[]) 685 685 { 686 - if (a->codec != b->codec) 687 - return (unsigned long)a - (unsigned long)b; 688 686 if (sort[a->id] != sort[b->id]) 689 687 return sort[a->id] - sort[b->id]; 690 688 if (a->reg != b->reg) 691 689 return a->reg - b->reg; 690 + if (a->codec != b->codec) 691 + return (unsigned long)a->codec - (unsigned long)b->codec; 692 692 693 693 return 0; 694 694 }
+1 -1
sound/spi/at73c213.c
··· 155 155 if (max_tries < 1) 156 156 max_tries = 1; 157 157 158 - /* ssc_div must be a power of 2. */ 158 + /* ssc_div must be even. */ 159 159 ssc_div = (ssc_div + 1) & ~1UL; 160 160 161 161 if ((ssc_rate / (ssc_div * 2 * 16)) < BITRATE_MIN) {