Commit 2208f651 authored by Linus Torvalds's avatar Linus Torvalds

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

Pull sound fixes from Takashi Iwai:
 "Still a slightly high amount of changes than wished, but they are all
  good regression and/or device-specific fixes.  Majority of commits are
  for HD-audio, an HDMI ctl index fix that hits old graphics boards,
  regression fixes for AD codecs and a few quirks.

  Other than that, two major fixes are included: a 64bit ABI fix for
  compress offload, and 64bit dma_addr_t truncation fix, which had hit
  on PAE kernels"

* tag 'sound-3.13-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound:
  ALSA: hda - Add static DAC/pin mapping for AD1986A codec
  ALSA: hda - One more Dell headset detection quirk
  ALSA: hda - hdmi: Fix IEC958 ctl indexes for some simple HDMI devices
  ALSA: hda - Mute all aamix inputs as default
  ALSA: compress: Fix 64bit ABI incompatibility
  ALSA: memalloc.h - fix wrong truncation of dma_addr_t
  ALSA: hda - Another Dell headset detection quirk
  ALSA: hda - A Dell headset detection quirk
  ALSA: hda - Remove quirk for Dell Vostro 131
  ALSA: usb-audio: fix uninitialized variable compile warning
  ALSA: hda - fix mic issues on Acer Aspire E-572
parents ea4ebd1c 3690739b
...@@ -108,7 +108,7 @@ static inline dma_addr_t snd_sgbuf_get_addr(struct snd_dma_buffer *dmab, ...@@ -108,7 +108,7 @@ static inline dma_addr_t snd_sgbuf_get_addr(struct snd_dma_buffer *dmab,
{ {
struct snd_sg_buf *sgbuf = dmab->private_data; struct snd_sg_buf *sgbuf = dmab->private_data;
dma_addr_t addr = sgbuf->table[offset >> PAGE_SHIFT].addr; dma_addr_t addr = sgbuf->table[offset >> PAGE_SHIFT].addr;
addr &= PAGE_MASK; addr &= ~((dma_addr_t)PAGE_SIZE - 1);
return addr + offset % PAGE_SIZE; return addr + offset % PAGE_SIZE;
} }
......
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
#include <sound/compress_params.h> #include <sound/compress_params.h>
#define SNDRV_COMPRESS_VERSION SNDRV_PROTOCOL_VERSION(0, 1, 1) #define SNDRV_COMPRESS_VERSION SNDRV_PROTOCOL_VERSION(0, 1, 2)
/** /**
* struct snd_compressed_buffer: compressed buffer * struct snd_compressed_buffer: compressed buffer
* @fragment_size: size of buffer fragment in bytes * @fragment_size: size of buffer fragment in bytes
...@@ -67,8 +67,8 @@ struct snd_compr_params { ...@@ -67,8 +67,8 @@ struct snd_compr_params {
struct snd_compr_tstamp { struct snd_compr_tstamp {
__u32 byte_offset; __u32 byte_offset;
__u32 copied_total; __u32 copied_total;
snd_pcm_uframes_t pcm_frames; __u32 pcm_frames;
snd_pcm_uframes_t pcm_io_frames; __u32 pcm_io_frames;
__u32 sampling_rate; __u32 sampling_rate;
}; };
......
...@@ -474,6 +474,20 @@ static void invalidate_nid_path(struct hda_codec *codec, int idx) ...@@ -474,6 +474,20 @@ static void invalidate_nid_path(struct hda_codec *codec, int idx)
memset(path, 0, sizeof(*path)); memset(path, 0, sizeof(*path));
} }
/* return a DAC if paired to the given pin by codec driver */
static hda_nid_t get_preferred_dac(struct hda_codec *codec, hda_nid_t pin)
{
struct hda_gen_spec *spec = codec->spec;
const hda_nid_t *list = spec->preferred_dacs;
if (!list)
return 0;
for (; *list; list += 2)
if (*list == pin)
return list[1];
return 0;
}
/* look for an empty DAC slot */ /* look for an empty DAC slot */
static hda_nid_t look_for_dac(struct hda_codec *codec, hda_nid_t pin, static hda_nid_t look_for_dac(struct hda_codec *codec, hda_nid_t pin,
bool is_digital) bool is_digital)
...@@ -1192,7 +1206,14 @@ static int try_assign_dacs(struct hda_codec *codec, int num_outs, ...@@ -1192,7 +1206,14 @@ static int try_assign_dacs(struct hda_codec *codec, int num_outs,
continue; continue;
} }
dacs[i] = look_for_dac(codec, pin, false); dacs[i] = get_preferred_dac(codec, pin);
if (dacs[i]) {
if (is_dac_already_used(codec, dacs[i]))
badness += bad->shared_primary;
}
if (!dacs[i])
dacs[i] = look_for_dac(codec, pin, false);
if (!dacs[i] && !i) { if (!dacs[i] && !i) {
/* try to steal the DAC of surrounds for the front */ /* try to steal the DAC of surrounds for the front */
for (j = 1; j < num_outs; j++) { for (j = 1; j < num_outs; j++) {
...@@ -4297,6 +4318,26 @@ static unsigned int snd_hda_gen_path_power_filter(struct hda_codec *codec, ...@@ -4297,6 +4318,26 @@ static unsigned int snd_hda_gen_path_power_filter(struct hda_codec *codec,
return AC_PWRST_D3; return AC_PWRST_D3;
} }
/* mute all aamix inputs initially; parse up to the first leaves */
static void mute_all_mixer_nid(struct hda_codec *codec, hda_nid_t mix)
{
int i, nums;
const hda_nid_t *conn;
bool has_amp;
nums = snd_hda_get_conn_list(codec, mix, &conn);
has_amp = nid_has_mute(codec, mix, HDA_INPUT);
for (i = 0; i < nums; i++) {
if (has_amp)
snd_hda_codec_amp_stereo(codec, mix,
HDA_INPUT, i,
0xff, HDA_AMP_MUTE);
else if (nid_has_volume(codec, conn[i], HDA_OUTPUT))
snd_hda_codec_amp_stereo(codec, conn[i],
HDA_OUTPUT, 0,
0xff, HDA_AMP_MUTE);
}
}
/* /*
* Parse the given BIOS configuration and set up the hda_gen_spec * Parse the given BIOS configuration and set up the hda_gen_spec
...@@ -4435,6 +4476,10 @@ int snd_hda_gen_parse_auto_config(struct hda_codec *codec, ...@@ -4435,6 +4476,10 @@ int snd_hda_gen_parse_auto_config(struct hda_codec *codec,
} }
} }
/* mute all aamix input initially */
if (spec->mixer_nid)
mute_all_mixer_nid(codec, spec->mixer_nid);
dig_only: dig_only:
parse_digital(codec); parse_digital(codec);
......
...@@ -249,6 +249,9 @@ struct hda_gen_spec { ...@@ -249,6 +249,9 @@ struct hda_gen_spec {
const struct badness_table *main_out_badness; const struct badness_table *main_out_badness;
const struct badness_table *extra_out_badness; const struct badness_table *extra_out_badness;
/* preferred pin/DAC pairs; an array of paired NIDs */
const hda_nid_t *preferred_dacs;
/* loopback mixing mode */ /* loopback mixing mode */
bool aamix_mode; bool aamix_mode;
......
...@@ -340,6 +340,14 @@ static int patch_ad1986a(struct hda_codec *codec) ...@@ -340,6 +340,14 @@ static int patch_ad1986a(struct hda_codec *codec)
{ {
int err; int err;
struct ad198x_spec *spec; struct ad198x_spec *spec;
static hda_nid_t preferred_pairs[] = {
0x1a, 0x03,
0x1b, 0x03,
0x1c, 0x04,
0x1d, 0x05,
0x1e, 0x03,
0
};
err = alloc_ad_spec(codec); err = alloc_ad_spec(codec);
if (err < 0) if (err < 0)
...@@ -360,6 +368,8 @@ static int patch_ad1986a(struct hda_codec *codec) ...@@ -360,6 +368,8 @@ static int patch_ad1986a(struct hda_codec *codec)
* So, let's disable the shared stream. * So, let's disable the shared stream.
*/ */
spec->gen.multiout.no_share_stream = 1; spec->gen.multiout.no_share_stream = 1;
/* give fixed DAC/pin pairs */
spec->gen.preferred_dacs = preferred_pairs;
/* AD1986A can't manage the dynamic pin on/off smoothly */ /* AD1986A can't manage the dynamic pin on/off smoothly */
spec->gen.auto_mute_via_amp = 1; spec->gen.auto_mute_via_amp = 1;
......
...@@ -2936,7 +2936,6 @@ static const struct snd_pci_quirk cxt5066_cfg_tbl[] = { ...@@ -2936,7 +2936,6 @@ static const struct snd_pci_quirk cxt5066_cfg_tbl[] = {
SND_PCI_QUIRK(0x1028, 0x0401, "Dell Vostro 1014", CXT5066_DELL_VOSTRO), SND_PCI_QUIRK(0x1028, 0x0401, "Dell Vostro 1014", CXT5066_DELL_VOSTRO),
SND_PCI_QUIRK(0x1028, 0x0408, "Dell Inspiron One 19T", CXT5066_IDEAPAD), SND_PCI_QUIRK(0x1028, 0x0408, "Dell Inspiron One 19T", CXT5066_IDEAPAD),
SND_PCI_QUIRK(0x1028, 0x050f, "Dell Inspiron", CXT5066_IDEAPAD), SND_PCI_QUIRK(0x1028, 0x050f, "Dell Inspiron", CXT5066_IDEAPAD),
SND_PCI_QUIRK(0x1028, 0x0510, "Dell Vostro", CXT5066_IDEAPAD),
SND_PCI_QUIRK(0x103c, 0x360b, "HP G60", CXT5066_HP_LAPTOP), SND_PCI_QUIRK(0x103c, 0x360b, "HP G60", CXT5066_HP_LAPTOP),
SND_PCI_QUIRK(0x1043, 0x13f3, "Asus A52J", CXT5066_ASUS), SND_PCI_QUIRK(0x1043, 0x13f3, "Asus A52J", CXT5066_ASUS),
SND_PCI_QUIRK(0x1043, 0x1643, "Asus K52JU", CXT5066_ASUS), SND_PCI_QUIRK(0x1043, 0x1643, "Asus K52JU", CXT5066_ASUS),
......
...@@ -2337,8 +2337,9 @@ static int simple_playback_build_controls(struct hda_codec *codec) ...@@ -2337,8 +2337,9 @@ static int simple_playback_build_controls(struct hda_codec *codec)
int err; int err;
per_cvt = get_cvt(spec, 0); per_cvt = get_cvt(spec, 0);
err = snd_hda_create_spdif_out_ctls(codec, per_cvt->cvt_nid, err = snd_hda_create_dig_out_ctls(codec, per_cvt->cvt_nid,
per_cvt->cvt_nid); per_cvt->cvt_nid,
HDA_PCM_TYPE_HDMI);
if (err < 0) if (err < 0)
return err; return err;
return simple_hdmi_build_jack(codec, 0); return simple_hdmi_build_jack(codec, 0);
......
...@@ -3849,6 +3849,7 @@ enum { ...@@ -3849,6 +3849,7 @@ enum {
ALC269_FIXUP_ASUS_X101, ALC269_FIXUP_ASUS_X101,
ALC271_FIXUP_AMIC_MIC2, ALC271_FIXUP_AMIC_MIC2,
ALC271_FIXUP_HP_GATE_MIC_JACK, ALC271_FIXUP_HP_GATE_MIC_JACK,
ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572,
ALC269_FIXUP_ACER_AC700, ALC269_FIXUP_ACER_AC700,
ALC269_FIXUP_LIMIT_INT_MIC_BOOST, ALC269_FIXUP_LIMIT_INT_MIC_BOOST,
ALC269VB_FIXUP_ASUS_ZENBOOK, ALC269VB_FIXUP_ASUS_ZENBOOK,
...@@ -4111,6 +4112,12 @@ static const struct hda_fixup alc269_fixups[] = { ...@@ -4111,6 +4112,12 @@ static const struct hda_fixup alc269_fixups[] = {
.chained = true, .chained = true,
.chain_id = ALC271_FIXUP_AMIC_MIC2, .chain_id = ALC271_FIXUP_AMIC_MIC2,
}, },
[ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572] = {
.type = HDA_FIXUP_FUNC,
.v.func = alc269_fixup_limit_int_mic_boost,
.chained = true,
.chain_id = ALC271_FIXUP_HP_GATE_MIC_JACK,
},
[ALC269_FIXUP_ACER_AC700] = { [ALC269_FIXUP_ACER_AC700] = {
.type = HDA_FIXUP_PINS, .type = HDA_FIXUP_PINS,
.v.pins = (const struct hda_pintbl[]) { .v.pins = (const struct hda_pintbl[]) {
...@@ -4208,6 +4215,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = { ...@@ -4208,6 +4215,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = {
SND_PCI_QUIRK(0x1025, 0x0740, "Acer AO725", ALC271_FIXUP_HP_GATE_MIC_JACK), SND_PCI_QUIRK(0x1025, 0x0740, "Acer AO725", ALC271_FIXUP_HP_GATE_MIC_JACK),
SND_PCI_QUIRK(0x1025, 0x0742, "Acer AO756", ALC271_FIXUP_HP_GATE_MIC_JACK), SND_PCI_QUIRK(0x1025, 0x0742, "Acer AO756", ALC271_FIXUP_HP_GATE_MIC_JACK),
SND_PCI_QUIRK_VENDOR(0x1025, "Acer Aspire", ALC271_FIXUP_DMIC), SND_PCI_QUIRK_VENDOR(0x1025, "Acer Aspire", ALC271_FIXUP_DMIC),
SND_PCI_QUIRK(0x1025, 0x0775, "Acer Aspire E1-572", ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572),
SND_PCI_QUIRK(0x1028, 0x0470, "Dell M101z", ALC269_FIXUP_DELL_M101Z), SND_PCI_QUIRK(0x1028, 0x0470, "Dell M101z", ALC269_FIXUP_DELL_M101Z),
SND_PCI_QUIRK(0x1028, 0x05bd, "Dell", ALC269_FIXUP_DELL2_MIC_NO_PRESENCE), SND_PCI_QUIRK(0x1028, 0x05bd, "Dell", ALC269_FIXUP_DELL2_MIC_NO_PRESENCE),
SND_PCI_QUIRK(0x1028, 0x05be, "Dell", ALC269_FIXUP_DELL2_MIC_NO_PRESENCE), SND_PCI_QUIRK(0x1028, 0x05be, "Dell", ALC269_FIXUP_DELL2_MIC_NO_PRESENCE),
...@@ -5034,8 +5042,11 @@ static const struct snd_pci_quirk alc662_fixup_tbl[] = { ...@@ -5034,8 +5042,11 @@ static const struct snd_pci_quirk alc662_fixup_tbl[] = {
SND_PCI_QUIRK(0x1025, 0x038b, "Acer Aspire 8943G", ALC662_FIXUP_ASPIRE), SND_PCI_QUIRK(0x1025, 0x038b, "Acer Aspire 8943G", ALC662_FIXUP_ASPIRE),
SND_PCI_QUIRK(0x1028, 0x05d8, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE), SND_PCI_QUIRK(0x1028, 0x05d8, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
SND_PCI_QUIRK(0x1028, 0x05db, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE), SND_PCI_QUIRK(0x1028, 0x05db, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
SND_PCI_QUIRK(0x1028, 0x0623, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
SND_PCI_QUIRK(0x1028, 0x0624, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
SND_PCI_QUIRK(0x1028, 0x0625, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE), SND_PCI_QUIRK(0x1028, 0x0625, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
SND_PCI_QUIRK(0x1028, 0x0626, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE), SND_PCI_QUIRK(0x1028, 0x0626, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
SND_PCI_QUIRK(0x1028, 0x0628, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
SND_PCI_QUIRK(0x103c, 0x1632, "HP RP5800", ALC662_FIXUP_HP_RP5800), SND_PCI_QUIRK(0x103c, 0x1632, "HP RP5800", ALC662_FIXUP_HP_RP5800),
SND_PCI_QUIRK(0x1043, 0x11cd, "Asus N550", ALC662_FIXUP_BASS_1A_CHMAP), SND_PCI_QUIRK(0x1043, 0x11cd, "Asus N550", ALC662_FIXUP_BASS_1A_CHMAP),
SND_PCI_QUIRK(0x1043, 0x1477, "ASUS N56VZ", ALC662_FIXUP_BASS_CHMAP), SND_PCI_QUIRK(0x1043, 0x1477, "ASUS N56VZ", ALC662_FIXUP_BASS_CHMAP),
......
...@@ -1603,7 +1603,7 @@ static int snd_microii_controls_create(struct usb_mixer_interface *mixer) ...@@ -1603,7 +1603,7 @@ static int snd_microii_controls_create(struct usb_mixer_interface *mixer)
return err; return err;
} }
return err; return 0;
} }
int snd_usb_mixer_apply_create_quirk(struct usb_mixer_interface *mixer) int snd_usb_mixer_apply_create_quirk(struct usb_mixer_interface *mixer)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment