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
Unified · Split
| @@ -9,6 +9,8 @@ · 8 unmodified lines | ||
| 9 | 9 | #include <sound/core.h> |
| 10 | 10 | #include <sound/hdaudio.h> |
| 11 | 11 | |
| 12 | +#define AC_AMP_FAKE_MUTE 0x10 /* fake mute bit set to amp verbs */ | |
| 13 | + | |
| 12 | 14 | int snd_hdac_regmap_init(struct hdac_device *codec); |
| 13 | 15 | void snd_hdac_regmap_exit(struct hdac_device *codec); |
| 14 | 16 | int snd_hdac_regmap_add_vendor_verb(struct hdac_device *codec, |
| @@ -246,6 +246,9 @@ static int hda_reg_read(void *context, unsigned int reg, unsigned int *val) · 245 unmodified lines | ||
| 246 | 246 | return hda_reg_read_stereo_amp(codec, reg, val); |
| 247 | 247 | if (verb == AC_VERB_GET_PROC_COEF) |
| 248 | 248 | 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 | + | |
| 249 | 252 | err = snd_hdac_exec_verb(codec, reg, 0, val); |
| 250 | 253 | if (err < 0) |
| 251 | 254 | return err; |
| @@ -265,6 +268,9 @@ static int hda_reg_write(void *context, unsigned int reg, unsigned int val) · 13 unmodified lines | ||
| 265 | 268 | unsigned int verb; |
| 266 | 269 | int i, bytes, err; |
| 267 | 270 | |
| 271 | + if (codec->caps_overwriting) | |
| 272 | + return 0; | |
| 273 | + | |
| 268 | 274 | reg &= ~0x00080000U; /* drop GET bit */ |
| 269 | 275 | reg |= (codec->addr << 28); |
| 270 | 276 | verb = get_verb(reg); |
| @@ -280,6 +286,8 @@ static int hda_reg_write(void *context, unsigned int reg, unsigned int val) · 9 unmodified lines | ||
| 280 | 286 | |
| 281 | 287 | switch (verb & 0xf00) { |
| 282 | 288 | case AC_VERB_SET_AMP_GAIN_MUTE: |
| 289 | + if ((reg & AC_AMP_FAKE_MUTE) && (val & AC_AMP_MUTE)) | |
| 290 | + val = 0; | |
| 283 | 291 | verb = AC_VERB_SET_AMP_GAIN_MUTE; |
| 284 | 292 | if (reg & AC_AMP_GET_LEFT) |
| 285 | 293 | verb |= AC_AMP_SET_LEFT >> 8; |
| @@ -436,7 +436,7 @@ static unsigned int get_num_devices(struct hda_codec *codec, hda_nid_t nid) · 435 unmodified lines | ||
| 436 | 436 | get_wcaps_type(wcaps) != AC_WID_PIN) |
| 437 | 437 | return 0; |
| 438 | 438 | |
| 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); | |
| 440 | 440 | if (parm == -1 && codec->bus->rirb_error) |
| 441 | 441 | parm = 0; |
| 442 | 442 | 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 | ||
| 1375 | 1375 | } |
| 1376 | 1376 | EXPORT_SYMBOL_GPL(snd_hda_override_amp_caps); |
| 1377 | 1377 | |
| 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 | + | |
| 1378 | 1403 | /** |
| 1379 | 1404 | * snd_hda_codec_amp_stereo - update the AMP stereo values |
| 1380 | 1405 | * @codec: HD-audio codec |
| @@ -340,6 +340,11 @@ enum { · 339 unmodified lines | ||
| 340 | 340 | #define use_vga_switcheroo(chip) 0 |
| 341 | 341 | #endif |
| 342 | 342 | |
| 343 | +#define CONTROLLER_IN_GPU(pci) (((pci)->device == 0x0a0c) || \ | |
| 344 | + ((pci)->device == 0x0c0c) || \ | |
| 345 | + ((pci)->device == 0x0d0c) || \ | |
| 346 | + ((pci)->device == 0x160c)) | |
| 347 | + | |
| 343 | 348 | static char *driver_short_names[] = { |
| 344 | 349 | [AZX_DRIVER_ICH] = "HDA Intel", |
| 345 | 350 | [AZX_DRIVER_PCH] = "HDA Intel PCH", |
| @@ -1854,8 +1859,17 @@ static int azx_probe_continue(struct azx *chip) · 1508 unmodified lines | ||
| 1854 | 1859 | if (chip->driver_caps & AZX_DCAPS_I915_POWERWELL) { |
| 1855 | 1860 | #ifdef CONFIG_SND_HDA_I915 |
| 1856 | 1861 | 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 | + } | |
| 1859 | 1873 | err = hda_display_power(hda, true); |
| 1860 | 1874 | if (err < 0) { |
| 1861 | 1875 | dev_err(chip->card->dev, |
| @@ -1865,6 +1879,7 @@ static int azx_probe_continue(struct azx *chip) · 3 unmodified lines | ||
| 1865 | 1879 | #endif |
| 1866 | 1880 | } |
| 1867 | 1881 | |
| 1882 | + skip_i915: | |
| 1868 | 1883 | err = azx_first_init(chip); |
| 1869 | 1884 | if (err < 0) |
| 1870 | 1885 | goto out_free; |
| @@ -129,8 +129,8 @@ int snd_hda_mixer_amp_switch_put_beep(struct snd_kcontrol *kcontrol, · 128 unmodified lines | ||
| 129 | 129 | /* lowlevel accessor with caching; use carefully */ |
| 130 | 130 | #define snd_hda_codec_amp_read(codec, nid, ch, dir, idx) \ |
| 131 | 131 | 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); | |
| 134 | 134 | int snd_hda_codec_amp_stereo(struct hda_codec *codec, hda_nid_t nid, |
| 135 | 135 | int dir, int idx, int mask, int val); |
| 136 | 136 | int snd_hda_codec_amp_init(struct hda_codec *codec, hda_nid_t nid, int ch, |
| @@ -1267,8 +1267,9 @@ u64 snd_usb_interface_dsd_format_quirks(struct snd_usb_audio *chip, · 1266 unmodified lines | ||
| 1267 | 1267 | if (fp->altsetting == 2) |
| 1268 | 1268 | return SNDRV_PCM_FMTBIT_DSD_U32_BE; |
| 1269 | 1269 | 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 */ | |
| 1272 | 1273 | if (fp->altsetting == 3) |
| 1273 | 1274 | return SNDRV_PCM_FMTBIT_DSD_U32_BE; |
| 1274 | 1275 | break; |