aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sound/pci/hda/patch_conexant.c114
-rw-r--r--sound/pci/hda/patch_realtek.c3
-rw-r--r--sound/pci/ice1712/ice1724.c2
-rw-r--r--sound/soc/codecs/twl4030.c377
-rw-r--r--sound/soc/codecs/twl4030.h7
-rw-r--r--sound/soc/davinci/davinci-sffsdr.c4
-rw-r--r--sound/soc/pxa/pxa2xx-pcm.c4
-rw-r--r--sound/soc/soc-core.c46
-rw-r--r--sound/soc/soc-dapm.c10
-rw-r--r--sound/usb/caiaq/caiaq-device.c4
-rw-r--r--sound/usb/usbaudio.c8
-rw-r--r--sound/usb/usbmidi.c39
-rw-r--r--sound/usb/usbmixer.c5
-rw-r--r--sound/usb/usx2y/us122l.c4
-rw-r--r--sound/usb/usx2y/usbusx2y.c4
15 files changed, 375 insertions, 256 deletions
diff --git a/sound/pci/hda/patch_conexant.c b/sound/pci/hda/patch_conexant.c
index b20e1cede00b..75de40aaab0a 100644
--- a/sound/pci/hda/patch_conexant.c
+++ b/sound/pci/hda/patch_conexant.c
@@ -25,6 +25,8 @@
25#include <linux/slab.h> 25#include <linux/slab.h>
26#include <linux/pci.h> 26#include <linux/pci.h>
27#include <sound/core.h> 27#include <sound/core.h>
28#include <sound/jack.h>
29
28#include "hda_codec.h" 30#include "hda_codec.h"
29#include "hda_local.h" 31#include "hda_local.h"
30 32
@@ -37,8 +39,21 @@
37#define CONEXANT_HP_EVENT 0x37 39#define CONEXANT_HP_EVENT 0x37
38#define CONEXANT_MIC_EVENT 0x38 40#define CONEXANT_MIC_EVENT 0x38
39 41
42/* Conexant 5051 specific */
43
44#define CXT5051_SPDIF_OUT 0x1C
45#define CXT5051_PORTB_EVENT 0x38
46#define CXT5051_PORTC_EVENT 0x39
40 47
41 48
49struct conexant_jack {
50
51 hda_nid_t nid;
52 int type;
53 struct snd_jack *jack;
54
55};
56
42struct conexant_spec { 57struct conexant_spec {
43 58
44 struct snd_kcontrol_new *mixers[5]; 59 struct snd_kcontrol_new *mixers[5];
@@ -83,6 +98,9 @@ struct conexant_spec {
83 98
84 unsigned int spdif_route; 99 unsigned int spdif_route;
85 100
101 /* jack detection */
102 struct snd_array jacks;
103
86 /* dynamic controls, init_verbs and input_mux */ 104 /* dynamic controls, init_verbs and input_mux */
87 struct auto_pin_cfg autocfg; 105 struct auto_pin_cfg autocfg;
88 struct hda_input_mux private_imux; 106 struct hda_input_mux private_imux;
@@ -329,6 +347,86 @@ static int conexant_mux_enum_put(struct snd_kcontrol *kcontrol,
329 &spec->cur_mux[adc_idx]); 347 &spec->cur_mux[adc_idx]);
330} 348}
331 349
350static int conexant_add_jack(struct hda_codec *codec,
351 hda_nid_t nid, int type)
352{
353 struct conexant_spec *spec;
354 struct conexant_jack *jack;
355 const char *name;
356
357 spec = codec->spec;
358 snd_array_init(&spec->jacks, sizeof(*jack), 32);
359 jack = snd_array_new(&spec->jacks);
360 name = (type == SND_JACK_HEADPHONE) ? "Headphone" : "Mic" ;
361
362 if (!jack)
363 return -ENOMEM;
364
365 jack->nid = nid;
366 jack->type = type;
367
368 return snd_jack_new(codec->bus->card, name, type, &jack->jack);
369}
370
371static void conexant_report_jack(struct hda_codec *codec, hda_nid_t nid)
372{
373 struct conexant_spec *spec = codec->spec;
374 struct conexant_jack *jacks = spec->jacks.list;
375
376 if (jacks) {
377 int i;
378 for (i = 0; i < spec->jacks.used; i++) {
379 if (jacks->nid == nid) {
380 unsigned int present;
381 present = snd_hda_codec_read(codec, nid, 0,
382 AC_VERB_GET_PIN_SENSE, 0) &
383 AC_PINSENSE_PRESENCE;
384
385 present = (present) ? jacks->type : 0 ;
386
387 snd_jack_report(jacks->jack,
388 present);
389 }
390 jacks++;
391 }
392 }
393}
394
395static int conexant_init_jacks(struct hda_codec *codec)
396{
397#ifdef CONFIG_SND_JACK
398 struct conexant_spec *spec = codec->spec;
399 int i;
400
401 for (i = 0; i < spec->num_init_verbs; i++) {
402 const struct hda_verb *hv;
403
404 hv = spec->init_verbs[i];
405 while (hv->nid) {
406 int err = 0;
407 switch (hv->param ^ AC_USRSP_EN) {
408 case CONEXANT_HP_EVENT:
409 err = conexant_add_jack(codec, hv->nid,
410 SND_JACK_HEADPHONE);
411 conexant_report_jack(codec, hv->nid);
412 break;
413 case CXT5051_PORTC_EVENT:
414 case CONEXANT_MIC_EVENT:
415 err = conexant_add_jack(codec, hv->nid,
416 SND_JACK_MICROPHONE);
417 conexant_report_jack(codec, hv->nid);
418 break;
419 }
420 if (err < 0)
421 return err;
422 ++hv;
423 }
424 }
425#endif
426 return 0;
427
428}
429
332static int conexant_init(struct hda_codec *codec) 430static int conexant_init(struct hda_codec *codec)
333{ 431{
334 struct conexant_spec *spec = codec->spec; 432 struct conexant_spec *spec = codec->spec;
@@ -341,6 +439,16 @@ static int conexant_init(struct hda_codec *codec)
341 439
342static void conexant_free(struct hda_codec *codec) 440static void conexant_free(struct hda_codec *codec)
343{ 441{
442#ifdef CONFIG_SND_JACK
443 struct conexant_spec *spec = codec->spec;
444 if (spec->jacks.list) {
445 struct conexant_jack *jacks = spec->jacks.list;
446 int i;
447 for (i = 0; i < spec->jacks.used; i++)
448 snd_device_free(codec->bus->card, &jacks[i].jack);
449 snd_array_free(&spec->jacks);
450 }
451#endif
344 kfree(codec->spec); 452 kfree(codec->spec);
345} 453}
346 454
@@ -1526,9 +1634,6 @@ static int patch_cxt5047(struct hda_codec *codec)
1526/* Conexant 5051 specific */ 1634/* Conexant 5051 specific */
1527static hda_nid_t cxt5051_dac_nids[1] = { 0x10 }; 1635static hda_nid_t cxt5051_dac_nids[1] = { 0x10 };
1528static hda_nid_t cxt5051_adc_nids[2] = { 0x14, 0x15 }; 1636static hda_nid_t cxt5051_adc_nids[2] = { 0x14, 0x15 };
1529#define CXT5051_SPDIF_OUT 0x1C
1530#define CXT5051_PORTB_EVENT 0x38
1531#define CXT5051_PORTC_EVENT 0x39
1532 1637
1533static struct hda_channel_mode cxt5051_modes[1] = { 1638static struct hda_channel_mode cxt5051_modes[1] = {
1534 { 2, NULL }, 1639 { 2, NULL },
@@ -1608,6 +1713,7 @@ static void cxt5051_hp_automute(struct hda_codec *codec)
1608static void cxt5051_hp_unsol_event(struct hda_codec *codec, 1713static void cxt5051_hp_unsol_event(struct hda_codec *codec,
1609 unsigned int res) 1714 unsigned int res)
1610{ 1715{
1716 int nid = (res & AC_UNSOL_RES_SUBTAG) >> 20;
1611 switch (res >> 26) { 1717 switch (res >> 26) {
1612 case CONEXANT_HP_EVENT: 1718 case CONEXANT_HP_EVENT:
1613 cxt5051_hp_automute(codec); 1719 cxt5051_hp_automute(codec);
@@ -1619,6 +1725,7 @@ static void cxt5051_hp_unsol_event(struct hda_codec *codec,
1619 cxt5051_portc_automic(codec); 1725 cxt5051_portc_automic(codec);
1620 break; 1726 break;
1621 } 1727 }
1728 conexant_report_jack(codec, nid);
1622} 1729}
1623 1730
1624static struct snd_kcontrol_new cxt5051_mixers[] = { 1731static struct snd_kcontrol_new cxt5051_mixers[] = {
@@ -1693,6 +1800,7 @@ static struct hda_verb cxt5051_init_verbs[] = {
1693static int cxt5051_init(struct hda_codec *codec) 1800static int cxt5051_init(struct hda_codec *codec)
1694{ 1801{
1695 conexant_init(codec); 1802 conexant_init(codec);
1803 conexant_init_jacks(codec);
1696 if (codec->patch_ops.unsol_event) { 1804 if (codec->patch_ops.unsol_event) {
1697 cxt5051_hp_automute(codec); 1805 cxt5051_hp_automute(codec);
1698 cxt5051_portb_automic(codec); 1806 cxt5051_portb_automic(codec);
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index 0bd4e6bf354d..9065ebf9c065 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -8467,6 +8467,7 @@ static struct snd_pci_quirk alc883_cfg_tbl[] = {
8467 SND_PCI_QUIRK(0x103c, 0x2a4f, "HP Samba", ALC888_3ST_HP), 8467 SND_PCI_QUIRK(0x103c, 0x2a4f, "HP Samba", ALC888_3ST_HP),
8468 SND_PCI_QUIRK(0x103c, 0x2a60, "HP Lucknow", 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), 8469 SND_PCI_QUIRK(0x103c, 0x2a61, "HP Nettle", ALC883_6ST_DIG),
8470 SND_PCI_QUIRK(0x103c, 0x2a66, "HP Acacia", ALC888_3ST_HP),
8470 SND_PCI_QUIRK(0x1043, 0x1873, "Asus M90V", ALC888_ASUS_M90V), 8471 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, 0x8249, "Asus M2A-VM HDMI", ALC883_3ST_6ch_DIG),
8472 SND_PCI_QUIRK(0x1043, 0x82fe, "Asus P5Q-EM HDMI", ALC1200_ASUS_P5Q), 8473 SND_PCI_QUIRK(0x1043, 0x82fe, "Asus P5Q-EM HDMI", ALC1200_ASUS_P5Q),
@@ -16638,9 +16639,9 @@ static struct hda_codec_preset snd_hda_preset_realtek[] = {
16638 .patch = patch_alc882 }, /* should be patch_alc883() in future */ 16639 .patch = patch_alc882 }, /* should be patch_alc883() in future */
16639 { .id = 0x10ec0885, .name = "ALC885", .patch = patch_alc882 }, 16640 { .id = 0x10ec0885, .name = "ALC885", .patch = patch_alc882 },
16640 { .id = 0x10ec0887, .name = "ALC887", .patch = patch_alc883 }, 16641 { .id = 0x10ec0887, .name = "ALC887", .patch = patch_alc883 },
16641 { .id = 0x10ec0888, .name = "ALC888", .patch = patch_alc883 },
16642 { .id = 0x10ec0888, .rev = 0x100101, .name = "ALC1200", 16642 { .id = 0x10ec0888, .rev = 0x100101, .name = "ALC1200",
16643 .patch = patch_alc883 }, 16643 .patch = patch_alc883 },
16644 { .id = 0x10ec0888, .name = "ALC888", .patch = patch_alc883 },
16644 { .id = 0x10ec0889, .name = "ALC889", .patch = patch_alc883 }, 16645 { .id = 0x10ec0889, .name = "ALC889", .patch = patch_alc883 },
16645 {} /* terminator */ 16646 {} /* terminator */
16646}; 16647};
diff --git a/sound/pci/ice1712/ice1724.c b/sound/pci/ice1712/ice1724.c
index 0dfa0540ce2c..bb8d8c766b9d 100644
--- a/sound/pci/ice1712/ice1724.c
+++ b/sound/pci/ice1712/ice1724.c
@@ -1239,7 +1239,7 @@ static int __devinit snd_vt1724_pcm_spdif(struct snd_ice1712 *ice, int device)
1239 if (ice->force_pdma4 || ice->force_rdma1) 1239 if (ice->force_pdma4 || ice->force_rdma1)
1240 name = "ICE1724 Secondary"; 1240 name = "ICE1724 Secondary";
1241 else 1241 else
1242 name = "IEC1724 IEC958"; 1242 name = "ICE1724 IEC958";
1243 err = snd_pcm_new(ice->card, name, device, play, capt, &pcm); 1243 err = snd_pcm_new(ice->card, name, device, play, capt, &pcm);
1244 if (err < 0) 1244 if (err < 0)
1245 return err; 1245 return err;
diff --git a/sound/soc/codecs/twl4030.c b/sound/soc/codecs/twl4030.c
index 51848880504a..31e44e346dc8 100644
--- a/sound/soc/codecs/twl4030.c
+++ b/sound/soc/codecs/twl4030.c
@@ -298,30 +298,107 @@ static const struct soc_enum twl4030_handsfreer_enum =
298static const struct snd_kcontrol_new twl4030_dapm_handsfreer_control = 298static const struct snd_kcontrol_new twl4030_dapm_handsfreer_control =
299SOC_DAPM_ENUM("Route", twl4030_handsfreer_enum); 299SOC_DAPM_ENUM("Route", twl4030_handsfreer_enum);
300 300
301static int outmixer_event(struct snd_soc_dapm_widget *w, 301/* Left analog microphone selection */
302static const char *twl4030_analoglmic_texts[] =
303 {"Off", "Main mic", "Headset mic", "Invalid", "AUXL",
304 "Invalid", "Invalid", "Invalid", "Carkit mic"};
305
306static 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
311static const struct snd_kcontrol_new twl4030_dapm_analoglmic_control =
312SOC_DAPM_ENUM("Route", twl4030_analoglmic_enum);
313
314/* Right analog microphone selection */
315static const char *twl4030_analogrmic_texts[] =
316 {"Off", "Sub mic", "Invalid", "Invalid", "AUXR"};
317
318static 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
323static const struct snd_kcontrol_new twl4030_dapm_analogrmic_control =
324SOC_DAPM_ENUM("Route", twl4030_analogrmic_enum);
325
326/* TX1 L/R Analog/Digital microphone selection */
327static const char *twl4030_micpathtx1_texts[] =
328 {"Analog", "Digimic0"};
329
330static 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
335static const struct snd_kcontrol_new twl4030_dapm_micpathtx1_control =
336SOC_DAPM_ENUM("Route", twl4030_micpathtx1_enum);
337
338/* TX2 L/R Analog/Digital microphone selection */
339static const char *twl4030_micpathtx2_texts[] =
340 {"Analog", "Digimic1"};
341
342static 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
347static const struct snd_kcontrol_new twl4030_dapm_micpathtx2_control =
348SOC_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 */
355static int twl4030_enum_event(struct snd_soc_dapm_widget *w,
302 struct snd_kcontrol *kcontrol, int event) 356 struct snd_kcontrol *kcontrol, int event)
303{ 357{
304 struct soc_enum *e = (struct soc_enum *)kcontrol->private_value; 358 struct soc_enum *e = (struct soc_enum *)kcontrol->private_value;
305 int ret = 0; 359 int ret = 0;
306 int val; 360 int val;
307 361
308 switch (e->reg) { 362 val = w->value >> e->shift_l;
309 case TWL4030_REG_PREDL_CTL: 363 if (!strcmp("Invalid", e->texts[val])) {
310 case TWL4030_REG_PREDR_CTL: 364 printk(KERN_WARNING "Invalid MUX setting on 0x%02x (%d)\n",
311 case TWL4030_REG_EAR_CTL: 365 e->reg, val);
312 val = w->value >> e->shift_l; 366 ret = -1;
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 } 367 }
321 368
322 return ret; 369 return ret;
323} 370}
324 371
372static 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
325static int handsfree_event(struct snd_soc_dapm_widget *w, 402static int handsfree_event(struct snd_soc_dapm_widget *w,
326 struct snd_kcontrol *kcontrol, int event) 403 struct snd_kcontrol *kcontrol, int event)
327{ 404{
@@ -503,162 +580,6 @@ static int snd_soc_put_volsw_r2_twl4030(struct snd_kcontrol *kcontrol,
503 return err; 580 return err;
504} 581}
505 582
506static int twl4030_get_left_input(struct snd_kcontrol *kcontrol,
507 struct snd_ctl_elem_value *ucontrol)
508{
509 struct snd_soc_codec *codec = kcontrol->private_data;
510 u8 reg = twl4030_read_reg_cache(codec, TWL4030_REG_ANAMICL);
511 int result = 0;
512
513 /* one bit must be set a time */
514 reg &= TWL4030_CKMIC_EN | TWL4030_AUXL_EN | TWL4030_HSMIC_EN
515 | TWL4030_MAINMIC_EN;
516 if (reg != 0) {
517 result++;
518 while ((reg & 1) == 0) {
519 result++;
520 reg >>= 1;
521 }
522 }
523
524 ucontrol->value.integer.value[0] = result;
525 return 0;
526}
527
528static int twl4030_put_left_input(struct snd_kcontrol *kcontrol,
529 struct snd_ctl_elem_value *ucontrol)
530{
531 struct snd_soc_codec *codec = kcontrol->private_data;
532 int value = ucontrol->value.integer.value[0];
533 u8 anamicl, micbias, avadc_ctl;
534
535 anamicl = twl4030_read_reg_cache(codec, TWL4030_REG_ANAMICL);
536 anamicl &= ~(TWL4030_CKMIC_EN | TWL4030_AUXL_EN | TWL4030_HSMIC_EN
537 | TWL4030_MAINMIC_EN);
538 micbias = twl4030_read_reg_cache(codec, TWL4030_REG_MICBIAS_CTL);
539 micbias &= ~(TWL4030_HSMICBIAS_EN | TWL4030_MICBIAS1_EN);
540 avadc_ctl = twl4030_read_reg_cache(codec, TWL4030_REG_AVADC_CTL);
541
542 switch (value) {
543 case 1:
544 anamicl |= TWL4030_MAINMIC_EN;
545 micbias |= TWL4030_MICBIAS1_EN;
546 break;
547 case 2:
548 anamicl |= TWL4030_HSMIC_EN;
549 micbias |= TWL4030_HSMICBIAS_EN;
550 break;
551 case 3:
552 anamicl |= TWL4030_AUXL_EN;
553 break;
554 case 4:
555 anamicl |= TWL4030_CKMIC_EN;
556 break;
557 default:
558 break;
559 }
560
561 /* If some input is selected, enable amp and ADC */
562 if (value != 0) {
563 anamicl |= TWL4030_MICAMPL_EN;
564 avadc_ctl |= TWL4030_ADCL_EN;
565 } else {
566 anamicl &= ~TWL4030_MICAMPL_EN;
567 avadc_ctl &= ~TWL4030_ADCL_EN;
568 }
569
570 twl4030_write(codec, TWL4030_REG_ANAMICL, anamicl);
571 twl4030_write(codec, TWL4030_REG_MICBIAS_CTL, micbias);
572 twl4030_write(codec, TWL4030_REG_AVADC_CTL, avadc_ctl);
573
574 return 1;
575}
576
577static int twl4030_get_right_input(struct snd_kcontrol *kcontrol,
578 struct snd_ctl_elem_value *ucontrol)
579{
580 struct snd_soc_codec *codec = kcontrol->private_data;
581 u8 reg = twl4030_read_reg_cache(codec, TWL4030_REG_ANAMICR);
582 int value = 0;
583
584 reg &= TWL4030_SUBMIC_EN|TWL4030_AUXR_EN;
585 switch (reg) {
586 case TWL4030_SUBMIC_EN:
587 value = 1;
588 break;
589 case TWL4030_AUXR_EN:
590 value = 2;
591 break;
592 default:
593 break;
594 }
595
596 ucontrol->value.integer.value[0] = value;
597 return 0;
598}
599
600static int twl4030_put_right_input(struct snd_kcontrol *kcontrol,
601 struct snd_ctl_elem_value *ucontrol)
602{
603 struct snd_soc_codec *codec = kcontrol->private_data;
604 int value = ucontrol->value.integer.value[0];
605 u8 anamicr, micbias, avadc_ctl;
606
607 anamicr = twl4030_read_reg_cache(codec, TWL4030_REG_ANAMICR);
608 anamicr &= ~(TWL4030_SUBMIC_EN|TWL4030_AUXR_EN);
609 micbias = twl4030_read_reg_cache(codec, TWL4030_REG_MICBIAS_CTL);
610 micbias &= ~TWL4030_MICBIAS2_EN;
611 avadc_ctl = twl4030_read_reg_cache(codec, TWL4030_REG_AVADC_CTL);
612
613 switch (value) {
614 case 1:
615 anamicr |= TWL4030_SUBMIC_EN;
616 micbias |= TWL4030_MICBIAS2_EN;
617 break;
618 case 2:
619 anamicr |= TWL4030_AUXR_EN;
620 break;
621 default:
622 break;
623 }
624
625 if (value != 0) {
626 anamicr |= TWL4030_MICAMPR_EN;
627 avadc_ctl |= TWL4030_ADCR_EN;
628 } else {
629 anamicr &= ~TWL4030_MICAMPR_EN;
630 avadc_ctl &= ~TWL4030_ADCR_EN;
631 }
632
633 twl4030_write(codec, TWL4030_REG_ANAMICR, anamicr);
634 twl4030_write(codec, TWL4030_REG_MICBIAS_CTL, micbias);
635 twl4030_write(codec, TWL4030_REG_AVADC_CTL, avadc_ctl);
636
637 return 1;
638}
639
640static const char *twl4030_left_in_sel[] = {
641 "None",
642 "Main Mic",
643 "Headset Mic",
644 "Line In",
645 "Carkit Mic",
646};
647
648static const char *twl4030_right_in_sel[] = {
649 "None",
650 "Sub Mic",
651 "Line In",
652};
653
654static const struct soc_enum twl4030_left_input_mux =
655 SOC_ENUM_SINGLE_EXT(ARRAY_SIZE(twl4030_left_in_sel),
656 twl4030_left_in_sel);
657
658static const struct soc_enum twl4030_right_input_mux =
659 SOC_ENUM_SINGLE_EXT(ARRAY_SIZE(twl4030_right_in_sel),
660 twl4030_right_in_sel);
661
662/* 583/*
663 * FGAIN volume control: 584 * FGAIN volume control:
664 * from -62 to 0 dB in 1 dB steps (mute instead of -63 dB) 585 * from -62 to 0 dB in 1 dB steps (mute instead of -63 dB)
@@ -741,18 +662,15 @@ static const struct snd_kcontrol_new twl4030_snd_controls[] = {
741 TWL4030_REG_EAR_CTL, 4, 3, 0, output_tvl), 662 TWL4030_REG_EAR_CTL, 4, 3, 0, output_tvl),
742 663
743 /* Common capture gain controls */ 664 /* Common capture gain controls */
744 SOC_DOUBLE_R_TLV("Capture Volume", 665 SOC_DOUBLE_R_TLV("TX1 Digital Capture Volume",
745 TWL4030_REG_ATXL1PGA, TWL4030_REG_ATXR1PGA, 666 TWL4030_REG_ATXL1PGA, TWL4030_REG_ATXR1PGA,
746 0, 0x1f, 0, digital_capture_tlv), 667 0, 0x1f, 0, digital_capture_tlv),
668 SOC_DOUBLE_R_TLV("TX2 Digital Capture Volume",
669 TWL4030_REG_AVTXL2PGA, TWL4030_REG_AVTXR2PGA,
670 0, 0x1f, 0, digital_capture_tlv),
747 671
748 SOC_DOUBLE_TLV("Input Boost Volume", TWL4030_REG_ANAMIC_GAIN, 672 SOC_DOUBLE_TLV("Analog Capture Volume", TWL4030_REG_ANAMIC_GAIN,
749 0, 3, 5, 0, input_gain_tlv), 673 0, 3, 5, 0, input_gain_tlv),
750
751 /* Input source controls */
752 SOC_ENUM_EXT("Left Input Source", twl4030_left_input_mux,
753 twl4030_get_left_input, twl4030_put_left_input),
754 SOC_ENUM_EXT("Right Input Source", twl4030_right_input_mux,
755 twl4030_get_right_input, twl4030_put_right_input),
756}; 674};
757 675
758/* add non dapm controls */ 676/* add non dapm controls */
@@ -772,9 +690,19 @@ static int twl4030_add_controls(struct snd_soc_codec *codec)
772} 690}
773 691
774static const struct snd_soc_dapm_widget twl4030_dapm_widgets[] = { 692static const struct snd_soc_dapm_widget twl4030_dapm_widgets[] = {
775 SND_SOC_DAPM_INPUT("INL"), 693 /* Left channel inputs */
776 SND_SOC_DAPM_INPUT("INR"), 694 SND_SOC_DAPM_INPUT("MAINMIC"),
777 695 SND_SOC_DAPM_INPUT("HSMIC"),
696 SND_SOC_DAPM_INPUT("AUXL"),
697 SND_SOC_DAPM_INPUT("CARKITMIC"),
698 /* Right channel inputs */
699 SND_SOC_DAPM_INPUT("SUBMIC"),
700 SND_SOC_DAPM_INPUT("AUXR"),
701 /* Digital microphones (Stereo) */
702 SND_SOC_DAPM_INPUT("DIGIMIC0"),
703 SND_SOC_DAPM_INPUT("DIGIMIC1"),
704
705 /* Outputs */
778 SND_SOC_DAPM_OUTPUT("OUTL"), 706 SND_SOC_DAPM_OUTPUT("OUTL"),
779 SND_SOC_DAPM_OUTPUT("OUTR"), 707 SND_SOC_DAPM_OUTPUT("OUTR"),
780 SND_SOC_DAPM_OUTPUT("EARPIECE"), 708 SND_SOC_DAPM_OUTPUT("EARPIECE"),
@@ -810,14 +738,14 @@ static const struct snd_soc_dapm_widget twl4030_dapm_widgets[] = {
810 /* Output MUX controls */ 738 /* Output MUX controls */
811 /* Earpiece */ 739 /* Earpiece */
812 SND_SOC_DAPM_MUX_E("Earpiece Mux", SND_SOC_NOPM, 0, 0, 740 SND_SOC_DAPM_MUX_E("Earpiece Mux", SND_SOC_NOPM, 0, 0,
813 &twl4030_dapm_earpiece_control, outmixer_event, 741 &twl4030_dapm_earpiece_control, twl4030_enum_event,
814 SND_SOC_DAPM_PRE_REG), 742 SND_SOC_DAPM_PRE_REG),
815 /* PreDrivL/R */ 743 /* PreDrivL/R */
816 SND_SOC_DAPM_MUX_E("PredriveL Mux", SND_SOC_NOPM, 0, 0, 744 SND_SOC_DAPM_MUX_E("PredriveL Mux", SND_SOC_NOPM, 0, 0,
817 &twl4030_dapm_predrivel_control, outmixer_event, 745 &twl4030_dapm_predrivel_control, twl4030_enum_event,
818 SND_SOC_DAPM_PRE_REG), 746 SND_SOC_DAPM_PRE_REG),
819 SND_SOC_DAPM_MUX_E("PredriveR Mux", SND_SOC_NOPM, 0, 0, 747 SND_SOC_DAPM_MUX_E("PredriveR Mux", SND_SOC_NOPM, 0, 0,
820 &twl4030_dapm_predriver_control, outmixer_event, 748 &twl4030_dapm_predriver_control, twl4030_enum_event,
821 SND_SOC_DAPM_PRE_REG), 749 SND_SOC_DAPM_PRE_REG),
822 /* HeadsetL/R */ 750 /* HeadsetL/R */
823 SND_SOC_DAPM_MUX("HeadsetL Mux", SND_SOC_NOPM, 0, 0, 751 SND_SOC_DAPM_MUX("HeadsetL Mux", SND_SOC_NOPM, 0, 0,
@@ -837,8 +765,50 @@ static const struct snd_soc_dapm_widget twl4030_dapm_widgets[] = {
837 &twl4030_dapm_handsfreer_control, handsfree_event, 765 &twl4030_dapm_handsfreer_control, handsfree_event,
838 SND_SOC_DAPM_POST_PMU|SND_SOC_DAPM_POST_PMD), 766 SND_SOC_DAPM_POST_PMU|SND_SOC_DAPM_POST_PMD),
839 767
840 SND_SOC_DAPM_ADC("ADCL", "Left Capture", SND_SOC_NOPM, 0, 0), 768 /* Introducing four virtual ADC, since TWL4030 have four channel for
841 SND_SOC_DAPM_ADC("ADCR", "Right Capture", SND_SOC_NOPM, 0, 0), 769 capture */
770 SND_SOC_DAPM_ADC("ADC Virtual Left1", "Left Front Capture",
771 SND_SOC_NOPM, 0, 0),
772 SND_SOC_DAPM_ADC("ADC Virtual Right1", "Right Front Capture",
773 SND_SOC_NOPM, 0, 0),
774 SND_SOC_DAPM_ADC("ADC Virtual Left2", "Left Rear Capture",
775 SND_SOC_NOPM, 0, 0),
776 SND_SOC_DAPM_ADC("ADC Virtual Right2", "Right Rear Capture",
777 SND_SOC_NOPM, 0, 0),
778
779 /* Analog/Digital mic path selection.
780 TX1 Left/Right: either analog Left/Right or Digimic0
781 TX2 Left/Right: either analog Left/Right or Digimic1 */
782 SND_SOC_DAPM_MUX_E("TX1 Capture Route", SND_SOC_NOPM, 0, 0,
783 &twl4030_dapm_micpathtx1_control, micpath_event,
784 SND_SOC_DAPM_POST_PMU|SND_SOC_DAPM_POST_PMD|
785 SND_SOC_DAPM_POST_REG),
786 SND_SOC_DAPM_MUX_E("TX2 Capture Route", SND_SOC_NOPM, 0, 0,
787 &twl4030_dapm_micpathtx2_control, micpath_event,
788 SND_SOC_DAPM_POST_PMU|SND_SOC_DAPM_POST_PMD|
789 SND_SOC_DAPM_POST_REG),
790
791 /* Analog input muxes with power switch for the physical ADCL/R */
792 SND_SOC_DAPM_MUX_E("Analog Left Capture Route",
793 TWL4030_REG_AVADC_CTL, 3, 0, &twl4030_dapm_analoglmic_control,
794 twl4030_enum_event, SND_SOC_DAPM_PRE_REG),
795 SND_SOC_DAPM_MUX_E("Analog Right Capture Route",
796 TWL4030_REG_AVADC_CTL, 1, 0, &twl4030_dapm_analogrmic_control,
797 twl4030_enum_event, SND_SOC_DAPM_PRE_REG),
798
799 SND_SOC_DAPM_PGA("Analog Left Amplifier",
800 TWL4030_REG_ANAMICL, 4, 0, NULL, 0),
801 SND_SOC_DAPM_PGA("Analog Right Amplifier",
802 TWL4030_REG_ANAMICR, 4, 0, NULL, 0),
803
804 SND_SOC_DAPM_PGA("Digimic0 Enable",
805 TWL4030_REG_ADCMICSEL, 1, 0, NULL, 0),
806 SND_SOC_DAPM_PGA("Digimic1 Enable",
807 TWL4030_REG_ADCMICSEL, 3, 0, NULL, 0),
808
809 SND_SOC_DAPM_MICBIAS("Mic Bias 1", TWL4030_REG_MICBIAS_CTL, 0, 0),
810 SND_SOC_DAPM_MICBIAS("Mic Bias 2", TWL4030_REG_MICBIAS_CTL, 1, 0),
811 SND_SOC_DAPM_MICBIAS("Headset Mic Bias", TWL4030_REG_MICBIAS_CTL, 2, 0),
842}; 812};
843 813
844static const struct snd_soc_dapm_route intercon[] = { 814static const struct snd_soc_dapm_route intercon[] = {
@@ -894,9 +864,39 @@ static const struct snd_soc_dapm_route intercon[] = {
894 {"HFL", NULL, "HandsfreeL Mux"}, 864 {"HFL", NULL, "HandsfreeL Mux"},
895 {"HFR", NULL, "HandsfreeR Mux"}, 865 {"HFR", NULL, "HandsfreeR Mux"},
896 866
897 /* inputs */ 867 /* Capture path */
898 {"ADCL", NULL, "INL"}, 868 {"Analog Left Capture Route", "Main mic", "MAINMIC"},
899 {"ADCR", NULL, "INR"}, 869 {"Analog Left Capture Route", "Headset mic", "HSMIC"},
870 {"Analog Left Capture Route", "AUXL", "AUXL"},
871 {"Analog Left Capture Route", "Carkit mic", "CARKITMIC"},
872
873 {"Analog Right Capture Route", "Sub mic", "SUBMIC"},
874 {"Analog Right Capture Route", "AUXR", "AUXR"},
875
876 {"Analog Left Amplifier", NULL, "Analog Left Capture Route"},
877 {"Analog Right Amplifier", NULL, "Analog Right Capture Route"},
878
879 {"Digimic0 Enable", NULL, "DIGIMIC0"},
880 {"Digimic1 Enable", NULL, "DIGIMIC1"},
881
882 /* TX1 Left capture path */
883 {"TX1 Capture Route", "Analog", "Analog Left Amplifier"},
884 {"TX1 Capture Route", "Digimic0", "Digimic0 Enable"},
885 /* TX1 Right capture path */
886 {"TX1 Capture Route", "Analog", "Analog Right Amplifier"},
887 {"TX1 Capture Route", "Digimic0", "Digimic0 Enable"},
888 /* TX2 Left capture path */
889 {"TX2 Capture Route", "Analog", "Analog Left Amplifier"},
890 {"TX2 Capture Route", "Digimic1", "Digimic1 Enable"},
891 /* TX2 Right capture path */
892 {"TX2 Capture Route", "Analog", "Analog Right Amplifier"},
893 {"TX2 Capture Route", "Digimic1", "Digimic1 Enable"},
894
895 {"ADC Virtual Left1", NULL, "TX1 Capture Route"},
896 {"ADC Virtual Right1", NULL, "TX1 Capture Route"},
897 {"ADC Virtual Left2", NULL, "TX2 Capture Route"},
898 {"ADC Virtual Right2", NULL, "TX2 Capture Route"},
899
900}; 900};
901 901
902static int twl4030_add_widgets(struct snd_soc_codec *codec) 902static int twl4030_add_widgets(struct snd_soc_codec *codec)
@@ -923,6 +923,7 @@ static void twl4030_power_up(struct snd_soc_codec *codec)
923 twl4030_write(codec, TWL4030_REG_ANAMICL, 923 twl4030_write(codec, TWL4030_REG_ANAMICL,
924 anamicl | TWL4030_CNCL_OFFSET_START); 924 anamicl | TWL4030_CNCL_OFFSET_START);
925 925
926
926 /* wait for offset cancellation to complete */ 927 /* wait for offset cancellation to complete */
927 do { 928 do {
928 /* this takes a little while, so don't slam i2c */ 929 /* this takes a little while, so don't slam i2c */
diff --git a/sound/soc/codecs/twl4030.h b/sound/soc/codecs/twl4030.h
index 54615c76802b..442e5a828617 100644
--- a/sound/soc/codecs/twl4030.h
+++ b/sound/soc/codecs/twl4030.h
@@ -147,6 +147,13 @@
147#define TWL4030_AVADC_CLK_PRIORITY 0x04 147#define TWL4030_AVADC_CLK_PRIORITY 0x04
148#define TWL4030_ADCR_EN 0x02 148#define TWL4030_ADCR_EN 0x02
149 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
150/* AUDIO_IF (0x0E) Fields */ 157/* AUDIO_IF (0x0E) Fields */
151 158
152#define TWL4030_AIF_SLAVE_EN 0x80 159#define TWL4030_AIF_SLAVE_EN 0x80
diff --git a/sound/soc/davinci/davinci-sffsdr.c b/sound/soc/davinci/davinci-sffsdr.c
index f67579d52765..4935d1bcbd8d 100644
--- a/sound/soc/davinci/davinci-sffsdr.c
+++ b/sound/soc/davinci/davinci-sffsdr.c
@@ -24,6 +24,7 @@
24#include <sound/soc-dapm.h> 24#include <sound/soc-dapm.h>
25 25
26#include <asm/dma.h> 26#include <asm/dma.h>
27#include <asm/mach-types.h>
27#include <asm/plat-sffsdr/sffsdr-fpga.h> 28#include <asm/plat-sffsdr/sffsdr-fpga.h>
28 29
29#include <mach/mcbsp.h> 30#include <mach/mcbsp.h>
@@ -115,6 +116,9 @@ static int __init sffsdr_init(void)
115{ 116{
116 int ret; 117 int ret;
117 118
119 if (!machine_is_sffsdr())
120 return -EINVAL;
121
118 sffsdr_snd_device = platform_device_alloc("soc-audio", 0); 122 sffsdr_snd_device = platform_device_alloc("soc-audio", 0);
119 if (!sffsdr_snd_device) { 123 if (!sffsdr_snd_device) {
120 printk(KERN_ERR "platform device allocation failed\n"); 124 printk(KERN_ERR "platform device allocation failed\n");
diff --git a/sound/soc/pxa/pxa2xx-pcm.c b/sound/soc/pxa/pxa2xx-pcm.c
index c670d08e7c9e..53b9fb127a6d 100644
--- a/sound/soc/pxa/pxa2xx-pcm.c
+++ b/sound/soc/pxa/pxa2xx-pcm.c
@@ -61,9 +61,9 @@ static int pxa2xx_pcm_hw_free(struct snd_pcm_substream *substream)
61 61
62 __pxa2xx_pcm_hw_free(substream); 62 __pxa2xx_pcm_hw_free(substream);
63 63
64 if (prtd->dma_ch) { 64 if (prtd->dma_ch >= 0) {
65 pxa_free_dma(prtd->dma_ch); 65 pxa_free_dma(prtd->dma_ch);
66 prtd->dma_ch = 0; 66 prtd->dma_ch = -1;
67 } 67 }
68 68
69 return 0; 69 return 0;
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index b098c0b4c584..f73c1341437c 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -1300,6 +1300,8 @@ EXPORT_SYMBOL_GPL(snd_soc_test_bits);
1300/** 1300/**
1301 * snd_soc_new_pcms - create new sound card and pcms 1301 * snd_soc_new_pcms - create new sound card and pcms
1302 * @socdev: the SoC audio device 1302 * @socdev: the SoC audio device
1303 * @idx: ALSA card index
1304 * @xid: card identification
1303 * 1305 *
1304 * Create a new sound card based upon the codec and interface pcms. 1306 * Create a new sound card based upon the codec and interface pcms.
1305 * 1307 *
@@ -1472,7 +1474,7 @@ EXPORT_SYMBOL_GPL(snd_soc_set_runtime_hwparams);
1472 * snd_soc_cnew - create new control 1474 * snd_soc_cnew - create new control
1473 * @_template: control template 1475 * @_template: control template
1474 * @data: control private data 1476 * @data: control private data
1475 * @lnng_name: control long name 1477 * @long_name: control long name
1476 * 1478 *
1477 * Create a new mixer control from a template control. 1479 * Create a new mixer control from a template control.
1478 * 1480 *
@@ -1522,7 +1524,7 @@ EXPORT_SYMBOL_GPL(snd_soc_info_enum_double);
1522/** 1524/**
1523 * snd_soc_get_enum_double - enumerated double mixer get callback 1525 * snd_soc_get_enum_double - enumerated double mixer get callback
1524 * @kcontrol: mixer control 1526 * @kcontrol: mixer control
1525 * @uinfo: control element information 1527 * @ucontrol: control element information
1526 * 1528 *
1527 * Callback to get the value of a double enumerated mixer. 1529 * Callback to get the value of a double enumerated mixer.
1528 * 1530 *
@@ -1551,7 +1553,7 @@ EXPORT_SYMBOL_GPL(snd_soc_get_enum_double);
1551/** 1553/**
1552 * snd_soc_put_enum_double - enumerated double mixer put callback 1554 * snd_soc_put_enum_double - enumerated double mixer put callback
1553 * @kcontrol: mixer control 1555 * @kcontrol: mixer control
1554 * @uinfo: control element information 1556 * @ucontrol: control element information
1555 * 1557 *
1556 * Callback to set the value of a double enumerated mixer. 1558 * Callback to set the value of a double enumerated mixer.
1557 * 1559 *
@@ -1668,7 +1670,7 @@ EXPORT_SYMBOL_GPL(snd_soc_info_volsw);
1668/** 1670/**
1669 * snd_soc_get_volsw - single mixer get callback 1671 * snd_soc_get_volsw - single mixer get callback
1670 * @kcontrol: mixer control 1672 * @kcontrol: mixer control
1671 * @uinfo: control element information 1673 * @ucontrol: control element information
1672 * 1674 *
1673 * Callback to get the value of a single mixer control. 1675 * Callback to get the value of a single mixer control.
1674 * 1676 *
@@ -1707,7 +1709,7 @@ EXPORT_SYMBOL_GPL(snd_soc_get_volsw);
1707/** 1709/**
1708 * snd_soc_put_volsw - single mixer put callback 1710 * snd_soc_put_volsw - single mixer put callback
1709 * @kcontrol: mixer control 1711 * @kcontrol: mixer control
1710 * @uinfo: control element information 1712 * @ucontrol: control element information
1711 * 1713 *
1712 * Callback to set the value of a single mixer control. 1714 * Callback to set the value of a single mixer control.
1713 * 1715 *
@@ -1775,7 +1777,7 @@ EXPORT_SYMBOL_GPL(snd_soc_info_volsw_2r);
1775/** 1777/**
1776 * snd_soc_get_volsw_2r - double mixer get callback 1778 * snd_soc_get_volsw_2r - double mixer get callback
1777 * @kcontrol: mixer control 1779 * @kcontrol: mixer control
1778 * @uinfo: control element information 1780 * @ucontrol: control element information
1779 * 1781 *
1780 * Callback to get the value of a double mixer control that spans 2 registers. 1782 * Callback to get the value of a double mixer control that spans 2 registers.
1781 * 1783 *
@@ -1812,7 +1814,7 @@ EXPORT_SYMBOL_GPL(snd_soc_get_volsw_2r);
1812/** 1814/**
1813 * snd_soc_put_volsw_2r - double mixer set callback 1815 * snd_soc_put_volsw_2r - double mixer set callback
1814 * @kcontrol: mixer control 1816 * @kcontrol: mixer control
1815 * @uinfo: control element information 1817 * @ucontrol: control element information
1816 * 1818 *
1817 * Callback to set the value of a double mixer control that spans 2 registers. 1819 * Callback to set the value of a double mixer control that spans 2 registers.
1818 * 1820 *
@@ -1882,7 +1884,7 @@ EXPORT_SYMBOL_GPL(snd_soc_info_volsw_s8);
1882/** 1884/**
1883 * snd_soc_get_volsw_s8 - signed mixer get callback 1885 * snd_soc_get_volsw_s8 - signed mixer get callback
1884 * @kcontrol: mixer control 1886 * @kcontrol: mixer control
1885 * @uinfo: control element information 1887 * @ucontrol: control element information
1886 * 1888 *
1887 * Callback to get the value of a signed mixer control. 1889 * Callback to get the value of a signed mixer control.
1888 * 1890 *
@@ -1909,7 +1911,7 @@ EXPORT_SYMBOL_GPL(snd_soc_get_volsw_s8);
1909/** 1911/**
1910 * snd_soc_put_volsw_sgn - signed mixer put callback 1912 * snd_soc_put_volsw_sgn - signed mixer put callback
1911 * @kcontrol: mixer control 1913 * @kcontrol: mixer control
1912 * @uinfo: control element information 1914 * @ucontrol: control element information
1913 * 1915 *
1914 * Callback to set the value of a signed mixer control. 1916 * Callback to set the value of a signed mixer control.
1915 * 1917 *
@@ -1954,7 +1956,7 @@ EXPORT_SYMBOL_GPL(snd_soc_dai_set_sysclk);
1954/** 1956/**
1955 * snd_soc_dai_set_clkdiv - configure DAI clock dividers. 1957 * snd_soc_dai_set_clkdiv - configure DAI clock dividers.
1956 * @dai: DAI 1958 * @dai: DAI
1957 * @clk_id: DAI specific clock divider ID 1959 * @div_id: DAI specific clock divider ID
1958 * @div: new clock divisor. 1960 * @div: new clock divisor.
1959 * 1961 *
1960 * Configures the clock dividers. This is used to derive the best DAI bit and 1962 * Configures the clock dividers. This is used to derive the best DAI bit and
@@ -2060,7 +2062,7 @@ EXPORT_SYMBOL_GPL(snd_soc_dai_digital_mute);
2060/** 2062/**
2061 * snd_soc_register_card - Register a card with the ASoC core 2063 * snd_soc_register_card - Register a card with the ASoC core
2062 * 2064 *
2063 * @param card Card to register 2065 * @card: Card to register
2064 * 2066 *
2065 * Note that currently this is an internal only function: it will be 2067 * Note that currently this is an internal only function: it will be
2066 * exposed to machine drivers after further backporting of ASoC v2 2068 * exposed to machine drivers after further backporting of ASoC v2
@@ -2087,7 +2089,7 @@ static int snd_soc_register_card(struct snd_soc_card *card)
2087/** 2089/**
2088 * snd_soc_unregister_card - Unregister a card with the ASoC core 2090 * snd_soc_unregister_card - Unregister a card with the ASoC core
2089 * 2091 *
2090 * @param card Card to unregister 2092 * @card: Card to unregister
2091 * 2093 *
2092 * Note that currently this is an internal only function: it will be 2094 * Note that currently this is an internal only function: it will be
2093 * exposed to machine drivers after further backporting of ASoC v2 2095 * exposed to machine drivers after further backporting of ASoC v2
@@ -2107,7 +2109,7 @@ static int snd_soc_unregister_card(struct snd_soc_card *card)
2107/** 2109/**
2108 * snd_soc_register_dai - Register a DAI with the ASoC core 2110 * snd_soc_register_dai - Register a DAI with the ASoC core
2109 * 2111 *
2110 * @param dai DAI to register 2112 * @dai: DAI to register
2111 */ 2113 */
2112int snd_soc_register_dai(struct snd_soc_dai *dai) 2114int snd_soc_register_dai(struct snd_soc_dai *dai)
2113{ 2115{
@@ -2134,7 +2136,7 @@ EXPORT_SYMBOL_GPL(snd_soc_register_dai);
2134/** 2136/**
2135 * snd_soc_unregister_dai - Unregister a DAI from the ASoC core 2137 * snd_soc_unregister_dai - Unregister a DAI from the ASoC core
2136 * 2138 *
2137 * @param dai DAI to unregister 2139 * @dai: DAI to unregister
2138 */ 2140 */
2139void snd_soc_unregister_dai(struct snd_soc_dai *dai) 2141void snd_soc_unregister_dai(struct snd_soc_dai *dai)
2140{ 2142{
@@ -2149,8 +2151,8 @@ EXPORT_SYMBOL_GPL(snd_soc_unregister_dai);
2149/** 2151/**
2150 * snd_soc_register_dais - Register multiple DAIs with the ASoC core 2152 * snd_soc_register_dais - Register multiple DAIs with the ASoC core
2151 * 2153 *
2152 * @param dai Array of DAIs to register 2154 * @dai: Array of DAIs to register
2153 * @param count Number of DAIs 2155 * @count: Number of DAIs
2154 */ 2156 */
2155int snd_soc_register_dais(struct snd_soc_dai *dai, size_t count) 2157int snd_soc_register_dais(struct snd_soc_dai *dai, size_t count)
2156{ 2158{
@@ -2175,8 +2177,8 @@ EXPORT_SYMBOL_GPL(snd_soc_register_dais);
2175/** 2177/**
2176 * snd_soc_unregister_dais - Unregister multiple DAIs from the ASoC core 2178 * snd_soc_unregister_dais - Unregister multiple DAIs from the ASoC core
2177 * 2179 *
2178 * @param dai Array of DAIs to unregister 2180 * @dai: Array of DAIs to unregister
2179 * @param count Number of DAIs 2181 * @count: Number of DAIs
2180 */ 2182 */
2181void snd_soc_unregister_dais(struct snd_soc_dai *dai, size_t count) 2183void snd_soc_unregister_dais(struct snd_soc_dai *dai, size_t count)
2182{ 2184{
@@ -2190,7 +2192,7 @@ EXPORT_SYMBOL_GPL(snd_soc_unregister_dais);
2190/** 2192/**
2191 * snd_soc_register_platform - Register a platform with the ASoC core 2193 * snd_soc_register_platform - Register a platform with the ASoC core
2192 * 2194 *
2193 * @param platform platform to register 2195 * @platform: platform to register
2194 */ 2196 */
2195int snd_soc_register_platform(struct snd_soc_platform *platform) 2197int snd_soc_register_platform(struct snd_soc_platform *platform)
2196{ 2198{
@@ -2213,7 +2215,7 @@ EXPORT_SYMBOL_GPL(snd_soc_register_platform);
2213/** 2215/**
2214 * snd_soc_unregister_platform - Unregister a platform from the ASoC core 2216 * snd_soc_unregister_platform - Unregister a platform from the ASoC core
2215 * 2217 *
2216 * @param platform platform to unregister 2218 * @platform: platform to unregister
2217 */ 2219 */
2218void snd_soc_unregister_platform(struct snd_soc_platform *platform) 2220void snd_soc_unregister_platform(struct snd_soc_platform *platform)
2219{ 2221{
@@ -2228,7 +2230,7 @@ EXPORT_SYMBOL_GPL(snd_soc_unregister_platform);
2228/** 2230/**
2229 * snd_soc_register_codec - Register a codec with the ASoC core 2231 * snd_soc_register_codec - Register a codec with the ASoC core
2230 * 2232 *
2231 * @param codec codec to register 2233 * @codec: codec to register
2232 */ 2234 */
2233int snd_soc_register_codec(struct snd_soc_codec *codec) 2235int snd_soc_register_codec(struct snd_soc_codec *codec)
2234{ 2236{
@@ -2255,7 +2257,7 @@ EXPORT_SYMBOL_GPL(snd_soc_register_codec);
2255/** 2257/**
2256 * snd_soc_unregister_codec - Unregister a codec from the ASoC core 2258 * snd_soc_unregister_codec - Unregister a codec from the ASoC core
2257 * 2259 *
2258 * @param codec codec to unregister 2260 * @codec: codec to unregister
2259 */ 2261 */
2260void snd_soc_unregister_codec(struct snd_soc_codec *codec) 2262void snd_soc_unregister_codec(struct snd_soc_codec *codec)
2261{ 2263{
diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c
index 8863eddbac02..6c79ca6df0bf 100644
--- a/sound/soc/soc-dapm.c
+++ b/sound/soc/soc-dapm.c
@@ -1077,7 +1077,7 @@ EXPORT_SYMBOL_GPL(snd_soc_dapm_new_widgets);
1077/** 1077/**
1078 * snd_soc_dapm_get_volsw - dapm mixer get callback 1078 * snd_soc_dapm_get_volsw - dapm mixer get callback
1079 * @kcontrol: mixer control 1079 * @kcontrol: mixer control
1080 * @uinfo: control element information 1080 * @ucontrol: control element information
1081 * 1081 *
1082 * Callback to get the value of a dapm mixer control. 1082 * Callback to get the value of a dapm mixer control.
1083 * 1083 *
@@ -1122,7 +1122,7 @@ EXPORT_SYMBOL_GPL(snd_soc_dapm_get_volsw);
1122/** 1122/**
1123 * snd_soc_dapm_put_volsw - dapm mixer set callback 1123 * snd_soc_dapm_put_volsw - dapm mixer set callback
1124 * @kcontrol: mixer control 1124 * @kcontrol: mixer control
1125 * @uinfo: control element information 1125 * @ucontrol: control element information
1126 * 1126 *
1127 * Callback to set the value of a dapm mixer control. 1127 * Callback to set the value of a dapm mixer control.
1128 * 1128 *
@@ -1193,7 +1193,7 @@ EXPORT_SYMBOL_GPL(snd_soc_dapm_put_volsw);
1193/** 1193/**
1194 * snd_soc_dapm_get_enum_double - dapm enumerated double mixer get callback 1194 * snd_soc_dapm_get_enum_double - dapm enumerated double mixer get callback
1195 * @kcontrol: mixer control 1195 * @kcontrol: mixer control
1196 * @uinfo: control element information 1196 * @ucontrol: control element information
1197 * 1197 *
1198 * Callback to get the value of a dapm enumerated double mixer control. 1198 * Callback to get the value of a dapm enumerated double mixer control.
1199 * 1199 *
@@ -1221,7 +1221,7 @@ EXPORT_SYMBOL_GPL(snd_soc_dapm_get_enum_double);
1221/** 1221/**
1222 * snd_soc_dapm_put_enum_double - dapm enumerated double mixer set callback 1222 * snd_soc_dapm_put_enum_double - dapm enumerated double mixer set callback
1223 * @kcontrol: mixer control 1223 * @kcontrol: mixer control
1224 * @uinfo: control element information 1224 * @ucontrol: control element information
1225 * 1225 *
1226 * Callback to set the value of a dapm enumerated double mixer control. 1226 * Callback to set the value of a dapm enumerated double mixer control.
1227 * 1227 *
@@ -1419,7 +1419,7 @@ int snd_soc_dapm_set_bias_level(struct snd_soc_device *socdev,
1419 1419
1420/** 1420/**
1421 * snd_soc_dapm_enable_pin - enable pin. 1421 * snd_soc_dapm_enable_pin - enable pin.
1422 * @snd_soc_codec: SoC codec 1422 * @codec: SoC codec
1423 * @pin: pin name 1423 * @pin: pin name
1424 * 1424 *
1425 * Enables input/output pin and it's parents or children widgets iff there is 1425 * Enables input/output pin and it's parents or children widgets iff there is
diff --git a/sound/usb/caiaq/caiaq-device.c b/sound/usb/caiaq/caiaq-device.c
index b143ef7152f7..a62500e387a6 100644
--- a/sound/usb/caiaq/caiaq-device.c
+++ b/sound/usb/caiaq/caiaq-device.c
@@ -446,7 +446,7 @@ static int __devinit snd_probe(struct usb_interface *intf,
446 if (!card) 446 if (!card)
447 return -ENOMEM; 447 return -ENOMEM;
448 448
449 dev_set_drvdata(&intf->dev, card); 449 usb_set_intfdata(intf, card);
450 ret = init_card(caiaqdev(card)); 450 ret = init_card(caiaqdev(card));
451 if (ret < 0) { 451 if (ret < 0) {
452 log("unable to init card! (ret=%d)\n", ret); 452 log("unable to init card! (ret=%d)\n", ret);
@@ -460,7 +460,7 @@ static int __devinit snd_probe(struct usb_interface *intf,
460static void snd_disconnect(struct usb_interface *intf) 460static void snd_disconnect(struct usb_interface *intf)
461{ 461{
462 struct snd_usb_caiaqdev *dev; 462 struct snd_usb_caiaqdev *dev;
463 struct snd_card *card = dev_get_drvdata(&intf->dev); 463 struct snd_card *card = usb_get_intfdata(intf);
464 464
465 debug("%s(%p)\n", __func__, intf); 465 debug("%s(%p)\n", __func__, intf);
466 466
diff --git a/sound/usb/usbaudio.c b/sound/usb/usbaudio.c
index bbd70d5814a0..c709b9563226 100644
--- a/sound/usb/usbaudio.c
+++ b/sound/usb/usbaudio.c
@@ -3709,7 +3709,7 @@ static int usb_audio_probe(struct usb_interface *intf,
3709 void *chip; 3709 void *chip;
3710 chip = snd_usb_audio_probe(interface_to_usbdev(intf), intf, id); 3710 chip = snd_usb_audio_probe(interface_to_usbdev(intf), intf, id);
3711 if (chip) { 3711 if (chip) {
3712 dev_set_drvdata(&intf->dev, chip); 3712 usb_set_intfdata(intf, chip);
3713 return 0; 3713 return 0;
3714 } else 3714 } else
3715 return -EIO; 3715 return -EIO;
@@ -3718,13 +3718,13 @@ static int usb_audio_probe(struct usb_interface *intf,
3718static void usb_audio_disconnect(struct usb_interface *intf) 3718static void usb_audio_disconnect(struct usb_interface *intf)
3719{ 3719{
3720 snd_usb_audio_disconnect(interface_to_usbdev(intf), 3720 snd_usb_audio_disconnect(interface_to_usbdev(intf),
3721 dev_get_drvdata(&intf->dev)); 3721 usb_get_intfdata(intf));
3722} 3722}
3723 3723
3724#ifdef CONFIG_PM 3724#ifdef CONFIG_PM
3725static int usb_audio_suspend(struct usb_interface *intf, pm_message_t message) 3725static int usb_audio_suspend(struct usb_interface *intf, pm_message_t message)
3726{ 3726{
3727 struct snd_usb_audio *chip = dev_get_drvdata(&intf->dev); 3727 struct snd_usb_audio *chip = usb_get_intfdata(intf);
3728 struct list_head *p; 3728 struct list_head *p;
3729 struct snd_usb_stream *as; 3729 struct snd_usb_stream *as;
3730 3730
@@ -3744,7 +3744,7 @@ static int usb_audio_suspend(struct usb_interface *intf, pm_message_t message)
3744 3744
3745static int usb_audio_resume(struct usb_interface *intf) 3745static int usb_audio_resume(struct usb_interface *intf)
3746{ 3746{
3747 struct snd_usb_audio *chip = dev_get_drvdata(&intf->dev); 3747 struct snd_usb_audio *chip = usb_get_intfdata(intf);
3748 3748
3749 if (chip == (void *)-1L) 3749 if (chip == (void *)-1L)
3750 return 0; 3750 return 0;
diff --git a/sound/usb/usbmidi.c b/sound/usb/usbmidi.c
index 6d9f9b135c62..320641ab5be7 100644
--- a/sound/usb/usbmidi.c
+++ b/sound/usb/usbmidi.c
@@ -1392,8 +1392,7 @@ static int snd_usbmidi_get_ms_info(struct snd_usb_midi* umidi,
1392 for (i = 0; i < intfd->bNumEndpoints; ++i) { 1392 for (i = 0; i < intfd->bNumEndpoints; ++i) {
1393 hostep = &hostif->endpoint[i]; 1393 hostep = &hostif->endpoint[i];
1394 ep = get_ep_desc(hostep); 1394 ep = get_ep_desc(hostep);
1395 if ((ep->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) != USB_ENDPOINT_XFER_BULK && 1395 if (!usb_endpoint_xfer_bulk(ep) && !usb_endpoint_xfer_int(ep))
1396 (ep->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) != USB_ENDPOINT_XFER_INT)
1397 continue; 1396 continue;
1398 ms_ep = (struct usb_ms_endpoint_descriptor*)hostep->extra; 1397 ms_ep = (struct usb_ms_endpoint_descriptor*)hostep->extra;
1399 if (hostep->extralen < 4 || 1398 if (hostep->extralen < 4 ||
@@ -1401,15 +1400,15 @@ static int snd_usbmidi_get_ms_info(struct snd_usb_midi* umidi,
1401 ms_ep->bDescriptorType != USB_DT_CS_ENDPOINT || 1400 ms_ep->bDescriptorType != USB_DT_CS_ENDPOINT ||
1402 ms_ep->bDescriptorSubtype != MS_GENERAL) 1401 ms_ep->bDescriptorSubtype != MS_GENERAL)
1403 continue; 1402 continue;
1404 if ((ep->bEndpointAddress & USB_ENDPOINT_DIR_MASK) == USB_DIR_OUT) { 1403 if (usb_endpoint_dir_out(ep)) {
1405 if (endpoints[epidx].out_ep) { 1404 if (endpoints[epidx].out_ep) {
1406 if (++epidx >= MIDI_MAX_ENDPOINTS) { 1405 if (++epidx >= MIDI_MAX_ENDPOINTS) {
1407 snd_printk(KERN_WARNING "too many endpoints\n"); 1406 snd_printk(KERN_WARNING "too many endpoints\n");
1408 break; 1407 break;
1409 } 1408 }
1410 } 1409 }
1411 endpoints[epidx].out_ep = ep->bEndpointAddress & USB_ENDPOINT_NUMBER_MASK; 1410 endpoints[epidx].out_ep = usb_endpoint_num(ep);
1412 if ((ep->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) == USB_ENDPOINT_XFER_INT) 1411 if (usb_endpoint_xfer_int(ep))
1413 endpoints[epidx].out_interval = ep->bInterval; 1412 endpoints[epidx].out_interval = ep->bInterval;
1414 else if (snd_usb_get_speed(umidi->chip->dev) == USB_SPEED_LOW) 1413 else if (snd_usb_get_speed(umidi->chip->dev) == USB_SPEED_LOW)
1415 /* 1414 /*
@@ -1428,8 +1427,8 @@ static int snd_usbmidi_get_ms_info(struct snd_usb_midi* umidi,
1428 break; 1427 break;
1429 } 1428 }
1430 } 1429 }
1431 endpoints[epidx].in_ep = ep->bEndpointAddress & USB_ENDPOINT_NUMBER_MASK; 1430 endpoints[epidx].in_ep = usb_endpoint_num(ep);
1432 if ((ep->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) == USB_ENDPOINT_XFER_INT) 1431 if (usb_endpoint_xfer_int(ep))
1433 endpoints[epidx].in_interval = ep->bInterval; 1432 endpoints[epidx].in_interval = ep->bInterval;
1434 else if (snd_usb_get_speed(umidi->chip->dev) == USB_SPEED_LOW) 1433 else if (snd_usb_get_speed(umidi->chip->dev) == USB_SPEED_LOW)
1435 endpoints[epidx].in_interval = 1; 1434 endpoints[epidx].in_interval = 1;
@@ -1495,20 +1494,20 @@ static int snd_usbmidi_detect_endpoints(struct snd_usb_midi* umidi,
1495 1494
1496 for (i = 0; i < intfd->bNumEndpoints; ++i) { 1495 for (i = 0; i < intfd->bNumEndpoints; ++i) {
1497 epd = get_endpoint(hostif, i); 1496 epd = get_endpoint(hostif, i);
1498 if ((epd->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) != USB_ENDPOINT_XFER_BULK && 1497 if (!usb_endpoint_xfer_bulk(epd) &&
1499 (epd->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) != USB_ENDPOINT_XFER_INT) 1498 !usb_endpoint_xfer_int(epd))
1500 continue; 1499 continue;
1501 if (out_eps < max_endpoints && 1500 if (out_eps < max_endpoints &&
1502 (epd->bEndpointAddress & USB_ENDPOINT_DIR_MASK) == USB_DIR_OUT) { 1501 usb_endpoint_dir_out(epd)) {
1503 endpoint[out_eps].out_ep = epd->bEndpointAddress & USB_ENDPOINT_NUMBER_MASK; 1502 endpoint[out_eps].out_ep = usb_endpoint_num(epd);
1504 if ((epd->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) == USB_ENDPOINT_XFER_INT) 1503 if (usb_endpoint_xfer_int(epd))
1505 endpoint[out_eps].out_interval = epd->bInterval; 1504 endpoint[out_eps].out_interval = epd->bInterval;
1506 ++out_eps; 1505 ++out_eps;
1507 } 1506 }
1508 if (in_eps < max_endpoints && 1507 if (in_eps < max_endpoints &&
1509 (epd->bEndpointAddress & USB_ENDPOINT_DIR_MASK) == USB_DIR_IN) { 1508 usb_endpoint_dir_in(epd)) {
1510 endpoint[in_eps].in_ep = epd->bEndpointAddress & USB_ENDPOINT_NUMBER_MASK; 1509 endpoint[in_eps].in_ep = usb_endpoint_num(epd);
1511 if ((epd->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) == USB_ENDPOINT_XFER_INT) 1510 if (usb_endpoint_xfer_int(epd))
1512 endpoint[in_eps].in_interval = epd->bInterval; 1511 endpoint[in_eps].in_interval = epd->bInterval;
1513 ++in_eps; 1512 ++in_eps;
1514 } 1513 }
@@ -1607,21 +1606,19 @@ static int snd_usbmidi_create_endpoints_midiman(struct snd_usb_midi* umidi,
1607 } 1606 }
1608 1607
1609 epd = get_endpoint(hostif, 0); 1608 epd = get_endpoint(hostif, 0);
1610 if ((epd->bEndpointAddress & USB_ENDPOINT_DIR_MASK) != USB_DIR_IN || 1609 if (!usb_endpoint_dir_in(epd) || !usb_endpoint_xfer_int(epd)) {
1611 (epd->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) != USB_ENDPOINT_XFER_INT) {
1612 snd_printdd(KERN_ERR "endpoint[0] isn't interrupt\n"); 1610 snd_printdd(KERN_ERR "endpoint[0] isn't interrupt\n");
1613 return -ENXIO; 1611 return -ENXIO;
1614 } 1612 }
1615 epd = get_endpoint(hostif, 2); 1613 epd = get_endpoint(hostif, 2);
1616 if ((epd->bEndpointAddress & USB_ENDPOINT_DIR_MASK) != USB_DIR_OUT || 1614 if (!usb_endpoint_dir_out(epd) || !usb_endpoint_xfer_bulk(epd)) {
1617 (epd->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) != USB_ENDPOINT_XFER_BULK) {
1618 snd_printdd(KERN_ERR "endpoint[2] isn't bulk output\n"); 1615 snd_printdd(KERN_ERR "endpoint[2] isn't bulk output\n");
1619 return -ENXIO; 1616 return -ENXIO;
1620 } 1617 }
1621 if (endpoint->out_cables > 0x0001) { 1618 if (endpoint->out_cables > 0x0001) {
1622 epd = get_endpoint(hostif, 4); 1619 epd = get_endpoint(hostif, 4);
1623 if ((epd->bEndpointAddress & USB_ENDPOINT_DIR_MASK) != USB_DIR_OUT || 1620 if (!usb_endpoint_dir_out(epd) ||
1624 (epd->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) != USB_ENDPOINT_XFER_BULK) { 1621 !usb_endpoint_xfer_bulk(epd)) {
1625 snd_printdd(KERN_ERR "endpoint[4] isn't bulk output\n"); 1622 snd_printdd(KERN_ERR "endpoint[4] isn't bulk output\n");
1626 return -ENXIO; 1623 return -ENXIO;
1627 } 1624 }
diff --git a/sound/usb/usbmixer.c b/sound/usb/usbmixer.c
index a49246113e75..00397c8a765b 100644
--- a/sound/usb/usbmixer.c
+++ b/sound/usb/usbmixer.c
@@ -1755,11 +1755,10 @@ static int snd_usb_mixer_status_create(struct usb_mixer_interface *mixer)
1755 if (get_iface_desc(hostif)->bNumEndpoints < 1) 1755 if (get_iface_desc(hostif)->bNumEndpoints < 1)
1756 return 0; 1756 return 0;
1757 ep = get_endpoint(hostif, 0); 1757 ep = get_endpoint(hostif, 0);
1758 if ((ep->bEndpointAddress & USB_ENDPOINT_DIR_MASK) != USB_DIR_IN || 1758 if (!usb_endpoint_dir_in(ep) || !usb_endpoint_xfer_int(ep))
1759 (ep->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) != USB_ENDPOINT_XFER_INT)
1760 return 0; 1759 return 0;
1761 1760
1762 epnum = ep->bEndpointAddress & USB_ENDPOINT_NUMBER_MASK; 1761 epnum = usb_endpoint_num(ep);
1763 buffer_length = le16_to_cpu(ep->wMaxPacketSize); 1762 buffer_length = le16_to_cpu(ep->wMaxPacketSize);
1764 transfer_buffer = kmalloc(buffer_length, GFP_KERNEL); 1763 transfer_buffer = kmalloc(buffer_length, GFP_KERNEL);
1765 if (!transfer_buffer) 1764 if (!transfer_buffer)
diff --git a/sound/usb/usx2y/us122l.c b/sound/usb/usx2y/us122l.c
index c2515b680f9f..73e59f4403a4 100644
--- a/sound/usb/usx2y/us122l.c
+++ b/sound/usb/usx2y/us122l.c
@@ -589,7 +589,7 @@ static int snd_us122l_suspend(struct usb_interface *intf, pm_message_t message)
589 struct us122l *us122l; 589 struct us122l *us122l;
590 struct list_head *p; 590 struct list_head *p;
591 591
592 card = dev_get_drvdata(&intf->dev); 592 card = usb_get_intfdata(intf);
593 if (!card) 593 if (!card)
594 return 0; 594 return 0;
595 snd_power_change_state(card, SNDRV_CTL_POWER_D3hot); 595 snd_power_change_state(card, SNDRV_CTL_POWER_D3hot);
@@ -615,7 +615,7 @@ static int snd_us122l_resume(struct usb_interface *intf)
615 struct list_head *p; 615 struct list_head *p;
616 int err; 616 int err;
617 617
618 card = dev_get_drvdata(&intf->dev); 618 card = usb_get_intfdata(intf);
619 if (!card) 619 if (!card)
620 return 0; 620 return 0;
621 621
diff --git a/sound/usb/usx2y/usbusx2y.c b/sound/usb/usx2y/usbusx2y.c
index e5981a630314..ca26c532e77e 100644
--- a/sound/usb/usx2y/usbusx2y.c
+++ b/sound/usb/usx2y/usbusx2y.c
@@ -392,7 +392,7 @@ static int snd_usX2Y_probe(struct usb_interface *intf, const struct usb_device_i
392 void *chip; 392 void *chip;
393 chip = usX2Y_usb_probe(interface_to_usbdev(intf), intf, id); 393 chip = usX2Y_usb_probe(interface_to_usbdev(intf), intf, id);
394 if (chip) { 394 if (chip) {
395 dev_set_drvdata(&intf->dev, chip); 395 usb_set_intfdata(intf, chip);
396 return 0; 396 return 0;
397 } else 397 } else
398 return -EIO; 398 return -EIO;
@@ -401,7 +401,7 @@ static int snd_usX2Y_probe(struct usb_interface *intf, const struct usb_device_i
401static void snd_usX2Y_disconnect(struct usb_interface *intf) 401static void snd_usX2Y_disconnect(struct usb_interface *intf)
402{ 402{
403 usX2Y_usb_disconnect(interface_to_usbdev(intf), 403 usX2Y_usb_disconnect(interface_to_usbdev(intf),
404 dev_get_drvdata(&intf->dev)); 404 usb_get_intfdata(intf));
405} 405}
406 406
407MODULE_DEVICE_TABLE(usb, snd_usX2Y_usb_id_table); 407MODULE_DEVICE_TABLE(usb, snd_usX2Y_usb_id_table);