Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge branch 'fix/hda' into topic/hda

+107 -74
+4 -4
Documentation/sound/alsa/HD-Audio.txt
··· 579 579 ~~~~~~~~~~~~~~~~ 580 580 The latest development codes for HD-audio are found on sound git tree: 581 581 582 - - git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6.git 582 + - git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound.git 583 583 584 584 The master branch or for-next branches can be used as the main 585 585 development branches in general while the HD-audio specific patches ··· 594 594 install(-modules). See INSTALL in the package. The snapshot tarballs 595 595 are found at: 596 596 597 - - ftp://ftp.kernel.org/pub/linux/kernel/people/tiwai/snapshot/ 597 + - ftp://ftp.suse.com/pub/people/tiwai/snapshot/ 598 598 599 599 600 600 Sending a Bug Report ··· 696 696 697 697 The hda-verb program is found in the ftp directory: 698 698 699 - - ftp://ftp.kernel.org/pub/linux/kernel/people/tiwai/misc/ 699 + - ftp://ftp.suse.com/pub/people/tiwai/misc/ 700 700 701 701 Also a git repository is available: 702 702 ··· 764 764 765 765 The package is found in: 766 766 767 - - ftp://ftp.kernel.org/pub/linux/kernel/people/tiwai/misc/ 767 + - ftp://ftp.suse.com/pub/people/tiwai/misc/ 768 768 769 769 A git repository is available: 770 770
+1 -1
MAINTAINERS
··· 6122 6122 SOUND - SOC LAYER / DYNAMIC AUDIO POWER MANAGEMENT (ASoC) 6123 6123 M: Liam Girdwood <lrg@ti.com> 6124 6124 M: Mark Brown <broonie@opensource.wolfsonmicro.com> 6125 - T: git git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound-2.6.git 6125 + T: git git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git 6126 6126 L: alsa-devel@alsa-project.org (moderated for non-subscribers) 6127 6127 W: http://alsa-project.org/main/index.php/ASoC 6128 6128 S: Supported
+15
include/linux/mfd/wm8994/registers.h
··· 1963 1963 #define WM8958_MICB2_DISCH_WIDTH 1 /* MICB2_DISCH */ 1964 1964 1965 1965 /* 1966 + * R210 (0xD2) - Mic Detect 3 1967 + */ 1968 + #define WM8958_MICD_LVL_MASK 0x07FC /* MICD_LVL - [10:2] */ 1969 + #define WM8958_MICD_LVL_SHIFT 2 /* MICD_LVL - [10:2] */ 1970 + #define WM8958_MICD_LVL_WIDTH 9 /* MICD_LVL - [10:2] */ 1971 + #define WM8958_MICD_VALID 0x0002 /* MICD_VALID */ 1972 + #define WM8958_MICD_VALID_MASK 0x0002 /* MICD_VALID */ 1973 + #define WM8958_MICD_VALID_SHIFT 1 /* MICD_VALID */ 1974 + #define WM8958_MICD_VALID_WIDTH 1 /* MICD_VALID */ 1975 + #define WM8958_MICD_STS 0x0001 /* MICD_STS */ 1976 + #define WM8958_MICD_STS_MASK 0x0001 /* MICD_STS */ 1977 + #define WM8958_MICD_STS_SHIFT 0 /* MICD_STS */ 1978 + #define WM8958_MICD_STS_WIDTH 1 /* MICD_STS */ 1979 + 1980 + /* 1966 1981 * R76 (0x4C) - Charge Pump (1) 1967 1982 */ 1968 1983 #define WM8994_CP_ENA 0x8000 /* CP_ENA */
+9 -4
sound/pci/hda/hda_eld.c
··· 297 297 buf + ELD_FIXED_BYTES + mnl + 3 * i); 298 298 } 299 299 300 + /* 301 + * HDMI sink's ELD info cannot always be retrieved for now, e.g. 302 + * in console or for audio devices. Assume the highest speakers 303 + * configuration, to _not_ prohibit multi-channel audio playback. 304 + */ 305 + if (!e->spk_alloc) 306 + e->spk_alloc = 0xffff; 307 + 308 + e->eld_valid = true; 300 309 return 0; 301 310 302 311 out_fail: 303 - e->eld_ver = 0; 304 312 return -EINVAL; 305 313 } 306 314 ··· 330 322 * ELD size is initialized to zero in caller function. If no errors and 331 323 * ELD is valid, actual eld_size is assigned in hdmi_update_eld() 332 324 */ 333 - 334 - if (!eld->eld_valid) 335 - return -ENOENT; 336 325 337 326 size = snd_hdmi_get_eld_size(codec, nid); 338 327 if (size == 0) {
+3
sound/pci/hda/hda_local.h
··· 653 653 int spk_alloc; 654 654 int sad_count; 655 655 struct cea_sad sad[ELD_MAX_SAD]; 656 + /* 657 + * all fields above eld_buffer will be cleared before updating ELD 658 + */ 656 659 char eld_buffer[ELD_MAX_SIZE]; 657 660 #ifdef CONFIG_PROC_FS 658 661 struct snd_info_entry *proc_entry;
+33 -22
sound/pci/hda/patch_hdmi.c
··· 65 65 hda_nid_t pin_nid; 66 66 int num_mux_nids; 67 67 hda_nid_t mux_nids[HDA_MAX_CONNECTIONS]; 68 + 69 + struct hda_codec *codec; 68 70 struct hdmi_eld sink_eld; 71 + struct delayed_work work; 69 72 }; 70 73 71 74 struct hdmi_spec { ··· 748 745 * Unsolicited events 749 746 */ 750 747 751 - static void hdmi_present_sense(struct hda_codec *codec, hda_nid_t pin_nid, 752 - struct hdmi_eld *eld); 748 + static void hdmi_present_sense(struct hdmi_spec_per_pin *per_pin, bool retry); 753 749 754 750 static void hdmi_intrinsic_event(struct hda_codec *codec, unsigned int res) 755 751 { ··· 757 755 int pd = !!(res & AC_UNSOL_RES_PD); 758 756 int eldv = !!(res & AC_UNSOL_RES_ELDV); 759 757 int pin_idx; 760 - struct hdmi_eld *eld; 761 758 762 759 printk(KERN_INFO 763 760 "HDMI hot plug event: Codec=%d Pin=%d Presence_Detect=%d ELD_Valid=%d\n", ··· 765 764 pin_idx = pin_nid_to_pin_index(spec, pin_nid); 766 765 if (pin_idx < 0) 767 766 return; 768 - eld = &spec->pins[pin_idx].sink_eld; 769 767 770 - hdmi_present_sense(codec, pin_nid, eld); 771 - 772 - /* 773 - * HDMI sink's ELD info cannot always be retrieved for now, e.g. 774 - * in console or for audio devices. Assume the highest speakers 775 - * configuration, to _not_ prohibit multi-channel audio playback. 776 - */ 777 - if (!eld->spk_alloc) 778 - eld->spk_alloc = 0xffff; 768 + hdmi_present_sense(&spec->pins[pin_idx], true); 779 769 } 780 770 781 771 static void hdmi_non_intrinsic_event(struct hda_codec *codec, unsigned int res) ··· 960 968 return 0; 961 969 } 962 970 963 - static void hdmi_present_sense(struct hda_codec *codec, hda_nid_t pin_nid, 964 - struct hdmi_eld *eld) 971 + static void hdmi_present_sense(struct hdmi_spec_per_pin *per_pin, bool retry) 965 972 { 973 + struct hda_codec *codec = per_pin->codec; 974 + struct hdmi_eld *eld = &per_pin->sink_eld; 975 + hda_nid_t pin_nid = per_pin->pin_nid; 966 976 /* 967 977 * Always execute a GetPinSense verb here, even when called from 968 978 * hdmi_intrinsic_event; for some NVIDIA HW, the unsolicited ··· 974 980 * the unsolicited response to avoid custom WARs. 975 981 */ 976 982 int present = snd_hda_pin_sense(codec, pin_nid); 983 + bool eld_valid = false; 977 984 978 - memset(eld, 0, sizeof(*eld)); 985 + memset(eld, 0, offsetof(struct hdmi_eld, eld_buffer)); 979 986 980 987 eld->monitor_present = !!(present & AC_PINSENSE_PRESENCE); 981 988 if (eld->monitor_present) 982 - eld->eld_valid = !!(present & AC_PINSENSE_ELDV); 983 - else 984 - eld->eld_valid = 0; 989 + eld_valid = !!(present & AC_PINSENSE_ELDV); 985 990 986 991 printk(KERN_INFO 987 992 "HDMI status: Codec=%d Pin=%d Presence_Detect=%d ELD_Valid=%d\n", 988 - codec->addr, pin_nid, eld->monitor_present, eld->eld_valid); 993 + codec->addr, pin_nid, eld->monitor_present, eld_valid); 989 994 990 - if (eld->eld_valid) 995 + if (eld_valid) { 991 996 if (!snd_hdmi_get_eld(eld, codec, pin_nid)) 992 997 snd_hdmi_show_eld(eld); 998 + else if (retry) { 999 + queue_delayed_work(codec->bus->workq, 1000 + &per_pin->work, 1001 + msecs_to_jiffies(300)); 1002 + } 1003 + } 993 1004 994 1005 snd_hda_input_jack_report(codec, pin_nid); 1006 + } 1007 + 1008 + static void hdmi_repoll_eld(struct work_struct *work) 1009 + { 1010 + struct hdmi_spec_per_pin *per_pin = 1011 + container_of(to_delayed_work(work), struct hdmi_spec_per_pin, work); 1012 + 1013 + hdmi_present_sense(per_pin, false); 995 1014 } 996 1015 997 1016 static int hdmi_add_pin(struct hda_codec *codec, hda_nid_t pin_nid) ··· 1235 1228 if (err < 0) 1236 1229 return err; 1237 1230 1238 - hdmi_present_sense(codec, per_pin->pin_nid, &per_pin->sink_eld); 1231 + hdmi_present_sense(per_pin, false); 1239 1232 return 0; 1240 1233 } 1241 1234 ··· 1286 1279 AC_VERB_SET_UNSOLICITED_ENABLE, 1287 1280 AC_USRSP_EN | pin_nid); 1288 1281 1282 + per_pin->codec = codec; 1283 + INIT_DELAYED_WORK(&per_pin->work, hdmi_repoll_eld); 1289 1284 snd_hda_eld_proc_new(codec, eld, pin_idx); 1290 1285 } 1291 1286 return 0; ··· 1302 1293 struct hdmi_spec_per_pin *per_pin = &spec->pins[pin_idx]; 1303 1294 struct hdmi_eld *eld = &per_pin->sink_eld; 1304 1295 1296 + cancel_delayed_work(&per_pin->work); 1305 1297 snd_hda_eld_proc_free(codec, eld); 1306 1298 } 1307 1299 snd_hda_input_jack_free(codec); 1308 1300 1301 + flush_workqueue(codec->bus->workq); 1309 1302 kfree(spec); 1310 1303 } 1311 1304
+1 -1
sound/pci/hda/patch_realtek.c
··· 1472 1472 switch (fix->type) { 1473 1473 case ALC_FIXUP_SKU: 1474 1474 if (action != ALC_FIXUP_ACT_PRE_PROBE || !fix->v.sku) 1475 - break;; 1475 + break; 1476 1476 snd_printdd(KERN_INFO "hda_codec: %s: " 1477 1477 "Apply sku override for %s\n", 1478 1478 codec->chip_name, modelname);
+9 -24
sound/pci/hda/patch_sigmatel.c
··· 227 227 228 228 /* power management */ 229 229 unsigned int num_pwrs; 230 - const unsigned int *pwr_mapping; 231 230 const hda_nid_t *pwr_nids; 232 231 const hda_nid_t *dac_list; 233 232 ··· 373 374 374 375 #define STAC92HD83_DAC_COUNT 3 375 376 376 - static const hda_nid_t stac92hd83xxx_pwr_nids[4] = { 377 - 0xa, 0xb, 0xd, 0xe, 377 + static const hda_nid_t stac92hd83xxx_pwr_nids[7] = { 378 + 0x0a, 0x0b, 0x0c, 0xd, 0x0e, 379 + 0x0f, 0x10 378 380 }; 379 381 380 382 static const hda_nid_t stac92hd83xxx_slave_dig_outs[2] = { 381 383 0x1e, 0, 382 - }; 383 - 384 - static const unsigned int stac92hd83xxx_pwr_mapping[4] = { 385 - 0x03, 0x0c, 0x20, 0x40, 386 384 }; 387 385 388 386 static const hda_nid_t stac92hd83xxx_dmic_nids[] = { ··· 4466 4470 stac_toggle_power_map(codec, nid, 1); 4467 4471 continue; 4468 4472 } 4469 - if (enable_pin_detect(codec, nid, STAC_PWR_EVENT)) 4473 + if (enable_pin_detect(codec, nid, STAC_PWR_EVENT)) { 4470 4474 stac_issue_unsol_event(codec, nid); 4475 + continue; 4476 + } 4477 + /* none of the above, turn the port OFF */ 4478 + stac_toggle_power_map(codec, nid, 0); 4471 4479 } 4472 4480 4473 4481 /* sync mute LED */ ··· 4727 4727 if (idx >= spec->num_pwrs) 4728 4728 return; 4729 4729 4730 - /* several codecs have two power down bits */ 4731 - if (spec->pwr_mapping) 4732 - idx = spec->pwr_mapping[idx]; 4733 - else 4734 - idx = 1 << idx; 4730 + idx = 1 << idx; 4735 4731 4736 4732 val = snd_hda_codec_read(codec, codec->afg, 0, 0x0fec, 0x0) & 0xff; 4737 4733 if (enable) ··· 5625 5629 snd_hda_codec_set_pincfg(codec, 0xf, 0x2181205e); 5626 5630 } 5627 5631 5628 - /* reset pin power-down; Windows may leave these bits after reboot */ 5629 - snd_hda_codec_write_cache(codec, codec->afg, 0, 0x7EC, 0); 5630 - snd_hda_codec_write_cache(codec, codec->afg, 0, 0x7ED, 0); 5631 5632 codec->no_trigger_sense = 1; 5632 5633 codec->spec = spec; 5633 5634 ··· 5634 5641 codec->slave_dig_outs = stac92hd83xxx_slave_dig_outs; 5635 5642 spec->digbeep_nid = 0x21; 5636 5643 spec->pwr_nids = stac92hd83xxx_pwr_nids; 5637 - spec->pwr_mapping = stac92hd83xxx_pwr_mapping; 5638 5644 spec->num_pwrs = ARRAY_SIZE(stac92hd83xxx_pwr_nids); 5639 5645 spec->multiout.dac_nids = spec->dac_nids; 5640 5646 spec->init = stac92hd83xxx_core_init; ··· 5649 5657 else 5650 5658 stac92xx_set_config_regs(codec, 5651 5659 stac92hd83xxx_brd_tbl[spec->board_config]); 5652 - 5653 - if (spec->board_config != STAC_92HD83XXX_PWR_REF) 5654 - spec->num_pwrs = 0; 5655 5660 5656 5661 codec->patch_ops = stac92xx_patch_ops; 5657 5662 ··· 5858 5869 (codec->revision_id & 0xf) == 1) 5859 5870 spec->stream_delay = 40; /* 40 milliseconds */ 5860 5871 5861 - /* no output amps */ 5862 - spec->num_pwrs = 0; 5863 5872 /* disable VSW */ 5864 5873 spec->init = stac92hd71bxx_core_init; 5865 5874 unmute_init++; ··· 5872 5885 if ((codec->revision_id & 0xf) == 1) 5873 5886 spec->stream_delay = 40; /* 40 milliseconds */ 5874 5887 5875 - /* no output amps */ 5876 - spec->num_pwrs = 0; 5877 5888 /* fallthru */ 5878 5889 default: 5879 5890 spec->init = stac92hd71bxx_core_init;
+29 -14
sound/soc/codecs/wm8994.c
··· 56 56 static int wm8994_readable(struct snd_soc_codec *codec, unsigned int reg) 57 57 { 58 58 struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec); 59 - struct wm8994 *control = wm8994->control_data; 59 + struct wm8994 *control = codec->control_data; 60 60 61 61 switch (reg) { 62 62 case WM8994_GPIO_1: ··· 3030 3030 { 3031 3031 struct wm8994_priv *wm8994 = data; 3032 3032 struct snd_soc_codec *codec = wm8994->codec; 3033 - int reg; 3033 + int reg, count; 3034 3034 3035 - reg = snd_soc_read(codec, WM8958_MIC_DETECT_3); 3036 - if (reg < 0) { 3037 - dev_err(codec->dev, "Failed to read mic detect status: %d\n", 3038 - reg); 3039 - return IRQ_NONE; 3040 - } 3035 + /* We may occasionally read a detection without an impedence 3036 + * range being provided - if that happens loop again. 3037 + */ 3038 + count = 10; 3039 + do { 3040 + reg = snd_soc_read(codec, WM8958_MIC_DETECT_3); 3041 + if (reg < 0) { 3042 + dev_err(codec->dev, 3043 + "Failed to read mic detect status: %d\n", 3044 + reg); 3045 + return IRQ_NONE; 3046 + } 3041 3047 3042 - if (!(reg & WM8958_MICD_VALID)) { 3043 - dev_dbg(codec->dev, "Mic detect data not valid\n"); 3044 - goto out; 3045 - } 3048 + if (!(reg & WM8958_MICD_VALID)) { 3049 + dev_dbg(codec->dev, "Mic detect data not valid\n"); 3050 + goto out; 3051 + } 3052 + 3053 + if (!(reg & WM8958_MICD_STS) || (reg & WM8958_MICD_LVL_MASK)) 3054 + break; 3055 + 3056 + msleep(1); 3057 + } while (count--); 3058 + 3059 + if (count == 0) 3060 + dev_warn(codec->dev, "No impedence range reported for jack\n"); 3046 3061 3047 3062 #ifndef CONFIG_SND_SOC_WM8994_MODULE 3048 3063 trace_snd_soc_jack_irq(dev_name(codec->dev)); ··· 3195 3180 3196 3181 wm8994_request_irq(codec->control_data, WM8994_IRQ_FIFOS_ERR, 3197 3182 wm8994_fifo_error, "FIFO error", codec); 3198 - wm8994_request_irq(wm8994->control_data, WM8994_IRQ_TEMP_WARN, 3183 + wm8994_request_irq(codec->control_data, WM8994_IRQ_TEMP_WARN, 3199 3184 wm8994_temp_warn, "Thermal warning", codec); 3200 - wm8994_request_irq(wm8994->control_data, WM8994_IRQ_TEMP_SHUT, 3185 + wm8994_request_irq(codec->control_data, WM8994_IRQ_TEMP_SHUT, 3201 3186 wm8994_temp_shut, "Thermal shutdown", codec); 3202 3187 3203 3188 ret = wm8994_request_irq(codec->control_data, WM8994_IRQ_DCS_DONE,
+3 -4
sound/usb/quirks.c
··· 137 137 return -ENOMEM; 138 138 } 139 139 if (fp->nr_rates > 0) { 140 - rate_table = kmalloc(sizeof(int) * fp->nr_rates, GFP_KERNEL); 140 + rate_table = kmemdup(fp->rate_table, 141 + sizeof(int) * fp->nr_rates, GFP_KERNEL); 141 142 if (!rate_table) { 142 143 kfree(fp); 143 144 return -ENOMEM; 144 145 } 145 - memcpy(rate_table, fp->rate_table, sizeof(int) * fp->nr_rates); 146 146 fp->rate_table = rate_table; 147 147 } 148 148 ··· 224 224 if (altsd->bNumEndpoints != 1) 225 225 return -ENXIO; 226 226 227 - fp = kmalloc(sizeof(*fp), GFP_KERNEL); 227 + fp = kmemdup(&ua_format, sizeof(*fp), GFP_KERNEL); 228 228 if (!fp) 229 229 return -ENOMEM; 230 - memcpy(fp, &ua_format, sizeof(*fp)); 231 230 232 231 fp->iface = altsd->bInterfaceNumber; 233 232 fp->endpoint = get_endpoint(alts, 0)->bEndpointAddress;