History

Merge tag 'sound-4.1-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound

Pull sound fixes from Takashi Iwai: "Most of commits are regression fixes for HD-audio: a few corner case fixes for regmap transition, and i915 binding issues. In addition, a quirk for another USB-audio device supporting DSD" * tag 'sound-4.1-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: ALSA: hda - Abort the probe without i915 binding for HSW/BDW ALSA: hda - Re-add the lost fake mute support ALSA: hda - Continue probing even if i915 binding fails ALSA: hda - Don't actually write registers for caps overwrites ALSA: hda - fix number of devices query on hotplug ALSA: usb-audio: add native DSD support for JLsounds I2SoverUSB

Linus Torvalds committed 11 years ago

Commit 2fbbada2 parents c8d17b4 535115b6 files · +58 −7Browse files

Unified · Split

6 files
  1. include/sound/hda_regmap.h +2 −0
  2. sound/hda/hdac_regmap.c +8 −0
  3. sound/pci/hda/hda_codec.c +26 −1
  4. sound/pci/hda/hda_intel.c +17 −2
  5. sound/pci/hda/hda_local.h +2 −2
  6. sound/usb/quirks.c +3 −2
include/sound/hda_regmap.h+2−0
@@ -9,6 +9,8 @@ · 8 unmodified lines
99 #include <sound/core.h>
1010 #include <sound/hdaudio.h>
1111
12+#define AC_AMP_FAKE_MUTE 0x10 /* fake mute bit set to amp verbs */
13+
1214 int snd_hdac_regmap_init(struct hdac_device *codec);
1315 void snd_hdac_regmap_exit(struct hdac_device *codec);
1416 int snd_hdac_regmap_add_vendor_verb(struct hdac_device *codec,
sound/hda/hdac_regmap.c+8−0
@@ -246,6 +246,9 @@ static int hda_reg_read(void *context, unsigned int reg, unsigned int *val) · 245 unmodified lines
246246 return hda_reg_read_stereo_amp(codec, reg, val);
247247 if (verb == AC_VERB_GET_PROC_COEF)
248248 return hda_reg_read_coef(codec, reg, val);
249+ if ((verb & 0x700) == AC_VERB_SET_AMP_GAIN_MUTE)
250+ reg &= ~AC_AMP_FAKE_MUTE;
251+
249252 err = snd_hdac_exec_verb(codec, reg, 0, val);
250253 if (err < 0)
251254 return err;
@@ -265,6 +268,9 @@ static int hda_reg_write(void *context, unsigned int reg, unsigned int val) · 13 unmodified lines
265268 unsigned int verb;
266269 int i, bytes, err;
267270
271+ if (codec->caps_overwriting)
272+ return 0;
273+
268274 reg &= ~0x00080000U; /* drop GET bit */
269275 reg |= (codec->addr << 28);
270276 verb = get_verb(reg);
@@ -280,6 +286,8 @@ static int hda_reg_write(void *context, unsigned int reg, unsigned int val) · 9 unmodified lines
280286
281287 switch (verb & 0xf00) {
282288 case AC_VERB_SET_AMP_GAIN_MUTE:
289+ if ((reg & AC_AMP_FAKE_MUTE) && (val & AC_AMP_MUTE))
290+ val = 0;
283291 verb = AC_VERB_SET_AMP_GAIN_MUTE;
284292 if (reg & AC_AMP_GET_LEFT)
285293 verb |= AC_AMP_SET_LEFT >> 8;
sound/pci/hda/hda_codec.c+26−1
@@ -436,7 +436,7 @@ static unsigned int get_num_devices(struct hda_codec *codec, hda_nid_t nid) · 435 unmodified lines
436436 get_wcaps_type(wcaps) != AC_WID_PIN)
437437 return 0;
438438
439− parm = snd_hda_param_read(codec, nid, AC_PAR_DEVLIST_LEN);
439+ parm = snd_hdac_read_parm_uncached(&codec->core, nid, AC_PAR_DEVLIST_LEN);
440440 if (parm == -1 && codec->bus->rirb_error)
441441 parm = 0;
442442 return parm & AC_DEV_LIST_LEN_MASK;
@@ -1375,6 +1375,31 @@ int snd_hda_override_amp_caps(struct hda_codec *codec, hda_nid_t nid, int dir, · 932 unmodified lines
13751375 }
13761376 EXPORT_SYMBOL_GPL(snd_hda_override_amp_caps);
13771377
1378+/**
1379+ * snd_hda_codec_amp_update - update the AMP mono value
1380+ * @codec: HD-audio codec
1381+ * @nid: NID to read the AMP value
1382+ * @ch: channel to update (0 or 1)
1383+ * @dir: #HDA_INPUT or #HDA_OUTPUT
1384+ * @idx: the index value (only for input direction)
1385+ * @mask: bit mask to set
1386+ * @val: the bits value to set
1387+ *
1388+ * Update the AMP values for the given channel, direction and index.
1389+ */
1390+int snd_hda_codec_amp_update(struct hda_codec *codec, hda_nid_t nid,
1391+ int ch, int dir, int idx, int mask, int val)
1392+{
1393+ unsigned int cmd = snd_hdac_regmap_encode_amp(nid, ch, dir, idx);
1394+
1395+ /* enable fake mute if no h/w mute but min=mute */
1396+ if ((query_amp_caps(codec, nid, dir) &
1397+ (AC_AMPCAP_MUTE | AC_AMPCAP_MIN_MUTE)) == AC_AMPCAP_MIN_MUTE)
1398+ cmd |= AC_AMP_FAKE_MUTE;
1399+ return snd_hdac_regmap_update_raw(&codec->core, cmd, mask, val);
1400+}
1401+EXPORT_SYMBOL_GPL(snd_hda_codec_amp_update);
1402+
13781403 /**
13791404 * snd_hda_codec_amp_stereo - update the AMP stereo values
13801405 * @codec: HD-audio codec
sound/pci/hda/hda_intel.c+17−2
@@ -340,6 +340,11 @@ enum { · 339 unmodified lines
340340 #define use_vga_switcheroo(chip) 0
341341 #endif
342342
343+#define CONTROLLER_IN_GPU(pci) (((pci)->device == 0x0a0c) || \
344+ ((pci)->device == 0x0c0c) || \
345+ ((pci)->device == 0x0d0c) || \
346+ ((pci)->device == 0x160c))
347+
343348 static char *driver_short_names[] = {
344349 [AZX_DRIVER_ICH] = "HDA Intel",
345350 [AZX_DRIVER_PCH] = "HDA Intel PCH",
@@ -1854,8 +1859,17 @@ static int azx_probe_continue(struct azx *chip) · 1508 unmodified lines
18541859 if (chip->driver_caps & AZX_DCAPS_I915_POWERWELL) {
18551860 #ifdef CONFIG_SND_HDA_I915
18561861 err = hda_i915_init(hda);
1857− if (err < 0)
1858− goto out_free;
1862+ if (err < 0) {
1863+ /* if the controller is bound only with HDMI/DP
1864+ * (for HSW and BDW), we need to abort the probe;
1865+ * for other chips, still continue probing as other
1866+ * codecs can be on the same link.
1867+ */
1868+ if (CONTROLLER_IN_GPU(pci))
1869+ goto out_free;
1870+ else
1871+ goto skip_i915;
1872+ }
18591873 err = hda_display_power(hda, true);
18601874 if (err < 0) {
18611875 dev_err(chip->card->dev,
@@ -1865,6 +1879,7 @@ static int azx_probe_continue(struct azx *chip) · 3 unmodified lines
18651879 #endif
18661880 }
18671881
1882+ skip_i915:
18681883 err = azx_first_init(chip);
18691884 if (err < 0)
18701885 goto out_free;
sound/pci/hda/hda_local.h+2−2
@@ -129,8 +129,8 @@ int snd_hda_mixer_amp_switch_put_beep(struct snd_kcontrol *kcontrol, · 128 unmodified lines
129129 /* lowlevel accessor with caching; use carefully */
130130 #define snd_hda_codec_amp_read(codec, nid, ch, dir, idx) \
131131 snd_hdac_regmap_get_amp(&(codec)->core, nid, ch, dir, idx)
132−#define snd_hda_codec_amp_update(codec, nid, ch, dir, idx, mask, val) \
133− snd_hdac_regmap_update_amp(&(codec)->core, nid, ch, dir, idx, mask, val)
132+int snd_hda_codec_amp_update(struct hda_codec *codec, hda_nid_t nid,
133+ int ch, int dir, int idx, int mask, int val);
134134 int snd_hda_codec_amp_stereo(struct hda_codec *codec, hda_nid_t nid,
135135 int dir, int idx, int mask, int val);
136136 int snd_hda_codec_amp_init(struct hda_codec *codec, hda_nid_t nid, int ch,
sound/usb/quirks.c+3−2
@@ -1267,8 +1267,9 @@ u64 snd_usb_interface_dsd_format_quirks(struct snd_usb_audio *chip, · 1266 unmodified lines
12671267 if (fp->altsetting == 2)
12681268 return SNDRV_PCM_FMTBIT_DSD_U32_BE;
12691269 break;
1270− /* DIYINHK DSD DXD 384kHz USB to I2S/DSD */
1271− case USB_ID(0x20b1, 0x2009):
1270+
1271+ case USB_ID(0x20b1, 0x2009): /* DIYINHK DSD DXD 384kHz USB to I2S/DSD */
1272+ case USB_ID(0x20b1, 0x2023): /* JLsounds I2SoverUSB */
12721273 if (fp->altsetting == 3)
12731274 return SNDRV_PCM_FMTBIT_DSD_U32_BE;
12741275 break;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t