diff options
author | Arnd Bergmann <arnd@arndb.de> | 2011-12-27 17:04:51 -0500 |
---|---|---|
committer | Arnd Bergmann <arnd@arndb.de> | 2011-12-27 17:05:06 -0500 |
commit | 07b98403ee67838bbaded43bd687875b9d7f74e0 (patch) | |
tree | 0b1f155ae4628a2be4dc4dd4c7fbeeaf1d8016dc /sound | |
parent | b17471f5d121a53be1ccf6e0b0599441e56b468c (diff) | |
parent | f4ebf1d1f8d10b703493e76300605e8be2f21bf5 (diff) |
Merge branch 'omap/hwmod' into next/drivers
This is needed as a dependency for omap/ehci.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Diffstat (limited to 'sound')
-rw-r--r-- | sound/pci/hda/hda_intel.c | 1 | ||||
-rw-r--r-- | sound/pci/hda/patch_realtek.c | 65 | ||||
-rw-r--r-- | sound/pci/hda/patch_sigmatel.c | 67 | ||||
-rw-r--r-- | sound/pci/sis7019.c | 64 | ||||
-rw-r--r-- | sound/soc/atmel/Kconfig | 21 | ||||
-rw-r--r-- | sound/soc/atmel/Makefile | 4 | ||||
-rw-r--r-- | sound/soc/atmel/playpaq_wm8510.c | 473 | ||||
-rw-r--r-- | sound/soc/codecs/ad1836.h | 2 | ||||
-rw-r--r-- | sound/soc/codecs/cs4270.c | 10 | ||||
-rw-r--r-- | sound/soc/codecs/cs42l51.c | 2 | ||||
-rw-r--r-- | sound/soc/codecs/max9877.c | 10 | ||||
-rw-r--r-- | sound/soc/codecs/uda1380.c | 4 | ||||
-rw-r--r-- | sound/soc/codecs/wm8994.c | 19 | ||||
-rw-r--r-- | sound/soc/fsl/mpc8610_hpcd.c | 24 | ||||
-rw-r--r-- | sound/soc/imx/Kconfig | 2 | ||||
-rw-r--r-- | sound/soc/kirkwood/Kconfig | 3 | ||||
-rw-r--r-- | sound/soc/pxa/Kconfig | 3 | ||||
-rw-r--r-- | sound/soc/samsung/smdk_wm8994.c | 1 | ||||
-rw-r--r-- | sound/soc/samsung/speyside.c | 2 | ||||
-rw-r--r-- | sound/soc/soc-core.c | 6 | ||||
-rw-r--r-- | sound/soc/soc-utils.c | 31 | ||||
-rw-r--r-- | sound/usb/quirks-table.h | 31 |
22 files changed, 243 insertions, 602 deletions
diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c index 096507d2ca9a..7d98240def0b 100644 --- a/sound/pci/hda/hda_intel.c +++ b/sound/pci/hda/hda_intel.c | |||
@@ -2508,7 +2508,6 @@ static struct snd_pci_quirk position_fix_list[] __devinitdata = { | |||
2508 | SND_PCI_QUIRK(0x1043, 0x81b3, "ASUS", POS_FIX_LPIB), | 2508 | SND_PCI_QUIRK(0x1043, 0x81b3, "ASUS", POS_FIX_LPIB), |
2509 | SND_PCI_QUIRK(0x1043, 0x81e7, "ASUS M2V", POS_FIX_LPIB), | 2509 | SND_PCI_QUIRK(0x1043, 0x81e7, "ASUS M2V", POS_FIX_LPIB), |
2510 | SND_PCI_QUIRK(0x104d, 0x9069, "Sony VPCS11V9E", POS_FIX_LPIB), | 2510 | SND_PCI_QUIRK(0x104d, 0x9069, "Sony VPCS11V9E", POS_FIX_LPIB), |
2511 | SND_PCI_QUIRK(0x1106, 0x3288, "ASUS M2V-MX SE", POS_FIX_LPIB), | ||
2512 | SND_PCI_QUIRK(0x1297, 0x3166, "Shuttle", POS_FIX_LPIB), | 2511 | SND_PCI_QUIRK(0x1297, 0x3166, "Shuttle", POS_FIX_LPIB), |
2513 | SND_PCI_QUIRK(0x1458, 0xa022, "ga-ma770-ud3", POS_FIX_LPIB), | 2512 | SND_PCI_QUIRK(0x1458, 0xa022, "ga-ma770-ud3", POS_FIX_LPIB), |
2514 | SND_PCI_QUIRK(0x1462, 0x1002, "MSI Wind U115", POS_FIX_LPIB), | 2513 | SND_PCI_QUIRK(0x1462, 0x1002, "MSI Wind U115", POS_FIX_LPIB), |
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c index cbde019d3d52..1d07e8fa2433 100644 --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c | |||
@@ -297,6 +297,8 @@ static int alc_mux_select(struct hda_codec *codec, unsigned int adc_idx, | |||
297 | imux = &spec->input_mux[mux_idx]; | 297 | imux = &spec->input_mux[mux_idx]; |
298 | if (!imux->num_items && mux_idx > 0) | 298 | if (!imux->num_items && mux_idx > 0) |
299 | imux = &spec->input_mux[0]; | 299 | imux = &spec->input_mux[0]; |
300 | if (!imux->num_items) | ||
301 | return 0; | ||
300 | 302 | ||
301 | if (idx >= imux->num_items) | 303 | if (idx >= imux->num_items) |
302 | idx = imux->num_items - 1; | 304 | idx = imux->num_items - 1; |
@@ -2629,6 +2631,8 @@ static const char *alc_get_line_out_pfx(struct alc_spec *spec, int ch, | |||
2629 | case AUTO_PIN_SPEAKER_OUT: | 2631 | case AUTO_PIN_SPEAKER_OUT: |
2630 | if (cfg->line_outs == 1) | 2632 | if (cfg->line_outs == 1) |
2631 | return "Speaker"; | 2633 | return "Speaker"; |
2634 | if (cfg->line_outs == 2) | ||
2635 | return ch ? "Bass Speaker" : "Speaker"; | ||
2632 | break; | 2636 | break; |
2633 | case AUTO_PIN_HP_OUT: | 2637 | case AUTO_PIN_HP_OUT: |
2634 | /* for multi-io case, only the primary out */ | 2638 | /* for multi-io case, only the primary out */ |
@@ -2902,7 +2906,7 @@ static hda_nid_t alc_auto_look_for_dac(struct hda_codec *codec, hda_nid_t pin) | |||
2902 | if (!nid) | 2906 | if (!nid) |
2903 | continue; | 2907 | continue; |
2904 | if (found_in_nid_list(nid, spec->multiout.dac_nids, | 2908 | if (found_in_nid_list(nid, spec->multiout.dac_nids, |
2905 | spec->multiout.num_dacs)) | 2909 | ARRAY_SIZE(spec->private_dac_nids))) |
2906 | continue; | 2910 | continue; |
2907 | if (found_in_nid_list(nid, spec->multiout.hp_out_nid, | 2911 | if (found_in_nid_list(nid, spec->multiout.hp_out_nid, |
2908 | ARRAY_SIZE(spec->multiout.hp_out_nid))) | 2912 | ARRAY_SIZE(spec->multiout.hp_out_nid))) |
@@ -2923,6 +2927,7 @@ static hda_nid_t get_dac_if_single(struct hda_codec *codec, hda_nid_t pin) | |||
2923 | return 0; | 2927 | return 0; |
2924 | } | 2928 | } |
2925 | 2929 | ||
2930 | /* return 0 if no possible DAC is found, 1 if one or more found */ | ||
2926 | static int alc_auto_fill_extra_dacs(struct hda_codec *codec, int num_outs, | 2931 | static int alc_auto_fill_extra_dacs(struct hda_codec *codec, int num_outs, |
2927 | const hda_nid_t *pins, hda_nid_t *dacs) | 2932 | const hda_nid_t *pins, hda_nid_t *dacs) |
2928 | { | 2933 | { |
@@ -2940,7 +2945,7 @@ static int alc_auto_fill_extra_dacs(struct hda_codec *codec, int num_outs, | |||
2940 | if (!dacs[i]) | 2945 | if (!dacs[i]) |
2941 | dacs[i] = alc_auto_look_for_dac(codec, pins[i]); | 2946 | dacs[i] = alc_auto_look_for_dac(codec, pins[i]); |
2942 | } | 2947 | } |
2943 | return 0; | 2948 | return 1; |
2944 | } | 2949 | } |
2945 | 2950 | ||
2946 | static int alc_auto_fill_multi_ios(struct hda_codec *codec, | 2951 | static int alc_auto_fill_multi_ios(struct hda_codec *codec, |
@@ -2950,7 +2955,7 @@ static int alc_auto_fill_multi_ios(struct hda_codec *codec, | |||
2950 | static int alc_auto_fill_dac_nids(struct hda_codec *codec) | 2955 | static int alc_auto_fill_dac_nids(struct hda_codec *codec) |
2951 | { | 2956 | { |
2952 | struct alc_spec *spec = codec->spec; | 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 | bool redone = false; | 2959 | bool redone = false; |
2955 | int i; | 2960 | int i; |
2956 | 2961 | ||
@@ -2961,6 +2966,7 @@ static int alc_auto_fill_dac_nids(struct hda_codec *codec) | |||
2961 | spec->multiout.extra_out_nid[0] = 0; | 2966 | spec->multiout.extra_out_nid[0] = 0; |
2962 | memset(spec->private_dac_nids, 0, sizeof(spec->private_dac_nids)); | 2967 | memset(spec->private_dac_nids, 0, sizeof(spec->private_dac_nids)); |
2963 | spec->multiout.dac_nids = spec->private_dac_nids; | 2968 | spec->multiout.dac_nids = spec->private_dac_nids; |
2969 | spec->multi_ios = 0; | ||
2964 | 2970 | ||
2965 | /* fill hard-wired DACs first */ | 2971 | /* fill hard-wired DACs first */ |
2966 | if (!redone) { | 2972 | if (!redone) { |
@@ -2994,10 +3000,12 @@ static int alc_auto_fill_dac_nids(struct hda_codec *codec) | |||
2994 | for (i = 0; i < cfg->line_outs; i++) { | 3000 | for (i = 0; i < cfg->line_outs; i++) { |
2995 | if (spec->private_dac_nids[i]) | 3001 | if (spec->private_dac_nids[i]) |
2996 | spec->multiout.num_dacs++; | 3002 | spec->multiout.num_dacs++; |
2997 | else | 3003 | else { |
2998 | memmove(spec->private_dac_nids + i, | 3004 | memmove(spec->private_dac_nids + i, |
2999 | spec->private_dac_nids + i + 1, | 3005 | spec->private_dac_nids + i + 1, |
3000 | sizeof(hda_nid_t) * (cfg->line_outs - i - 1)); | 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 | if (cfg->line_outs == 1 && cfg->line_out_type != AUTO_PIN_SPEAKER_OUT) { | 3011 | if (cfg->line_outs == 1 && cfg->line_out_type != AUTO_PIN_SPEAKER_OUT) { |
@@ -3019,9 +3027,28 @@ static int alc_auto_fill_dac_nids(struct hda_codec *codec) | |||
3019 | if (cfg->line_out_type != AUTO_PIN_HP_OUT) | 3027 | if (cfg->line_out_type != AUTO_PIN_HP_OUT) |
3020 | alc_auto_fill_extra_dacs(codec, cfg->hp_outs, cfg->hp_pins, | 3028 | alc_auto_fill_extra_dacs(codec, cfg->hp_outs, cfg->hp_pins, |
3021 | spec->multiout.hp_out_nid); | 3029 | spec->multiout.hp_out_nid); |
3022 | if (cfg->line_out_type != AUTO_PIN_SPEAKER_OUT) | 3030 | if (cfg->line_out_type != AUTO_PIN_SPEAKER_OUT) { |
3023 | alc_auto_fill_extra_dacs(codec, cfg->speaker_outs, cfg->speaker_pins, | 3031 | int err = alc_auto_fill_extra_dacs(codec, cfg->speaker_outs, |
3024 | spec->multiout.extra_out_nid); | 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 | return 0; | 3053 | return 0; |
3027 | } | 3054 | } |
@@ -3171,7 +3198,8 @@ static int alc_auto_create_multi_out_ctls(struct hda_codec *codec, | |||
3171 | } | 3198 | } |
3172 | 3199 | ||
3173 | static int alc_auto_create_extra_out(struct hda_codec *codec, hda_nid_t pin, | 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 | struct alc_spec *spec = codec->spec; | 3204 | struct alc_spec *spec = codec->spec; |
3177 | hda_nid_t sw, vol; | 3205 | hda_nid_t sw, vol; |
@@ -3187,15 +3215,15 @@ static int alc_auto_create_extra_out(struct hda_codec *codec, hda_nid_t pin, | |||
3187 | if (is_ctl_used(spec->sw_ctls, val)) | 3215 | if (is_ctl_used(spec->sw_ctls, val)) |
3188 | return 0; /* already created */ | 3216 | return 0; /* already created */ |
3189 | mark_ctl_usage(spec->sw_ctls, val); | 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 | sw = alc_look_for_out_mute_nid(codec, pin, dac); | 3221 | sw = alc_look_for_out_mute_nid(codec, pin, dac); |
3194 | vol = alc_look_for_out_vol_nid(codec, pin, dac); | 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 | if (err < 0) | 3224 | if (err < 0) |
3197 | return err; | 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 | if (err < 0) | 3227 | if (err < 0) |
3200 | return err; | 3228 | return err; |
3201 | return 0; | 3229 | return 0; |
@@ -3236,16 +3264,21 @@ static int alc_auto_create_extra_outs(struct hda_codec *codec, int num_pins, | |||
3236 | hda_nid_t dac = *dacs; | 3264 | hda_nid_t dac = *dacs; |
3237 | if (!dac) | 3265 | if (!dac) |
3238 | dac = spec->multiout.dac_nids[0]; | 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 | if (dacs[num_pins - 1]) { | 3270 | if (dacs[num_pins - 1]) { |
3243 | /* OK, we have a multi-output system with individual volumes */ | 3271 | /* OK, we have a multi-output system with individual volumes */ |
3244 | for (i = 0; i < num_pins; i++) { | 3272 | for (i = 0; i < num_pins; i++) { |
3245 | snprintf(name, sizeof(name), "%s %s", | 3273 | if (num_pins >= 3) { |
3246 | pfx, channel_name[i]); | 3274 | snprintf(name, sizeof(name), "%s %s", |
3247 | err = alc_auto_create_extra_out(codec, pins[i], dacs[i], | 3275 | pfx, channel_name[i]); |
3248 | name); | 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 | if (err < 0) | 3282 | if (err < 0) |
3250 | return err; | 3283 | return err; |
3251 | } | 3284 | } |
diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c index f3658658548e..eeb25d529e30 100644 --- a/sound/pci/hda/patch_sigmatel.c +++ b/sound/pci/hda/patch_sigmatel.c | |||
@@ -215,6 +215,7 @@ struct sigmatel_spec { | |||
215 | unsigned int gpio_mute; | 215 | unsigned int gpio_mute; |
216 | unsigned int gpio_led; | 216 | unsigned int gpio_led; |
217 | unsigned int gpio_led_polarity; | 217 | unsigned int gpio_led_polarity; |
218 | unsigned int vref_mute_led_nid; /* pin NID for mute-LED vref control */ | ||
218 | unsigned int vref_led; | 219 | unsigned int vref_led; |
219 | 220 | ||
220 | /* stream */ | 221 | /* stream */ |
@@ -4318,12 +4319,10 @@ static void stac_store_hints(struct hda_codec *codec) | |||
4318 | spec->eapd_switch = val; | 4319 | spec->eapd_switch = val; |
4319 | get_int_hint(codec, "gpio_led_polarity", &spec->gpio_led_polarity); | 4320 | get_int_hint(codec, "gpio_led_polarity", &spec->gpio_led_polarity); |
4320 | if (get_int_hint(codec, "gpio_led", &spec->gpio_led)) { | 4321 | if (get_int_hint(codec, "gpio_led", &spec->gpio_led)) { |
4321 | if (spec->gpio_led <= 8) { | 4322 | spec->gpio_mask |= spec->gpio_led; |
4322 | spec->gpio_mask |= spec->gpio_led; | 4323 | spec->gpio_dir |= spec->gpio_led; |
4323 | spec->gpio_dir |= spec->gpio_led; | 4324 | if (spec->gpio_led_polarity) |
4324 | if (spec->gpio_led_polarity) | 4325 | spec->gpio_data |= spec->gpio_led; |
4325 | spec->gpio_data |= spec->gpio_led; | ||
4326 | } | ||
4327 | } | 4326 | } |
4328 | } | 4327 | } |
4329 | 4328 | ||
@@ -4441,7 +4440,9 @@ static int stac92xx_init(struct hda_codec *codec) | |||
4441 | int pinctl, def_conf; | 4440 | int pinctl, def_conf; |
4442 | 4441 | ||
4443 | /* power on when no jack detection is available */ | 4442 | /* power on when no jack detection is available */ |
4444 | if (!spec->hp_detect) { | 4443 | /* or when the VREF is used for controlling LED */ |
4444 | if (!spec->hp_detect || | ||
4445 | spec->vref_mute_led_nid == nid) { | ||
4445 | stac_toggle_power_map(codec, nid, 1); | 4446 | stac_toggle_power_map(codec, nid, 1); |
4446 | continue; | 4447 | continue; |
4447 | } | 4448 | } |
@@ -4913,8 +4914,14 @@ static int find_mute_led_gpio(struct hda_codec *codec, int default_polarity) | |||
4913 | if (sscanf(dev->name, "HP_Mute_LED_%d_%x", | 4914 | if (sscanf(dev->name, "HP_Mute_LED_%d_%x", |
4914 | &spec->gpio_led_polarity, | 4915 | &spec->gpio_led_polarity, |
4915 | &spec->gpio_led) == 2) { | 4916 | &spec->gpio_led) == 2) { |
4916 | 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) | ||
4917 | spec->gpio_led = 1 << spec->gpio_led; | 4922 | spec->gpio_led = 1 << spec->gpio_led; |
4923 | else | ||
4924 | spec->vref_mute_led_nid = spec->gpio_led; | ||
4918 | return 1; | 4925 | return 1; |
4919 | } | 4926 | } |
4920 | if (sscanf(dev->name, "HP_Mute_LED_%d", | 4927 | if (sscanf(dev->name, "HP_Mute_LED_%d", |
@@ -5043,29 +5050,12 @@ static int stac92xx_pre_resume(struct hda_codec *codec) | |||
5043 | struct sigmatel_spec *spec = codec->spec; | 5050 | struct sigmatel_spec *spec = codec->spec; |
5044 | 5051 | ||
5045 | /* sync mute LED */ | 5052 | /* sync mute LED */ |
5046 | if (spec->gpio_led) { | 5053 | if (spec->vref_mute_led_nid) |
5047 | if (spec->gpio_led <= 8) { | 5054 | stac_vrefout_set(codec, spec->vref_mute_led_nid, |
5048 | stac_gpio_set(codec, spec->gpio_mask, | 5055 | spec->vref_led); |
5049 | spec->gpio_dir, spec->gpio_data); | 5056 | else if (spec->gpio_led) |
5050 | } else { | 5057 | stac_gpio_set(codec, spec->gpio_mask, |
5051 | stac_vrefout_set(codec, | 5058 | spec->gpio_dir, spec->gpio_data); |
5052 | spec->gpio_led, spec->vref_led); | ||
5053 | } | ||
5054 | } | ||
5055 | return 0; | ||
5056 | } | ||
5057 | |||
5058 | static int stac92xx_post_suspend(struct hda_codec *codec) | ||
5059 | { | ||
5060 | struct sigmatel_spec *spec = codec->spec; | ||
5061 | if (spec->gpio_led > 8) { | ||
5062 | /* with vref-out pin used for mute led control | ||
5063 | * codec AFG is prevented from D3 state, but on | ||
5064 | * system suspend it can (and should) be used | ||
5065 | */ | ||
5066 | snd_hda_codec_read(codec, codec->afg, 0, | ||
5067 | AC_VERB_SET_POWER_STATE, AC_PWRST_D3); | ||
5068 | } | ||
5069 | return 0; | 5059 | return 0; |
5070 | } | 5060 | } |
5071 | 5061 | ||
@@ -5076,7 +5066,7 @@ static void stac92xx_set_power_state(struct hda_codec *codec, hda_nid_t fg, | |||
5076 | struct sigmatel_spec *spec = codec->spec; | 5066 | struct sigmatel_spec *spec = codec->spec; |
5077 | 5067 | ||
5078 | if (power_state == AC_PWRST_D3) { | 5068 | if (power_state == AC_PWRST_D3) { |
5079 | if (spec->gpio_led > 8) { | 5069 | if (spec->vref_mute_led_nid) { |
5080 | /* with vref-out pin used for mute led control | 5070 | /* with vref-out pin used for mute led control |
5081 | * codec AFG is prevented from D3 state | 5071 | * codec AFG is prevented from D3 state |
5082 | */ | 5072 | */ |
@@ -5129,7 +5119,7 @@ static int stac92xx_update_led_status(struct hda_codec *codec) | |||
5129 | } | 5119 | } |
5130 | } | 5120 | } |
5131 | /*polarity defines *not* muted state level*/ | 5121 | /*polarity defines *not* muted state level*/ |
5132 | if (spec->gpio_led <= 8) { | 5122 | if (!spec->vref_mute_led_nid) { |
5133 | if (muted) | 5123 | if (muted) |
5134 | spec->gpio_data &= ~spec->gpio_led; /* orange */ | 5124 | spec->gpio_data &= ~spec->gpio_led; /* orange */ |
5135 | else | 5125 | else |
@@ -5147,7 +5137,8 @@ static int stac92xx_update_led_status(struct hda_codec *codec) | |||
5147 | muted_lvl = spec->gpio_led_polarity ? | 5137 | muted_lvl = spec->gpio_led_polarity ? |
5148 | AC_PINCTL_VREF_GRD : AC_PINCTL_VREF_HIZ; | 5138 | AC_PINCTL_VREF_GRD : AC_PINCTL_VREF_HIZ; |
5149 | spec->vref_led = muted ? muted_lvl : notmtd_lvl; | 5139 | spec->vref_led = muted ? muted_lvl : notmtd_lvl; |
5150 | stac_vrefout_set(codec, spec->gpio_led, spec->vref_led); | 5140 | stac_vrefout_set(codec, spec->vref_mute_led_nid, |
5141 | spec->vref_led); | ||
5151 | } | 5142 | } |
5152 | return 0; | 5143 | return 0; |
5153 | } | 5144 | } |
@@ -5661,15 +5652,13 @@ again: | |||
5661 | 5652 | ||
5662 | #ifdef CONFIG_SND_HDA_POWER_SAVE | 5653 | #ifdef CONFIG_SND_HDA_POWER_SAVE |
5663 | if (spec->gpio_led) { | 5654 | if (spec->gpio_led) { |
5664 | if (spec->gpio_led <= 8) { | 5655 | if (!spec->vref_mute_led_nid) { |
5665 | spec->gpio_mask |= spec->gpio_led; | 5656 | spec->gpio_mask |= spec->gpio_led; |
5666 | spec->gpio_dir |= spec->gpio_led; | 5657 | spec->gpio_dir |= spec->gpio_led; |
5667 | spec->gpio_data |= spec->gpio_led; | 5658 | spec->gpio_data |= spec->gpio_led; |
5668 | } else { | 5659 | } else { |
5669 | codec->patch_ops.set_power_state = | 5660 | codec->patch_ops.set_power_state = |
5670 | stac92xx_set_power_state; | 5661 | stac92xx_set_power_state; |
5671 | codec->patch_ops.post_suspend = | ||
5672 | stac92xx_post_suspend; | ||
5673 | } | 5662 | } |
5674 | codec->patch_ops.pre_resume = stac92xx_pre_resume; | 5663 | codec->patch_ops.pre_resume = stac92xx_pre_resume; |
5675 | codec->patch_ops.check_power_status = | 5664 | codec->patch_ops.check_power_status = |
@@ -5976,15 +5965,13 @@ again: | |||
5976 | 5965 | ||
5977 | #ifdef CONFIG_SND_HDA_POWER_SAVE | 5966 | #ifdef CONFIG_SND_HDA_POWER_SAVE |
5978 | if (spec->gpio_led) { | 5967 | if (spec->gpio_led) { |
5979 | if (spec->gpio_led <= 8) { | 5968 | if (!spec->vref_mute_led_nid) { |
5980 | spec->gpio_mask |= spec->gpio_led; | 5969 | spec->gpio_mask |= spec->gpio_led; |
5981 | spec->gpio_dir |= spec->gpio_led; | 5970 | spec->gpio_dir |= spec->gpio_led; |
5982 | spec->gpio_data |= spec->gpio_led; | 5971 | spec->gpio_data |= spec->gpio_led; |
5983 | } else { | 5972 | } else { |
5984 | codec->patch_ops.set_power_state = | 5973 | codec->patch_ops.set_power_state = |
5985 | stac92xx_set_power_state; | 5974 | stac92xx_set_power_state; |
5986 | codec->patch_ops.post_suspend = | ||
5987 | stac92xx_post_suspend; | ||
5988 | } | 5975 | } |
5989 | codec->patch_ops.pre_resume = stac92xx_pre_resume; | 5976 | codec->patch_ops.pre_resume = stac92xx_pre_resume; |
5990 | codec->patch_ops.check_power_status = | 5977 | codec->patch_ops.check_power_status = |
diff --git a/sound/pci/sis7019.c b/sound/pci/sis7019.c index a391e622a192..28dfafb56dd1 100644 --- a/sound/pci/sis7019.c +++ b/sound/pci/sis7019.c | |||
@@ -41,6 +41,7 @@ MODULE_SUPPORTED_DEVICE("{{SiS,SiS7019 Audio Accelerator}}"); | |||
41 | static int index = SNDRV_DEFAULT_IDX1; /* Index 0-MAX */ | 41 | static int index = SNDRV_DEFAULT_IDX1; /* Index 0-MAX */ |
42 | static char *id = SNDRV_DEFAULT_STR1; /* ID for this card */ | 42 | static char *id = SNDRV_DEFAULT_STR1; /* ID for this card */ |
43 | static int enable = 1; | 43 | static int enable = 1; |
44 | static int codecs = 1; | ||
44 | 45 | ||
45 | module_param(index, int, 0444); | 46 | module_param(index, int, 0444); |
46 | MODULE_PARM_DESC(index, "Index value for SiS7019 Audio Accelerator."); | 47 | MODULE_PARM_DESC(index, "Index value for SiS7019 Audio Accelerator."); |
@@ -48,6 +49,8 @@ module_param(id, charp, 0444); | |||
48 | MODULE_PARM_DESC(id, "ID string for SiS7019 Audio Accelerator."); | 49 | MODULE_PARM_DESC(id, "ID string for SiS7019 Audio Accelerator."); |
49 | module_param(enable, bool, 0444); | 50 | module_param(enable, bool, 0444); |
50 | MODULE_PARM_DESC(enable, "Enable SiS7019 Audio Accelerator."); | 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 | static DEFINE_PCI_DEVICE_TABLE(snd_sis7019_ids) = { | 55 | static DEFINE_PCI_DEVICE_TABLE(snd_sis7019_ids) = { |
53 | { PCI_DEVICE(PCI_VENDOR_ID_SI, 0x7019) }, | 56 | { PCI_DEVICE(PCI_VENDOR_ID_SI, 0x7019) }, |
@@ -140,6 +143,9 @@ struct sis7019 { | |||
140 | dma_addr_t silence_dma_addr; | 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 | #define SIS_PRIMARY_CODEC_PRESENT 0x0001 | 149 | #define SIS_PRIMARY_CODEC_PRESENT 0x0001 |
144 | #define SIS_SECONDARY_CODEC_PRESENT 0x0002 | 150 | #define SIS_SECONDARY_CODEC_PRESENT 0x0002 |
145 | #define SIS_TERTIARY_CODEC_PRESENT 0x0004 | 151 | #define SIS_TERTIARY_CODEC_PRESENT 0x0004 |
@@ -1078,6 +1084,7 @@ static int sis_chip_init(struct sis7019 *sis) | |||
1078 | { | 1084 | { |
1079 | unsigned long io = sis->ioport; | 1085 | unsigned long io = sis->ioport; |
1080 | void __iomem *ioaddr = sis->ioaddr; | 1086 | void __iomem *ioaddr = sis->ioaddr; |
1087 | unsigned long timeout; | ||
1081 | u16 status; | 1088 | u16 status; |
1082 | int count; | 1089 | int count; |
1083 | int i; | 1090 | int i; |
@@ -1104,21 +1111,45 @@ static int sis_chip_init(struct sis7019 *sis) | |||
1104 | while ((inw(io + SIS_AC97_STATUS) & SIS_AC97_STATUS_BUSY) && --count) | 1111 | while ((inw(io + SIS_AC97_STATUS) & SIS_AC97_STATUS_BUSY) && --count) |
1105 | udelay(1); | 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 | /* Now that we've finished the reset, find out what's attached. | 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); | 1125 | sis->codecs_present = 0; |
1110 | if (status & SIS_AC97_STATUS_CODEC_READY) | 1126 | timeout = msecs_to_jiffies(500) + jiffies; |
1111 | sis->codecs_present |= SIS_PRIMARY_CODEC_PRESENT; | 1127 | while (time_before_eq(jiffies, timeout)) { |
1112 | if (status & SIS_AC97_STATUS_CODEC2_READY) | 1128 | status = inl(io + SIS_AC97_STATUS); |
1113 | sis->codecs_present |= SIS_SECONDARY_CODEC_PRESENT; | 1129 | if (status & SIS_AC97_STATUS_CODEC_READY) |
1114 | if (status & SIS_AC97_STATUS_CODEC3_READY) | 1130 | sis->codecs_present |= SIS_PRIMARY_CODEC_PRESENT; |
1115 | sis->codecs_present |= SIS_TERTIARY_CODEC_PRESENT; | 1131 | if (status & SIS_AC97_STATUS_CODEC2_READY) |
1116 | 1132 | sis->codecs_present |= SIS_SECONDARY_CODEC_PRESENT; | |
1117 | /* All done, let go of the semaphore, and check for errors | 1133 | if (status & SIS_AC97_STATUS_CODEC3_READY) |
1134 | sis->codecs_present |= SIS_TERTIARY_CODEC_PRESENT; | ||
1135 | |||
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); | 1144 | if (!sis->codecs_present) { |
1120 | if (!sis->codecs_present || !count) | 1145 | printk(KERN_ERR "sis7019: could not find any codecs\n"); |
1121 | return -EIO; | 1146 | return -EIO; |
1147 | } | ||
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 | } | ||
1122 | 1153 | ||
1123 | /* Let the hardware know that the audio driver is alive, | 1154 | /* Let the hardware know that the audio driver is alive, |
1124 | * and enable PCM slots on the AC-link for L/R playback (3 & 4) and | 1155 | * and enable PCM slots on the AC-link for L/R playback (3 & 4) and |
@@ -1390,6 +1421,17 @@ static int __devinit snd_sis7019_probe(struct pci_dev *pci, | |||
1390 | if (!enable) | 1421 | if (!enable) |
1391 | goto error_out; | 1422 | goto error_out; |
1392 | 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; | ||
1434 | |||
1393 | rc = snd_card_create(index, id, THIS_MODULE, sizeof(*sis), &card); | 1435 | rc = snd_card_create(index, id, THIS_MODULE, sizeof(*sis), &card); |
1394 | if (rc < 0) | 1436 | if (rc < 0) |
1395 | goto error_out; | 1437 | goto error_out; |
diff --git a/sound/soc/atmel/Kconfig b/sound/soc/atmel/Kconfig index bee3c94f58b0..d1fcc816ce97 100644 --- a/sound/soc/atmel/Kconfig +++ b/sound/soc/atmel/Kconfig | |||
@@ -1,6 +1,6 @@ | |||
1 | config SND_ATMEL_SOC | 1 | config SND_ATMEL_SOC |
2 | tristate "SoC Audio for the Atmel System-on-Chip" | 2 | tristate "SoC Audio for the Atmel System-on-Chip" |
3 | depends on ARCH_AT91 || AVR32 | 3 | depends on ARCH_AT91 |
4 | help | 4 | help |
5 | Say Y or M if you want to add support for codecs attached to | 5 | Say Y or M if you want to add support for codecs attached to |
6 | the ATMEL SSC interface. You will also need | 6 | the ATMEL SSC interface. You will also need |
@@ -24,25 +24,6 @@ config SND_AT91_SOC_SAM9G20_WM8731 | |||
24 | Say Y if you want to add support for SoC audio on WM8731-based | 24 | Say Y if you want to add support for SoC audio on WM8731-based |
25 | AT91sam9g20 evaluation board. | 25 | AT91sam9g20 evaluation board. |
26 | 26 | ||
27 | config SND_AT32_SOC_PLAYPAQ | ||
28 | tristate "SoC Audio support for PlayPaq with WM8510" | ||
29 | depends on SND_ATMEL_SOC && BOARD_PLAYPAQ && AT91_PROGRAMMABLE_CLOCKS | ||
30 | select SND_ATMEL_SOC_SSC | ||
31 | select SND_SOC_WM8510 | ||
32 | help | ||
33 | Say Y or M here if you want to add support for SoC audio | ||
34 | on the LRS PlayPaq. | ||
35 | |||
36 | config SND_AT32_SOC_PLAYPAQ_SLAVE | ||
37 | bool "Run CODEC on PlayPaq in slave mode" | ||
38 | depends on SND_AT32_SOC_PLAYPAQ | ||
39 | default n | ||
40 | help | ||
41 | Say Y if you want to run with the AT32 SSC generating the BCLK | ||
42 | and FRAME signals on the PlayPaq. Unless you want to play | ||
43 | with the AT32 as the SSC master, you probably want to say N here, | ||
44 | as this will give you better sound quality. | ||
45 | |||
46 | config SND_AT91_SOC_AFEB9260 | 27 | config SND_AT91_SOC_AFEB9260 |
47 | tristate "SoC Audio support for AFEB9260 board" | 28 | tristate "SoC Audio support for AFEB9260 board" |
48 | depends on ARCH_AT91 && MACH_AFEB9260 && SND_ATMEL_SOC | 29 | depends on ARCH_AT91 && MACH_AFEB9260 && SND_ATMEL_SOC |
diff --git a/sound/soc/atmel/Makefile b/sound/soc/atmel/Makefile index e7ea56bd5f82..a5c0bf19da78 100644 --- a/sound/soc/atmel/Makefile +++ b/sound/soc/atmel/Makefile | |||
@@ -8,9 +8,5 @@ obj-$(CONFIG_SND_ATMEL_SOC_SSC) += snd-soc-atmel_ssc_dai.o | |||
8 | # AT91 Machine Support | 8 | # AT91 Machine Support |
9 | snd-soc-sam9g20-wm8731-objs := sam9g20_wm8731.o | 9 | snd-soc-sam9g20-wm8731-objs := sam9g20_wm8731.o |
10 | 10 | ||
11 | # AT32 Machine Support | ||
12 | snd-soc-playpaq-objs := playpaq_wm8510.o | ||
13 | |||
14 | obj-$(CONFIG_SND_AT91_SOC_SAM9G20_WM8731) += snd-soc-sam9g20-wm8731.o | 11 | obj-$(CONFIG_SND_AT91_SOC_SAM9G20_WM8731) += snd-soc-sam9g20-wm8731.o |
15 | obj-$(CONFIG_SND_AT32_SOC_PLAYPAQ) += snd-soc-playpaq.o | ||
16 | obj-$(CONFIG_SND_AT91_SOC_AFEB9260) += snd-soc-afeb9260.o | 12 | obj-$(CONFIG_SND_AT91_SOC_AFEB9260) += snd-soc-afeb9260.o |
diff --git a/sound/soc/atmel/playpaq_wm8510.c b/sound/soc/atmel/playpaq_wm8510.c deleted file mode 100644 index 73ae99ad4578..000000000000 --- a/sound/soc/atmel/playpaq_wm8510.c +++ /dev/null | |||
@@ -1,473 +0,0 @@ | |||
1 | /* sound/soc/at32/playpaq_wm8510.c | ||
2 | * ASoC machine driver for PlayPaq using WM8510 codec | ||
3 | * | ||
4 | * Copyright (C) 2008 Long Range Systems | ||
5 | * Geoffrey Wossum <gwossum@acm.org> | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify | ||
8 | * it under the terms of the GNU General Public License version 2 as | ||
9 | * published by the Free Software Foundation. | ||
10 | * | ||
11 | * This code is largely inspired by sound/soc/at91/eti_b1_wm8731.c | ||
12 | * | ||
13 | * NOTE: If you don't have the AT32 enhanced portmux configured (which | ||
14 | * isn't currently in the mainline or Atmel patched kernel), you will | ||
15 | * need to set the MCLK pin (PA30) to peripheral A in your board initialization | ||
16 | * code. Something like: | ||
17 | * at32_select_periph(GPIO_PIN_PA(30), GPIO_PERIPH_A, 0); | ||
18 | * | ||
19 | */ | ||
20 | |||
21 | /* #define DEBUG */ | ||
22 | |||
23 | #include <linux/module.h> | ||
24 | #include <linux/moduleparam.h> | ||
25 | #include <linux/kernel.h> | ||
26 | #include <linux/errno.h> | ||
27 | #include <linux/clk.h> | ||
28 | #include <linux/timer.h> | ||
29 | #include <linux/interrupt.h> | ||
30 | #include <linux/platform_device.h> | ||
31 | |||
32 | #include <sound/core.h> | ||
33 | #include <sound/pcm.h> | ||
34 | #include <sound/pcm_params.h> | ||
35 | #include <sound/soc.h> | ||
36 | |||
37 | #include <mach/at32ap700x.h> | ||
38 | #include <mach/portmux.h> | ||
39 | |||
40 | #include "../codecs/wm8510.h" | ||
41 | #include "atmel-pcm.h" | ||
42 | #include "atmel_ssc_dai.h" | ||
43 | |||
44 | |||
45 | /*-------------------------------------------------------------------------*\ | ||
46 | * constants | ||
47 | \*-------------------------------------------------------------------------*/ | ||
48 | #define MCLK_PIN GPIO_PIN_PA(30) | ||
49 | #define MCLK_PERIPH GPIO_PERIPH_A | ||
50 | |||
51 | |||
52 | /*-------------------------------------------------------------------------*\ | ||
53 | * data types | ||
54 | \*-------------------------------------------------------------------------*/ | ||
55 | /* SSC clocking data */ | ||
56 | struct ssc_clock_data { | ||
57 | /* CMR div */ | ||
58 | unsigned int cmr_div; | ||
59 | |||
60 | /* Frame period (as needed by xCMR.PERIOD) */ | ||
61 | unsigned int period; | ||
62 | |||
63 | /* The SSC clock rate these settings where calculated for */ | ||
64 | unsigned long ssc_rate; | ||
65 | }; | ||
66 | |||
67 | |||
68 | /*-------------------------------------------------------------------------*\ | ||
69 | * module data | ||
70 | \*-------------------------------------------------------------------------*/ | ||
71 | static struct clk *_gclk0; | ||
72 | static struct clk *_pll0; | ||
73 | |||
74 | #define CODEC_CLK (_gclk0) | ||
75 | |||
76 | |||
77 | /*-------------------------------------------------------------------------*\ | ||
78 | * Sound SOC operations | ||
79 | \*-------------------------------------------------------------------------*/ | ||
80 | #if defined CONFIG_SND_AT32_SOC_PLAYPAQ_SLAVE | ||
81 | static struct ssc_clock_data playpaq_wm8510_calc_ssc_clock( | ||
82 | struct snd_pcm_hw_params *params, | ||
83 | struct snd_soc_dai *cpu_dai) | ||
84 | { | ||
85 | struct at32_ssc_info *ssc_p = snd_soc_dai_get_drvdata(cpu_dai); | ||
86 | struct ssc_device *ssc = ssc_p->ssc; | ||
87 | struct ssc_clock_data cd; | ||
88 | unsigned int rate, width_bits, channels; | ||
89 | unsigned int bitrate, ssc_div; | ||
90 | unsigned actual_rate; | ||
91 | |||
92 | |||
93 | /* | ||
94 | * Figure out required bitrate | ||
95 | */ | ||
96 | rate = params_rate(params); | ||
97 | channels = params_channels(params); | ||
98 | width_bits = snd_pcm_format_physical_width(params_format(params)); | ||
99 | bitrate = rate * width_bits * channels; | ||
100 | |||
101 | |||
102 | /* | ||
103 | * Figure out required SSC divider and period for required bitrate | ||
104 | */ | ||
105 | cd.ssc_rate = clk_get_rate(ssc->clk); | ||
106 | ssc_div = cd.ssc_rate / bitrate; | ||
107 | cd.cmr_div = ssc_div / 2; | ||
108 | if (ssc_div & 1) { | ||
109 | /* round cmr_div up */ | ||
110 | cd.cmr_div++; | ||
111 | } | ||
112 | cd.period = width_bits - 1; | ||
113 | |||
114 | |||
115 | /* | ||
116 | * Find actual rate, compare to requested rate | ||
117 | */ | ||
118 | actual_rate = (cd.ssc_rate / (cd.cmr_div * 2)) / (2 * (cd.period + 1)); | ||
119 | pr_debug("playpaq_wm8510: Request rate = %u, actual rate = %u\n", | ||
120 | rate, actual_rate); | ||
121 | |||
122 | |||
123 | return cd; | ||
124 | } | ||
125 | #endif /* CONFIG_SND_AT32_SOC_PLAYPAQ_SLAVE */ | ||
126 | |||
127 | |||
128 | |||
129 | static int playpaq_wm8510_hw_params(struct snd_pcm_substream *substream, | ||
130 | struct snd_pcm_hw_params *params) | ||
131 | { | ||
132 | struct snd_soc_pcm_runtime *rtd = substream->private_data; | ||
133 | struct snd_soc_dai *codec_dai = rtd->codec_dai; | ||
134 | struct snd_soc_dai *cpu_dai = rtd->cpu_dai; | ||
135 | struct at32_ssc_info *ssc_p = snd_soc_dai_get_drvdata(cpu_dai); | ||
136 | struct ssc_device *ssc = ssc_p->ssc; | ||
137 | unsigned int pll_out = 0, bclk = 0, mclk_div = 0; | ||
138 | int ret; | ||
139 | |||
140 | |||
141 | /* Due to difficulties with getting the correct clocks from the AT32's | ||
142 | * PLL0, we're going to let the CODEC be in charge of all the clocks | ||
143 | */ | ||
144 | #if !defined CONFIG_SND_AT32_SOC_PLAYPAQ_SLAVE | ||
145 | const unsigned int fmt = (SND_SOC_DAIFMT_I2S | | ||
146 | SND_SOC_DAIFMT_NB_NF | | ||
147 | SND_SOC_DAIFMT_CBM_CFM); | ||
148 | #else | ||
149 | struct ssc_clock_data cd; | ||
150 | const unsigned int fmt = (SND_SOC_DAIFMT_I2S | | ||
151 | SND_SOC_DAIFMT_NB_NF | | ||
152 | SND_SOC_DAIFMT_CBS_CFS); | ||
153 | #endif | ||
154 | |||
155 | if (ssc == NULL) { | ||
156 | pr_warning("playpaq_wm8510_hw_params: ssc is NULL!\n"); | ||
157 | return -EINVAL; | ||
158 | } | ||
159 | |||
160 | |||
161 | /* | ||
162 | * Figure out PLL and BCLK dividers for WM8510 | ||
163 | */ | ||
164 | switch (params_rate(params)) { | ||
165 | case 48000: | ||
166 | pll_out = 24576000; | ||
167 | mclk_div = WM8510_MCLKDIV_2; | ||
168 | bclk = WM8510_BCLKDIV_8; | ||
169 | break; | ||
170 | |||
171 | case 44100: | ||
172 | pll_out = 22579200; | ||
173 | mclk_div = WM8510_MCLKDIV_2; | ||
174 | bclk = WM8510_BCLKDIV_8; | ||
175 | break; | ||
176 | |||
177 | case 22050: | ||
178 | pll_out = 22579200; | ||
179 | mclk_div = WM8510_MCLKDIV_4; | ||
180 | bclk = WM8510_BCLKDIV_8; | ||
181 | break; | ||
182 | |||
183 | case 16000: | ||
184 | pll_out = 24576000; | ||
185 | mclk_div = WM8510_MCLKDIV_6; | ||
186 | bclk = WM8510_BCLKDIV_8; | ||
187 | break; | ||
188 | |||
189 | case 11025: | ||
190 | pll_out = 22579200; | ||
191 | mclk_div = WM8510_MCLKDIV_8; | ||
192 | bclk = WM8510_BCLKDIV_8; | ||
193 | break; | ||
194 | |||
195 | case 8000: | ||
196 | pll_out = 24576000; | ||
197 | mclk_div = WM8510_MCLKDIV_12; | ||
198 | bclk = WM8510_BCLKDIV_8; | ||
199 | break; | ||
200 | |||
201 | default: | ||
202 | pr_warning("playpaq_wm8510: Unsupported sample rate %d\n", | ||
203 | params_rate(params)); | ||
204 | return -EINVAL; | ||
205 | } | ||
206 | |||
207 | |||
208 | /* | ||
209 | * set CPU and CODEC DAI configuration | ||
210 | */ | ||
211 | ret = snd_soc_dai_set_fmt(codec_dai, fmt); | ||
212 | if (ret < 0) { | ||
213 | pr_warning("playpaq_wm8510: " | ||
214 | "Failed to set CODEC DAI format (%d)\n", | ||
215 | ret); | ||
216 | return ret; | ||
217 | } | ||
218 | ret = snd_soc_dai_set_fmt(cpu_dai, fmt); | ||
219 | if (ret < 0) { | ||
220 | pr_warning("playpaq_wm8510: " | ||
221 | "Failed to set CPU DAI format (%d)\n", | ||
222 | ret); | ||
223 | return ret; | ||
224 | } | ||
225 | |||
226 | |||
227 | /* | ||
228 | * Set CPU clock configuration | ||
229 | */ | ||
230 | #if defined CONFIG_SND_AT32_SOC_PLAYPAQ_SLAVE | ||
231 | cd = playpaq_wm8510_calc_ssc_clock(params, cpu_dai); | ||
232 | pr_debug("playpaq_wm8510: cmr_div = %d, period = %d\n", | ||
233 | cd.cmr_div, cd.period); | ||
234 | ret = snd_soc_dai_set_clkdiv(cpu_dai, AT32_SSC_CMR_DIV, cd.cmr_div); | ||
235 | if (ret < 0) { | ||
236 | pr_warning("playpaq_wm8510: Failed to set CPU CMR_DIV (%d)\n", | ||
237 | ret); | ||
238 | return ret; | ||
239 | } | ||
240 | ret = snd_soc_dai_set_clkdiv(cpu_dai, AT32_SSC_TCMR_PERIOD, | ||
241 | cd.period); | ||
242 | if (ret < 0) { | ||
243 | pr_warning("playpaq_wm8510: " | ||
244 | "Failed to set CPU transmit period (%d)\n", | ||
245 | ret); | ||
246 | return ret; | ||
247 | } | ||
248 | #endif /* CONFIG_SND_AT32_SOC_PLAYPAQ_SLAVE */ | ||
249 | |||
250 | |||
251 | /* | ||
252 | * Set CODEC clock configuration | ||
253 | */ | ||
254 | pr_debug("playpaq_wm8510: " | ||
255 | "pll_in = %ld, pll_out = %u, bclk = %x, mclk = %x\n", | ||
256 | clk_get_rate(CODEC_CLK), pll_out, bclk, mclk_div); | ||
257 | |||
258 | |||
259 | #if !defined CONFIG_SND_AT32_SOC_PLAYPAQ_SLAVE | ||
260 | ret = snd_soc_dai_set_clkdiv(codec_dai, WM8510_BCLKDIV, bclk); | ||
261 | if (ret < 0) { | ||
262 | pr_warning | ||
263 | ("playpaq_wm8510: Failed to set CODEC DAI BCLKDIV (%d)\n", | ||
264 | ret); | ||
265 | return ret; | ||
266 | } | ||
267 | #endif /* CONFIG_SND_AT32_SOC_PLAYPAQ_SLAVE */ | ||
268 | |||
269 | |||
270 | ret = snd_soc_dai_set_pll(codec_dai, 0, 0, | ||
271 | clk_get_rate(CODEC_CLK), pll_out); | ||
272 | if (ret < 0) { | ||
273 | pr_warning("playpaq_wm8510: Failed to set CODEC DAI PLL (%d)\n", | ||
274 | ret); | ||
275 | return ret; | ||
276 | } | ||
277 | |||
278 | |||
279 | ret = snd_soc_dai_set_clkdiv(codec_dai, WM8510_MCLKDIV, mclk_div); | ||
280 | if (ret < 0) { | ||
281 | pr_warning("playpaq_wm8510: Failed to set CODEC MCLKDIV (%d)\n", | ||
282 | ret); | ||
283 | return ret; | ||
284 | } | ||
285 | |||
286 | |||
287 | return 0; | ||
288 | } | ||
289 | |||
290 | |||
291 | |||
292 | static struct snd_soc_ops playpaq_wm8510_ops = { | ||
293 | .hw_params = playpaq_wm8510_hw_params, | ||
294 | }; | ||
295 | |||
296 | |||
297 | |||
298 | static const struct snd_soc_dapm_widget playpaq_dapm_widgets[] = { | ||
299 | SND_SOC_DAPM_MIC("Int Mic", NULL), | ||
300 | SND_SOC_DAPM_SPK("Ext Spk", NULL), | ||
301 | }; | ||
302 | |||
303 | |||
304 | |||
305 | static const struct snd_soc_dapm_route intercon[] = { | ||
306 | /* speaker connected to SPKOUT */ | ||
307 | {"Ext Spk", NULL, "SPKOUTP"}, | ||
308 | {"Ext Spk", NULL, "SPKOUTN"}, | ||
309 | |||
310 | {"Mic Bias", NULL, "Int Mic"}, | ||
311 | {"MICN", NULL, "Mic Bias"}, | ||
312 | {"MICP", NULL, "Mic Bias"}, | ||
313 | }; | ||
314 | |||
315 | |||
316 | |||
317 | static int playpaq_wm8510_init(struct snd_soc_pcm_runtime *rtd) | ||
318 | { | ||
319 | struct snd_soc_codec *codec = rtd->codec; | ||
320 | struct snd_soc_dapm_context *dapm = &codec->dapm; | ||
321 | int i; | ||
322 | |||
323 | /* | ||
324 | * Add DAPM widgets | ||
325 | */ | ||
326 | for (i = 0; i < ARRAY_SIZE(playpaq_dapm_widgets); i++) | ||
327 | snd_soc_dapm_new_control(dapm, &playpaq_dapm_widgets[i]); | ||
328 | |||
329 | |||
330 | |||
331 | /* | ||
332 | * Setup audio path interconnects | ||
333 | */ | ||
334 | snd_soc_dapm_add_routes(dapm, intercon, ARRAY_SIZE(intercon)); | ||
335 | |||
336 | |||
337 | |||
338 | /* always connected pins */ | ||
339 | snd_soc_dapm_enable_pin(dapm, "Int Mic"); | ||
340 | snd_soc_dapm_enable_pin(dapm, "Ext Spk"); | ||
341 | |||
342 | |||
343 | |||
344 | /* Make CSB show PLL rate */ | ||
345 | snd_soc_dai_set_clkdiv(rtd->codec_dai, WM8510_OPCLKDIV, | ||
346 | WM8510_OPCLKDIV_1 | 4); | ||
347 | |||
348 | return 0; | ||
349 | } | ||
350 | |||
351 | |||
352 | |||
353 | static struct snd_soc_dai_link playpaq_wm8510_dai = { | ||
354 | .name = "WM8510", | ||
355 | .stream_name = "WM8510 PCM", | ||
356 | .cpu_dai_name= "atmel-ssc-dai.0", | ||
357 | .platform_name = "atmel-pcm-audio", | ||
358 | .codec_name = "wm8510-codec.0-0x1a", | ||
359 | .codec_dai_name = "wm8510-hifi", | ||
360 | .init = playpaq_wm8510_init, | ||
361 | .ops = &playpaq_wm8510_ops, | ||
362 | }; | ||
363 | |||
364 | |||
365 | |||
366 | static struct snd_soc_card snd_soc_playpaq = { | ||
367 | .name = "LRS_PlayPaq_WM8510", | ||
368 | .dai_link = &playpaq_wm8510_dai, | ||
369 | .num_links = 1, | ||
370 | }; | ||
371 | |||
372 | static struct platform_device *playpaq_snd_device; | ||
373 | |||
374 | |||
375 | static int __init playpaq_asoc_init(void) | ||
376 | { | ||
377 | int ret = 0; | ||
378 | |||
379 | /* | ||
380 | * Configure MCLK for WM8510 | ||
381 | */ | ||
382 | _gclk0 = clk_get(NULL, "gclk0"); | ||
383 | if (IS_ERR(_gclk0)) { | ||
384 | _gclk0 = NULL; | ||
385 | ret = PTR_ERR(_gclk0); | ||
386 | goto err_gclk0; | ||
387 | } | ||
388 | _pll0 = clk_get(NULL, "pll0"); | ||
389 | if (IS_ERR(_pll0)) { | ||
390 | _pll0 = NULL; | ||
391 | ret = PTR_ERR(_pll0); | ||
392 | goto err_pll0; | ||
393 | } | ||
394 | ret = clk_set_parent(_gclk0, _pll0); | ||
395 | if (ret) { | ||
396 | pr_warning("snd-soc-playpaq: " | ||
397 | "Failed to set PLL0 as parent for DAC clock\n"); | ||
398 | goto err_set_clk; | ||
399 | } | ||
400 | clk_set_rate(CODEC_CLK, 12000000); | ||
401 | clk_enable(CODEC_CLK); | ||
402 | |||
403 | #if defined CONFIG_AT32_ENHANCED_PORTMUX | ||
404 | at32_select_periph(MCLK_PIN, MCLK_PERIPH, 0); | ||
405 | #endif | ||
406 | |||
407 | |||
408 | /* | ||
409 | * Create and register platform device | ||
410 | */ | ||
411 | playpaq_snd_device = platform_device_alloc("soc-audio", 0); | ||
412 | if (playpaq_snd_device == NULL) { | ||
413 | ret = -ENOMEM; | ||
414 | goto err_device_alloc; | ||
415 | } | ||
416 | |||
417 | platform_set_drvdata(playpaq_snd_device, &snd_soc_playpaq); | ||
418 | |||
419 | ret = platform_device_add(playpaq_snd_device); | ||
420 | if (ret) { | ||
421 | pr_warning("playpaq_wm8510: platform_device_add failed (%d)\n", | ||
422 | ret); | ||
423 | goto err_device_add; | ||
424 | } | ||
425 | |||
426 | return 0; | ||
427 | |||
428 | |||
429 | err_device_add: | ||
430 | if (playpaq_snd_device != NULL) { | ||
431 | platform_device_put(playpaq_snd_device); | ||
432 | playpaq_snd_device = NULL; | ||
433 | } | ||
434 | err_device_alloc: | ||
435 | err_set_clk: | ||
436 | if (_pll0 != NULL) { | ||
437 | clk_put(_pll0); | ||
438 | _pll0 = NULL; | ||
439 | } | ||
440 | err_pll0: | ||
441 | if (_gclk0 != NULL) { | ||
442 | clk_put(_gclk0); | ||
443 | _gclk0 = NULL; | ||
444 | } | ||
445 | return ret; | ||
446 | } | ||
447 | |||
448 | |||
449 | static void __exit playpaq_asoc_exit(void) | ||
450 | { | ||
451 | if (_gclk0 != NULL) { | ||
452 | clk_put(_gclk0); | ||
453 | _gclk0 = NULL; | ||
454 | } | ||
455 | if (_pll0 != NULL) { | ||
456 | clk_put(_pll0); | ||
457 | _pll0 = NULL; | ||
458 | } | ||
459 | |||
460 | #if defined CONFIG_AT32_ENHANCED_PORTMUX | ||
461 | at32_free_pin(MCLK_PIN); | ||
462 | #endif | ||
463 | |||
464 | platform_device_unregister(playpaq_snd_device); | ||
465 | playpaq_snd_device = NULL; | ||
466 | } | ||
467 | |||
468 | module_init(playpaq_asoc_init); | ||
469 | module_exit(playpaq_asoc_exit); | ||
470 | |||
471 | MODULE_AUTHOR("Geoffrey Wossum <gwossum@acm.org>"); | ||
472 | MODULE_DESCRIPTION("ASoC machine driver for LRS PlayPaq"); | ||
473 | MODULE_LICENSE("GPL"); | ||
diff --git a/sound/soc/codecs/ad1836.h b/sound/soc/codecs/ad1836.h index 444747f0db26..dd7be0dbbc58 100644 --- a/sound/soc/codecs/ad1836.h +++ b/sound/soc/codecs/ad1836.h | |||
@@ -34,7 +34,7 @@ | |||
34 | 34 | ||
35 | #define AD1836_ADC_CTRL2 13 | 35 | #define AD1836_ADC_CTRL2 13 |
36 | #define AD1836_ADC_WORD_LEN_MASK 0x30 | 36 | #define AD1836_ADC_WORD_LEN_MASK 0x30 |
37 | #define AD1836_ADC_WORD_OFFSET 5 | 37 | #define AD1836_ADC_WORD_OFFSET 4 |
38 | #define AD1836_ADC_SERFMT_MASK (7 << 6) | 38 | #define AD1836_ADC_SERFMT_MASK (7 << 6) |
39 | #define AD1836_ADC_SERFMT_PCK256 (0x4 << 6) | 39 | #define AD1836_ADC_SERFMT_PCK256 (0x4 << 6) |
40 | #define AD1836_ADC_SERFMT_PCK128 (0x5 << 6) | 40 | #define AD1836_ADC_SERFMT_PCK128 (0x5 << 6) |
diff --git a/sound/soc/codecs/cs4270.c b/sound/soc/codecs/cs4270.c index f1f237ecec2a..73f46eb459f1 100644 --- a/sound/soc/codecs/cs4270.c +++ b/sound/soc/codecs/cs4270.c | |||
@@ -601,7 +601,6 @@ static int cs4270_soc_suspend(struct snd_soc_codec *codec, pm_message_t mesg) | |||
601 | static int cs4270_soc_resume(struct snd_soc_codec *codec) | 601 | static int cs4270_soc_resume(struct snd_soc_codec *codec) |
602 | { | 602 | { |
603 | struct cs4270_private *cs4270 = snd_soc_codec_get_drvdata(codec); | 603 | struct cs4270_private *cs4270 = snd_soc_codec_get_drvdata(codec); |
604 | struct i2c_client *i2c_client = to_i2c_client(codec->dev); | ||
605 | int reg; | 604 | int reg; |
606 | 605 | ||
607 | regulator_bulk_enable(ARRAY_SIZE(cs4270->supplies), | 606 | regulator_bulk_enable(ARRAY_SIZE(cs4270->supplies), |
@@ -612,14 +611,7 @@ static int cs4270_soc_resume(struct snd_soc_codec *codec) | |||
612 | ndelay(500); | 611 | ndelay(500); |
613 | 612 | ||
614 | /* first restore the entire register cache ... */ | 613 | /* first restore the entire register cache ... */ |
615 | for (reg = CS4270_FIRSTREG; reg <= CS4270_LASTREG; reg++) { | 614 | snd_soc_cache_sync(codec); |
616 | u8 val = snd_soc_read(codec, reg); | ||
617 | |||
618 | if (i2c_smbus_write_byte_data(i2c_client, reg, val)) { | ||
619 | dev_err(codec->dev, "i2c write failed\n"); | ||
620 | return -EIO; | ||
621 | } | ||
622 | } | ||
623 | 615 | ||
624 | /* ... then disable the power-down bits */ | 616 | /* ... then disable the power-down bits */ |
625 | reg = snd_soc_read(codec, CS4270_PWRCTL); | 617 | reg = snd_soc_read(codec, CS4270_PWRCTL); |
diff --git a/sound/soc/codecs/cs42l51.c b/sound/soc/codecs/cs42l51.c index 8c3c8205d19e..1ee66361f61b 100644 --- a/sound/soc/codecs/cs42l51.c +++ b/sound/soc/codecs/cs42l51.c | |||
@@ -555,7 +555,7 @@ static int cs42l51_probe(struct snd_soc_codec *codec) | |||
555 | 555 | ||
556 | static struct snd_soc_codec_driver soc_codec_device_cs42l51 = { | 556 | static struct snd_soc_codec_driver soc_codec_device_cs42l51 = { |
557 | .probe = cs42l51_probe, | 557 | .probe = cs42l51_probe, |
558 | .reg_cache_size = CS42L51_NUMREGS, | 558 | .reg_cache_size = CS42L51_NUMREGS + 1, |
559 | .reg_word_size = sizeof(u8), | 559 | .reg_word_size = sizeof(u8), |
560 | }; | 560 | }; |
561 | 561 | ||
diff --git a/sound/soc/codecs/max9877.c b/sound/soc/codecs/max9877.c index 9e7e964a5fa3..dcf6f2a1600a 100644 --- a/sound/soc/codecs/max9877.c +++ b/sound/soc/codecs/max9877.c | |||
@@ -106,13 +106,13 @@ static int max9877_set_2reg(struct snd_kcontrol *kcontrol, | |||
106 | unsigned int mask = mc->max; | 106 | unsigned int mask = mc->max; |
107 | unsigned int val = (ucontrol->value.integer.value[0] & mask); | 107 | unsigned int val = (ucontrol->value.integer.value[0] & mask); |
108 | unsigned int val2 = (ucontrol->value.integer.value[1] & mask); | 108 | unsigned int val2 = (ucontrol->value.integer.value[1] & mask); |
109 | unsigned int change = 1; | 109 | unsigned int change = 0; |
110 | 110 | ||
111 | if (((max9877_regs[reg] >> shift) & mask) == val) | 111 | if (((max9877_regs[reg] >> shift) & mask) != val) |
112 | change = 0; | 112 | change = 1; |
113 | 113 | ||
114 | if (((max9877_regs[reg2] >> shift) & mask) == val2) | 114 | if (((max9877_regs[reg2] >> shift) & mask) != val2) |
115 | change = 0; | 115 | change = 1; |
116 | 116 | ||
117 | if (change) { | 117 | if (change) { |
118 | max9877_regs[reg] &= ~(mask << shift); | 118 | max9877_regs[reg] &= ~(mask << shift); |
diff --git a/sound/soc/codecs/uda1380.c b/sound/soc/codecs/uda1380.c index c5ca8cfea60f..0441893e270e 100644 --- a/sound/soc/codecs/uda1380.c +++ b/sound/soc/codecs/uda1380.c | |||
@@ -863,13 +863,13 @@ static struct i2c_driver uda1380_i2c_driver = { | |||
863 | 863 | ||
864 | static int __init uda1380_modinit(void) | 864 | static int __init uda1380_modinit(void) |
865 | { | 865 | { |
866 | int ret; | 866 | int ret = 0; |
867 | #if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE) | 867 | #if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE) |
868 | ret = i2c_add_driver(&uda1380_i2c_driver); | 868 | ret = i2c_add_driver(&uda1380_i2c_driver); |
869 | if (ret != 0) | 869 | if (ret != 0) |
870 | pr_err("Failed to register UDA1380 I2C driver: %d\n", ret); | 870 | pr_err("Failed to register UDA1380 I2C driver: %d\n", ret); |
871 | #endif | 871 | #endif |
872 | return 0; | 872 | return ret; |
873 | } | 873 | } |
874 | module_init(uda1380_modinit); | 874 | module_init(uda1380_modinit); |
875 | 875 | ||
diff --git a/sound/soc/codecs/wm8994.c b/sound/soc/codecs/wm8994.c index 9c982e47eb99..d0c545b73d78 100644 --- a/sound/soc/codecs/wm8994.c +++ b/sound/soc/codecs/wm8994.c | |||
@@ -1325,15 +1325,15 @@ SND_SOC_DAPM_DAC("DAC1R", NULL, WM8994_POWER_MANAGEMENT_5, 0, 0), | |||
1325 | }; | 1325 | }; |
1326 | 1326 | ||
1327 | static const struct snd_soc_dapm_widget wm8994_adc_revd_widgets[] = { | 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, | 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), | 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, | 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), | 1331 | adc_mux_ev, SND_SOC_DAPM_PRE_PMU), |
1332 | }; | 1332 | }; |
1333 | 1333 | ||
1334 | static const struct snd_soc_dapm_widget wm8994_adc_widgets[] = { | 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), | 1335 | SND_SOC_DAPM_VIRT_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), | 1336 | SND_SOC_DAPM_VIRT_MUX("ADCR Mux", WM8994_POWER_MANAGEMENT_4, 0, 0, &adcr_mux), |
1337 | }; | 1337 | }; |
1338 | 1338 | ||
1339 | static const struct snd_soc_dapm_widget wm8994_dapm_widgets[] = { | 1339 | static const struct snd_soc_dapm_widget wm8994_dapm_widgets[] = { |
@@ -2357,6 +2357,11 @@ static int wm8994_hw_params(struct snd_pcm_substream *substream, | |||
2357 | bclk |= best << WM8994_AIF1_BCLK_DIV_SHIFT; | 2357 | bclk |= best << WM8994_AIF1_BCLK_DIV_SHIFT; |
2358 | 2358 | ||
2359 | lrclk = bclk_rate / params_rate(params); | 2359 | lrclk = bclk_rate / params_rate(params); |
2360 | if (!lrclk) { | ||
2361 | dev_err(dai->dev, "Unable to generate LRCLK from %dHz BCLK\n", | ||
2362 | bclk_rate); | ||
2363 | return -EINVAL; | ||
2364 | } | ||
2360 | dev_dbg(dai->dev, "Using LRCLK rate %d for actual LRCLK %dHz\n", | 2365 | dev_dbg(dai->dev, "Using LRCLK rate %d for actual LRCLK %dHz\n", |
2361 | lrclk, bclk_rate / lrclk); | 2366 | lrclk, bclk_rate / lrclk); |
2362 | 2367 | ||
@@ -3178,6 +3183,8 @@ static int wm8994_codec_probe(struct snd_soc_codec *codec) | |||
3178 | switch (wm8994->revision) { | 3183 | switch (wm8994->revision) { |
3179 | case 0: | 3184 | case 0: |
3180 | case 1: | 3185 | case 1: |
3186 | case 2: | ||
3187 | case 3: | ||
3181 | wm8994->hubs.dcs_codes_l = -9; | 3188 | wm8994->hubs.dcs_codes_l = -9; |
3182 | wm8994->hubs.dcs_codes_r = -5; | 3189 | wm8994->hubs.dcs_codes_r = -5; |
3183 | break; | 3190 | break; |
diff --git a/sound/soc/fsl/mpc8610_hpcd.c b/sound/soc/fsl/mpc8610_hpcd.c index 31af405bda84..ae49f1c78c6d 100644 --- a/sound/soc/fsl/mpc8610_hpcd.c +++ b/sound/soc/fsl/mpc8610_hpcd.c | |||
@@ -392,7 +392,8 @@ static int mpc8610_hpcd_probe(struct platform_device *pdev) | |||
392 | } | 392 | } |
393 | 393 | ||
394 | if (strcasecmp(sprop, "i2s-slave") == 0) { | 394 | if (strcasecmp(sprop, "i2s-slave") == 0) { |
395 | machine_data->dai_format = SND_SOC_DAIFMT_I2S; | 395 | machine_data->dai_format = |
396 | SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_CBM_CFM; | ||
396 | machine_data->codec_clk_direction = SND_SOC_CLOCK_OUT; | 397 | machine_data->codec_clk_direction = SND_SOC_CLOCK_OUT; |
397 | machine_data->cpu_clk_direction = SND_SOC_CLOCK_IN; | 398 | machine_data->cpu_clk_direction = SND_SOC_CLOCK_IN; |
398 | 399 | ||
@@ -409,31 +410,38 @@ static int mpc8610_hpcd_probe(struct platform_device *pdev) | |||
409 | } | 410 | } |
410 | machine_data->clk_frequency = be32_to_cpup(iprop); | 411 | machine_data->clk_frequency = be32_to_cpup(iprop); |
411 | } else if (strcasecmp(sprop, "i2s-master") == 0) { | 412 | } else if (strcasecmp(sprop, "i2s-master") == 0) { |
412 | machine_data->dai_format = SND_SOC_DAIFMT_I2S; | 413 | machine_data->dai_format = |
414 | SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_CBS_CFS; | ||
413 | machine_data->codec_clk_direction = SND_SOC_CLOCK_IN; | 415 | machine_data->codec_clk_direction = SND_SOC_CLOCK_IN; |
414 | machine_data->cpu_clk_direction = SND_SOC_CLOCK_OUT; | 416 | machine_data->cpu_clk_direction = SND_SOC_CLOCK_OUT; |
415 | } else if (strcasecmp(sprop, "lj-slave") == 0) { | 417 | } else if (strcasecmp(sprop, "lj-slave") == 0) { |
416 | machine_data->dai_format = SND_SOC_DAIFMT_LEFT_J; | 418 | machine_data->dai_format = |
419 | SND_SOC_DAIFMT_LEFT_J | SND_SOC_DAIFMT_CBM_CFM; | ||
417 | machine_data->codec_clk_direction = SND_SOC_CLOCK_OUT; | 420 | machine_data->codec_clk_direction = SND_SOC_CLOCK_OUT; |
418 | machine_data->cpu_clk_direction = SND_SOC_CLOCK_IN; | 421 | machine_data->cpu_clk_direction = SND_SOC_CLOCK_IN; |
419 | } else if (strcasecmp(sprop, "lj-master") == 0) { | 422 | } else if (strcasecmp(sprop, "lj-master") == 0) { |
420 | machine_data->dai_format = SND_SOC_DAIFMT_LEFT_J; | 423 | machine_data->dai_format = |
424 | SND_SOC_DAIFMT_LEFT_J | SND_SOC_DAIFMT_CBS_CFS; | ||
421 | machine_data->codec_clk_direction = SND_SOC_CLOCK_IN; | 425 | machine_data->codec_clk_direction = SND_SOC_CLOCK_IN; |
422 | machine_data->cpu_clk_direction = SND_SOC_CLOCK_OUT; | 426 | machine_data->cpu_clk_direction = SND_SOC_CLOCK_OUT; |
423 | } else if (strcasecmp(sprop, "rj-slave") == 0) { | 427 | } else if (strcasecmp(sprop, "rj-slave") == 0) { |
424 | machine_data->dai_format = SND_SOC_DAIFMT_RIGHT_J; | 428 | machine_data->dai_format = |
429 | SND_SOC_DAIFMT_RIGHT_J | SND_SOC_DAIFMT_CBM_CFM; | ||
425 | machine_data->codec_clk_direction = SND_SOC_CLOCK_OUT; | 430 | machine_data->codec_clk_direction = SND_SOC_CLOCK_OUT; |
426 | machine_data->cpu_clk_direction = SND_SOC_CLOCK_IN; | 431 | machine_data->cpu_clk_direction = SND_SOC_CLOCK_IN; |
427 | } else if (strcasecmp(sprop, "rj-master") == 0) { | 432 | } else if (strcasecmp(sprop, "rj-master") == 0) { |
428 | machine_data->dai_format = SND_SOC_DAIFMT_RIGHT_J; | 433 | machine_data->dai_format = |
434 | SND_SOC_DAIFMT_RIGHT_J | SND_SOC_DAIFMT_CBS_CFS; | ||
429 | machine_data->codec_clk_direction = SND_SOC_CLOCK_IN; | 435 | machine_data->codec_clk_direction = SND_SOC_CLOCK_IN; |
430 | machine_data->cpu_clk_direction = SND_SOC_CLOCK_OUT; | 436 | machine_data->cpu_clk_direction = SND_SOC_CLOCK_OUT; |
431 | } else if (strcasecmp(sprop, "ac97-slave") == 0) { | 437 | } else if (strcasecmp(sprop, "ac97-slave") == 0) { |
432 | machine_data->dai_format = SND_SOC_DAIFMT_AC97; | 438 | machine_data->dai_format = |
439 | SND_SOC_DAIFMT_AC97 | SND_SOC_DAIFMT_CBM_CFM; | ||
433 | machine_data->codec_clk_direction = SND_SOC_CLOCK_OUT; | 440 | machine_data->codec_clk_direction = SND_SOC_CLOCK_OUT; |
434 | machine_data->cpu_clk_direction = SND_SOC_CLOCK_IN; | 441 | machine_data->cpu_clk_direction = SND_SOC_CLOCK_IN; |
435 | } else if (strcasecmp(sprop, "ac97-master") == 0) { | 442 | } else if (strcasecmp(sprop, "ac97-master") == 0) { |
436 | machine_data->dai_format = SND_SOC_DAIFMT_AC97; | 443 | machine_data->dai_format = |
444 | SND_SOC_DAIFMT_AC97 | SND_SOC_DAIFMT_CBS_CFS; | ||
437 | machine_data->codec_clk_direction = SND_SOC_CLOCK_IN; | 445 | machine_data->codec_clk_direction = SND_SOC_CLOCK_IN; |
438 | machine_data->cpu_clk_direction = SND_SOC_CLOCK_OUT; | 446 | machine_data->cpu_clk_direction = SND_SOC_CLOCK_OUT; |
439 | } else { | 447 | } else { |
diff --git a/sound/soc/imx/Kconfig b/sound/soc/imx/Kconfig index b133bfcc5848..738391757f2c 100644 --- a/sound/soc/imx/Kconfig +++ b/sound/soc/imx/Kconfig | |||
@@ -28,7 +28,7 @@ config SND_MXC_SOC_WM1133_EV1 | |||
28 | 28 | ||
29 | config SND_SOC_MX27VIS_AIC32X4 | 29 | config SND_SOC_MX27VIS_AIC32X4 |
30 | tristate "SoC audio support for Visstrim M10 boards" | 30 | tristate "SoC audio support for Visstrim M10 boards" |
31 | depends on MACH_IMX27_VISSTRIM_M10 | 31 | depends on MACH_IMX27_VISSTRIM_M10 && I2C |
32 | select SND_SOC_TLV320AIC32X4 | 32 | select SND_SOC_TLV320AIC32X4 |
33 | select SND_MXC_SOC_MX2 | 33 | select SND_MXC_SOC_MX2 |
34 | help | 34 | help |
diff --git a/sound/soc/kirkwood/Kconfig b/sound/soc/kirkwood/Kconfig index 8f49e165f4d1..c62d715235e2 100644 --- a/sound/soc/kirkwood/Kconfig +++ b/sound/soc/kirkwood/Kconfig | |||
@@ -12,6 +12,7 @@ config SND_KIRKWOOD_SOC_I2S | |||
12 | config SND_KIRKWOOD_SOC_OPENRD | 12 | config SND_KIRKWOOD_SOC_OPENRD |
13 | tristate "SoC Audio support for Kirkwood Openrd Client" | 13 | tristate "SoC Audio support for Kirkwood Openrd Client" |
14 | depends on SND_KIRKWOOD_SOC && (MACH_OPENRD_CLIENT || MACH_OPENRD_ULTIMATE) | 14 | depends on SND_KIRKWOOD_SOC && (MACH_OPENRD_CLIENT || MACH_OPENRD_ULTIMATE) |
15 | depends on I2C | ||
15 | select SND_KIRKWOOD_SOC_I2S | 16 | select SND_KIRKWOOD_SOC_I2S |
16 | select SND_SOC_CS42L51 | 17 | select SND_SOC_CS42L51 |
17 | help | 18 | help |
@@ -20,7 +21,7 @@ config SND_KIRKWOOD_SOC_OPENRD | |||
20 | 21 | ||
21 | config SND_KIRKWOOD_SOC_T5325 | 22 | config SND_KIRKWOOD_SOC_T5325 |
22 | tristate "SoC Audio support for HP t5325" | 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 | select SND_KIRKWOOD_SOC_I2S | 25 | select SND_KIRKWOOD_SOC_I2S |
25 | select SND_SOC_ALC5623 | 26 | select SND_SOC_ALC5623 |
26 | help | 27 | help |
diff --git a/sound/soc/pxa/Kconfig b/sound/soc/pxa/Kconfig index ffd2242e305f..a0f7d3cfa470 100644 --- a/sound/soc/pxa/Kconfig +++ b/sound/soc/pxa/Kconfig | |||
@@ -151,6 +151,7 @@ config SND_SOC_ZYLONITE | |||
151 | config SND_SOC_RAUMFELD | 151 | config SND_SOC_RAUMFELD |
152 | tristate "SoC Audio support Raumfeld audio adapter" | 152 | tristate "SoC Audio support Raumfeld audio adapter" |
153 | depends on SND_PXA2XX_SOC && (MACH_RAUMFELD_SPEAKER || MACH_RAUMFELD_CONNECTOR) | 153 | depends on SND_PXA2XX_SOC && (MACH_RAUMFELD_SPEAKER || MACH_RAUMFELD_CONNECTOR) |
154 | depends on I2C && SPI_MASTER | ||
154 | select SND_PXA_SOC_SSP | 155 | select SND_PXA_SOC_SSP |
155 | select SND_SOC_CS4270 | 156 | select SND_SOC_CS4270 |
156 | select SND_SOC_AK4104 | 157 | select SND_SOC_AK4104 |
@@ -159,7 +160,7 @@ config SND_SOC_RAUMFELD | |||
159 | 160 | ||
160 | config SND_PXA2XX_SOC_HX4700 | 161 | config SND_PXA2XX_SOC_HX4700 |
161 | tristate "SoC Audio support for HP iPAQ hx4700" | 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 | select SND_PXA2XX_SOC_I2S | 164 | select SND_PXA2XX_SOC_I2S |
164 | select SND_SOC_AK4641 | 165 | select SND_SOC_AK4641 |
165 | help | 166 | help |
diff --git a/sound/soc/samsung/smdk_wm8994.c b/sound/soc/samsung/smdk_wm8994.c index f75e43997d5b..ad9ac42522e2 100644 --- a/sound/soc/samsung/smdk_wm8994.c +++ b/sound/soc/samsung/smdk_wm8994.c | |||
@@ -9,6 +9,7 @@ | |||
9 | 9 | ||
10 | #include "../codecs/wm8994.h" | 10 | #include "../codecs/wm8994.h" |
11 | #include <sound/pcm_params.h> | 11 | #include <sound/pcm_params.h> |
12 | #include <linux/module.h> | ||
12 | 13 | ||
13 | /* | 14 | /* |
14 | * Default CFG switch settings to use this driver: | 15 | * Default CFG switch settings to use this driver: |
diff --git a/sound/soc/samsung/speyside.c b/sound/soc/samsung/speyside.c index 85bf541a771d..4b8e35410eb1 100644 --- a/sound/soc/samsung/speyside.c +++ b/sound/soc/samsung/speyside.c | |||
@@ -191,7 +191,7 @@ static int speyside_late_probe(struct snd_soc_card *card) | |||
191 | snd_soc_dapm_ignore_suspend(&card->dapm, "Headset Mic"); | 191 | snd_soc_dapm_ignore_suspend(&card->dapm, "Headset Mic"); |
192 | snd_soc_dapm_ignore_suspend(&card->dapm, "Main AMIC"); | 192 | snd_soc_dapm_ignore_suspend(&card->dapm, "Main AMIC"); |
193 | snd_soc_dapm_ignore_suspend(&card->dapm, "Main DMIC"); | 193 | snd_soc_dapm_ignore_suspend(&card->dapm, "Main DMIC"); |
194 | snd_soc_dapm_ignore_suspend(&card->dapm, "Speaker"); | 194 | snd_soc_dapm_ignore_suspend(&card->dapm, "Main Speaker"); |
195 | snd_soc_dapm_ignore_suspend(&card->dapm, "WM1250 Output"); | 195 | snd_soc_dapm_ignore_suspend(&card->dapm, "WM1250 Output"); |
196 | snd_soc_dapm_ignore_suspend(&card->dapm, "WM1250 Input"); | 196 | snd_soc_dapm_ignore_suspend(&card->dapm, "WM1250 Input"); |
197 | 197 | ||
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index a5d3685a5d38..a25fa63ce9a2 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c | |||
@@ -709,6 +709,12 @@ int snd_soc_resume(struct device *dev) | |||
709 | struct snd_soc_card *card = dev_get_drvdata(dev); | 709 | struct snd_soc_card *card = dev_get_drvdata(dev); |
710 | int i, ac97_control = 0; | 710 | int i, ac97_control = 0; |
711 | 711 | ||
712 | /* If the initialization of this soc device failed, there is no codec | ||
713 | * associated with it. Just bail out in this case. | ||
714 | */ | ||
715 | if (list_empty(&card->codec_dev_list)) | ||
716 | return 0; | ||
717 | |||
712 | /* AC97 devices might have other drivers hanging off them so | 718 | /* AC97 devices might have other drivers hanging off them so |
713 | * need to resume immediately. Other drivers don't have that | 719 | * need to resume immediately. Other drivers don't have that |
714 | * problem and may take a substantial amount of time to resume | 720 | * problem and may take a substantial amount of time to resume |
diff --git a/sound/soc/soc-utils.c b/sound/soc/soc-utils.c index 0c12b98484bd..4220bb0f2730 100644 --- a/sound/soc/soc-utils.c +++ b/sound/soc/soc-utils.c | |||
@@ -58,7 +58,36 @@ int snd_soc_params_to_bclk(struct snd_pcm_hw_params *params) | |||
58 | } | 58 | } |
59 | EXPORT_SYMBOL_GPL(snd_soc_params_to_bclk); | 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 | static __devinit int snd_soc_dummy_probe(struct platform_device *pdev) | 92 | static __devinit int snd_soc_dummy_probe(struct platform_device *pdev) |
64 | { | 93 | { |
diff --git a/sound/usb/quirks-table.h b/sound/usb/quirks-table.h index b61945f3af9e..32d2a21f2e3b 100644 --- a/sound/usb/quirks-table.h +++ b/sound/usb/quirks-table.h | |||
@@ -1633,6 +1633,37 @@ YAMAHA_DEVICE(0x7010, "UB99"), | |||
1633 | } | 1633 | } |
1634 | }, | 1634 | }, |
1635 | { | 1635 | { |
1636 | /* Roland GAIA SH-01 */ | ||
1637 | USB_DEVICE(0x0582, 0x0111), | ||
1638 | .driver_info = (unsigned long) &(const struct snd_usb_audio_quirk) { | ||
1639 | .vendor_name = "Roland", | ||
1640 | .product_name = "GAIA", | ||
1641 | .ifnum = QUIRK_ANY_INTERFACE, | ||
1642 | .type = QUIRK_COMPOSITE, | ||
1643 | .data = (const struct snd_usb_audio_quirk[]) { | ||
1644 | { | ||
1645 | .ifnum = 0, | ||
1646 | .type = QUIRK_AUDIO_STANDARD_INTERFACE | ||
1647 | }, | ||
1648 | { | ||
1649 | .ifnum = 1, | ||
1650 | .type = QUIRK_AUDIO_STANDARD_INTERFACE | ||
1651 | }, | ||
1652 | { | ||
1653 | .ifnum = 2, | ||
1654 | .type = QUIRK_MIDI_FIXED_ENDPOINT, | ||
1655 | .data = &(const struct snd_usb_midi_endpoint_info) { | ||
1656 | .out_cables = 0x0003, | ||
1657 | .in_cables = 0x0003 | ||
1658 | } | ||
1659 | }, | ||
1660 | { | ||
1661 | .ifnum = -1 | ||
1662 | } | ||
1663 | } | ||
1664 | } | ||
1665 | }, | ||
1666 | { | ||
1636 | USB_DEVICE(0x0582, 0x0113), | 1667 | USB_DEVICE(0x0582, 0x0113), |
1637 | .driver_info = (unsigned long) & (const struct snd_usb_audio_quirk) { | 1668 | .driver_info = (unsigned long) & (const struct snd_usb_audio_quirk) { |
1638 | /* .vendor_name = "BOSS", */ | 1669 | /* .vendor_name = "BOSS", */ |