Commit 3ab345fc4b95a981a83f616487bbe07ddb5b1b1a
Exists in
master
and in
6 other branches
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: ALSA: hda/realtek - Fix lost speaker volume controls ALSA: hda/realtek - Create "Bass Speaker" for two speaker pins ALSA: hda/realtek - Don't create extra controls with channel suffix ALSA: hda - Fix remaining VREF mute-LED NID check in post-3.1 changes ALSA: hda - Fix GPIO LED setup for IDT 92HD75 codecs ASoC: Provide a more complete DMA driver stub ASoC: Remove references to corgi and spitz from machine driver document ASoC: Make SND_SOC_MX27VIS_AIC32X4 depend on I2C ASoC: Fix dependency for SND_SOC_RAUMFELD and SND_PXA2XX_SOC_HX4700 ASoC: uda1380: Return proper error in uda1380_modinit failure path ASoC: kirkwood: Make SND_KIRKWOOD_SOC_OPENRD and SND_KIRKWOOD_SOC_T5325 depend on I2C ASoC: Mark WM8994 ADC muxes as virtual ALSA: hda/realtek - Fix Oops in alc_mux_select() ALSA: sis7019 - give slow codecs more time to reset
Showing 10 changed files Side-by-side Diff
Documentation/sound/alsa/soc/machine.txt
... | ... | @@ -50,8 +50,7 @@ |
50 | 50 | The machine DAI configuration glues all the codec and CPU DAIs together. It can |
51 | 51 | also be used to set up the DAI system clock and for any machine related DAI |
52 | 52 | initialisation e.g. the machine audio map can be connected to the codec audio |
53 | -map, unconnected codec pins can be set as such. Please see corgi.c, spitz.c | |
54 | -for examples. | |
53 | +map, unconnected codec pins can be set as such. | |
55 | 54 | |
56 | 55 | struct snd_soc_dai_link is used to set up each DAI in your machine. e.g. |
57 | 56 | |
... | ... | @@ -83,8 +82,7 @@ |
83 | 82 | The machine driver can optionally extend the codec power map and to become an |
84 | 83 | audio power map of the audio subsystem. This allows for automatic power up/down |
85 | 84 | of speaker/HP amplifiers, etc. Codec pins can be connected to the machines jack |
86 | -sockets in the machine init function. See soc/pxa/spitz.c and dapm.txt for | |
87 | -details. | |
85 | +sockets in the machine init function. | |
88 | 86 | |
89 | 87 | |
90 | 88 | Machine Controls |
sound/pci/hda/patch_realtek.c
... | ... | @@ -297,6 +297,8 @@ |
297 | 297 | imux = &spec->input_mux[mux_idx]; |
298 | 298 | if (!imux->num_items && mux_idx > 0) |
299 | 299 | imux = &spec->input_mux[0]; |
300 | + if (!imux->num_items) | |
301 | + return 0; | |
300 | 302 | |
301 | 303 | if (idx >= imux->num_items) |
302 | 304 | idx = imux->num_items - 1; |
... | ... | @@ -2629,6 +2631,8 @@ |
2629 | 2631 | case AUTO_PIN_SPEAKER_OUT: |
2630 | 2632 | if (cfg->line_outs == 1) |
2631 | 2633 | return "Speaker"; |
2634 | + if (cfg->line_outs == 2) | |
2635 | + return ch ? "Bass Speaker" : "Speaker"; | |
2632 | 2636 | break; |
2633 | 2637 | case AUTO_PIN_HP_OUT: |
2634 | 2638 | /* for multi-io case, only the primary out */ |
... | ... | @@ -2902,7 +2906,7 @@ |
2902 | 2906 | if (!nid) |
2903 | 2907 | continue; |
2904 | 2908 | if (found_in_nid_list(nid, spec->multiout.dac_nids, |
2905 | - spec->multiout.num_dacs)) | |
2909 | + ARRAY_SIZE(spec->private_dac_nids))) | |
2906 | 2910 | continue; |
2907 | 2911 | if (found_in_nid_list(nid, spec->multiout.hp_out_nid, |
2908 | 2912 | ARRAY_SIZE(spec->multiout.hp_out_nid))) |
... | ... | @@ -2923,6 +2927,7 @@ |
2923 | 2927 | return 0; |
2924 | 2928 | } |
2925 | 2929 | |
2930 | +/* return 0 if no possible DAC is found, 1 if one or more found */ | |
2926 | 2931 | static int alc_auto_fill_extra_dacs(struct hda_codec *codec, int num_outs, |
2927 | 2932 | const hda_nid_t *pins, hda_nid_t *dacs) |
2928 | 2933 | { |
... | ... | @@ -2940,7 +2945,7 @@ |
2940 | 2945 | if (!dacs[i]) |
2941 | 2946 | dacs[i] = alc_auto_look_for_dac(codec, pins[i]); |
2942 | 2947 | } |
2943 | - return 0; | |
2948 | + return 1; | |
2944 | 2949 | } |
2945 | 2950 | |
2946 | 2951 | static int alc_auto_fill_multi_ios(struct hda_codec *codec, |
... | ... | @@ -2950,7 +2955,7 @@ |
2950 | 2955 | static int alc_auto_fill_dac_nids(struct hda_codec *codec) |
2951 | 2956 | { |
2952 | 2957 | struct alc_spec *spec = codec->spec; |
2953 | - const struct auto_pin_cfg *cfg = &spec->autocfg; | |
2958 | + struct auto_pin_cfg *cfg = &spec->autocfg; | |
2954 | 2959 | bool redone = false; |
2955 | 2960 | int i; |
2956 | 2961 | |
... | ... | @@ -2961,6 +2966,7 @@ |
2961 | 2966 | spec->multiout.extra_out_nid[0] = 0; |
2962 | 2967 | memset(spec->private_dac_nids, 0, sizeof(spec->private_dac_nids)); |
2963 | 2968 | spec->multiout.dac_nids = spec->private_dac_nids; |
2969 | + spec->multi_ios = 0; | |
2964 | 2970 | |
2965 | 2971 | /* fill hard-wired DACs first */ |
2966 | 2972 | if (!redone) { |
2967 | 2973 | |
... | ... | @@ -2994,10 +3000,12 @@ |
2994 | 3000 | for (i = 0; i < cfg->line_outs; i++) { |
2995 | 3001 | if (spec->private_dac_nids[i]) |
2996 | 3002 | spec->multiout.num_dacs++; |
2997 | - else | |
3003 | + else { | |
2998 | 3004 | memmove(spec->private_dac_nids + i, |
2999 | 3005 | spec->private_dac_nids + i + 1, |
3000 | 3006 | sizeof(hda_nid_t) * (cfg->line_outs - i - 1)); |
3007 | + spec->private_dac_nids[cfg->line_outs - 1] = 0; | |
3008 | + } | |
3001 | 3009 | } |
3002 | 3010 | |
3003 | 3011 | if (cfg->line_outs == 1 && cfg->line_out_type != AUTO_PIN_SPEAKER_OUT) { |
... | ... | @@ -3019,9 +3027,28 @@ |
3019 | 3027 | if (cfg->line_out_type != AUTO_PIN_HP_OUT) |
3020 | 3028 | alc_auto_fill_extra_dacs(codec, cfg->hp_outs, cfg->hp_pins, |
3021 | 3029 | spec->multiout.hp_out_nid); |
3022 | - if (cfg->line_out_type != AUTO_PIN_SPEAKER_OUT) | |
3023 | - alc_auto_fill_extra_dacs(codec, cfg->speaker_outs, cfg->speaker_pins, | |
3024 | - spec->multiout.extra_out_nid); | |
3030 | + if (cfg->line_out_type != AUTO_PIN_SPEAKER_OUT) { | |
3031 | + int err = alc_auto_fill_extra_dacs(codec, cfg->speaker_outs, | |
3032 | + cfg->speaker_pins, | |
3033 | + spec->multiout.extra_out_nid); | |
3034 | + /* if no speaker volume is assigned, try again as the primary | |
3035 | + * output | |
3036 | + */ | |
3037 | + if (!err && cfg->speaker_outs > 0 && | |
3038 | + cfg->line_out_type == AUTO_PIN_HP_OUT) { | |
3039 | + cfg->hp_outs = cfg->line_outs; | |
3040 | + memcpy(cfg->hp_pins, cfg->line_out_pins, | |
3041 | + sizeof(cfg->hp_pins)); | |
3042 | + cfg->line_outs = cfg->speaker_outs; | |
3043 | + memcpy(cfg->line_out_pins, cfg->speaker_pins, | |
3044 | + sizeof(cfg->speaker_pins)); | |
3045 | + cfg->speaker_outs = 0; | |
3046 | + memset(cfg->speaker_pins, 0, sizeof(cfg->speaker_pins)); | |
3047 | + cfg->line_out_type = AUTO_PIN_SPEAKER_OUT; | |
3048 | + redone = false; | |
3049 | + goto again; | |
3050 | + } | |
3051 | + } | |
3025 | 3052 | |
3026 | 3053 | return 0; |
3027 | 3054 | } |
... | ... | @@ -3171,7 +3198,8 @@ |
3171 | 3198 | } |
3172 | 3199 | |
3173 | 3200 | static int alc_auto_create_extra_out(struct hda_codec *codec, hda_nid_t pin, |
3174 | - hda_nid_t dac, const char *pfx) | |
3201 | + hda_nid_t dac, const char *pfx, | |
3202 | + int cidx) | |
3175 | 3203 | { |
3176 | 3204 | struct alc_spec *spec = codec->spec; |
3177 | 3205 | hda_nid_t sw, vol; |
3178 | 3206 | |
3179 | 3207 | |
... | ... | @@ -3187,15 +3215,15 @@ |
3187 | 3215 | if (is_ctl_used(spec->sw_ctls, val)) |
3188 | 3216 | return 0; /* already created */ |
3189 | 3217 | mark_ctl_usage(spec->sw_ctls, val); |
3190 | - return add_pb_sw_ctrl(spec, ALC_CTL_WIDGET_MUTE, pfx, val); | |
3218 | + return __add_pb_sw_ctrl(spec, ALC_CTL_WIDGET_MUTE, pfx, cidx, val); | |
3191 | 3219 | } |
3192 | 3220 | |
3193 | 3221 | sw = alc_look_for_out_mute_nid(codec, pin, dac); |
3194 | 3222 | vol = alc_look_for_out_vol_nid(codec, pin, dac); |
3195 | - err = alc_auto_add_stereo_vol(codec, pfx, 0, vol); | |
3223 | + err = alc_auto_add_stereo_vol(codec, pfx, cidx, vol); | |
3196 | 3224 | if (err < 0) |
3197 | 3225 | return err; |
3198 | - err = alc_auto_add_stereo_sw(codec, pfx, 0, sw); | |
3226 | + err = alc_auto_add_stereo_sw(codec, pfx, cidx, sw); | |
3199 | 3227 | if (err < 0) |
3200 | 3228 | return err; |
3201 | 3229 | return 0; |
3202 | 3230 | |
... | ... | @@ -3236,16 +3264,21 @@ |
3236 | 3264 | hda_nid_t dac = *dacs; |
3237 | 3265 | if (!dac) |
3238 | 3266 | dac = spec->multiout.dac_nids[0]; |
3239 | - return alc_auto_create_extra_out(codec, *pins, dac, pfx); | |
3267 | + return alc_auto_create_extra_out(codec, *pins, dac, pfx, 0); | |
3240 | 3268 | } |
3241 | 3269 | |
3242 | 3270 | if (dacs[num_pins - 1]) { |
3243 | 3271 | /* OK, we have a multi-output system with individual volumes */ |
3244 | 3272 | for (i = 0; i < num_pins; i++) { |
3245 | - snprintf(name, sizeof(name), "%s %s", | |
3246 | - pfx, channel_name[i]); | |
3247 | - err = alc_auto_create_extra_out(codec, pins[i], dacs[i], | |
3248 | - name); | |
3273 | + if (num_pins >= 3) { | |
3274 | + snprintf(name, sizeof(name), "%s %s", | |
3275 | + pfx, channel_name[i]); | |
3276 | + err = alc_auto_create_extra_out(codec, pins[i], dacs[i], | |
3277 | + name, 0); | |
3278 | + } else { | |
3279 | + err = alc_auto_create_extra_out(codec, pins[i], dacs[i], | |
3280 | + pfx, i); | |
3281 | + } | |
3249 | 3282 | if (err < 0) |
3250 | 3283 | return err; |
3251 | 3284 | } |
sound/pci/hda/patch_sigmatel.c
... | ... | @@ -215,6 +215,7 @@ |
215 | 215 | unsigned int gpio_mute; |
216 | 216 | unsigned int gpio_led; |
217 | 217 | unsigned int gpio_led_polarity; |
218 | + unsigned int vref_mute_led_nid; /* pin NID for mute-LED vref control */ | |
218 | 219 | unsigned int vref_led; |
219 | 220 | |
220 | 221 | /* stream */ |
... | ... | @@ -4318,12 +4319,10 @@ |
4318 | 4319 | spec->eapd_switch = val; |
4319 | 4320 | get_int_hint(codec, "gpio_led_polarity", &spec->gpio_led_polarity); |
4320 | 4321 | if (get_int_hint(codec, "gpio_led", &spec->gpio_led)) { |
4321 | - if (spec->gpio_led <= 8) { | |
4322 | - spec->gpio_mask |= spec->gpio_led; | |
4323 | - spec->gpio_dir |= spec->gpio_led; | |
4324 | - if (spec->gpio_led_polarity) | |
4325 | - spec->gpio_data |= spec->gpio_led; | |
4326 | - } | |
4322 | + spec->gpio_mask |= spec->gpio_led; | |
4323 | + spec->gpio_dir |= spec->gpio_led; | |
4324 | + if (spec->gpio_led_polarity) | |
4325 | + spec->gpio_data |= spec->gpio_led; | |
4327 | 4326 | } |
4328 | 4327 | } |
4329 | 4328 | |
... | ... | @@ -4443,7 +4442,7 @@ |
4443 | 4442 | /* power on when no jack detection is available */ |
4444 | 4443 | /* or when the VREF is used for controlling LED */ |
4445 | 4444 | if (!spec->hp_detect || |
4446 | - (spec->gpio_led > 8 && spec->gpio_led == nid)) { | |
4445 | + spec->vref_mute_led_nid == nid) { | |
4447 | 4446 | stac_toggle_power_map(codec, nid, 1); |
4448 | 4447 | continue; |
4449 | 4448 | } |
4450 | 4449 | |
... | ... | @@ -4915,8 +4914,14 @@ |
4915 | 4914 | if (sscanf(dev->name, "HP_Mute_LED_%d_%x", |
4916 | 4915 | &spec->gpio_led_polarity, |
4917 | 4916 | &spec->gpio_led) == 2) { |
4918 | - if (spec->gpio_led < 4) | |
4917 | + unsigned int max_gpio; | |
4918 | + max_gpio = snd_hda_param_read(codec, codec->afg, | |
4919 | + AC_PAR_GPIO_CAP); | |
4920 | + max_gpio &= AC_GPIO_IO_COUNT; | |
4921 | + if (spec->gpio_led < max_gpio) | |
4919 | 4922 | spec->gpio_led = 1 << spec->gpio_led; |
4923 | + else | |
4924 | + spec->vref_mute_led_nid = spec->gpio_led; | |
4920 | 4925 | return 1; |
4921 | 4926 | } |
4922 | 4927 | if (sscanf(dev->name, "HP_Mute_LED_%d", |
... | ... | @@ -5045,15 +5050,12 @@ |
5045 | 5050 | struct sigmatel_spec *spec = codec->spec; |
5046 | 5051 | |
5047 | 5052 | /* sync mute LED */ |
5048 | - if (spec->gpio_led) { | |
5049 | - if (spec->gpio_led <= 8) { | |
5050 | - stac_gpio_set(codec, spec->gpio_mask, | |
5051 | - spec->gpio_dir, spec->gpio_data); | |
5052 | - } else { | |
5053 | - stac_vrefout_set(codec, | |
5054 | - spec->gpio_led, spec->vref_led); | |
5055 | - } | |
5056 | - } | |
5053 | + if (spec->vref_mute_led_nid) | |
5054 | + stac_vrefout_set(codec, spec->vref_mute_led_nid, | |
5055 | + spec->vref_led); | |
5056 | + else if (spec->gpio_led) | |
5057 | + stac_gpio_set(codec, spec->gpio_mask, | |
5058 | + spec->gpio_dir, spec->gpio_data); | |
5057 | 5059 | return 0; |
5058 | 5060 | } |
5059 | 5061 | |
... | ... | @@ -5064,7 +5066,7 @@ |
5064 | 5066 | struct sigmatel_spec *spec = codec->spec; |
5065 | 5067 | |
5066 | 5068 | if (power_state == AC_PWRST_D3) { |
5067 | - if (spec->gpio_led > 8) { | |
5069 | + if (spec->vref_mute_led_nid) { | |
5068 | 5070 | /* with vref-out pin used for mute led control |
5069 | 5071 | * codec AFG is prevented from D3 state |
5070 | 5072 | */ |
... | ... | @@ -5117,7 +5119,7 @@ |
5117 | 5119 | } |
5118 | 5120 | } |
5119 | 5121 | /*polarity defines *not* muted state level*/ |
5120 | - if (spec->gpio_led <= 8) { | |
5122 | + if (!spec->vref_mute_led_nid) { | |
5121 | 5123 | if (muted) |
5122 | 5124 | spec->gpio_data &= ~spec->gpio_led; /* orange */ |
5123 | 5125 | else |
... | ... | @@ -5135,7 +5137,8 @@ |
5135 | 5137 | muted_lvl = spec->gpio_led_polarity ? |
5136 | 5138 | AC_PINCTL_VREF_GRD : AC_PINCTL_VREF_HIZ; |
5137 | 5139 | spec->vref_led = muted ? muted_lvl : notmtd_lvl; |
5138 | - stac_vrefout_set(codec, spec->gpio_led, spec->vref_led); | |
5140 | + stac_vrefout_set(codec, spec->vref_mute_led_nid, | |
5141 | + spec->vref_led); | |
5139 | 5142 | } |
5140 | 5143 | return 0; |
5141 | 5144 | } |
... | ... | @@ -5649,7 +5652,7 @@ |
5649 | 5652 | |
5650 | 5653 | #ifdef CONFIG_SND_HDA_POWER_SAVE |
5651 | 5654 | if (spec->gpio_led) { |
5652 | - if (spec->gpio_led <= 8) { | |
5655 | + if (!spec->vref_mute_led_nid) { | |
5653 | 5656 | spec->gpio_mask |= spec->gpio_led; |
5654 | 5657 | spec->gpio_dir |= spec->gpio_led; |
5655 | 5658 | spec->gpio_data |= spec->gpio_led; |
... | ... | @@ -5962,7 +5965,7 @@ |
5962 | 5965 | |
5963 | 5966 | #ifdef CONFIG_SND_HDA_POWER_SAVE |
5964 | 5967 | if (spec->gpio_led) { |
5965 | - if (spec->gpio_led <= 8) { | |
5968 | + if (!spec->vref_mute_led_nid) { | |
5966 | 5969 | spec->gpio_mask |= spec->gpio_led; |
5967 | 5970 | spec->gpio_dir |= spec->gpio_led; |
5968 | 5971 | spec->gpio_data |= spec->gpio_led; |
sound/pci/sis7019.c
... | ... | @@ -41,6 +41,7 @@ |
41 | 41 | static int index = SNDRV_DEFAULT_IDX1; /* Index 0-MAX */ |
42 | 42 | static char *id = SNDRV_DEFAULT_STR1; /* ID for this card */ |
43 | 43 | static int enable = 1; |
44 | +static int codecs = 1; | |
44 | 45 | |
45 | 46 | module_param(index, int, 0444); |
46 | 47 | MODULE_PARM_DESC(index, "Index value for SiS7019 Audio Accelerator."); |
... | ... | @@ -48,6 +49,8 @@ |
48 | 49 | MODULE_PARM_DESC(id, "ID string for SiS7019 Audio Accelerator."); |
49 | 50 | module_param(enable, bool, 0444); |
50 | 51 | MODULE_PARM_DESC(enable, "Enable SiS7019 Audio Accelerator."); |
52 | +module_param(codecs, int, 0444); | |
53 | +MODULE_PARM_DESC(codecs, "Set bit to indicate that codec number is expected to be present (default 1)"); | |
51 | 54 | |
52 | 55 | static DEFINE_PCI_DEVICE_TABLE(snd_sis7019_ids) = { |
53 | 56 | { PCI_DEVICE(PCI_VENDOR_ID_SI, 0x7019) }, |
... | ... | @@ -140,6 +143,9 @@ |
140 | 143 | dma_addr_t silence_dma_addr; |
141 | 144 | }; |
142 | 145 | |
146 | +/* These values are also used by the module param 'codecs' to indicate | |
147 | + * which codecs should be present. | |
148 | + */ | |
143 | 149 | #define SIS_PRIMARY_CODEC_PRESENT 0x0001 |
144 | 150 | #define SIS_SECONDARY_CODEC_PRESENT 0x0002 |
145 | 151 | #define SIS_TERTIARY_CODEC_PRESENT 0x0004 |
... | ... | @@ -1078,6 +1084,7 @@ |
1078 | 1084 | { |
1079 | 1085 | unsigned long io = sis->ioport; |
1080 | 1086 | void __iomem *ioaddr = sis->ioaddr; |
1087 | + unsigned long timeout; | |
1081 | 1088 | u16 status; |
1082 | 1089 | int count; |
1083 | 1090 | int i; |
1084 | 1091 | |
1085 | 1092 | |
1086 | 1093 | |
1087 | 1094 | |
1088 | 1095 | |
1089 | 1096 | |
... | ... | @@ -1104,22 +1111,46 @@ |
1104 | 1111 | while ((inw(io + SIS_AC97_STATUS) & SIS_AC97_STATUS_BUSY) && --count) |
1105 | 1112 | udelay(1); |
1106 | 1113 | |
1114 | + /* Command complete, we can let go of the semaphore now. | |
1115 | + */ | |
1116 | + outl(SIS_AC97_SEMA_RELEASE, io + SIS_AC97_SEMA); | |
1117 | + if (!count) | |
1118 | + return -EIO; | |
1119 | + | |
1107 | 1120 | /* Now that we've finished the reset, find out what's attached. |
1121 | + * There are some codec/board combinations that take an extremely | |
1122 | + * long time to come up. 350+ ms has been observed in the field, | |
1123 | + * so we'll give them up to 500ms. | |
1108 | 1124 | */ |
1109 | - status = inl(io + SIS_AC97_STATUS); | |
1110 | - if (status & SIS_AC97_STATUS_CODEC_READY) | |
1111 | - sis->codecs_present |= SIS_PRIMARY_CODEC_PRESENT; | |
1112 | - if (status & SIS_AC97_STATUS_CODEC2_READY) | |
1113 | - sis->codecs_present |= SIS_SECONDARY_CODEC_PRESENT; | |
1114 | - if (status & SIS_AC97_STATUS_CODEC3_READY) | |
1115 | - sis->codecs_present |= SIS_TERTIARY_CODEC_PRESENT; | |
1125 | + sis->codecs_present = 0; | |
1126 | + timeout = msecs_to_jiffies(500) + jiffies; | |
1127 | + while (time_before_eq(jiffies, timeout)) { | |
1128 | + status = inl(io + SIS_AC97_STATUS); | |
1129 | + if (status & SIS_AC97_STATUS_CODEC_READY) | |
1130 | + sis->codecs_present |= SIS_PRIMARY_CODEC_PRESENT; | |
1131 | + if (status & SIS_AC97_STATUS_CODEC2_READY) | |
1132 | + sis->codecs_present |= SIS_SECONDARY_CODEC_PRESENT; | |
1133 | + if (status & SIS_AC97_STATUS_CODEC3_READY) | |
1134 | + sis->codecs_present |= SIS_TERTIARY_CODEC_PRESENT; | |
1116 | 1135 | |
1117 | - /* All done, let go of the semaphore, and check for errors | |
1136 | + if (sis->codecs_present == codecs) | |
1137 | + break; | |
1138 | + | |
1139 | + msleep(1); | |
1140 | + } | |
1141 | + | |
1142 | + /* All done, check for errors. | |
1118 | 1143 | */ |
1119 | - outl(SIS_AC97_SEMA_RELEASE, io + SIS_AC97_SEMA); | |
1120 | - if (!sis->codecs_present || !count) | |
1144 | + if (!sis->codecs_present) { | |
1145 | + printk(KERN_ERR "sis7019: could not find any codecs\n"); | |
1121 | 1146 | return -EIO; |
1147 | + } | |
1122 | 1148 | |
1149 | + if (sis->codecs_present != codecs) { | |
1150 | + printk(KERN_WARNING "sis7019: missing codecs, found %0x, expected %0x\n", | |
1151 | + sis->codecs_present, codecs); | |
1152 | + } | |
1153 | + | |
1123 | 1154 | /* Let the hardware know that the audio driver is alive, |
1124 | 1155 | * and enable PCM slots on the AC-link for L/R playback (3 & 4) and |
1125 | 1156 | * record channels. We're going to want to use Variable Rate Audio |
... | ... | @@ -1389,6 +1420,17 @@ |
1389 | 1420 | rc = -ENOENT; |
1390 | 1421 | if (!enable) |
1391 | 1422 | goto error_out; |
1423 | + | |
1424 | + /* The user can specify which codecs should be present so that we | |
1425 | + * can wait for them to show up if they are slow to recover from | |
1426 | + * the AC97 cold reset. We default to a single codec, the primary. | |
1427 | + * | |
1428 | + * We assume that SIS_PRIMARY_*_PRESENT matches bits 0-2. | |
1429 | + */ | |
1430 | + codecs &= SIS_PRIMARY_CODEC_PRESENT | SIS_SECONDARY_CODEC_PRESENT | | |
1431 | + SIS_TERTIARY_CODEC_PRESENT; | |
1432 | + if (!codecs) | |
1433 | + codecs = SIS_PRIMARY_CODEC_PRESENT; | |
1392 | 1434 | |
1393 | 1435 | rc = snd_card_create(index, id, THIS_MODULE, sizeof(*sis), &card); |
1394 | 1436 | if (rc < 0) |
sound/soc/codecs/uda1380.c
... | ... | @@ -863,13 +863,13 @@ |
863 | 863 | |
864 | 864 | static int __init uda1380_modinit(void) |
865 | 865 | { |
866 | - int ret; | |
866 | + int ret = 0; | |
867 | 867 | #if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE) |
868 | 868 | ret = i2c_add_driver(&uda1380_i2c_driver); |
869 | 869 | if (ret != 0) |
870 | 870 | pr_err("Failed to register UDA1380 I2C driver: %d\n", ret); |
871 | 871 | #endif |
872 | - return 0; | |
872 | + return ret; | |
873 | 873 | } |
874 | 874 | module_init(uda1380_modinit); |
875 | 875 |
sound/soc/codecs/wm8994.c
... | ... | @@ -1325,15 +1325,15 @@ |
1325 | 1325 | }; |
1326 | 1326 | |
1327 | 1327 | static const struct snd_soc_dapm_widget wm8994_adc_revd_widgets[] = { |
1328 | -SND_SOC_DAPM_MUX_E("ADCL Mux", WM8994_POWER_MANAGEMENT_4, 1, 0, &adcl_mux, | |
1329 | - adc_mux_ev, SND_SOC_DAPM_PRE_PMU), | |
1330 | -SND_SOC_DAPM_MUX_E("ADCR Mux", WM8994_POWER_MANAGEMENT_4, 0, 0, &adcr_mux, | |
1331 | - adc_mux_ev, SND_SOC_DAPM_PRE_PMU), | |
1328 | +SND_SOC_DAPM_VIRT_MUX_E("ADCL Mux", WM8994_POWER_MANAGEMENT_4, 1, 0, &adcl_mux, | |
1329 | + adc_mux_ev, SND_SOC_DAPM_PRE_PMU), | |
1330 | +SND_SOC_DAPM_VIRT_MUX_E("ADCR Mux", WM8994_POWER_MANAGEMENT_4, 0, 0, &adcr_mux, | |
1331 | + adc_mux_ev, SND_SOC_DAPM_PRE_PMU), | |
1332 | 1332 | }; |
1333 | 1333 | |
1334 | 1334 | static const struct snd_soc_dapm_widget wm8994_adc_widgets[] = { |
1335 | -SND_SOC_DAPM_MUX("ADCL Mux", WM8994_POWER_MANAGEMENT_4, 1, 0, &adcl_mux), | |
1336 | -SND_SOC_DAPM_MUX("ADCR Mux", WM8994_POWER_MANAGEMENT_4, 0, 0, &adcr_mux), | |
1335 | +SND_SOC_DAPM_VIRT_MUX("ADCL Mux", WM8994_POWER_MANAGEMENT_4, 1, 0, &adcl_mux), | |
1336 | +SND_SOC_DAPM_VIRT_MUX("ADCR Mux", WM8994_POWER_MANAGEMENT_4, 0, 0, &adcr_mux), | |
1337 | 1337 | }; |
1338 | 1338 | |
1339 | 1339 | static const struct snd_soc_dapm_widget wm8994_dapm_widgets[] = { |
sound/soc/imx/Kconfig
sound/soc/kirkwood/Kconfig
... | ... | @@ -12,6 +12,7 @@ |
12 | 12 | config SND_KIRKWOOD_SOC_OPENRD |
13 | 13 | tristate "SoC Audio support for Kirkwood Openrd Client" |
14 | 14 | depends on SND_KIRKWOOD_SOC && (MACH_OPENRD_CLIENT || MACH_OPENRD_ULTIMATE) |
15 | + depends on I2C | |
15 | 16 | select SND_KIRKWOOD_SOC_I2S |
16 | 17 | select SND_SOC_CS42L51 |
17 | 18 | help |
... | ... | @@ -20,7 +21,7 @@ |
20 | 21 | |
21 | 22 | config SND_KIRKWOOD_SOC_T5325 |
22 | 23 | tristate "SoC Audio support for HP t5325" |
23 | - depends on SND_KIRKWOOD_SOC && MACH_T5325 | |
24 | + depends on SND_KIRKWOOD_SOC && MACH_T5325 && I2C | |
24 | 25 | select SND_KIRKWOOD_SOC_I2S |
25 | 26 | select SND_SOC_ALC5623 |
26 | 27 | help |
sound/soc/pxa/Kconfig
... | ... | @@ -151,6 +151,7 @@ |
151 | 151 | config SND_SOC_RAUMFELD |
152 | 152 | tristate "SoC Audio support Raumfeld audio adapter" |
153 | 153 | depends on SND_PXA2XX_SOC && (MACH_RAUMFELD_SPEAKER || MACH_RAUMFELD_CONNECTOR) |
154 | + depends on I2C && SPI_MASTER | |
154 | 155 | select SND_PXA_SOC_SSP |
155 | 156 | select SND_SOC_CS4270 |
156 | 157 | select SND_SOC_AK4104 |
... | ... | @@ -159,7 +160,7 @@ |
159 | 160 | |
160 | 161 | config SND_PXA2XX_SOC_HX4700 |
161 | 162 | tristate "SoC Audio support for HP iPAQ hx4700" |
162 | - depends on SND_PXA2XX_SOC && MACH_H4700 | |
163 | + depends on SND_PXA2XX_SOC && MACH_H4700 && I2C | |
163 | 164 | select SND_PXA2XX_SOC_I2S |
164 | 165 | select SND_SOC_AK4641 |
165 | 166 | help |
sound/soc/soc-utils.c
... | ... | @@ -58,7 +58,36 @@ |
58 | 58 | } |
59 | 59 | EXPORT_SYMBOL_GPL(snd_soc_params_to_bclk); |
60 | 60 | |
61 | -static struct snd_soc_platform_driver dummy_platform; | |
61 | +static const struct snd_pcm_hardware dummy_dma_hardware = { | |
62 | + .formats = 0xffffffff, | |
63 | + .channels_min = 1, | |
64 | + .channels_max = UINT_MAX, | |
65 | + | |
66 | + /* Random values to keep userspace happy when checking constraints */ | |
67 | + .info = SNDRV_PCM_INFO_INTERLEAVED | | |
68 | + SNDRV_PCM_INFO_BLOCK_TRANSFER, | |
69 | + .buffer_bytes_max = 128*1024, | |
70 | + .period_bytes_min = PAGE_SIZE, | |
71 | + .period_bytes_max = PAGE_SIZE*2, | |
72 | + .periods_min = 2, | |
73 | + .periods_max = 128, | |
74 | +}; | |
75 | + | |
76 | +static int dummy_dma_open(struct snd_pcm_substream *substream) | |
77 | +{ | |
78 | + snd_soc_set_runtime_hwparams(substream, &dummy_dma_hardware); | |
79 | + | |
80 | + return 0; | |
81 | +} | |
82 | + | |
83 | +static struct snd_pcm_ops dummy_dma_ops = { | |
84 | + .open = dummy_dma_open, | |
85 | + .ioctl = snd_pcm_lib_ioctl, | |
86 | +}; | |
87 | + | |
88 | +static struct snd_soc_platform_driver dummy_platform = { | |
89 | + .ops = &dummy_dma_ops, | |
90 | +}; | |
62 | 91 | |
63 | 92 | static __devinit int snd_soc_dummy_probe(struct platform_device *pdev) |
64 | 93 | { |