aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2015-06-14 19:55:24 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2015-06-14 19:55:24 -0400
commit2fbbada1e1f321a0d525eae77d45acb56e7e9b52 (patch)
tree7599bfb177cb02c78de9fcbf2345bf3d82ccb709
parentc8d17b451aa18b07b60e771addf17a5fdd4138c7 (diff)
parent535115b5ff51c702a9a22feb918707c2fe1fbd17 (diff)
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
-rw-r--r--include/sound/hda_regmap.h2
-rw-r--r--sound/hda/hdac_regmap.c8
-rw-r--r--sound/pci/hda/hda_codec.c27
-rw-r--r--sound/pci/hda/hda_intel.c19
-rw-r--r--sound/pci/hda/hda_local.h4
-rw-r--r--sound/usb/quirks.c5
6 files changed, 58 insertions, 7 deletions
diff --git a/include/sound/hda_regmap.h b/include/sound/hda_regmap.h
index 53a18b3635e2..df705908480a 100644
--- a/include/sound/hda_regmap.h
+++ b/include/sound/hda_regmap.h
@@ -9,6 +9,8 @@
9#include <sound/core.h> 9#include <sound/core.h>
10#include <sound/hdaudio.h> 10#include <sound/hdaudio.h>
11 11
12#define AC_AMP_FAKE_MUTE 0x10 /* fake mute bit set to amp verbs */
13
12int snd_hdac_regmap_init(struct hdac_device *codec); 14int snd_hdac_regmap_init(struct hdac_device *codec);
13void snd_hdac_regmap_exit(struct hdac_device *codec); 15void snd_hdac_regmap_exit(struct hdac_device *codec);
14int snd_hdac_regmap_add_vendor_verb(struct hdac_device *codec, 16int snd_hdac_regmap_add_vendor_verb(struct hdac_device *codec,
diff --git a/sound/hda/hdac_regmap.c b/sound/hda/hdac_regmap.c
index 7371e0c3926f..1eabcdf69457 100644
--- a/sound/hda/hdac_regmap.c
+++ b/sound/hda/hdac_regmap.c
@@ -246,6 +246,9 @@ static int hda_reg_read(void *context, unsigned int reg, unsigned int *val)
246 return hda_reg_read_stereo_amp(codec, reg, val); 246 return hda_reg_read_stereo_amp(codec, reg, val);
247 if (verb == AC_VERB_GET_PROC_COEF) 247 if (verb == AC_VERB_GET_PROC_COEF)
248 return hda_reg_read_coef(codec, reg, val); 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 err = snd_hdac_exec_verb(codec, reg, 0, val); 252 err = snd_hdac_exec_verb(codec, reg, 0, val);
250 if (err < 0) 253 if (err < 0)
251 return err; 254 return err;
@@ -265,6 +268,9 @@ static int hda_reg_write(void *context, unsigned int reg, unsigned int val)
265 unsigned int verb; 268 unsigned int verb;
266 int i, bytes, err; 269 int i, bytes, err;
267 270
271 if (codec->caps_overwriting)
272 return 0;
273
268 reg &= ~0x00080000U; /* drop GET bit */ 274 reg &= ~0x00080000U; /* drop GET bit */
269 reg |= (codec->addr << 28); 275 reg |= (codec->addr << 28);
270 verb = get_verb(reg); 276 verb = get_verb(reg);
@@ -280,6 +286,8 @@ static int hda_reg_write(void *context, unsigned int reg, unsigned int val)
280 286
281 switch (verb & 0xf00) { 287 switch (verb & 0xf00) {
282 case AC_VERB_SET_AMP_GAIN_MUTE: 288 case AC_VERB_SET_AMP_GAIN_MUTE:
289 if ((reg & AC_AMP_FAKE_MUTE) && (val & AC_AMP_MUTE))
290 val = 0;
283 verb = AC_VERB_SET_AMP_GAIN_MUTE; 291 verb = AC_VERB_SET_AMP_GAIN_MUTE;
284 if (reg & AC_AMP_GET_LEFT) 292 if (reg & AC_AMP_GET_LEFT)
285 verb |= AC_AMP_SET_LEFT >> 8; 293 verb |= AC_AMP_SET_LEFT >> 8;
diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c
index b49feff0a319..5645481af3d9 100644
--- a/sound/pci/hda/hda_codec.c
+++ b/sound/pci/hda/hda_codec.c
@@ -436,7 +436,7 @@ static unsigned int get_num_devices(struct hda_codec *codec, hda_nid_t nid)
436 get_wcaps_type(wcaps) != AC_WID_PIN) 436 get_wcaps_type(wcaps) != AC_WID_PIN)
437 return 0; 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 if (parm == -1 && codec->bus->rirb_error) 440 if (parm == -1 && codec->bus->rirb_error)
441 parm = 0; 441 parm = 0;
442 return parm & AC_DEV_LIST_LEN_MASK; 442 return parm & AC_DEV_LIST_LEN_MASK;
@@ -1376,6 +1376,31 @@ int snd_hda_override_amp_caps(struct hda_codec *codec, hda_nid_t nid, int dir,
1376EXPORT_SYMBOL_GPL(snd_hda_override_amp_caps); 1376EXPORT_SYMBOL_GPL(snd_hda_override_amp_caps);
1377 1377
1378/** 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 */
1390int 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}
1401EXPORT_SYMBOL_GPL(snd_hda_codec_amp_update);
1402
1403/**
1379 * snd_hda_codec_amp_stereo - update the AMP stereo values 1404 * snd_hda_codec_amp_stereo - update the AMP stereo values
1380 * @codec: HD-audio codec 1405 * @codec: HD-audio codec
1381 * @nid: NID to read the AMP value 1406 * @nid: NID to read the AMP value
diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c
index fea198c58196..a244ba706317 100644
--- a/sound/pci/hda/hda_intel.c
+++ b/sound/pci/hda/hda_intel.c
@@ -340,6 +340,11 @@ enum {
340#define use_vga_switcheroo(chip) 0 340#define use_vga_switcheroo(chip) 0
341#endif 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
343static char *driver_short_names[] = { 348static char *driver_short_names[] = {
344 [AZX_DRIVER_ICH] = "HDA Intel", 349 [AZX_DRIVER_ICH] = "HDA Intel",
345 [AZX_DRIVER_PCH] = "HDA Intel PCH", 350 [AZX_DRIVER_PCH] = "HDA Intel PCH",
@@ -1854,8 +1859,17 @@ static int azx_probe_continue(struct azx *chip)
1854 if (chip->driver_caps & AZX_DCAPS_I915_POWERWELL) { 1859 if (chip->driver_caps & AZX_DCAPS_I915_POWERWELL) {
1855#ifdef CONFIG_SND_HDA_I915 1860#ifdef CONFIG_SND_HDA_I915
1856 err = hda_i915_init(hda); 1861 err = hda_i915_init(hda);
1857 if (err < 0) 1862 if (err < 0) {
1858 goto out_free; 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 err = hda_display_power(hda, true); 1873 err = hda_display_power(hda, true);
1860 if (err < 0) { 1874 if (err < 0) {
1861 dev_err(chip->card->dev, 1875 dev_err(chip->card->dev,
@@ -1865,6 +1879,7 @@ static int azx_probe_continue(struct azx *chip)
1865#endif 1879#endif
1866 } 1880 }
1867 1881
1882 skip_i915:
1868 err = azx_first_init(chip); 1883 err = azx_first_init(chip);
1869 if (err < 0) 1884 if (err < 0)
1870 goto out_free; 1885 goto out_free;
diff --git a/sound/pci/hda/hda_local.h b/sound/pci/hda/hda_local.h
index 3b567f42296b..bed66c314431 100644
--- a/sound/pci/hda/hda_local.h
+++ b/sound/pci/hda/hda_local.h
@@ -129,8 +129,8 @@ int snd_hda_mixer_amp_switch_put_beep(struct snd_kcontrol *kcontrol,
129/* lowlevel accessor with caching; use carefully */ 129/* lowlevel accessor with caching; use carefully */
130#define snd_hda_codec_amp_read(codec, nid, ch, dir, idx) \ 130#define snd_hda_codec_amp_read(codec, nid, ch, dir, idx) \
131 snd_hdac_regmap_get_amp(&(codec)->core, nid, ch, dir, idx) 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) \ 132int snd_hda_codec_amp_update(struct hda_codec *codec, hda_nid_t nid,
133 snd_hdac_regmap_update_amp(&(codec)->core, nid, ch, dir, idx, mask, val) 133 int ch, int dir, int idx, int mask, int val);
134int snd_hda_codec_amp_stereo(struct hda_codec *codec, hda_nid_t nid, 134int snd_hda_codec_amp_stereo(struct hda_codec *codec, hda_nid_t nid,
135 int dir, int idx, int mask, int val); 135 int dir, int idx, int mask, int val);
136int snd_hda_codec_amp_init(struct hda_codec *codec, hda_nid_t nid, int ch, 136int snd_hda_codec_amp_init(struct hda_codec *codec, hda_nid_t nid, int ch,
diff --git a/sound/usb/quirks.c b/sound/usb/quirks.c
index b8c97d092a47..754e689596a2 100644
--- a/sound/usb/quirks.c
+++ b/sound/usb/quirks.c
@@ -1267,8 +1267,9 @@ u64 snd_usb_interface_dsd_format_quirks(struct snd_usb_audio *chip,
1267 if (fp->altsetting == 2) 1267 if (fp->altsetting == 2)
1268 return SNDRV_PCM_FMTBIT_DSD_U32_BE; 1268 return SNDRV_PCM_FMTBIT_DSD_U32_BE;
1269 break; 1269 break;
1270 /* DIYINHK DSD DXD 384kHz USB to I2S/DSD */ 1270
1271 case USB_ID(0x20b1, 0x2009): 1271 case USB_ID(0x20b1, 0x2009): /* DIYINHK DSD DXD 384kHz USB to I2S/DSD */
1272 case USB_ID(0x20b1, 0x2023): /* JLsounds I2SoverUSB */
1272 if (fp->altsetting == 3) 1273 if (fp->altsetting == 3)
1273 return SNDRV_PCM_FMTBIT_DSD_U32_BE; 1274 return SNDRV_PCM_FMTBIT_DSD_U32_BE;
1274 break; 1275 break;