diff options
Diffstat (limited to 'sound')
-rw-r--r-- | sound/drivers/mtpav.c | 3 | ||||
-rw-r--r-- | sound/oss/Makefile | 4 | ||||
-rw-r--r-- | sound/pci/hda/patch_conexant.c | 149 | ||||
-rw-r--r-- | sound/pci/oxygen/oxygen.h | 2 | ||||
-rw-r--r-- | sound/pci/oxygen/oxygen_mixer.c | 2 | ||||
-rw-r--r-- | sound/pci/oxygen/xonar_dg.c | 36 | ||||
-rw-r--r-- | sound/pcmcia/pdaudiocf/pdaudiocf.h | 2 | ||||
-rw-r--r-- | sound/pcmcia/vx/vxp_ops.c | 2 | ||||
-rw-r--r-- | sound/soc/codecs/cq93vc.c | 2 | ||||
-rw-r--r-- | sound/soc/codecs/cx20442.c | 3 | ||||
-rw-r--r-- | sound/soc/omap/ams-delta.c | 2 | ||||
-rw-r--r-- | sound/soc/soc-core.c | 3 | ||||
-rw-r--r-- | sound/soc/soc-dapm.c | 6 |
13 files changed, 137 insertions, 79 deletions
diff --git a/sound/drivers/mtpav.c b/sound/drivers/mtpav.c index da03597fc893..5c426df87678 100644 --- a/sound/drivers/mtpav.c +++ b/sound/drivers/mtpav.c | |||
@@ -55,14 +55,13 @@ | |||
55 | #include <linux/err.h> | 55 | #include <linux/err.h> |
56 | #include <linux/platform_device.h> | 56 | #include <linux/platform_device.h> |
57 | #include <linux/ioport.h> | 57 | #include <linux/ioport.h> |
58 | #include <linux/io.h> | ||
58 | #include <linux/moduleparam.h> | 59 | #include <linux/moduleparam.h> |
59 | #include <sound/core.h> | 60 | #include <sound/core.h> |
60 | #include <sound/initval.h> | 61 | #include <sound/initval.h> |
61 | #include <sound/rawmidi.h> | 62 | #include <sound/rawmidi.h> |
62 | #include <linux/delay.h> | 63 | #include <linux/delay.h> |
63 | 64 | ||
64 | #include <asm/io.h> | ||
65 | |||
66 | /* | 65 | /* |
67 | * globals | 66 | * globals |
68 | */ | 67 | */ |
diff --git a/sound/oss/Makefile b/sound/oss/Makefile index 96f14dcd0cd1..90ffb99c6b17 100644 --- a/sound/oss/Makefile +++ b/sound/oss/Makefile | |||
@@ -87,7 +87,7 @@ ifeq ($(CONFIG_PSS_HAVE_BOOT),y) | |||
87 | $(obj)/bin2hex pss_synth < $< > $@ | 87 | $(obj)/bin2hex pss_synth < $< > $@ |
88 | else | 88 | else |
89 | $(obj)/pss_boot.h: | 89 | $(obj)/pss_boot.h: |
90 | ( \ | 90 | $(Q)( \ |
91 | echo 'static unsigned char * pss_synth = NULL;'; \ | 91 | echo 'static unsigned char * pss_synth = NULL;'; \ |
92 | echo 'static int pss_synthLen = 0;'; \ | 92 | echo 'static int pss_synthLen = 0;'; \ |
93 | ) > $@ | 93 | ) > $@ |
@@ -102,7 +102,7 @@ ifeq ($(CONFIG_TRIX_HAVE_BOOT),y) | |||
102 | $(obj)/hex2hex -i trix_boot < $< > $@ | 102 | $(obj)/hex2hex -i trix_boot < $< > $@ |
103 | else | 103 | else |
104 | $(obj)/trix_boot.h: | 104 | $(obj)/trix_boot.h: |
105 | ( \ | 105 | $(Q)( \ |
106 | echo 'static unsigned char * trix_boot = NULL;'; \ | 106 | echo 'static unsigned char * trix_boot = NULL;'; \ |
107 | echo 'static int trix_boot_len = 0;'; \ | 107 | echo 'static int trix_boot_len = 0;'; \ |
108 | ) > $@ | 108 | ) > $@ |
diff --git a/sound/pci/hda/patch_conexant.c b/sound/pci/hda/patch_conexant.c index 9bb030a469cd..fbe97d32140d 100644 --- a/sound/pci/hda/patch_conexant.c +++ b/sound/pci/hda/patch_conexant.c | |||
@@ -85,6 +85,7 @@ struct conexant_spec { | |||
85 | unsigned int auto_mic; | 85 | unsigned int auto_mic; |
86 | int auto_mic_ext; /* autocfg.inputs[] index for ext mic */ | 86 | int auto_mic_ext; /* autocfg.inputs[] index for ext mic */ |
87 | unsigned int need_dac_fix; | 87 | unsigned int need_dac_fix; |
88 | hda_nid_t slave_dig_outs[2]; | ||
88 | 89 | ||
89 | /* capture */ | 90 | /* capture */ |
90 | unsigned int num_adc_nids; | 91 | unsigned int num_adc_nids; |
@@ -127,6 +128,7 @@ struct conexant_spec { | |||
127 | unsigned int ideapad:1; | 128 | unsigned int ideapad:1; |
128 | unsigned int thinkpad:1; | 129 | unsigned int thinkpad:1; |
129 | unsigned int hp_laptop:1; | 130 | unsigned int hp_laptop:1; |
131 | unsigned int asus:1; | ||
130 | 132 | ||
131 | unsigned int ext_mic_present; | 133 | unsigned int ext_mic_present; |
132 | unsigned int recording; | 134 | unsigned int recording; |
@@ -352,6 +354,8 @@ static int conexant_build_pcms(struct hda_codec *codec) | |||
352 | info->stream[SNDRV_PCM_STREAM_CAPTURE].nid = | 354 | info->stream[SNDRV_PCM_STREAM_CAPTURE].nid = |
353 | spec->dig_in_nid; | 355 | spec->dig_in_nid; |
354 | } | 356 | } |
357 | if (spec->slave_dig_outs[0]) | ||
358 | codec->slave_dig_outs = spec->slave_dig_outs; | ||
355 | } | 359 | } |
356 | 360 | ||
357 | return 0; | 361 | return 0; |
@@ -403,10 +407,16 @@ static int conexant_add_jack(struct hda_codec *codec, | |||
403 | struct conexant_spec *spec; | 407 | struct conexant_spec *spec; |
404 | struct conexant_jack *jack; | 408 | struct conexant_jack *jack; |
405 | const char *name; | 409 | const char *name; |
406 | int err; | 410 | int i, err; |
407 | 411 | ||
408 | spec = codec->spec; | 412 | spec = codec->spec; |
409 | snd_array_init(&spec->jacks, sizeof(*jack), 32); | 413 | snd_array_init(&spec->jacks, sizeof(*jack), 32); |
414 | |||
415 | jack = spec->jacks.list; | ||
416 | for (i = 0; i < spec->jacks.used; i++, jack++) | ||
417 | if (jack->nid == nid) | ||
418 | return 0 ; /* already present */ | ||
419 | |||
410 | jack = snd_array_new(&spec->jacks); | 420 | jack = snd_array_new(&spec->jacks); |
411 | name = (type == SND_JACK_HEADPHONE) ? "Headphone" : "Mic" ; | 421 | name = (type == SND_JACK_HEADPHONE) ? "Headphone" : "Mic" ; |
412 | 422 | ||
@@ -2100,7 +2110,7 @@ static int patch_cxt5051(struct hda_codec *codec) | |||
2100 | static hda_nid_t cxt5066_dac_nids[1] = { 0x10 }; | 2110 | static hda_nid_t cxt5066_dac_nids[1] = { 0x10 }; |
2101 | static hda_nid_t cxt5066_adc_nids[3] = { 0x14, 0x15, 0x16 }; | 2111 | static hda_nid_t cxt5066_adc_nids[3] = { 0x14, 0x15, 0x16 }; |
2102 | static hda_nid_t cxt5066_capsrc_nids[1] = { 0x17 }; | 2112 | static hda_nid_t cxt5066_capsrc_nids[1] = { 0x17 }; |
2103 | #define CXT5066_SPDIF_OUT 0x21 | 2113 | static hda_nid_t cxt5066_digout_pin_nids[2] = { 0x20, 0x22 }; |
2104 | 2114 | ||
2105 | /* OLPC's microphone port is DC coupled for use with external sensors, | 2115 | /* OLPC's microphone port is DC coupled for use with external sensors, |
2106 | * therefore we use a 50% mic bias in order to center the input signal with | 2116 | * therefore we use a 50% mic bias in order to center the input signal with |
@@ -2312,6 +2322,19 @@ static void cxt5066_ideapad_automic(struct hda_codec *codec) | |||
2312 | } | 2322 | } |
2313 | } | 2323 | } |
2314 | 2324 | ||
2325 | |||
2326 | /* toggle input of built-in digital mic and mic jack appropriately */ | ||
2327 | static void cxt5066_asus_automic(struct hda_codec *codec) | ||
2328 | { | ||
2329 | unsigned int present; | ||
2330 | |||
2331 | present = snd_hda_jack_detect(codec, 0x1b); | ||
2332 | snd_printdd("CXT5066: external microphone present=%d\n", present); | ||
2333 | snd_hda_codec_write(codec, 0x17, 0, AC_VERB_SET_CONNECT_SEL, | ||
2334 | present ? 1 : 0); | ||
2335 | } | ||
2336 | |||
2337 | |||
2315 | /* toggle input of built-in digital mic and mic jack appropriately */ | 2338 | /* toggle input of built-in digital mic and mic jack appropriately */ |
2316 | static void cxt5066_hp_laptop_automic(struct hda_codec *codec) | 2339 | static void cxt5066_hp_laptop_automic(struct hda_codec *codec) |
2317 | { | 2340 | { |
@@ -2387,79 +2410,55 @@ static void cxt5066_hp_automute(struct hda_codec *codec) | |||
2387 | cxt5066_update_speaker(codec); | 2410 | cxt5066_update_speaker(codec); |
2388 | } | 2411 | } |
2389 | 2412 | ||
2390 | /* unsolicited event for jack sensing */ | 2413 | /* Dispatch the right mic autoswitch function */ |
2391 | static void cxt5066_olpc_unsol_event(struct hda_codec *codec, unsigned int res) | 2414 | static void cxt5066_automic(struct hda_codec *codec) |
2392 | { | 2415 | { |
2393 | struct conexant_spec *spec = codec->spec; | 2416 | struct conexant_spec *spec = codec->spec; |
2394 | snd_printdd("CXT5066: unsol event %x (%x)\n", res, res >> 26); | ||
2395 | switch (res >> 26) { | ||
2396 | case CONEXANT_HP_EVENT: | ||
2397 | cxt5066_hp_automute(codec); | ||
2398 | break; | ||
2399 | case CONEXANT_MIC_EVENT: | ||
2400 | /* ignore mic events in DC mode; we're always using the jack */ | ||
2401 | if (!spec->dc_enable) | ||
2402 | cxt5066_olpc_automic(codec); | ||
2403 | break; | ||
2404 | } | ||
2405 | } | ||
2406 | 2417 | ||
2407 | /* unsolicited event for jack sensing */ | 2418 | if (spec->dell_vostro) |
2408 | static void cxt5066_vostro_event(struct hda_codec *codec, unsigned int res) | ||
2409 | { | ||
2410 | snd_printdd("CXT5066_vostro: unsol event %x (%x)\n", res, res >> 26); | ||
2411 | switch (res >> 26) { | ||
2412 | case CONEXANT_HP_EVENT: | ||
2413 | cxt5066_hp_automute(codec); | ||
2414 | break; | ||
2415 | case CONEXANT_MIC_EVENT: | ||
2416 | cxt5066_vostro_automic(codec); | 2419 | cxt5066_vostro_automic(codec); |
2417 | break; | 2420 | else if (spec->ideapad) |
2418 | } | ||
2419 | } | ||
2420 | |||
2421 | /* unsolicited event for jack sensing */ | ||
2422 | static void cxt5066_ideapad_event(struct hda_codec *codec, unsigned int res) | ||
2423 | { | ||
2424 | snd_printdd("CXT5066_ideapad: unsol event %x (%x)\n", res, res >> 26); | ||
2425 | switch (res >> 26) { | ||
2426 | case CONEXANT_HP_EVENT: | ||
2427 | cxt5066_hp_automute(codec); | ||
2428 | break; | ||
2429 | case CONEXANT_MIC_EVENT: | ||
2430 | cxt5066_ideapad_automic(codec); | 2421 | cxt5066_ideapad_automic(codec); |
2431 | break; | 2422 | else if (spec->thinkpad) |
2432 | } | 2423 | cxt5066_thinkpad_automic(codec); |
2424 | else if (spec->hp_laptop) | ||
2425 | cxt5066_hp_laptop_automic(codec); | ||
2426 | else if (spec->asus) | ||
2427 | cxt5066_asus_automic(codec); | ||
2433 | } | 2428 | } |
2434 | 2429 | ||
2435 | /* unsolicited event for jack sensing */ | 2430 | /* unsolicited event for jack sensing */ |
2436 | static void cxt5066_hp_laptop_event(struct hda_codec *codec, unsigned int res) | 2431 | static void cxt5066_olpc_unsol_event(struct hda_codec *codec, unsigned int res) |
2437 | { | 2432 | { |
2438 | snd_printdd("CXT5066_hp_laptop: unsol event %x (%x)\n", res, res >> 26); | 2433 | struct conexant_spec *spec = codec->spec; |
2434 | snd_printdd("CXT5066: unsol event %x (%x)\n", res, res >> 26); | ||
2439 | switch (res >> 26) { | 2435 | switch (res >> 26) { |
2440 | case CONEXANT_HP_EVENT: | 2436 | case CONEXANT_HP_EVENT: |
2441 | cxt5066_hp_automute(codec); | 2437 | cxt5066_hp_automute(codec); |
2442 | break; | 2438 | break; |
2443 | case CONEXANT_MIC_EVENT: | 2439 | case CONEXANT_MIC_EVENT: |
2444 | cxt5066_hp_laptop_automic(codec); | 2440 | /* ignore mic events in DC mode; we're always using the jack */ |
2441 | if (!spec->dc_enable) | ||
2442 | cxt5066_olpc_automic(codec); | ||
2445 | break; | 2443 | break; |
2446 | } | 2444 | } |
2447 | } | 2445 | } |
2448 | 2446 | ||
2449 | /* unsolicited event for jack sensing */ | 2447 | /* unsolicited event for jack sensing */ |
2450 | static void cxt5066_thinkpad_event(struct hda_codec *codec, unsigned int res) | 2448 | static void cxt5066_unsol_event(struct hda_codec *codec, unsigned int res) |
2451 | { | 2449 | { |
2452 | snd_printdd("CXT5066_thinkpad: unsol event %x (%x)\n", res, res >> 26); | 2450 | snd_printdd("CXT5066: unsol event %x (%x)\n", res, res >> 26); |
2453 | switch (res >> 26) { | 2451 | switch (res >> 26) { |
2454 | case CONEXANT_HP_EVENT: | 2452 | case CONEXANT_HP_EVENT: |
2455 | cxt5066_hp_automute(codec); | 2453 | cxt5066_hp_automute(codec); |
2456 | break; | 2454 | break; |
2457 | case CONEXANT_MIC_EVENT: | 2455 | case CONEXANT_MIC_EVENT: |
2458 | cxt5066_thinkpad_automic(codec); | 2456 | cxt5066_automic(codec); |
2459 | break; | 2457 | break; |
2460 | } | 2458 | } |
2461 | } | 2459 | } |
2462 | 2460 | ||
2461 | |||
2463 | static const struct hda_input_mux cxt5066_analog_mic_boost = { | 2462 | static const struct hda_input_mux cxt5066_analog_mic_boost = { |
2464 | .num_items = 5, | 2463 | .num_items = 5, |
2465 | .items = { | 2464 | .items = { |
@@ -2633,6 +2632,27 @@ static void cxt5066_olpc_capture_cleanup(struct hda_codec *codec) | |||
2633 | spec->recording = 0; | 2632 | spec->recording = 0; |
2634 | } | 2633 | } |
2635 | 2634 | ||
2635 | static void conexant_check_dig_outs(struct hda_codec *codec, | ||
2636 | hda_nid_t *dig_pins, | ||
2637 | int num_pins) | ||
2638 | { | ||
2639 | struct conexant_spec *spec = codec->spec; | ||
2640 | hda_nid_t *nid_loc = &spec->multiout.dig_out_nid; | ||
2641 | int i; | ||
2642 | |||
2643 | for (i = 0; i < num_pins; i++, dig_pins++) { | ||
2644 | unsigned int cfg = snd_hda_codec_get_pincfg(codec, *dig_pins); | ||
2645 | if (get_defcfg_connect(cfg) == AC_JACK_PORT_NONE) | ||
2646 | continue; | ||
2647 | if (snd_hda_get_connections(codec, *dig_pins, nid_loc, 1) != 1) | ||
2648 | continue; | ||
2649 | if (spec->slave_dig_outs[0]) | ||
2650 | nid_loc++; | ||
2651 | else | ||
2652 | nid_loc = spec->slave_dig_outs; | ||
2653 | } | ||
2654 | } | ||
2655 | |||
2636 | static struct hda_input_mux cxt5066_capture_source = { | 2656 | static struct hda_input_mux cxt5066_capture_source = { |
2637 | .num_items = 4, | 2657 | .num_items = 4, |
2638 | .items = { | 2658 | .items = { |
@@ -3039,20 +3059,11 @@ static struct hda_verb cxt5066_init_verbs_hp_laptop[] = { | |||
3039 | /* initialize jack-sensing, too */ | 3059 | /* initialize jack-sensing, too */ |
3040 | static int cxt5066_init(struct hda_codec *codec) | 3060 | static int cxt5066_init(struct hda_codec *codec) |
3041 | { | 3061 | { |
3042 | struct conexant_spec *spec = codec->spec; | ||
3043 | |||
3044 | snd_printdd("CXT5066: init\n"); | 3062 | snd_printdd("CXT5066: init\n"); |
3045 | conexant_init(codec); | 3063 | conexant_init(codec); |
3046 | if (codec->patch_ops.unsol_event) { | 3064 | if (codec->patch_ops.unsol_event) { |
3047 | cxt5066_hp_automute(codec); | 3065 | cxt5066_hp_automute(codec); |
3048 | if (spec->dell_vostro) | 3066 | cxt5066_automic(codec); |
3049 | cxt5066_vostro_automic(codec); | ||
3050 | else if (spec->ideapad) | ||
3051 | cxt5066_ideapad_automic(codec); | ||
3052 | else if (spec->thinkpad) | ||
3053 | cxt5066_thinkpad_automic(codec); | ||
3054 | else if (spec->hp_laptop) | ||
3055 | cxt5066_hp_laptop_automic(codec); | ||
3056 | } | 3067 | } |
3057 | cxt5066_set_mic_boost(codec); | 3068 | cxt5066_set_mic_boost(codec); |
3058 | return 0; | 3069 | return 0; |
@@ -3080,6 +3091,7 @@ enum { | |||
3080 | CXT5066_DELL_VOSTRO, /* Dell Vostro 1015i */ | 3091 | CXT5066_DELL_VOSTRO, /* Dell Vostro 1015i */ |
3081 | CXT5066_IDEAPAD, /* Lenovo IdeaPad U150 */ | 3092 | CXT5066_IDEAPAD, /* Lenovo IdeaPad U150 */ |
3082 | CXT5066_THINKPAD, /* Lenovo ThinkPad T410s, others? */ | 3093 | CXT5066_THINKPAD, /* Lenovo ThinkPad T410s, others? */ |
3094 | CXT5066_ASUS, /* Asus K52JU, Lenovo G560 - Int mic at 0x1a and Ext mic at 0x1b */ | ||
3083 | CXT5066_HP_LAPTOP, /* HP Laptop */ | 3095 | CXT5066_HP_LAPTOP, /* HP Laptop */ |
3084 | CXT5066_MODELS | 3096 | CXT5066_MODELS |
3085 | }; | 3097 | }; |
@@ -3091,6 +3103,7 @@ static const char * const cxt5066_models[CXT5066_MODELS] = { | |||
3091 | [CXT5066_DELL_VOSTRO] = "dell-vostro", | 3103 | [CXT5066_DELL_VOSTRO] = "dell-vostro", |
3092 | [CXT5066_IDEAPAD] = "ideapad", | 3104 | [CXT5066_IDEAPAD] = "ideapad", |
3093 | [CXT5066_THINKPAD] = "thinkpad", | 3105 | [CXT5066_THINKPAD] = "thinkpad", |
3106 | [CXT5066_ASUS] = "asus", | ||
3094 | [CXT5066_HP_LAPTOP] = "hp-laptop", | 3107 | [CXT5066_HP_LAPTOP] = "hp-laptop", |
3095 | }; | 3108 | }; |
3096 | 3109 | ||
@@ -3102,7 +3115,9 @@ static struct snd_pci_quirk cxt5066_cfg_tbl[] = { | |||
3102 | SND_PCI_QUIRK(0x1028, 0x0402, "Dell Vostro", CXT5066_DELL_VOSTRO), | 3115 | SND_PCI_QUIRK(0x1028, 0x0402, "Dell Vostro", CXT5066_DELL_VOSTRO), |
3103 | SND_PCI_QUIRK(0x1028, 0x0408, "Dell Inspiron One 19T", CXT5066_IDEAPAD), | 3116 | SND_PCI_QUIRK(0x1028, 0x0408, "Dell Inspiron One 19T", CXT5066_IDEAPAD), |
3104 | SND_PCI_QUIRK(0x103c, 0x360b, "HP G60", CXT5066_HP_LAPTOP), | 3117 | SND_PCI_QUIRK(0x103c, 0x360b, "HP G60", CXT5066_HP_LAPTOP), |
3105 | SND_PCI_QUIRK(0x1043, 0x13f3, "Asus A52J", CXT5066_HP_LAPTOP), | 3118 | SND_PCI_QUIRK(0x1043, 0x13f3, "Asus A52J", CXT5066_ASUS), |
3119 | SND_PCI_QUIRK(0x1043, 0x1643, "Asus K52JU", CXT5066_ASUS), | ||
3120 | SND_PCI_QUIRK(0x1043, 0x1993, "Asus U50F", CXT5066_ASUS), | ||
3106 | SND_PCI_QUIRK(0x1179, 0xff1e, "Toshiba Satellite C650D", CXT5066_IDEAPAD), | 3121 | SND_PCI_QUIRK(0x1179, 0xff1e, "Toshiba Satellite C650D", CXT5066_IDEAPAD), |
3107 | SND_PCI_QUIRK(0x1179, 0xff50, "Toshiba Satellite P500-PSPGSC-01800T", CXT5066_OLPC_XO_1_5), | 3122 | SND_PCI_QUIRK(0x1179, 0xff50, "Toshiba Satellite P500-PSPGSC-01800T", CXT5066_OLPC_XO_1_5), |
3108 | SND_PCI_QUIRK(0x1179, 0xffe0, "Toshiba Satellite Pro T130-15F", CXT5066_OLPC_XO_1_5), | 3123 | SND_PCI_QUIRK(0x1179, 0xffe0, "Toshiba Satellite Pro T130-15F", CXT5066_OLPC_XO_1_5), |
@@ -3111,7 +3126,9 @@ static struct snd_pci_quirk cxt5066_cfg_tbl[] = { | |||
3111 | SND_PCI_QUIRK(0x152d, 0x0833, "OLPC XO-1.5", CXT5066_OLPC_XO_1_5), | 3126 | SND_PCI_QUIRK(0x152d, 0x0833, "OLPC XO-1.5", CXT5066_OLPC_XO_1_5), |
3112 | SND_PCI_QUIRK(0x17aa, 0x20f2, "Lenovo T400s", CXT5066_THINKPAD), | 3127 | SND_PCI_QUIRK(0x17aa, 0x20f2, "Lenovo T400s", CXT5066_THINKPAD), |
3113 | SND_PCI_QUIRK(0x17aa, 0x21c5, "Thinkpad Edge 13", CXT5066_THINKPAD), | 3128 | SND_PCI_QUIRK(0x17aa, 0x21c5, "Thinkpad Edge 13", CXT5066_THINKPAD), |
3129 | SND_PCI_QUIRK(0x17aa, 0x21c6, "Thinkpad Edge 13", CXT5066_ASUS), | ||
3114 | SND_PCI_QUIRK(0x17aa, 0x215e, "Lenovo Thinkpad", CXT5066_THINKPAD), | 3130 | SND_PCI_QUIRK(0x17aa, 0x215e, "Lenovo Thinkpad", CXT5066_THINKPAD), |
3131 | SND_PCI_QUIRK(0x17aa, 0x38af, "Lenovo G560", CXT5066_ASUS), | ||
3115 | SND_PCI_QUIRK_VENDOR(0x17aa, "Lenovo", CXT5066_IDEAPAD), /* Fallback for Lenovos without dock mic */ | 3132 | SND_PCI_QUIRK_VENDOR(0x17aa, "Lenovo", CXT5066_IDEAPAD), /* Fallback for Lenovos without dock mic */ |
3116 | {} | 3133 | {} |
3117 | }; | 3134 | }; |
@@ -3133,7 +3150,8 @@ static int patch_cxt5066(struct hda_codec *codec) | |||
3133 | spec->multiout.max_channels = 2; | 3150 | spec->multiout.max_channels = 2; |
3134 | spec->multiout.num_dacs = ARRAY_SIZE(cxt5066_dac_nids); | 3151 | spec->multiout.num_dacs = ARRAY_SIZE(cxt5066_dac_nids); |
3135 | spec->multiout.dac_nids = cxt5066_dac_nids; | 3152 | spec->multiout.dac_nids = cxt5066_dac_nids; |
3136 | spec->multiout.dig_out_nid = CXT5066_SPDIF_OUT; | 3153 | conexant_check_dig_outs(codec, cxt5066_digout_pin_nids, |
3154 | ARRAY_SIZE(cxt5066_digout_pin_nids)); | ||
3137 | spec->num_adc_nids = 1; | 3155 | spec->num_adc_nids = 1; |
3138 | spec->adc_nids = cxt5066_adc_nids; | 3156 | spec->adc_nids = cxt5066_adc_nids; |
3139 | spec->capsrc_nids = cxt5066_capsrc_nids; | 3157 | spec->capsrc_nids = cxt5066_capsrc_nids; |
@@ -3167,17 +3185,20 @@ static int patch_cxt5066(struct hda_codec *codec) | |||
3167 | spec->num_init_verbs++; | 3185 | spec->num_init_verbs++; |
3168 | spec->dell_automute = 1; | 3186 | spec->dell_automute = 1; |
3169 | break; | 3187 | break; |
3188 | case CXT5066_ASUS: | ||
3170 | case CXT5066_HP_LAPTOP: | 3189 | case CXT5066_HP_LAPTOP: |
3171 | codec->patch_ops.init = cxt5066_init; | 3190 | codec->patch_ops.init = cxt5066_init; |
3172 | codec->patch_ops.unsol_event = cxt5066_hp_laptop_event; | 3191 | codec->patch_ops.unsol_event = cxt5066_unsol_event; |
3173 | spec->init_verbs[spec->num_init_verbs] = | 3192 | spec->init_verbs[spec->num_init_verbs] = |
3174 | cxt5066_init_verbs_hp_laptop; | 3193 | cxt5066_init_verbs_hp_laptop; |
3175 | spec->num_init_verbs++; | 3194 | spec->num_init_verbs++; |
3176 | spec->hp_laptop = 1; | 3195 | spec->hp_laptop = board_config == CXT5066_HP_LAPTOP; |
3196 | spec->asus = board_config == CXT5066_ASUS; | ||
3177 | spec->mixers[spec->num_mixers++] = cxt5066_mixer_master; | 3197 | spec->mixers[spec->num_mixers++] = cxt5066_mixer_master; |
3178 | spec->mixers[spec->num_mixers++] = cxt5066_mixers; | 3198 | spec->mixers[spec->num_mixers++] = cxt5066_mixers; |
3179 | /* no S/PDIF out */ | 3199 | /* no S/PDIF out */ |
3180 | spec->multiout.dig_out_nid = 0; | 3200 | if (board_config == CXT5066_HP_LAPTOP) |
3201 | spec->multiout.dig_out_nid = 0; | ||
3181 | /* input source automatically selected */ | 3202 | /* input source automatically selected */ |
3182 | spec->input_mux = NULL; | 3203 | spec->input_mux = NULL; |
3183 | spec->port_d_mode = 0; | 3204 | spec->port_d_mode = 0; |
@@ -3207,7 +3228,7 @@ static int patch_cxt5066(struct hda_codec *codec) | |||
3207 | break; | 3228 | break; |
3208 | case CXT5066_DELL_VOSTRO: | 3229 | case CXT5066_DELL_VOSTRO: |
3209 | codec->patch_ops.init = cxt5066_init; | 3230 | codec->patch_ops.init = cxt5066_init; |
3210 | codec->patch_ops.unsol_event = cxt5066_vostro_event; | 3231 | codec->patch_ops.unsol_event = cxt5066_unsol_event; |
3211 | spec->init_verbs[0] = cxt5066_init_verbs_vostro; | 3232 | spec->init_verbs[0] = cxt5066_init_verbs_vostro; |
3212 | spec->mixers[spec->num_mixers++] = cxt5066_mixer_master_olpc; | 3233 | spec->mixers[spec->num_mixers++] = cxt5066_mixer_master_olpc; |
3213 | spec->mixers[spec->num_mixers++] = cxt5066_mixers; | 3234 | spec->mixers[spec->num_mixers++] = cxt5066_mixers; |
@@ -3224,7 +3245,7 @@ static int patch_cxt5066(struct hda_codec *codec) | |||
3224 | break; | 3245 | break; |
3225 | case CXT5066_IDEAPAD: | 3246 | case CXT5066_IDEAPAD: |
3226 | codec->patch_ops.init = cxt5066_init; | 3247 | codec->patch_ops.init = cxt5066_init; |
3227 | codec->patch_ops.unsol_event = cxt5066_ideapad_event; | 3248 | codec->patch_ops.unsol_event = cxt5066_unsol_event; |
3228 | spec->mixers[spec->num_mixers++] = cxt5066_mixer_master; | 3249 | spec->mixers[spec->num_mixers++] = cxt5066_mixer_master; |
3229 | spec->mixers[spec->num_mixers++] = cxt5066_mixers; | 3250 | spec->mixers[spec->num_mixers++] = cxt5066_mixers; |
3230 | spec->init_verbs[0] = cxt5066_init_verbs_ideapad; | 3251 | spec->init_verbs[0] = cxt5066_init_verbs_ideapad; |
@@ -3240,7 +3261,7 @@ static int patch_cxt5066(struct hda_codec *codec) | |||
3240 | break; | 3261 | break; |
3241 | case CXT5066_THINKPAD: | 3262 | case CXT5066_THINKPAD: |
3242 | codec->patch_ops.init = cxt5066_init; | 3263 | codec->patch_ops.init = cxt5066_init; |
3243 | codec->patch_ops.unsol_event = cxt5066_thinkpad_event; | 3264 | codec->patch_ops.unsol_event = cxt5066_unsol_event; |
3244 | spec->mixers[spec->num_mixers++] = cxt5066_mixer_master; | 3265 | spec->mixers[spec->num_mixers++] = cxt5066_mixer_master; |
3245 | spec->mixers[spec->num_mixers++] = cxt5066_mixers; | 3266 | spec->mixers[spec->num_mixers++] = cxt5066_mixers; |
3246 | spec->init_verbs[0] = cxt5066_init_verbs_thinkpad; | 3267 | spec->init_verbs[0] = cxt5066_init_verbs_thinkpad; |
diff --git a/sound/pci/oxygen/oxygen.h b/sound/pci/oxygen/oxygen.h index c2ae63d17cd2..f53897a708b4 100644 --- a/sound/pci/oxygen/oxygen.h +++ b/sound/pci/oxygen/oxygen.h | |||
@@ -92,6 +92,8 @@ struct oxygen_model { | |||
92 | void (*update_dac_volume)(struct oxygen *chip); | 92 | void (*update_dac_volume)(struct oxygen *chip); |
93 | void (*update_dac_mute)(struct oxygen *chip); | 93 | void (*update_dac_mute)(struct oxygen *chip); |
94 | void (*update_center_lfe_mix)(struct oxygen *chip, bool mixed); | 94 | void (*update_center_lfe_mix)(struct oxygen *chip, bool mixed); |
95 | unsigned int (*adjust_dac_routing)(struct oxygen *chip, | ||
96 | unsigned int play_routing); | ||
95 | void (*gpio_changed)(struct oxygen *chip); | 97 | void (*gpio_changed)(struct oxygen *chip); |
96 | void (*uart_input)(struct oxygen *chip); | 98 | void (*uart_input)(struct oxygen *chip); |
97 | void (*ac97_switch)(struct oxygen *chip, | 99 | void (*ac97_switch)(struct oxygen *chip, |
diff --git a/sound/pci/oxygen/oxygen_mixer.c b/sound/pci/oxygen/oxygen_mixer.c index 9bff14d5895d..26c7e8bcb229 100644 --- a/sound/pci/oxygen/oxygen_mixer.c +++ b/sound/pci/oxygen/oxygen_mixer.c | |||
@@ -180,6 +180,8 @@ void oxygen_update_dac_routing(struct oxygen *chip) | |||
180 | (1 << OXYGEN_PLAY_DAC1_SOURCE_SHIFT) | | 180 | (1 << OXYGEN_PLAY_DAC1_SOURCE_SHIFT) | |
181 | (2 << OXYGEN_PLAY_DAC2_SOURCE_SHIFT) | | 181 | (2 << OXYGEN_PLAY_DAC2_SOURCE_SHIFT) | |
182 | (3 << OXYGEN_PLAY_DAC3_SOURCE_SHIFT); | 182 | (3 << OXYGEN_PLAY_DAC3_SOURCE_SHIFT); |
183 | if (chip->model.adjust_dac_routing) | ||
184 | reg_value = chip->model.adjust_dac_routing(chip, reg_value); | ||
183 | oxygen_write16_masked(chip, OXYGEN_PLAY_ROUTING, reg_value, | 185 | oxygen_write16_masked(chip, OXYGEN_PLAY_ROUTING, reg_value, |
184 | OXYGEN_PLAY_DAC0_SOURCE_MASK | | 186 | OXYGEN_PLAY_DAC0_SOURCE_MASK | |
185 | OXYGEN_PLAY_DAC1_SOURCE_MASK | | 187 | OXYGEN_PLAY_DAC1_SOURCE_MASK | |
diff --git a/sound/pci/oxygen/xonar_dg.c b/sound/pci/oxygen/xonar_dg.c index e1fa602eba79..bc6eb58be380 100644 --- a/sound/pci/oxygen/xonar_dg.c +++ b/sound/pci/oxygen/xonar_dg.c | |||
@@ -24,6 +24,11 @@ | |||
24 | * | 24 | * |
25 | * SPI 0 -> CS4245 | 25 | * SPI 0 -> CS4245 |
26 | * | 26 | * |
27 | * I²S 1 -> CS4245 | ||
28 | * I²S 2 -> CS4361 (center/LFE) | ||
29 | * I²S 3 -> CS4361 (surround) | ||
30 | * I²S 4 -> CS4361 (front) | ||
31 | * | ||
27 | * GPIO 3 <- ? | 32 | * GPIO 3 <- ? |
28 | * GPIO 4 <- headphone detect | 33 | * GPIO 4 <- headphone detect |
29 | * GPIO 5 -> route input jack to line-in (0) or mic-in (1) | 34 | * GPIO 5 -> route input jack to line-in (0) or mic-in (1) |
@@ -36,6 +41,7 @@ | |||
36 | * input 1 <- aux | 41 | * input 1 <- aux |
37 | * input 2 <- front mic | 42 | * input 2 <- front mic |
38 | * input 4 <- line/mic | 43 | * input 4 <- line/mic |
44 | * DAC out -> headphones | ||
39 | * aux out -> front panel headphones | 45 | * aux out -> front panel headphones |
40 | */ | 46 | */ |
41 | 47 | ||
@@ -207,6 +213,35 @@ static void set_cs4245_adc_params(struct oxygen *chip, | |||
207 | cs4245_write_cached(chip, CS4245_ADC_CTRL, value); | 213 | cs4245_write_cached(chip, CS4245_ADC_CTRL, value); |
208 | } | 214 | } |
209 | 215 | ||
216 | static inline unsigned int shift_bits(unsigned int value, | ||
217 | unsigned int shift_from, | ||
218 | unsigned int shift_to, | ||
219 | unsigned int mask) | ||
220 | { | ||
221 | if (shift_from < shift_to) | ||
222 | return (value << (shift_to - shift_from)) & mask; | ||
223 | else | ||
224 | return (value >> (shift_from - shift_to)) & mask; | ||
225 | } | ||
226 | |||
227 | static unsigned int adjust_dg_dac_routing(struct oxygen *chip, | ||
228 | unsigned int play_routing) | ||
229 | { | ||
230 | return (play_routing & OXYGEN_PLAY_DAC0_SOURCE_MASK) | | ||
231 | shift_bits(play_routing, | ||
232 | OXYGEN_PLAY_DAC2_SOURCE_SHIFT, | ||
233 | OXYGEN_PLAY_DAC1_SOURCE_SHIFT, | ||
234 | OXYGEN_PLAY_DAC1_SOURCE_MASK) | | ||
235 | shift_bits(play_routing, | ||
236 | OXYGEN_PLAY_DAC1_SOURCE_SHIFT, | ||
237 | OXYGEN_PLAY_DAC2_SOURCE_SHIFT, | ||
238 | OXYGEN_PLAY_DAC2_SOURCE_MASK) | | ||
239 | shift_bits(play_routing, | ||
240 | OXYGEN_PLAY_DAC0_SOURCE_SHIFT, | ||
241 | OXYGEN_PLAY_DAC3_SOURCE_SHIFT, | ||
242 | OXYGEN_PLAY_DAC3_SOURCE_MASK); | ||
243 | } | ||
244 | |||
210 | static int output_switch_info(struct snd_kcontrol *ctl, | 245 | static int output_switch_info(struct snd_kcontrol *ctl, |
211 | struct snd_ctl_elem_info *info) | 246 | struct snd_ctl_elem_info *info) |
212 | { | 247 | { |
@@ -557,6 +592,7 @@ struct oxygen_model model_xonar_dg = { | |||
557 | .resume = dg_resume, | 592 | .resume = dg_resume, |
558 | .set_dac_params = set_cs4245_dac_params, | 593 | .set_dac_params = set_cs4245_dac_params, |
559 | .set_adc_params = set_cs4245_adc_params, | 594 | .set_adc_params = set_cs4245_adc_params, |
595 | .adjust_dac_routing = adjust_dg_dac_routing, | ||
560 | .dump_registers = dump_cs4245_registers, | 596 | .dump_registers = dump_cs4245_registers, |
561 | .model_data_size = sizeof(struct dg), | 597 | .model_data_size = sizeof(struct dg), |
562 | .device_config = PLAYBACK_0_TO_I2S | | 598 | .device_config = PLAYBACK_0_TO_I2S | |
diff --git a/sound/pcmcia/pdaudiocf/pdaudiocf.h b/sound/pcmcia/pdaudiocf/pdaudiocf.h index bd26e092aead..6ce9ad700290 100644 --- a/sound/pcmcia/pdaudiocf/pdaudiocf.h +++ b/sound/pcmcia/pdaudiocf/pdaudiocf.h | |||
@@ -22,7 +22,7 @@ | |||
22 | #define __PDAUDIOCF_H | 22 | #define __PDAUDIOCF_H |
23 | 23 | ||
24 | #include <sound/pcm.h> | 24 | #include <sound/pcm.h> |
25 | #include <asm/io.h> | 25 | #include <linux/io.h> |
26 | #include <linux/interrupt.h> | 26 | #include <linux/interrupt.h> |
27 | #include <pcmcia/cistpl.h> | 27 | #include <pcmcia/cistpl.h> |
28 | #include <pcmcia/ds.h> | 28 | #include <pcmcia/ds.h> |
diff --git a/sound/pcmcia/vx/vxp_ops.c b/sound/pcmcia/vx/vxp_ops.c index 989e04abb520..fe33e122e372 100644 --- a/sound/pcmcia/vx/vxp_ops.c +++ b/sound/pcmcia/vx/vxp_ops.c | |||
@@ -23,8 +23,8 @@ | |||
23 | #include <linux/delay.h> | 23 | #include <linux/delay.h> |
24 | #include <linux/device.h> | 24 | #include <linux/device.h> |
25 | #include <linux/firmware.h> | 25 | #include <linux/firmware.h> |
26 | #include <linux/io.h> | ||
26 | #include <sound/core.h> | 27 | #include <sound/core.h> |
27 | #include <asm/io.h> | ||
28 | #include "vxpocket.h" | 28 | #include "vxpocket.h" |
29 | 29 | ||
30 | 30 | ||
diff --git a/sound/soc/codecs/cq93vc.c b/sound/soc/codecs/cq93vc.c index 46dbfd067f79..347a567b01e1 100644 --- a/sound/soc/codecs/cq93vc.c +++ b/sound/soc/codecs/cq93vc.c | |||
@@ -153,7 +153,7 @@ static int cq93vc_resume(struct snd_soc_codec *codec) | |||
153 | 153 | ||
154 | static int cq93vc_probe(struct snd_soc_codec *codec) | 154 | static int cq93vc_probe(struct snd_soc_codec *codec) |
155 | { | 155 | { |
156 | struct davinci_vc *davinci_vc = codec->dev->platform_data; | 156 | struct davinci_vc *davinci_vc = snd_soc_codec_get_drvdata(codec); |
157 | 157 | ||
158 | davinci_vc->cq93vc.codec = codec; | 158 | davinci_vc->cq93vc.codec = codec; |
159 | codec->control_data = davinci_vc; | 159 | codec->control_data = davinci_vc; |
diff --git a/sound/soc/codecs/cx20442.c b/sound/soc/codecs/cx20442.c index 03d1e860d229..bb4bf65b9e7e 100644 --- a/sound/soc/codecs/cx20442.c +++ b/sound/soc/codecs/cx20442.c | |||
@@ -367,9 +367,12 @@ static int cx20442_codec_remove(struct snd_soc_codec *codec) | |||
367 | return 0; | 367 | return 0; |
368 | } | 368 | } |
369 | 369 | ||
370 | static const u8 cx20442_reg = CX20442_TELOUT | CX20442_MIC; | ||
371 | |||
370 | static struct snd_soc_codec_driver cx20442_codec_dev = { | 372 | static struct snd_soc_codec_driver cx20442_codec_dev = { |
371 | .probe = cx20442_codec_probe, | 373 | .probe = cx20442_codec_probe, |
372 | .remove = cx20442_codec_remove, | 374 | .remove = cx20442_codec_remove, |
375 | .reg_cache_default = &cx20442_reg, | ||
373 | .reg_cache_size = 1, | 376 | .reg_cache_size = 1, |
374 | .reg_word_size = sizeof(u8), | 377 | .reg_word_size = sizeof(u8), |
375 | .read = cx20442_read_reg_cache, | 378 | .read = cx20442_read_reg_cache, |
diff --git a/sound/soc/omap/ams-delta.c b/sound/soc/omap/ams-delta.c index 2101bdcee21f..3167be689621 100644 --- a/sound/soc/omap/ams-delta.c +++ b/sound/soc/omap/ams-delta.c | |||
@@ -507,8 +507,6 @@ static int ams_delta_cx20442_init(struct snd_soc_pcm_runtime *rtd) | |||
507 | /* Set up digital mute if not provided by the codec */ | 507 | /* Set up digital mute if not provided by the codec */ |
508 | if (!codec_dai->driver->ops) { | 508 | if (!codec_dai->driver->ops) { |
509 | codec_dai->driver->ops = &ams_delta_dai_ops; | 509 | codec_dai->driver->ops = &ams_delta_dai_ops; |
510 | } else if (!codec_dai->driver->ops->digital_mute) { | ||
511 | codec_dai->driver->ops->digital_mute = ams_delta_digital_mute; | ||
512 | } else { | 510 | } else { |
513 | ams_delta_ops.startup = ams_delta_startup; | 511 | ams_delta_ops.startup = ams_delta_startup; |
514 | ams_delta_ops.shutdown = ams_delta_shutdown; | 512 | ams_delta_ops.shutdown = ams_delta_shutdown; |
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index bac7291b6ff6..c4b60610beb0 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c | |||
@@ -1664,9 +1664,6 @@ static int soc_probe_aux_dev(struct snd_soc_card *card, int num) | |||
1664 | goto out; | 1664 | goto out; |
1665 | 1665 | ||
1666 | found: | 1666 | found: |
1667 | if (!try_module_get(codec->dev->driver->owner)) | ||
1668 | return -ENODEV; | ||
1669 | |||
1670 | ret = soc_probe_codec(card, codec); | 1667 | ret = soc_probe_codec(card, codec); |
1671 | if (ret < 0) | 1668 | if (ret < 0) |
1672 | return ret; | 1669 | return ret; |
diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c index 499730ab5638..8194f150bab7 100644 --- a/sound/soc/soc-dapm.c +++ b/sound/soc/soc-dapm.c | |||
@@ -1742,7 +1742,7 @@ int snd_soc_dapm_put_volsw(struct snd_kcontrol *kcontrol, | |||
1742 | int max = mc->max; | 1742 | int max = mc->max; |
1743 | unsigned int mask = (1 << fls(max)) - 1; | 1743 | unsigned int mask = (1 << fls(max)) - 1; |
1744 | unsigned int invert = mc->invert; | 1744 | unsigned int invert = mc->invert; |
1745 | unsigned int val, val_mask; | 1745 | unsigned int val; |
1746 | int connect, change; | 1746 | int connect, change; |
1747 | struct snd_soc_dapm_update update; | 1747 | struct snd_soc_dapm_update update; |
1748 | 1748 | ||
@@ -1750,13 +1750,13 @@ int snd_soc_dapm_put_volsw(struct snd_kcontrol *kcontrol, | |||
1750 | 1750 | ||
1751 | if (invert) | 1751 | if (invert) |
1752 | val = max - val; | 1752 | val = max - val; |
1753 | val_mask = mask << shift; | 1753 | mask = mask << shift; |
1754 | val = val << shift; | 1754 | val = val << shift; |
1755 | 1755 | ||
1756 | mutex_lock(&widget->codec->mutex); | 1756 | mutex_lock(&widget->codec->mutex); |
1757 | widget->value = val; | 1757 | widget->value = val; |
1758 | 1758 | ||
1759 | change = snd_soc_test_bits(widget->codec, reg, val_mask, val); | 1759 | change = snd_soc_test_bits(widget->codec, reg, mask, val); |
1760 | if (change) { | 1760 | if (change) { |
1761 | if (val) | 1761 | if (val) |
1762 | /* new connection */ | 1762 | /* new connection */ |