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:
ALSA: ice1724 - Fix a typo in IEC958 PCM name
ASoC: fix davinci-sffsdr buglet
ALSA: sound/usb: Use negated usb_endpoint_xfer_control, etc
ALSA: hda - cxt5051 report jack state
ALSA: hda - add basic jack reporting functions to patch_conexant.c
ALSA: Use usb_set/get_intfdata
ASoC: Clean up kerneldoc warnings
ASoC: Fix pxa2xx-pcm checks for invalid DMA channels
LSA: hda - Add HP Acacia detection
ALSA: hda - fix name for ALC1200
ALSA: sound/usb: use USB API functions rather than constants
ASoC: TWL4030: DAPM based capture implementation
ASoC: TWL4030: Make the enum filter generic for twl4030

+374 -255
+111 -3
sound/pci/hda/patch_conexant.c
··· 25 #include <linux/slab.h> 26 #include <linux/pci.h> 27 #include <sound/core.h> 28 #include "hda_codec.h" 29 #include "hda_local.h" 30 ··· 39 #define CONEXANT_HP_EVENT 0x37 40 #define CONEXANT_MIC_EVENT 0x38 41 42 43 44 struct conexant_spec { 45 ··· 97 struct hda_pcm pcm_rec[2]; /* used in build_pcms() */ 98 99 unsigned int spdif_route; 100 101 /* dynamic controls, init_verbs and input_mux */ 102 struct auto_pin_cfg autocfg; ··· 347 &spec->cur_mux[adc_idx]); 348 } 349 350 static int conexant_init(struct hda_codec *codec) 351 { 352 struct conexant_spec *spec = codec->spec; ··· 439 440 static void conexant_free(struct hda_codec *codec) 441 { 442 kfree(codec->spec); 443 } 444 ··· 1634 /* Conexant 5051 specific */ 1635 static hda_nid_t cxt5051_dac_nids[1] = { 0x10 }; 1636 static hda_nid_t cxt5051_adc_nids[2] = { 0x14, 0x15 }; 1637 - #define CXT5051_SPDIF_OUT 0x1C 1638 - #define CXT5051_PORTB_EVENT 0x38 1639 - #define CXT5051_PORTC_EVENT 0x39 1640 1641 static struct hda_channel_mode cxt5051_modes[1] = { 1642 { 2, NULL }, ··· 1713 static void cxt5051_hp_unsol_event(struct hda_codec *codec, 1714 unsigned int res) 1715 { 1716 switch (res >> 26) { 1717 case CONEXANT_HP_EVENT: 1718 cxt5051_hp_automute(codec); ··· 1725 cxt5051_portc_automic(codec); 1726 break; 1727 } 1728 } 1729 1730 static struct snd_kcontrol_new cxt5051_mixers[] = { ··· 1800 static int cxt5051_init(struct hda_codec *codec) 1801 { 1802 conexant_init(codec); 1803 if (codec->patch_ops.unsol_event) { 1804 cxt5051_hp_automute(codec); 1805 cxt5051_portb_automic(codec);
··· 25 #include <linux/slab.h> 26 #include <linux/pci.h> 27 #include <sound/core.h> 28 + #include <sound/jack.h> 29 + 30 #include "hda_codec.h" 31 #include "hda_local.h" 32 ··· 37 #define CONEXANT_HP_EVENT 0x37 38 #define CONEXANT_MIC_EVENT 0x38 39 40 + /* Conexant 5051 specific */ 41 42 + #define CXT5051_SPDIF_OUT 0x1C 43 + #define CXT5051_PORTB_EVENT 0x38 44 + #define CXT5051_PORTC_EVENT 0x39 45 + 46 + 47 + struct conexant_jack { 48 + 49 + hda_nid_t nid; 50 + int type; 51 + struct snd_jack *jack; 52 + 53 + }; 54 55 struct conexant_spec { 56 ··· 82 struct hda_pcm pcm_rec[2]; /* used in build_pcms() */ 83 84 unsigned int spdif_route; 85 + 86 + /* jack detection */ 87 + struct snd_array jacks; 88 89 /* dynamic controls, init_verbs and input_mux */ 90 struct auto_pin_cfg autocfg; ··· 329 &spec->cur_mux[adc_idx]); 330 } 331 332 + static int conexant_add_jack(struct hda_codec *codec, 333 + hda_nid_t nid, int type) 334 + { 335 + struct conexant_spec *spec; 336 + struct conexant_jack *jack; 337 + const char *name; 338 + 339 + spec = codec->spec; 340 + snd_array_init(&spec->jacks, sizeof(*jack), 32); 341 + jack = snd_array_new(&spec->jacks); 342 + name = (type == SND_JACK_HEADPHONE) ? "Headphone" : "Mic" ; 343 + 344 + if (!jack) 345 + return -ENOMEM; 346 + 347 + jack->nid = nid; 348 + jack->type = type; 349 + 350 + return snd_jack_new(codec->bus->card, name, type, &jack->jack); 351 + } 352 + 353 + static void conexant_report_jack(struct hda_codec *codec, hda_nid_t nid) 354 + { 355 + struct conexant_spec *spec = codec->spec; 356 + struct conexant_jack *jacks = spec->jacks.list; 357 + 358 + if (jacks) { 359 + int i; 360 + for (i = 0; i < spec->jacks.used; i++) { 361 + if (jacks->nid == nid) { 362 + unsigned int present; 363 + present = snd_hda_codec_read(codec, nid, 0, 364 + AC_VERB_GET_PIN_SENSE, 0) & 365 + AC_PINSENSE_PRESENCE; 366 + 367 + present = (present) ? jacks->type : 0 ; 368 + 369 + snd_jack_report(jacks->jack, 370 + present); 371 + } 372 + jacks++; 373 + } 374 + } 375 + } 376 + 377 + static int conexant_init_jacks(struct hda_codec *codec) 378 + { 379 + #ifdef CONFIG_SND_JACK 380 + struct conexant_spec *spec = codec->spec; 381 + int i; 382 + 383 + for (i = 0; i < spec->num_init_verbs; i++) { 384 + const struct hda_verb *hv; 385 + 386 + hv = spec->init_verbs[i]; 387 + while (hv->nid) { 388 + int err = 0; 389 + switch (hv->param ^ AC_USRSP_EN) { 390 + case CONEXANT_HP_EVENT: 391 + err = conexant_add_jack(codec, hv->nid, 392 + SND_JACK_HEADPHONE); 393 + conexant_report_jack(codec, hv->nid); 394 + break; 395 + case CXT5051_PORTC_EVENT: 396 + case CONEXANT_MIC_EVENT: 397 + err = conexant_add_jack(codec, hv->nid, 398 + SND_JACK_MICROPHONE); 399 + conexant_report_jack(codec, hv->nid); 400 + break; 401 + } 402 + if (err < 0) 403 + return err; 404 + ++hv; 405 + } 406 + } 407 + #endif 408 + return 0; 409 + 410 + } 411 + 412 static int conexant_init(struct hda_codec *codec) 413 { 414 struct conexant_spec *spec = codec->spec; ··· 341 342 static void conexant_free(struct hda_codec *codec) 343 { 344 + #ifdef CONFIG_SND_JACK 345 + struct conexant_spec *spec = codec->spec; 346 + if (spec->jacks.list) { 347 + struct conexant_jack *jacks = spec->jacks.list; 348 + int i; 349 + for (i = 0; i < spec->jacks.used; i++) 350 + snd_device_free(codec->bus->card, &jacks[i].jack); 351 + snd_array_free(&spec->jacks); 352 + } 353 + #endif 354 kfree(codec->spec); 355 } 356 ··· 1526 /* Conexant 5051 specific */ 1527 static hda_nid_t cxt5051_dac_nids[1] = { 0x10 }; 1528 static hda_nid_t cxt5051_adc_nids[2] = { 0x14, 0x15 }; 1529 1530 static struct hda_channel_mode cxt5051_modes[1] = { 1531 { 2, NULL }, ··· 1608 static void cxt5051_hp_unsol_event(struct hda_codec *codec, 1609 unsigned int res) 1610 { 1611 + int nid = (res & AC_UNSOL_RES_SUBTAG) >> 20; 1612 switch (res >> 26) { 1613 case CONEXANT_HP_EVENT: 1614 cxt5051_hp_automute(codec); ··· 1619 cxt5051_portc_automic(codec); 1620 break; 1621 } 1622 + conexant_report_jack(codec, nid); 1623 } 1624 1625 static struct snd_kcontrol_new cxt5051_mixers[] = { ··· 1693 static int cxt5051_init(struct hda_codec *codec) 1694 { 1695 conexant_init(codec); 1696 + conexant_init_jacks(codec); 1697 if (codec->patch_ops.unsol_event) { 1698 cxt5051_hp_automute(codec); 1699 cxt5051_portb_automic(codec);
+2 -1
sound/pci/hda/patch_realtek.c
··· 8467 SND_PCI_QUIRK(0x103c, 0x2a4f, "HP Samba", ALC888_3ST_HP), 8468 SND_PCI_QUIRK(0x103c, 0x2a60, "HP Lucknow", ALC888_3ST_HP), 8469 SND_PCI_QUIRK(0x103c, 0x2a61, "HP Nettle", ALC883_6ST_DIG), 8470 SND_PCI_QUIRK(0x1043, 0x1873, "Asus M90V", ALC888_ASUS_M90V), 8471 SND_PCI_QUIRK(0x1043, 0x8249, "Asus M2A-VM HDMI", ALC883_3ST_6ch_DIG), 8472 SND_PCI_QUIRK(0x1043, 0x82fe, "Asus P5Q-EM HDMI", ALC1200_ASUS_P5Q), ··· 16639 .patch = patch_alc882 }, /* should be patch_alc883() in future */ 16640 { .id = 0x10ec0885, .name = "ALC885", .patch = patch_alc882 }, 16641 { .id = 0x10ec0887, .name = "ALC887", .patch = patch_alc883 }, 16642 - { .id = 0x10ec0888, .name = "ALC888", .patch = patch_alc883 }, 16643 { .id = 0x10ec0888, .rev = 0x100101, .name = "ALC1200", 16644 .patch = patch_alc883 }, 16645 { .id = 0x10ec0889, .name = "ALC889", .patch = patch_alc883 }, 16646 {} /* terminator */ 16647 };
··· 8467 SND_PCI_QUIRK(0x103c, 0x2a4f, "HP Samba", ALC888_3ST_HP), 8468 SND_PCI_QUIRK(0x103c, 0x2a60, "HP Lucknow", ALC888_3ST_HP), 8469 SND_PCI_QUIRK(0x103c, 0x2a61, "HP Nettle", ALC883_6ST_DIG), 8470 + SND_PCI_QUIRK(0x103c, 0x2a66, "HP Acacia", ALC888_3ST_HP), 8471 SND_PCI_QUIRK(0x1043, 0x1873, "Asus M90V", ALC888_ASUS_M90V), 8472 SND_PCI_QUIRK(0x1043, 0x8249, "Asus M2A-VM HDMI", ALC883_3ST_6ch_DIG), 8473 SND_PCI_QUIRK(0x1043, 0x82fe, "Asus P5Q-EM HDMI", ALC1200_ASUS_P5Q), ··· 16638 .patch = patch_alc882 }, /* should be patch_alc883() in future */ 16639 { .id = 0x10ec0885, .name = "ALC885", .patch = patch_alc882 }, 16640 { .id = 0x10ec0887, .name = "ALC887", .patch = patch_alc883 }, 16641 { .id = 0x10ec0888, .rev = 0x100101, .name = "ALC1200", 16642 .patch = patch_alc883 }, 16643 + { .id = 0x10ec0888, .name = "ALC888", .patch = patch_alc883 }, 16644 { .id = 0x10ec0889, .name = "ALC889", .patch = patch_alc883 }, 16645 {} /* terminator */ 16646 };
+1 -1
sound/pci/ice1712/ice1724.c
··· 1239 if (ice->force_pdma4 || ice->force_rdma1) 1240 name = "ICE1724 Secondary"; 1241 else 1242 - name = "IEC1724 IEC958"; 1243 err = snd_pcm_new(ice->card, name, device, play, capt, &pcm); 1244 if (err < 0) 1245 return err;
··· 1239 if (ice->force_pdma4 || ice->force_rdma1) 1240 name = "ICE1724 Secondary"; 1241 else 1242 + name = "ICE1724 IEC958"; 1243 err = snd_pcm_new(ice->card, name, device, play, capt, &pcm); 1244 if (err < 0) 1245 return err;
+188 -187
sound/soc/codecs/twl4030.c
··· 298 static const struct snd_kcontrol_new twl4030_dapm_handsfreer_control = 299 SOC_DAPM_ENUM("Route", twl4030_handsfreer_enum); 300 301 - static int outmixer_event(struct snd_soc_dapm_widget *w, 302 struct snd_kcontrol *kcontrol, int event) 303 { 304 struct soc_enum *e = (struct soc_enum *)kcontrol->private_value; 305 int ret = 0; 306 int val; 307 308 - switch (e->reg) { 309 - case TWL4030_REG_PREDL_CTL: 310 - case TWL4030_REG_PREDR_CTL: 311 - case TWL4030_REG_EAR_CTL: 312 - val = w->value >> e->shift_l; 313 - if (val == 3) { 314 - printk(KERN_WARNING 315 - "Invalid MUX setting for register 0x%02x (%d)\n", 316 - e->reg, val); 317 - ret = -1; 318 - } 319 - break; 320 } 321 322 return ret; 323 } 324 325 static int handsfree_event(struct snd_soc_dapm_widget *w, ··· 580 return err; 581 } 582 583 - static int twl4030_get_left_input(struct snd_kcontrol *kcontrol, 584 - struct snd_ctl_elem_value *ucontrol) 585 - { 586 - struct snd_soc_codec *codec = kcontrol->private_data; 587 - u8 reg = twl4030_read_reg_cache(codec, TWL4030_REG_ANAMICL); 588 - int result = 0; 589 - 590 - /* one bit must be set a time */ 591 - reg &= TWL4030_CKMIC_EN | TWL4030_AUXL_EN | TWL4030_HSMIC_EN 592 - | TWL4030_MAINMIC_EN; 593 - if (reg != 0) { 594 - result++; 595 - while ((reg & 1) == 0) { 596 - result++; 597 - reg >>= 1; 598 - } 599 - } 600 - 601 - ucontrol->value.integer.value[0] = result; 602 - return 0; 603 - } 604 - 605 - static int twl4030_put_left_input(struct snd_kcontrol *kcontrol, 606 - struct snd_ctl_elem_value *ucontrol) 607 - { 608 - struct snd_soc_codec *codec = kcontrol->private_data; 609 - int value = ucontrol->value.integer.value[0]; 610 - u8 anamicl, micbias, avadc_ctl; 611 - 612 - anamicl = twl4030_read_reg_cache(codec, TWL4030_REG_ANAMICL); 613 - anamicl &= ~(TWL4030_CKMIC_EN | TWL4030_AUXL_EN | TWL4030_HSMIC_EN 614 - | TWL4030_MAINMIC_EN); 615 - micbias = twl4030_read_reg_cache(codec, TWL4030_REG_MICBIAS_CTL); 616 - micbias &= ~(TWL4030_HSMICBIAS_EN | TWL4030_MICBIAS1_EN); 617 - avadc_ctl = twl4030_read_reg_cache(codec, TWL4030_REG_AVADC_CTL); 618 - 619 - switch (value) { 620 - case 1: 621 - anamicl |= TWL4030_MAINMIC_EN; 622 - micbias |= TWL4030_MICBIAS1_EN; 623 - break; 624 - case 2: 625 - anamicl |= TWL4030_HSMIC_EN; 626 - micbias |= TWL4030_HSMICBIAS_EN; 627 - break; 628 - case 3: 629 - anamicl |= TWL4030_AUXL_EN; 630 - break; 631 - case 4: 632 - anamicl |= TWL4030_CKMIC_EN; 633 - break; 634 - default: 635 - break; 636 - } 637 - 638 - /* If some input is selected, enable amp and ADC */ 639 - if (value != 0) { 640 - anamicl |= TWL4030_MICAMPL_EN; 641 - avadc_ctl |= TWL4030_ADCL_EN; 642 - } else { 643 - anamicl &= ~TWL4030_MICAMPL_EN; 644 - avadc_ctl &= ~TWL4030_ADCL_EN; 645 - } 646 - 647 - twl4030_write(codec, TWL4030_REG_ANAMICL, anamicl); 648 - twl4030_write(codec, TWL4030_REG_MICBIAS_CTL, micbias); 649 - twl4030_write(codec, TWL4030_REG_AVADC_CTL, avadc_ctl); 650 - 651 - return 1; 652 - } 653 - 654 - static int twl4030_get_right_input(struct snd_kcontrol *kcontrol, 655 - struct snd_ctl_elem_value *ucontrol) 656 - { 657 - struct snd_soc_codec *codec = kcontrol->private_data; 658 - u8 reg = twl4030_read_reg_cache(codec, TWL4030_REG_ANAMICR); 659 - int value = 0; 660 - 661 - reg &= TWL4030_SUBMIC_EN|TWL4030_AUXR_EN; 662 - switch (reg) { 663 - case TWL4030_SUBMIC_EN: 664 - value = 1; 665 - break; 666 - case TWL4030_AUXR_EN: 667 - value = 2; 668 - break; 669 - default: 670 - break; 671 - } 672 - 673 - ucontrol->value.integer.value[0] = value; 674 - return 0; 675 - } 676 - 677 - static int twl4030_put_right_input(struct snd_kcontrol *kcontrol, 678 - struct snd_ctl_elem_value *ucontrol) 679 - { 680 - struct snd_soc_codec *codec = kcontrol->private_data; 681 - int value = ucontrol->value.integer.value[0]; 682 - u8 anamicr, micbias, avadc_ctl; 683 - 684 - anamicr = twl4030_read_reg_cache(codec, TWL4030_REG_ANAMICR); 685 - anamicr &= ~(TWL4030_SUBMIC_EN|TWL4030_AUXR_EN); 686 - micbias = twl4030_read_reg_cache(codec, TWL4030_REG_MICBIAS_CTL); 687 - micbias &= ~TWL4030_MICBIAS2_EN; 688 - avadc_ctl = twl4030_read_reg_cache(codec, TWL4030_REG_AVADC_CTL); 689 - 690 - switch (value) { 691 - case 1: 692 - anamicr |= TWL4030_SUBMIC_EN; 693 - micbias |= TWL4030_MICBIAS2_EN; 694 - break; 695 - case 2: 696 - anamicr |= TWL4030_AUXR_EN; 697 - break; 698 - default: 699 - break; 700 - } 701 - 702 - if (value != 0) { 703 - anamicr |= TWL4030_MICAMPR_EN; 704 - avadc_ctl |= TWL4030_ADCR_EN; 705 - } else { 706 - anamicr &= ~TWL4030_MICAMPR_EN; 707 - avadc_ctl &= ~TWL4030_ADCR_EN; 708 - } 709 - 710 - twl4030_write(codec, TWL4030_REG_ANAMICR, anamicr); 711 - twl4030_write(codec, TWL4030_REG_MICBIAS_CTL, micbias); 712 - twl4030_write(codec, TWL4030_REG_AVADC_CTL, avadc_ctl); 713 - 714 - return 1; 715 - } 716 - 717 - static const char *twl4030_left_in_sel[] = { 718 - "None", 719 - "Main Mic", 720 - "Headset Mic", 721 - "Line In", 722 - "Carkit Mic", 723 - }; 724 - 725 - static const char *twl4030_right_in_sel[] = { 726 - "None", 727 - "Sub Mic", 728 - "Line In", 729 - }; 730 - 731 - static const struct soc_enum twl4030_left_input_mux = 732 - SOC_ENUM_SINGLE_EXT(ARRAY_SIZE(twl4030_left_in_sel), 733 - twl4030_left_in_sel); 734 - 735 - static const struct soc_enum twl4030_right_input_mux = 736 - SOC_ENUM_SINGLE_EXT(ARRAY_SIZE(twl4030_right_in_sel), 737 - twl4030_right_in_sel); 738 - 739 /* 740 * FGAIN volume control: 741 * from -62 to 0 dB in 1 dB steps (mute instead of -63 dB) ··· 662 TWL4030_REG_EAR_CTL, 4, 3, 0, output_tvl), 663 664 /* Common capture gain controls */ 665 - SOC_DOUBLE_R_TLV("Capture Volume", 666 TWL4030_REG_ATXL1PGA, TWL4030_REG_ATXR1PGA, 667 0, 0x1f, 0, digital_capture_tlv), 668 669 - SOC_DOUBLE_TLV("Input Boost Volume", TWL4030_REG_ANAMIC_GAIN, 670 0, 3, 5, 0, input_gain_tlv), 671 - 672 - /* Input source controls */ 673 - SOC_ENUM_EXT("Left Input Source", twl4030_left_input_mux, 674 - twl4030_get_left_input, twl4030_put_left_input), 675 - SOC_ENUM_EXT("Right Input Source", twl4030_right_input_mux, 676 - twl4030_get_right_input, twl4030_put_right_input), 677 }; 678 679 /* add non dapm controls */ ··· 690 } 691 692 static const struct snd_soc_dapm_widget twl4030_dapm_widgets[] = { 693 - SND_SOC_DAPM_INPUT("INL"), 694 - SND_SOC_DAPM_INPUT("INR"), 695 696 SND_SOC_DAPM_OUTPUT("OUTL"), 697 SND_SOC_DAPM_OUTPUT("OUTR"), 698 SND_SOC_DAPM_OUTPUT("EARPIECE"), ··· 738 /* Output MUX controls */ 739 /* Earpiece */ 740 SND_SOC_DAPM_MUX_E("Earpiece Mux", SND_SOC_NOPM, 0, 0, 741 - &twl4030_dapm_earpiece_control, outmixer_event, 742 SND_SOC_DAPM_PRE_REG), 743 /* PreDrivL/R */ 744 SND_SOC_DAPM_MUX_E("PredriveL Mux", SND_SOC_NOPM, 0, 0, 745 - &twl4030_dapm_predrivel_control, outmixer_event, 746 SND_SOC_DAPM_PRE_REG), 747 SND_SOC_DAPM_MUX_E("PredriveR Mux", SND_SOC_NOPM, 0, 0, 748 - &twl4030_dapm_predriver_control, outmixer_event, 749 SND_SOC_DAPM_PRE_REG), 750 /* HeadsetL/R */ 751 SND_SOC_DAPM_MUX("HeadsetL Mux", SND_SOC_NOPM, 0, 0, ··· 765 &twl4030_dapm_handsfreer_control, handsfree_event, 766 SND_SOC_DAPM_POST_PMU|SND_SOC_DAPM_POST_PMD), 767 768 - SND_SOC_DAPM_ADC("ADCL", "Left Capture", SND_SOC_NOPM, 0, 0), 769 - SND_SOC_DAPM_ADC("ADCR", "Right Capture", SND_SOC_NOPM, 0, 0), 770 }; 771 772 static const struct snd_soc_dapm_route intercon[] = { ··· 864 {"HFL", NULL, "HandsfreeL Mux"}, 865 {"HFR", NULL, "HandsfreeR Mux"}, 866 867 - /* inputs */ 868 - {"ADCL", NULL, "INL"}, 869 - {"ADCR", NULL, "INR"}, 870 }; 871 872 static int twl4030_add_widgets(struct snd_soc_codec *codec) ··· 922 anamicl = twl4030_read_reg_cache(codec, TWL4030_REG_ANAMICL); 923 twl4030_write(codec, TWL4030_REG_ANAMICL, 924 anamicl | TWL4030_CNCL_OFFSET_START); 925 926 /* wait for offset cancellation to complete */ 927 do {
··· 298 static const struct snd_kcontrol_new twl4030_dapm_handsfreer_control = 299 SOC_DAPM_ENUM("Route", twl4030_handsfreer_enum); 300 301 + /* Left analog microphone selection */ 302 + static const char *twl4030_analoglmic_texts[] = 303 + {"Off", "Main mic", "Headset mic", "Invalid", "AUXL", 304 + "Invalid", "Invalid", "Invalid", "Carkit mic"}; 305 + 306 + static const struct soc_enum twl4030_analoglmic_enum = 307 + SOC_ENUM_SINGLE(TWL4030_REG_ANAMICL, 0, 308 + ARRAY_SIZE(twl4030_analoglmic_texts), 309 + twl4030_analoglmic_texts); 310 + 311 + static const struct snd_kcontrol_new twl4030_dapm_analoglmic_control = 312 + SOC_DAPM_ENUM("Route", twl4030_analoglmic_enum); 313 + 314 + /* Right analog microphone selection */ 315 + static const char *twl4030_analogrmic_texts[] = 316 + {"Off", "Sub mic", "Invalid", "Invalid", "AUXR"}; 317 + 318 + static const struct soc_enum twl4030_analogrmic_enum = 319 + SOC_ENUM_SINGLE(TWL4030_REG_ANAMICR, 0, 320 + ARRAY_SIZE(twl4030_analogrmic_texts), 321 + twl4030_analogrmic_texts); 322 + 323 + static const struct snd_kcontrol_new twl4030_dapm_analogrmic_control = 324 + SOC_DAPM_ENUM("Route", twl4030_analogrmic_enum); 325 + 326 + /* TX1 L/R Analog/Digital microphone selection */ 327 + static const char *twl4030_micpathtx1_texts[] = 328 + {"Analog", "Digimic0"}; 329 + 330 + static const struct soc_enum twl4030_micpathtx1_enum = 331 + SOC_ENUM_SINGLE(TWL4030_REG_ADCMICSEL, 0, 332 + ARRAY_SIZE(twl4030_micpathtx1_texts), 333 + twl4030_micpathtx1_texts); 334 + 335 + static const struct snd_kcontrol_new twl4030_dapm_micpathtx1_control = 336 + SOC_DAPM_ENUM("Route", twl4030_micpathtx1_enum); 337 + 338 + /* TX2 L/R Analog/Digital microphone selection */ 339 + static const char *twl4030_micpathtx2_texts[] = 340 + {"Analog", "Digimic1"}; 341 + 342 + static const struct soc_enum twl4030_micpathtx2_enum = 343 + SOC_ENUM_SINGLE(TWL4030_REG_ADCMICSEL, 2, 344 + ARRAY_SIZE(twl4030_micpathtx2_texts), 345 + twl4030_micpathtx2_texts); 346 + 347 + static const struct snd_kcontrol_new twl4030_dapm_micpathtx2_control = 348 + SOC_DAPM_ENUM("Route", twl4030_micpathtx2_enum); 349 + 350 + /* 351 + * This function filters out the non valid mux settings, named as "Invalid" 352 + * in the enum texts. 353 + * Just refuse to set an invalid mux mode. 354 + */ 355 + static int twl4030_enum_event(struct snd_soc_dapm_widget *w, 356 struct snd_kcontrol *kcontrol, int event) 357 { 358 struct soc_enum *e = (struct soc_enum *)kcontrol->private_value; 359 int ret = 0; 360 int val; 361 362 + val = w->value >> e->shift_l; 363 + if (!strcmp("Invalid", e->texts[val])) { 364 + printk(KERN_WARNING "Invalid MUX setting on 0x%02x (%d)\n", 365 + e->reg, val); 366 + ret = -1; 367 } 368 369 return ret; 370 + } 371 + 372 + static int micpath_event(struct snd_soc_dapm_widget *w, 373 + struct snd_kcontrol *kcontrol, int event) 374 + { 375 + struct soc_enum *e = (struct soc_enum *)w->kcontrols->private_value; 376 + unsigned char adcmicsel, micbias_ctl; 377 + 378 + adcmicsel = twl4030_read_reg_cache(w->codec, TWL4030_REG_ADCMICSEL); 379 + micbias_ctl = twl4030_read_reg_cache(w->codec, TWL4030_REG_MICBIAS_CTL); 380 + /* Prepare the bits for the given TX path: 381 + * shift_l == 0: TX1 microphone path 382 + * shift_l == 2: TX2 microphone path */ 383 + if (e->shift_l) { 384 + /* TX2 microphone path */ 385 + if (adcmicsel & TWL4030_TX2IN_SEL) 386 + micbias_ctl |= TWL4030_MICBIAS2_CTL; /* digimic */ 387 + else 388 + micbias_ctl &= ~TWL4030_MICBIAS2_CTL; 389 + } else { 390 + /* TX1 microphone path */ 391 + if (adcmicsel & TWL4030_TX1IN_SEL) 392 + micbias_ctl |= TWL4030_MICBIAS1_CTL; /* digimic */ 393 + else 394 + micbias_ctl &= ~TWL4030_MICBIAS1_CTL; 395 + } 396 + 397 + twl4030_write(w->codec, TWL4030_REG_MICBIAS_CTL, micbias_ctl); 398 + 399 + return 0; 400 } 401 402 static int handsfree_event(struct snd_soc_dapm_widget *w, ··· 503 return err; 504 } 505 506 /* 507 * FGAIN volume control: 508 * from -62 to 0 dB in 1 dB steps (mute instead of -63 dB) ··· 741 TWL4030_REG_EAR_CTL, 4, 3, 0, output_tvl), 742 743 /* Common capture gain controls */ 744 + SOC_DOUBLE_R_TLV("TX1 Digital Capture Volume", 745 TWL4030_REG_ATXL1PGA, TWL4030_REG_ATXR1PGA, 746 0, 0x1f, 0, digital_capture_tlv), 747 + SOC_DOUBLE_R_TLV("TX2 Digital Capture Volume", 748 + TWL4030_REG_AVTXL2PGA, TWL4030_REG_AVTXR2PGA, 749 + 0, 0x1f, 0, digital_capture_tlv), 750 751 + SOC_DOUBLE_TLV("Analog Capture Volume", TWL4030_REG_ANAMIC_GAIN, 752 0, 3, 5, 0, input_gain_tlv), 753 }; 754 755 /* add non dapm controls */ ··· 772 } 773 774 static const struct snd_soc_dapm_widget twl4030_dapm_widgets[] = { 775 + /* Left channel inputs */ 776 + SND_SOC_DAPM_INPUT("MAINMIC"), 777 + SND_SOC_DAPM_INPUT("HSMIC"), 778 + SND_SOC_DAPM_INPUT("AUXL"), 779 + SND_SOC_DAPM_INPUT("CARKITMIC"), 780 + /* Right channel inputs */ 781 + SND_SOC_DAPM_INPUT("SUBMIC"), 782 + SND_SOC_DAPM_INPUT("AUXR"), 783 + /* Digital microphones (Stereo) */ 784 + SND_SOC_DAPM_INPUT("DIGIMIC0"), 785 + SND_SOC_DAPM_INPUT("DIGIMIC1"), 786 787 + /* Outputs */ 788 SND_SOC_DAPM_OUTPUT("OUTL"), 789 SND_SOC_DAPM_OUTPUT("OUTR"), 790 SND_SOC_DAPM_OUTPUT("EARPIECE"), ··· 810 /* Output MUX controls */ 811 /* Earpiece */ 812 SND_SOC_DAPM_MUX_E("Earpiece Mux", SND_SOC_NOPM, 0, 0, 813 + &twl4030_dapm_earpiece_control, twl4030_enum_event, 814 SND_SOC_DAPM_PRE_REG), 815 /* PreDrivL/R */ 816 SND_SOC_DAPM_MUX_E("PredriveL Mux", SND_SOC_NOPM, 0, 0, 817 + &twl4030_dapm_predrivel_control, twl4030_enum_event, 818 SND_SOC_DAPM_PRE_REG), 819 SND_SOC_DAPM_MUX_E("PredriveR Mux", SND_SOC_NOPM, 0, 0, 820 + &twl4030_dapm_predriver_control, twl4030_enum_event, 821 SND_SOC_DAPM_PRE_REG), 822 /* HeadsetL/R */ 823 SND_SOC_DAPM_MUX("HeadsetL Mux", SND_SOC_NOPM, 0, 0, ··· 837 &twl4030_dapm_handsfreer_control, handsfree_event, 838 SND_SOC_DAPM_POST_PMU|SND_SOC_DAPM_POST_PMD), 839 840 + /* Introducing four virtual ADC, since TWL4030 have four channel for 841 + capture */ 842 + SND_SOC_DAPM_ADC("ADC Virtual Left1", "Left Front Capture", 843 + SND_SOC_NOPM, 0, 0), 844 + SND_SOC_DAPM_ADC("ADC Virtual Right1", "Right Front Capture", 845 + SND_SOC_NOPM, 0, 0), 846 + SND_SOC_DAPM_ADC("ADC Virtual Left2", "Left Rear Capture", 847 + SND_SOC_NOPM, 0, 0), 848 + SND_SOC_DAPM_ADC("ADC Virtual Right2", "Right Rear Capture", 849 + SND_SOC_NOPM, 0, 0), 850 + 851 + /* Analog/Digital mic path selection. 852 + TX1 Left/Right: either analog Left/Right or Digimic0 853 + TX2 Left/Right: either analog Left/Right or Digimic1 */ 854 + SND_SOC_DAPM_MUX_E("TX1 Capture Route", SND_SOC_NOPM, 0, 0, 855 + &twl4030_dapm_micpathtx1_control, micpath_event, 856 + SND_SOC_DAPM_POST_PMU|SND_SOC_DAPM_POST_PMD| 857 + SND_SOC_DAPM_POST_REG), 858 + SND_SOC_DAPM_MUX_E("TX2 Capture Route", SND_SOC_NOPM, 0, 0, 859 + &twl4030_dapm_micpathtx2_control, micpath_event, 860 + SND_SOC_DAPM_POST_PMU|SND_SOC_DAPM_POST_PMD| 861 + SND_SOC_DAPM_POST_REG), 862 + 863 + /* Analog input muxes with power switch for the physical ADCL/R */ 864 + SND_SOC_DAPM_MUX_E("Analog Left Capture Route", 865 + TWL4030_REG_AVADC_CTL, 3, 0, &twl4030_dapm_analoglmic_control, 866 + twl4030_enum_event, SND_SOC_DAPM_PRE_REG), 867 + SND_SOC_DAPM_MUX_E("Analog Right Capture Route", 868 + TWL4030_REG_AVADC_CTL, 1, 0, &twl4030_dapm_analogrmic_control, 869 + twl4030_enum_event, SND_SOC_DAPM_PRE_REG), 870 + 871 + SND_SOC_DAPM_PGA("Analog Left Amplifier", 872 + TWL4030_REG_ANAMICL, 4, 0, NULL, 0), 873 + SND_SOC_DAPM_PGA("Analog Right Amplifier", 874 + TWL4030_REG_ANAMICR, 4, 0, NULL, 0), 875 + 876 + SND_SOC_DAPM_PGA("Digimic0 Enable", 877 + TWL4030_REG_ADCMICSEL, 1, 0, NULL, 0), 878 + SND_SOC_DAPM_PGA("Digimic1 Enable", 879 + TWL4030_REG_ADCMICSEL, 3, 0, NULL, 0), 880 + 881 + SND_SOC_DAPM_MICBIAS("Mic Bias 1", TWL4030_REG_MICBIAS_CTL, 0, 0), 882 + SND_SOC_DAPM_MICBIAS("Mic Bias 2", TWL4030_REG_MICBIAS_CTL, 1, 0), 883 + SND_SOC_DAPM_MICBIAS("Headset Mic Bias", TWL4030_REG_MICBIAS_CTL, 2, 0), 884 }; 885 886 static const struct snd_soc_dapm_route intercon[] = { ··· 894 {"HFL", NULL, "HandsfreeL Mux"}, 895 {"HFR", NULL, "HandsfreeR Mux"}, 896 897 + /* Capture path */ 898 + {"Analog Left Capture Route", "Main mic", "MAINMIC"}, 899 + {"Analog Left Capture Route", "Headset mic", "HSMIC"}, 900 + {"Analog Left Capture Route", "AUXL", "AUXL"}, 901 + {"Analog Left Capture Route", "Carkit mic", "CARKITMIC"}, 902 + 903 + {"Analog Right Capture Route", "Sub mic", "SUBMIC"}, 904 + {"Analog Right Capture Route", "AUXR", "AUXR"}, 905 + 906 + {"Analog Left Amplifier", NULL, "Analog Left Capture Route"}, 907 + {"Analog Right Amplifier", NULL, "Analog Right Capture Route"}, 908 + 909 + {"Digimic0 Enable", NULL, "DIGIMIC0"}, 910 + {"Digimic1 Enable", NULL, "DIGIMIC1"}, 911 + 912 + /* TX1 Left capture path */ 913 + {"TX1 Capture Route", "Analog", "Analog Left Amplifier"}, 914 + {"TX1 Capture Route", "Digimic0", "Digimic0 Enable"}, 915 + /* TX1 Right capture path */ 916 + {"TX1 Capture Route", "Analog", "Analog Right Amplifier"}, 917 + {"TX1 Capture Route", "Digimic0", "Digimic0 Enable"}, 918 + /* TX2 Left capture path */ 919 + {"TX2 Capture Route", "Analog", "Analog Left Amplifier"}, 920 + {"TX2 Capture Route", "Digimic1", "Digimic1 Enable"}, 921 + /* TX2 Right capture path */ 922 + {"TX2 Capture Route", "Analog", "Analog Right Amplifier"}, 923 + {"TX2 Capture Route", "Digimic1", "Digimic1 Enable"}, 924 + 925 + {"ADC Virtual Left1", NULL, "TX1 Capture Route"}, 926 + {"ADC Virtual Right1", NULL, "TX1 Capture Route"}, 927 + {"ADC Virtual Left2", NULL, "TX2 Capture Route"}, 928 + {"ADC Virtual Right2", NULL, "TX2 Capture Route"}, 929 + 930 }; 931 932 static int twl4030_add_widgets(struct snd_soc_codec *codec) ··· 922 anamicl = twl4030_read_reg_cache(codec, TWL4030_REG_ANAMICL); 923 twl4030_write(codec, TWL4030_REG_ANAMICL, 924 anamicl | TWL4030_CNCL_OFFSET_START); 925 + 926 927 /* wait for offset cancellation to complete */ 928 do {
+7
sound/soc/codecs/twl4030.h
··· 147 #define TWL4030_AVADC_CLK_PRIORITY 0x04 148 #define TWL4030_ADCR_EN 0x02 149 150 /* AUDIO_IF (0x0E) Fields */ 151 152 #define TWL4030_AIF_SLAVE_EN 0x80
··· 147 #define TWL4030_AVADC_CLK_PRIORITY 0x04 148 #define TWL4030_ADCR_EN 0x02 149 150 + /* TWL4030_REG_ADCMICSEL (0x08) Fields */ 151 + 152 + #define TWL4030_DIGMIC1_EN 0x08 153 + #define TWL4030_TX2IN_SEL 0x04 154 + #define TWL4030_DIGMIC0_EN 0x02 155 + #define TWL4030_TX1IN_SEL 0x01 156 + 157 /* AUDIO_IF (0x0E) Fields */ 158 159 #define TWL4030_AIF_SLAVE_EN 0x80
+4
sound/soc/davinci/davinci-sffsdr.c
··· 24 #include <sound/soc-dapm.h> 25 26 #include <asm/dma.h> 27 #include <asm/plat-sffsdr/sffsdr-fpga.h> 28 29 #include <mach/mcbsp.h> ··· 115 static int __init sffsdr_init(void) 116 { 117 int ret; 118 119 sffsdr_snd_device = platform_device_alloc("soc-audio", 0); 120 if (!sffsdr_snd_device) {
··· 24 #include <sound/soc-dapm.h> 25 26 #include <asm/dma.h> 27 + #include <asm/mach-types.h> 28 #include <asm/plat-sffsdr/sffsdr-fpga.h> 29 30 #include <mach/mcbsp.h> ··· 114 static int __init sffsdr_init(void) 115 { 116 int ret; 117 + 118 + if (!machine_is_sffsdr()) 119 + return -EINVAL; 120 121 sffsdr_snd_device = platform_device_alloc("soc-audio", 0); 122 if (!sffsdr_snd_device) {
+2 -2
sound/soc/pxa/pxa2xx-pcm.c
··· 61 62 __pxa2xx_pcm_hw_free(substream); 63 64 - if (prtd->dma_ch) { 65 pxa_free_dma(prtd->dma_ch); 66 - prtd->dma_ch = 0; 67 } 68 69 return 0;
··· 61 62 __pxa2xx_pcm_hw_free(substream); 63 64 + if (prtd->dma_ch >= 0) { 65 pxa_free_dma(prtd->dma_ch); 66 + prtd->dma_ch = -1; 67 } 68 69 return 0;
+24 -22
sound/soc/soc-core.c
··· 1300 /** 1301 * snd_soc_new_pcms - create new sound card and pcms 1302 * @socdev: the SoC audio device 1303 * 1304 * Create a new sound card based upon the codec and interface pcms. 1305 * ··· 1474 * snd_soc_cnew - create new control 1475 * @_template: control template 1476 * @data: control private data 1477 - * @lnng_name: control long name 1478 * 1479 * Create a new mixer control from a template control. 1480 * ··· 1524 /** 1525 * snd_soc_get_enum_double - enumerated double mixer get callback 1526 * @kcontrol: mixer control 1527 - * @uinfo: control element information 1528 * 1529 * Callback to get the value of a double enumerated mixer. 1530 * ··· 1553 /** 1554 * snd_soc_put_enum_double - enumerated double mixer put callback 1555 * @kcontrol: mixer control 1556 - * @uinfo: control element information 1557 * 1558 * Callback to set the value of a double enumerated mixer. 1559 * ··· 1670 /** 1671 * snd_soc_get_volsw - single mixer get callback 1672 * @kcontrol: mixer control 1673 - * @uinfo: control element information 1674 * 1675 * Callback to get the value of a single mixer control. 1676 * ··· 1709 /** 1710 * snd_soc_put_volsw - single mixer put callback 1711 * @kcontrol: mixer control 1712 - * @uinfo: control element information 1713 * 1714 * Callback to set the value of a single mixer control. 1715 * ··· 1777 /** 1778 * snd_soc_get_volsw_2r - double mixer get callback 1779 * @kcontrol: mixer control 1780 - * @uinfo: control element information 1781 * 1782 * Callback to get the value of a double mixer control that spans 2 registers. 1783 * ··· 1814 /** 1815 * snd_soc_put_volsw_2r - double mixer set callback 1816 * @kcontrol: mixer control 1817 - * @uinfo: control element information 1818 * 1819 * Callback to set the value of a double mixer control that spans 2 registers. 1820 * ··· 1884 /** 1885 * snd_soc_get_volsw_s8 - signed mixer get callback 1886 * @kcontrol: mixer control 1887 - * @uinfo: control element information 1888 * 1889 * Callback to get the value of a signed mixer control. 1890 * ··· 1911 /** 1912 * snd_soc_put_volsw_sgn - signed mixer put callback 1913 * @kcontrol: mixer control 1914 - * @uinfo: control element information 1915 * 1916 * Callback to set the value of a signed mixer control. 1917 * ··· 1956 /** 1957 * snd_soc_dai_set_clkdiv - configure DAI clock dividers. 1958 * @dai: DAI 1959 - * @clk_id: DAI specific clock divider ID 1960 * @div: new clock divisor. 1961 * 1962 * Configures the clock dividers. This is used to derive the best DAI bit and ··· 2062 /** 2063 * snd_soc_register_card - Register a card with the ASoC core 2064 * 2065 - * @param card Card to register 2066 * 2067 * Note that currently this is an internal only function: it will be 2068 * exposed to machine drivers after further backporting of ASoC v2 ··· 2089 /** 2090 * snd_soc_unregister_card - Unregister a card with the ASoC core 2091 * 2092 - * @param card Card to unregister 2093 * 2094 * Note that currently this is an internal only function: it will be 2095 * exposed to machine drivers after further backporting of ASoC v2 ··· 2109 /** 2110 * snd_soc_register_dai - Register a DAI with the ASoC core 2111 * 2112 - * @param dai DAI to register 2113 */ 2114 int snd_soc_register_dai(struct snd_soc_dai *dai) 2115 { ··· 2136 /** 2137 * snd_soc_unregister_dai - Unregister a DAI from the ASoC core 2138 * 2139 - * @param dai DAI to unregister 2140 */ 2141 void snd_soc_unregister_dai(struct snd_soc_dai *dai) 2142 { ··· 2151 /** 2152 * snd_soc_register_dais - Register multiple DAIs with the ASoC core 2153 * 2154 - * @param dai Array of DAIs to register 2155 - * @param count Number of DAIs 2156 */ 2157 int snd_soc_register_dais(struct snd_soc_dai *dai, size_t count) 2158 { ··· 2177 /** 2178 * snd_soc_unregister_dais - Unregister multiple DAIs from the ASoC core 2179 * 2180 - * @param dai Array of DAIs to unregister 2181 - * @param count Number of DAIs 2182 */ 2183 void snd_soc_unregister_dais(struct snd_soc_dai *dai, size_t count) 2184 { ··· 2192 /** 2193 * snd_soc_register_platform - Register a platform with the ASoC core 2194 * 2195 - * @param platform platform to register 2196 */ 2197 int snd_soc_register_platform(struct snd_soc_platform *platform) 2198 { ··· 2215 /** 2216 * snd_soc_unregister_platform - Unregister a platform from the ASoC core 2217 * 2218 - * @param platform platform to unregister 2219 */ 2220 void snd_soc_unregister_platform(struct snd_soc_platform *platform) 2221 { ··· 2230 /** 2231 * snd_soc_register_codec - Register a codec with the ASoC core 2232 * 2233 - * @param codec codec to register 2234 */ 2235 int snd_soc_register_codec(struct snd_soc_codec *codec) 2236 { ··· 2257 /** 2258 * snd_soc_unregister_codec - Unregister a codec from the ASoC core 2259 * 2260 - * @param codec codec to unregister 2261 */ 2262 void snd_soc_unregister_codec(struct snd_soc_codec *codec) 2263 {
··· 1300 /** 1301 * snd_soc_new_pcms - create new sound card and pcms 1302 * @socdev: the SoC audio device 1303 + * @idx: ALSA card index 1304 + * @xid: card identification 1305 * 1306 * Create a new sound card based upon the codec and interface pcms. 1307 * ··· 1472 * snd_soc_cnew - create new control 1473 * @_template: control template 1474 * @data: control private data 1475 + * @long_name: control long name 1476 * 1477 * Create a new mixer control from a template control. 1478 * ··· 1522 /** 1523 * snd_soc_get_enum_double - enumerated double mixer get callback 1524 * @kcontrol: mixer control 1525 + * @ucontrol: control element information 1526 * 1527 * Callback to get the value of a double enumerated mixer. 1528 * ··· 1551 /** 1552 * snd_soc_put_enum_double - enumerated double mixer put callback 1553 * @kcontrol: mixer control 1554 + * @ucontrol: control element information 1555 * 1556 * Callback to set the value of a double enumerated mixer. 1557 * ··· 1668 /** 1669 * snd_soc_get_volsw - single mixer get callback 1670 * @kcontrol: mixer control 1671 + * @ucontrol: control element information 1672 * 1673 * Callback to get the value of a single mixer control. 1674 * ··· 1707 /** 1708 * snd_soc_put_volsw - single mixer put callback 1709 * @kcontrol: mixer control 1710 + * @ucontrol: control element information 1711 * 1712 * Callback to set the value of a single mixer control. 1713 * ··· 1775 /** 1776 * snd_soc_get_volsw_2r - double mixer get callback 1777 * @kcontrol: mixer control 1778 + * @ucontrol: control element information 1779 * 1780 * Callback to get the value of a double mixer control that spans 2 registers. 1781 * ··· 1812 /** 1813 * snd_soc_put_volsw_2r - double mixer set callback 1814 * @kcontrol: mixer control 1815 + * @ucontrol: control element information 1816 * 1817 * Callback to set the value of a double mixer control that spans 2 registers. 1818 * ··· 1882 /** 1883 * snd_soc_get_volsw_s8 - signed mixer get callback 1884 * @kcontrol: mixer control 1885 + * @ucontrol: control element information 1886 * 1887 * Callback to get the value of a signed mixer control. 1888 * ··· 1909 /** 1910 * snd_soc_put_volsw_sgn - signed mixer put callback 1911 * @kcontrol: mixer control 1912 + * @ucontrol: control element information 1913 * 1914 * Callback to set the value of a signed mixer control. 1915 * ··· 1954 /** 1955 * snd_soc_dai_set_clkdiv - configure DAI clock dividers. 1956 * @dai: DAI 1957 + * @div_id: DAI specific clock divider ID 1958 * @div: new clock divisor. 1959 * 1960 * Configures the clock dividers. This is used to derive the best DAI bit and ··· 2060 /** 2061 * snd_soc_register_card - Register a card with the ASoC core 2062 * 2063 + * @card: Card to register 2064 * 2065 * Note that currently this is an internal only function: it will be 2066 * exposed to machine drivers after further backporting of ASoC v2 ··· 2087 /** 2088 * snd_soc_unregister_card - Unregister a card with the ASoC core 2089 * 2090 + * @card: Card to unregister 2091 * 2092 * Note that currently this is an internal only function: it will be 2093 * exposed to machine drivers after further backporting of ASoC v2 ··· 2107 /** 2108 * snd_soc_register_dai - Register a DAI with the ASoC core 2109 * 2110 + * @dai: DAI to register 2111 */ 2112 int snd_soc_register_dai(struct snd_soc_dai *dai) 2113 { ··· 2134 /** 2135 * snd_soc_unregister_dai - Unregister a DAI from the ASoC core 2136 * 2137 + * @dai: DAI to unregister 2138 */ 2139 void snd_soc_unregister_dai(struct snd_soc_dai *dai) 2140 { ··· 2149 /** 2150 * snd_soc_register_dais - Register multiple DAIs with the ASoC core 2151 * 2152 + * @dai: Array of DAIs to register 2153 + * @count: Number of DAIs 2154 */ 2155 int snd_soc_register_dais(struct snd_soc_dai *dai, size_t count) 2156 { ··· 2175 /** 2176 * snd_soc_unregister_dais - Unregister multiple DAIs from the ASoC core 2177 * 2178 + * @dai: Array of DAIs to unregister 2179 + * @count: Number of DAIs 2180 */ 2181 void snd_soc_unregister_dais(struct snd_soc_dai *dai, size_t count) 2182 { ··· 2190 /** 2191 * snd_soc_register_platform - Register a platform with the ASoC core 2192 * 2193 + * @platform: platform to register 2194 */ 2195 int snd_soc_register_platform(struct snd_soc_platform *platform) 2196 { ··· 2213 /** 2214 * snd_soc_unregister_platform - Unregister a platform from the ASoC core 2215 * 2216 + * @platform: platform to unregister 2217 */ 2218 void snd_soc_unregister_platform(struct snd_soc_platform *platform) 2219 { ··· 2228 /** 2229 * snd_soc_register_codec - Register a codec with the ASoC core 2230 * 2231 + * @codec: codec to register 2232 */ 2233 int snd_soc_register_codec(struct snd_soc_codec *codec) 2234 { ··· 2255 /** 2256 * snd_soc_unregister_codec - Unregister a codec from the ASoC core 2257 * 2258 + * @codec: codec to unregister 2259 */ 2260 void snd_soc_unregister_codec(struct snd_soc_codec *codec) 2261 {
+5 -5
sound/soc/soc-dapm.c
··· 1077 /** 1078 * snd_soc_dapm_get_volsw - dapm mixer get callback 1079 * @kcontrol: mixer control 1080 - * @uinfo: control element information 1081 * 1082 * Callback to get the value of a dapm mixer control. 1083 * ··· 1122 /** 1123 * snd_soc_dapm_put_volsw - dapm mixer set callback 1124 * @kcontrol: mixer control 1125 - * @uinfo: control element information 1126 * 1127 * Callback to set the value of a dapm mixer control. 1128 * ··· 1193 /** 1194 * snd_soc_dapm_get_enum_double - dapm enumerated double mixer get callback 1195 * @kcontrol: mixer control 1196 - * @uinfo: control element information 1197 * 1198 * Callback to get the value of a dapm enumerated double mixer control. 1199 * ··· 1221 /** 1222 * snd_soc_dapm_put_enum_double - dapm enumerated double mixer set callback 1223 * @kcontrol: mixer control 1224 - * @uinfo: control element information 1225 * 1226 * Callback to set the value of a dapm enumerated double mixer control. 1227 * ··· 1419 1420 /** 1421 * snd_soc_dapm_enable_pin - enable pin. 1422 - * @snd_soc_codec: SoC codec 1423 * @pin: pin name 1424 * 1425 * Enables input/output pin and it's parents or children widgets iff there is
··· 1077 /** 1078 * snd_soc_dapm_get_volsw - dapm mixer get callback 1079 * @kcontrol: mixer control 1080 + * @ucontrol: control element information 1081 * 1082 * Callback to get the value of a dapm mixer control. 1083 * ··· 1122 /** 1123 * snd_soc_dapm_put_volsw - dapm mixer set callback 1124 * @kcontrol: mixer control 1125 + * @ucontrol: control element information 1126 * 1127 * Callback to set the value of a dapm mixer control. 1128 * ··· 1193 /** 1194 * snd_soc_dapm_get_enum_double - dapm enumerated double mixer get callback 1195 * @kcontrol: mixer control 1196 + * @ucontrol: control element information 1197 * 1198 * Callback to get the value of a dapm enumerated double mixer control. 1199 * ··· 1221 /** 1222 * snd_soc_dapm_put_enum_double - dapm enumerated double mixer set callback 1223 * @kcontrol: mixer control 1224 + * @ucontrol: control element information 1225 * 1226 * Callback to set the value of a dapm enumerated double mixer control. 1227 * ··· 1419 1420 /** 1421 * snd_soc_dapm_enable_pin - enable pin. 1422 + * @codec: SoC codec 1423 * @pin: pin name 1424 * 1425 * Enables input/output pin and it's parents or children widgets iff there is
+2 -2
sound/usb/caiaq/caiaq-device.c
··· 446 if (!card) 447 return -ENOMEM; 448 449 - dev_set_drvdata(&intf->dev, card); 450 ret = init_card(caiaqdev(card)); 451 if (ret < 0) { 452 log("unable to init card! (ret=%d)\n", ret); ··· 460 static void snd_disconnect(struct usb_interface *intf) 461 { 462 struct snd_usb_caiaqdev *dev; 463 - struct snd_card *card = dev_get_drvdata(&intf->dev); 464 465 debug("%s(%p)\n", __func__, intf); 466
··· 446 if (!card) 447 return -ENOMEM; 448 449 + usb_set_intfdata(intf, card); 450 ret = init_card(caiaqdev(card)); 451 if (ret < 0) { 452 log("unable to init card! (ret=%d)\n", ret); ··· 460 static void snd_disconnect(struct usb_interface *intf) 461 { 462 struct snd_usb_caiaqdev *dev; 463 + struct snd_card *card = usb_get_intfdata(intf); 464 465 debug("%s(%p)\n", __func__, intf); 466
+4 -4
sound/usb/usbaudio.c
··· 3709 void *chip; 3710 chip = snd_usb_audio_probe(interface_to_usbdev(intf), intf, id); 3711 if (chip) { 3712 - dev_set_drvdata(&intf->dev, chip); 3713 return 0; 3714 } else 3715 return -EIO; ··· 3718 static void usb_audio_disconnect(struct usb_interface *intf) 3719 { 3720 snd_usb_audio_disconnect(interface_to_usbdev(intf), 3721 - dev_get_drvdata(&intf->dev)); 3722 } 3723 3724 #ifdef CONFIG_PM 3725 static int usb_audio_suspend(struct usb_interface *intf, pm_message_t message) 3726 { 3727 - struct snd_usb_audio *chip = dev_get_drvdata(&intf->dev); 3728 struct list_head *p; 3729 struct snd_usb_stream *as; 3730 ··· 3744 3745 static int usb_audio_resume(struct usb_interface *intf) 3746 { 3747 - struct snd_usb_audio *chip = dev_get_drvdata(&intf->dev); 3748 3749 if (chip == (void *)-1L) 3750 return 0;
··· 3709 void *chip; 3710 chip = snd_usb_audio_probe(interface_to_usbdev(intf), intf, id); 3711 if (chip) { 3712 + usb_set_intfdata(intf, chip); 3713 return 0; 3714 } else 3715 return -EIO; ··· 3718 static void usb_audio_disconnect(struct usb_interface *intf) 3719 { 3720 snd_usb_audio_disconnect(interface_to_usbdev(intf), 3721 + usb_get_intfdata(intf)); 3722 } 3723 3724 #ifdef CONFIG_PM 3725 static int usb_audio_suspend(struct usb_interface *intf, pm_message_t message) 3726 { 3727 + struct snd_usb_audio *chip = usb_get_intfdata(intf); 3728 struct list_head *p; 3729 struct snd_usb_stream *as; 3730 ··· 3744 3745 static int usb_audio_resume(struct usb_interface *intf) 3746 { 3747 + struct snd_usb_audio *chip = usb_get_intfdata(intf); 3748 3749 if (chip == (void *)-1L) 3750 return 0;
+18 -21
sound/usb/usbmidi.c
··· 1392 for (i = 0; i < intfd->bNumEndpoints; ++i) { 1393 hostep = &hostif->endpoint[i]; 1394 ep = get_ep_desc(hostep); 1395 - if ((ep->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) != USB_ENDPOINT_XFER_BULK && 1396 - (ep->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) != USB_ENDPOINT_XFER_INT) 1397 continue; 1398 ms_ep = (struct usb_ms_endpoint_descriptor*)hostep->extra; 1399 if (hostep->extralen < 4 || ··· 1400 ms_ep->bDescriptorType != USB_DT_CS_ENDPOINT || 1401 ms_ep->bDescriptorSubtype != MS_GENERAL) 1402 continue; 1403 - if ((ep->bEndpointAddress & USB_ENDPOINT_DIR_MASK) == USB_DIR_OUT) { 1404 if (endpoints[epidx].out_ep) { 1405 if (++epidx >= MIDI_MAX_ENDPOINTS) { 1406 snd_printk(KERN_WARNING "too many endpoints\n"); 1407 break; 1408 } 1409 } 1410 - endpoints[epidx].out_ep = ep->bEndpointAddress & USB_ENDPOINT_NUMBER_MASK; 1411 - if ((ep->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) == USB_ENDPOINT_XFER_INT) 1412 endpoints[epidx].out_interval = ep->bInterval; 1413 else if (snd_usb_get_speed(umidi->chip->dev) == USB_SPEED_LOW) 1414 /* ··· 1427 break; 1428 } 1429 } 1430 - endpoints[epidx].in_ep = ep->bEndpointAddress & USB_ENDPOINT_NUMBER_MASK; 1431 - if ((ep->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) == USB_ENDPOINT_XFER_INT) 1432 endpoints[epidx].in_interval = ep->bInterval; 1433 else if (snd_usb_get_speed(umidi->chip->dev) == USB_SPEED_LOW) 1434 endpoints[epidx].in_interval = 1; ··· 1494 1495 for (i = 0; i < intfd->bNumEndpoints; ++i) { 1496 epd = get_endpoint(hostif, i); 1497 - if ((epd->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) != USB_ENDPOINT_XFER_BULK && 1498 - (epd->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) != USB_ENDPOINT_XFER_INT) 1499 continue; 1500 if (out_eps < max_endpoints && 1501 - (epd->bEndpointAddress & USB_ENDPOINT_DIR_MASK) == USB_DIR_OUT) { 1502 - endpoint[out_eps].out_ep = epd->bEndpointAddress & USB_ENDPOINT_NUMBER_MASK; 1503 - if ((epd->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) == USB_ENDPOINT_XFER_INT) 1504 endpoint[out_eps].out_interval = epd->bInterval; 1505 ++out_eps; 1506 } 1507 if (in_eps < max_endpoints && 1508 - (epd->bEndpointAddress & USB_ENDPOINT_DIR_MASK) == USB_DIR_IN) { 1509 - endpoint[in_eps].in_ep = epd->bEndpointAddress & USB_ENDPOINT_NUMBER_MASK; 1510 - if ((epd->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) == USB_ENDPOINT_XFER_INT) 1511 endpoint[in_eps].in_interval = epd->bInterval; 1512 ++in_eps; 1513 } ··· 1606 } 1607 1608 epd = get_endpoint(hostif, 0); 1609 - if ((epd->bEndpointAddress & USB_ENDPOINT_DIR_MASK) != USB_DIR_IN || 1610 - (epd->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) != USB_ENDPOINT_XFER_INT) { 1611 snd_printdd(KERN_ERR "endpoint[0] isn't interrupt\n"); 1612 return -ENXIO; 1613 } 1614 epd = get_endpoint(hostif, 2); 1615 - if ((epd->bEndpointAddress & USB_ENDPOINT_DIR_MASK) != USB_DIR_OUT || 1616 - (epd->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) != USB_ENDPOINT_XFER_BULK) { 1617 snd_printdd(KERN_ERR "endpoint[2] isn't bulk output\n"); 1618 return -ENXIO; 1619 } 1620 if (endpoint->out_cables > 0x0001) { 1621 epd = get_endpoint(hostif, 4); 1622 - if ((epd->bEndpointAddress & USB_ENDPOINT_DIR_MASK) != USB_DIR_OUT || 1623 - (epd->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) != USB_ENDPOINT_XFER_BULK) { 1624 snd_printdd(KERN_ERR "endpoint[4] isn't bulk output\n"); 1625 return -ENXIO; 1626 }
··· 1392 for (i = 0; i < intfd->bNumEndpoints; ++i) { 1393 hostep = &hostif->endpoint[i]; 1394 ep = get_ep_desc(hostep); 1395 + if (!usb_endpoint_xfer_bulk(ep) && !usb_endpoint_xfer_int(ep)) 1396 continue; 1397 ms_ep = (struct usb_ms_endpoint_descriptor*)hostep->extra; 1398 if (hostep->extralen < 4 || ··· 1401 ms_ep->bDescriptorType != USB_DT_CS_ENDPOINT || 1402 ms_ep->bDescriptorSubtype != MS_GENERAL) 1403 continue; 1404 + if (usb_endpoint_dir_out(ep)) { 1405 if (endpoints[epidx].out_ep) { 1406 if (++epidx >= MIDI_MAX_ENDPOINTS) { 1407 snd_printk(KERN_WARNING "too many endpoints\n"); 1408 break; 1409 } 1410 } 1411 + endpoints[epidx].out_ep = usb_endpoint_num(ep); 1412 + if (usb_endpoint_xfer_int(ep)) 1413 endpoints[epidx].out_interval = ep->bInterval; 1414 else if (snd_usb_get_speed(umidi->chip->dev) == USB_SPEED_LOW) 1415 /* ··· 1428 break; 1429 } 1430 } 1431 + endpoints[epidx].in_ep = usb_endpoint_num(ep); 1432 + if (usb_endpoint_xfer_int(ep)) 1433 endpoints[epidx].in_interval = ep->bInterval; 1434 else if (snd_usb_get_speed(umidi->chip->dev) == USB_SPEED_LOW) 1435 endpoints[epidx].in_interval = 1; ··· 1495 1496 for (i = 0; i < intfd->bNumEndpoints; ++i) { 1497 epd = get_endpoint(hostif, i); 1498 + if (!usb_endpoint_xfer_bulk(epd) && 1499 + !usb_endpoint_xfer_int(epd)) 1500 continue; 1501 if (out_eps < max_endpoints && 1502 + usb_endpoint_dir_out(epd)) { 1503 + endpoint[out_eps].out_ep = usb_endpoint_num(epd); 1504 + if (usb_endpoint_xfer_int(epd)) 1505 endpoint[out_eps].out_interval = epd->bInterval; 1506 ++out_eps; 1507 } 1508 if (in_eps < max_endpoints && 1509 + usb_endpoint_dir_in(epd)) { 1510 + endpoint[in_eps].in_ep = usb_endpoint_num(epd); 1511 + if (usb_endpoint_xfer_int(epd)) 1512 endpoint[in_eps].in_interval = epd->bInterval; 1513 ++in_eps; 1514 } ··· 1607 } 1608 1609 epd = get_endpoint(hostif, 0); 1610 + if (!usb_endpoint_dir_in(epd) || !usb_endpoint_xfer_int(epd)) { 1611 snd_printdd(KERN_ERR "endpoint[0] isn't interrupt\n"); 1612 return -ENXIO; 1613 } 1614 epd = get_endpoint(hostif, 2); 1615 + if (!usb_endpoint_dir_out(epd) || !usb_endpoint_xfer_bulk(epd)) { 1616 snd_printdd(KERN_ERR "endpoint[2] isn't bulk output\n"); 1617 return -ENXIO; 1618 } 1619 if (endpoint->out_cables > 0x0001) { 1620 epd = get_endpoint(hostif, 4); 1621 + if (!usb_endpoint_dir_out(epd) || 1622 + !usb_endpoint_xfer_bulk(epd)) { 1623 snd_printdd(KERN_ERR "endpoint[4] isn't bulk output\n"); 1624 return -ENXIO; 1625 }
+2 -3
sound/usb/usbmixer.c
··· 1755 if (get_iface_desc(hostif)->bNumEndpoints < 1) 1756 return 0; 1757 ep = get_endpoint(hostif, 0); 1758 - if ((ep->bEndpointAddress & USB_ENDPOINT_DIR_MASK) != USB_DIR_IN || 1759 - (ep->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) != USB_ENDPOINT_XFER_INT) 1760 return 0; 1761 1762 - epnum = ep->bEndpointAddress & USB_ENDPOINT_NUMBER_MASK; 1763 buffer_length = le16_to_cpu(ep->wMaxPacketSize); 1764 transfer_buffer = kmalloc(buffer_length, GFP_KERNEL); 1765 if (!transfer_buffer)
··· 1755 if (get_iface_desc(hostif)->bNumEndpoints < 1) 1756 return 0; 1757 ep = get_endpoint(hostif, 0); 1758 + if (!usb_endpoint_dir_in(ep) || !usb_endpoint_xfer_int(ep)) 1759 return 0; 1760 1761 + epnum = usb_endpoint_num(ep); 1762 buffer_length = le16_to_cpu(ep->wMaxPacketSize); 1763 transfer_buffer = kmalloc(buffer_length, GFP_KERNEL); 1764 if (!transfer_buffer)
+2 -2
sound/usb/usx2y/us122l.c
··· 589 struct us122l *us122l; 590 struct list_head *p; 591 592 - card = dev_get_drvdata(&intf->dev); 593 if (!card) 594 return 0; 595 snd_power_change_state(card, SNDRV_CTL_POWER_D3hot); ··· 615 struct list_head *p; 616 int err; 617 618 - card = dev_get_drvdata(&intf->dev); 619 if (!card) 620 return 0; 621
··· 589 struct us122l *us122l; 590 struct list_head *p; 591 592 + card = usb_get_intfdata(intf); 593 if (!card) 594 return 0; 595 snd_power_change_state(card, SNDRV_CTL_POWER_D3hot); ··· 615 struct list_head *p; 616 int err; 617 618 + card = usb_get_intfdata(intf); 619 if (!card) 620 return 0; 621
+2 -2
sound/usb/usx2y/usbusx2y.c
··· 392 void *chip; 393 chip = usX2Y_usb_probe(interface_to_usbdev(intf), intf, id); 394 if (chip) { 395 - dev_set_drvdata(&intf->dev, chip); 396 return 0; 397 } else 398 return -EIO; ··· 401 static void snd_usX2Y_disconnect(struct usb_interface *intf) 402 { 403 usX2Y_usb_disconnect(interface_to_usbdev(intf), 404 - dev_get_drvdata(&intf->dev)); 405 } 406 407 MODULE_DEVICE_TABLE(usb, snd_usX2Y_usb_id_table);
··· 392 void *chip; 393 chip = usX2Y_usb_probe(interface_to_usbdev(intf), intf, id); 394 if (chip) { 395 + usb_set_intfdata(intf, chip); 396 return 0; 397 } else 398 return -EIO; ··· 401 static void snd_usX2Y_disconnect(struct usb_interface *intf) 402 { 403 usX2Y_usb_disconnect(interface_to_usbdev(intf), 404 + usb_get_intfdata(intf)); 405 } 406 407 MODULE_DEVICE_TABLE(usb, snd_usX2Y_usb_id_table);