···579579~~~~~~~~~~~~~~~~580580The latest development codes for HD-audio are found on sound git tree:581581582582-- git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6.git582582+- git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound.git583583584584The master branch or for-next branches can be used as the main585585development branches in general while the HD-audio specific patches···594594install(-modules). See INSTALL in the package. The snapshot tarballs595595are found at:596596597597-- ftp://ftp.kernel.org/pub/linux/kernel/people/tiwai/snapshot/597597+- ftp://ftp.suse.com/pub/people/tiwai/snapshot/598598599599600600Sending a Bug Report···696696697697The hda-verb program is found in the ftp directory:698698699699-- ftp://ftp.kernel.org/pub/linux/kernel/people/tiwai/misc/699699+- ftp://ftp.suse.com/pub/people/tiwai/misc/700700701701Also a git repository is available:702702···764764765765The package is found in:766766767767-- ftp://ftp.kernel.org/pub/linux/kernel/people/tiwai/misc/767767+- ftp://ftp.suse.com/pub/people/tiwai/misc/768768769769A git repository is available:770770
+1-1
MAINTAINERS
···61226122SOUND - SOC LAYER / DYNAMIC AUDIO POWER MANAGEMENT (ASoC)61236123M: Liam Girdwood <lrg@ti.com>61246124M: Mark Brown <broonie@opensource.wolfsonmicro.com>61256125-T: git git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound-2.6.git61256125+T: git git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git61266126L: alsa-devel@alsa-project.org (moderated for non-subscribers)61276127W: http://alsa-project.org/main/index.php/ASoC61286128S: Supported
···297297 buf + ELD_FIXED_BYTES + mnl + 3 * i);298298 }299299300300+ /*301301+ * HDMI sink's ELD info cannot always be retrieved for now, e.g.302302+ * in console or for audio devices. Assume the highest speakers303303+ * configuration, to _not_ prohibit multi-channel audio playback.304304+ */305305+ if (!e->spk_alloc)306306+ e->spk_alloc = 0xffff;307307+308308+ e->eld_valid = true;300309 return 0;301310302311out_fail:303303- e->eld_ver = 0;304312 return -EINVAL;305313}306314···330322 * ELD size is initialized to zero in caller function. If no errors and331323 * ELD is valid, actual eld_size is assigned in hdmi_update_eld()332324 */333333-334334- if (!eld->eld_valid)335335- return -ENOENT;336325337326 size = snd_hdmi_get_eld_size(codec, nid);338327 if (size == 0) {
+3
sound/pci/hda/hda_local.h
···653653 int spk_alloc;654654 int sad_count;655655 struct cea_sad sad[ELD_MAX_SAD];656656+ /*657657+ * all fields above eld_buffer will be cleared before updating ELD658658+ */656659 char eld_buffer[ELD_MAX_SIZE];657660#ifdef CONFIG_PROC_FS658661 struct snd_info_entry *proc_entry;
+33-22
sound/pci/hda/patch_hdmi.c
···6565 hda_nid_t pin_nid;6666 int num_mux_nids;6767 hda_nid_t mux_nids[HDA_MAX_CONNECTIONS];6868+6969+ struct hda_codec *codec;6870 struct hdmi_eld sink_eld;7171+ struct delayed_work work;6972};70737174struct hdmi_spec {···748745 * Unsolicited events749746 */750747751751-static void hdmi_present_sense(struct hda_codec *codec, hda_nid_t pin_nid,752752- struct hdmi_eld *eld);748748+static void hdmi_present_sense(struct hdmi_spec_per_pin *per_pin, bool retry);753749754750static void hdmi_intrinsic_event(struct hda_codec *codec, unsigned int res)755751{···757755 int pd = !!(res & AC_UNSOL_RES_PD);758756 int eldv = !!(res & AC_UNSOL_RES_ELDV);759757 int pin_idx;760760- struct hdmi_eld *eld;761758762759 printk(KERN_INFO763760 "HDMI hot plug event: Codec=%d Pin=%d Presence_Detect=%d ELD_Valid=%d\n",···765764 pin_idx = pin_nid_to_pin_index(spec, pin_nid);766765 if (pin_idx < 0)767766 return;768768- eld = &spec->pins[pin_idx].sink_eld;769767770770- hdmi_present_sense(codec, pin_nid, eld);771771-772772- /*773773- * HDMI sink's ELD info cannot always be retrieved for now, e.g.774774- * in console or for audio devices. Assume the highest speakers775775- * configuration, to _not_ prohibit multi-channel audio playback.776776- */777777- if (!eld->spk_alloc)778778- eld->spk_alloc = 0xffff;768768+ hdmi_present_sense(&spec->pins[pin_idx], true);779769}780770781771static void hdmi_non_intrinsic_event(struct hda_codec *codec, unsigned int res)···960968 return 0;961969}962970963963-static void hdmi_present_sense(struct hda_codec *codec, hda_nid_t pin_nid,964964- struct hdmi_eld *eld)971971+static void hdmi_present_sense(struct hdmi_spec_per_pin *per_pin, bool retry)965972{973973+ struct hda_codec *codec = per_pin->codec;974974+ struct hdmi_eld *eld = &per_pin->sink_eld;975975+ hda_nid_t pin_nid = per_pin->pin_nid;966976 /*967977 * Always execute a GetPinSense verb here, even when called from968978 * hdmi_intrinsic_event; for some NVIDIA HW, the unsolicited···974980 * the unsolicited response to avoid custom WARs.975981 */976982 int present = snd_hda_pin_sense(codec, pin_nid);983983+ bool eld_valid = false;977984978978- memset(eld, 0, sizeof(*eld));985985+ memset(eld, 0, offsetof(struct hdmi_eld, eld_buffer));979986980987 eld->monitor_present = !!(present & AC_PINSENSE_PRESENCE);981988 if (eld->monitor_present)982982- eld->eld_valid = !!(present & AC_PINSENSE_ELDV);983983- else984984- eld->eld_valid = 0;989989+ eld_valid = !!(present & AC_PINSENSE_ELDV);985990986991 printk(KERN_INFO987992 "HDMI status: Codec=%d Pin=%d Presence_Detect=%d ELD_Valid=%d\n",988988- codec->addr, pin_nid, eld->monitor_present, eld->eld_valid);993993+ codec->addr, pin_nid, eld->monitor_present, eld_valid);989994990990- if (eld->eld_valid)995995+ if (eld_valid) {991996 if (!snd_hdmi_get_eld(eld, codec, pin_nid))992997 snd_hdmi_show_eld(eld);998998+ else if (retry) {999999+ queue_delayed_work(codec->bus->workq,10001000+ &per_pin->work,10011001+ msecs_to_jiffies(300));10021002+ }10031003+ }99310049941005 snd_hda_input_jack_report(codec, pin_nid);10061006+}10071007+10081008+static void hdmi_repoll_eld(struct work_struct *work)10091009+{10101010+ struct hdmi_spec_per_pin *per_pin =10111011+ container_of(to_delayed_work(work), struct hdmi_spec_per_pin, work);10121012+10131013+ hdmi_present_sense(per_pin, false);9951014}99610159971016static int hdmi_add_pin(struct hda_codec *codec, hda_nid_t pin_nid)···12351228 if (err < 0)12361229 return err;1237123012381238- hdmi_present_sense(codec, per_pin->pin_nid, &per_pin->sink_eld);12311231+ hdmi_present_sense(per_pin, false);12391232 return 0;12401233}12411234···12861279 AC_VERB_SET_UNSOLICITED_ENABLE,12871280 AC_USRSP_EN | pin_nid);1288128112821282+ per_pin->codec = codec;12831283+ INIT_DELAYED_WORK(&per_pin->work, hdmi_repoll_eld);12891284 snd_hda_eld_proc_new(codec, eld, pin_idx);12901285 }12911286 return 0;···13021293 struct hdmi_spec_per_pin *per_pin = &spec->pins[pin_idx];13031294 struct hdmi_eld *eld = &per_pin->sink_eld;1304129512961296+ cancel_delayed_work(&per_pin->work);13051297 snd_hda_eld_proc_free(codec, eld);13061298 }13071299 snd_hda_input_jack_free(codec);1308130013011301+ flush_workqueue(codec->bus->workq);13091302 kfree(spec);13101303}13111304
+1-1
sound/pci/hda/patch_realtek.c
···14721472 switch (fix->type) {14731473 case ALC_FIXUP_SKU:14741474 if (action != ALC_FIXUP_ACT_PRE_PROBE || !fix->v.sku)14751475- break;;14751475+ break;14761476 snd_printdd(KERN_INFO "hda_codec: %s: "14771477 "Apply sku override for %s\n",14781478 codec->chip_name, modelname);
+9-24
sound/pci/hda/patch_sigmatel.c
···227227228228 /* power management */229229 unsigned int num_pwrs;230230- const unsigned int *pwr_mapping;231230 const hda_nid_t *pwr_nids;232231 const hda_nid_t *dac_list;233232···373374374375#define STAC92HD83_DAC_COUNT 3375376376376-static const hda_nid_t stac92hd83xxx_pwr_nids[4] = {377377- 0xa, 0xb, 0xd, 0xe,377377+static const hda_nid_t stac92hd83xxx_pwr_nids[7] = {378378+ 0x0a, 0x0b, 0x0c, 0xd, 0x0e,379379+ 0x0f, 0x10378380};379381380382static const hda_nid_t stac92hd83xxx_slave_dig_outs[2] = {381383 0x1e, 0,382382-};383383-384384-static const unsigned int stac92hd83xxx_pwr_mapping[4] = {385385- 0x03, 0x0c, 0x20, 0x40,386384};387385388386static const hda_nid_t stac92hd83xxx_dmic_nids[] = {···44664470 stac_toggle_power_map(codec, nid, 1);44674471 continue;44684472 }44694469- if (enable_pin_detect(codec, nid, STAC_PWR_EVENT))44734473+ if (enable_pin_detect(codec, nid, STAC_PWR_EVENT)) {44704474 stac_issue_unsol_event(codec, nid);44754475+ continue;44764476+ }44774477+ /* none of the above, turn the port OFF */44784478+ stac_toggle_power_map(codec, nid, 0);44714479 }4472448044734481 /* sync mute LED */···47274727 if (idx >= spec->num_pwrs)47284728 return;4729472947304730- /* several codecs have two power down bits */47314731- if (spec->pwr_mapping)47324732- idx = spec->pwr_mapping[idx];47334733- else47344734- idx = 1 << idx;47304730+ idx = 1 << idx;4735473147364732 val = snd_hda_codec_read(codec, codec->afg, 0, 0x0fec, 0x0) & 0xff;47374733 if (enable)···56255629 snd_hda_codec_set_pincfg(codec, 0xf, 0x2181205e);56265630 }5627563156285628- /* reset pin power-down; Windows may leave these bits after reboot */56295629- snd_hda_codec_write_cache(codec, codec->afg, 0, 0x7EC, 0);56305630- snd_hda_codec_write_cache(codec, codec->afg, 0, 0x7ED, 0);56315632 codec->no_trigger_sense = 1;56325633 codec->spec = spec;56335634···56345641 codec->slave_dig_outs = stac92hd83xxx_slave_dig_outs;56355642 spec->digbeep_nid = 0x21;56365643 spec->pwr_nids = stac92hd83xxx_pwr_nids;56375637- spec->pwr_mapping = stac92hd83xxx_pwr_mapping;56385644 spec->num_pwrs = ARRAY_SIZE(stac92hd83xxx_pwr_nids);56395645 spec->multiout.dac_nids = spec->dac_nids;56405646 spec->init = stac92hd83xxx_core_init;···56495657 else56505658 stac92xx_set_config_regs(codec,56515659 stac92hd83xxx_brd_tbl[spec->board_config]);56525652-56535653- if (spec->board_config != STAC_92HD83XXX_PWR_REF)56545654- spec->num_pwrs = 0;5655566056565661 codec->patch_ops = stac92xx_patch_ops;56575662···58585869 (codec->revision_id & 0xf) == 1)58595870 spec->stream_delay = 40; /* 40 milliseconds */5860587158615861- /* no output amps */58625862- spec->num_pwrs = 0;58635872 /* disable VSW */58645873 spec->init = stac92hd71bxx_core_init;58655874 unmute_init++;···58725885 if ((codec->revision_id & 0xf) == 1)58735886 spec->stream_delay = 40; /* 40 milliseconds */5874588758755875- /* no output amps */58765876- spec->num_pwrs = 0;58775888 /* fallthru */58785889 default:58795890 spec->init = stac92hd71bxx_core_init;
+29-14
sound/soc/codecs/wm8994.c
···5656static int wm8994_readable(struct snd_soc_codec *codec, unsigned int reg)5757{5858 struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec);5959- struct wm8994 *control = wm8994->control_data;5959+ struct wm8994 *control = codec->control_data;60606161 switch (reg) {6262 case WM8994_GPIO_1:···30303030{30313031 struct wm8994_priv *wm8994 = data;30323032 struct snd_soc_codec *codec = wm8994->codec;30333033- int reg;30333033+ int reg, count;3034303430353035- reg = snd_soc_read(codec, WM8958_MIC_DETECT_3);30363036- if (reg < 0) {30373037- dev_err(codec->dev, "Failed to read mic detect status: %d\n",30383038- reg);30393039- return IRQ_NONE;30403040- }30353035+ /* We may occasionally read a detection without an impedence30363036+ * range being provided - if that happens loop again.30373037+ */30383038+ count = 10;30393039+ do {30403040+ reg = snd_soc_read(codec, WM8958_MIC_DETECT_3);30413041+ if (reg < 0) {30423042+ dev_err(codec->dev,30433043+ "Failed to read mic detect status: %d\n",30443044+ reg);30453045+ return IRQ_NONE;30463046+ }3041304730423042- if (!(reg & WM8958_MICD_VALID)) {30433043- dev_dbg(codec->dev, "Mic detect data not valid\n");30443044- goto out;30453045- }30483048+ if (!(reg & WM8958_MICD_VALID)) {30493049+ dev_dbg(codec->dev, "Mic detect data not valid\n");30503050+ goto out;30513051+ }30523052+30533053+ if (!(reg & WM8958_MICD_STS) || (reg & WM8958_MICD_LVL_MASK))30543054+ break;30553055+30563056+ msleep(1);30573057+ } while (count--);30583058+30593059+ if (count == 0)30603060+ dev_warn(codec->dev, "No impedence range reported for jack\n");3046306130473062#ifndef CONFIG_SND_SOC_WM8994_MODULE30483063 trace_snd_soc_jack_irq(dev_name(codec->dev));···3195318031963181 wm8994_request_irq(codec->control_data, WM8994_IRQ_FIFOS_ERR,31973182 wm8994_fifo_error, "FIFO error", codec);31983198- wm8994_request_irq(wm8994->control_data, WM8994_IRQ_TEMP_WARN,31833183+ wm8994_request_irq(codec->control_data, WM8994_IRQ_TEMP_WARN,31993184 wm8994_temp_warn, "Thermal warning", codec);32003200- wm8994_request_irq(wm8994->control_data, WM8994_IRQ_TEMP_SHUT,31853185+ wm8994_request_irq(codec->control_data, WM8994_IRQ_TEMP_SHUT,32013186 wm8994_temp_shut, "Thermal shutdown", codec);3202318732033188 ret = wm8994_request_irq(codec->control_data, WM8994_IRQ_DCS_DONE,