Commit d19d133e authored by Linus Torvalds's avatar Linus Torvalds

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

Pull sound fixes from Takashi Iwai:
 "Here are a few fixes that have been pending since the previous pull
  request: a regression fix for HD-audio multiple SPDIF / HDMI devices,
  several ALC256 codec fixes, a couple of i915 HDMI audio fixes, and
  various small fixes.

  Nothing exciting, just boring, but things good to have"

* tag 'sound-fix-4.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound:
  ALSA: hda - fix headset mic detection problem for one more machine
  ALSA: hda/realtek - Fix Headphone Mic doesn't recording for ALC256
  ALSA: hda - fix "num_steps = 0" error on ALC256
  ALSA: usb-audio: Fix audio output on Roland SC-D70 sound module
  ALSA: hda - add AZX_DCAPS_I915_POWERWELL to Baytrail
  ALSA: hda - only sync BCLK to the display clock for Haswell & Broadwell
  ALSA: hda - Mute headphone pin on suspend on XPS13 9333
  sound/oss: fix deadlock in sequencer_ioctl(SNDCTL_SEQ_OUTOFBAND)
  ALSA: asound.h - use SNDRV_CTL_ELEM_ID_NAME_MAXLEN
  ALSA: hda - potential (but unlikely) uninitialized variable
  ALSA: hda - Fix regression for slave SPDIF setups
  ALSA: intel8x0: Check pci_iomap() success for DEVICE_ALI
  ALSA: hda - simplify azx_has_pm_runtime
parents c6668726 e8191a8e
...@@ -864,7 +864,7 @@ struct snd_ctl_elem_id { ...@@ -864,7 +864,7 @@ struct snd_ctl_elem_id {
snd_ctl_elem_iface_t iface; /* interface identifier */ snd_ctl_elem_iface_t iface; /* interface identifier */
unsigned int device; /* device/client number */ unsigned int device; /* device/client number */
unsigned int subdevice; /* subdevice (substream) number */ unsigned int subdevice; /* subdevice (substream) number */
unsigned char name[44]; /* ASCII name of item */ unsigned char name[SNDRV_CTL_ELEM_ID_NAME_MAXLEN]; /* ASCII name of item */
unsigned int index; /* index of item */ unsigned int index; /* index of item */
}; };
......
...@@ -681,13 +681,8 @@ static int seq_timing_event(unsigned char *event_rec) ...@@ -681,13 +681,8 @@ static int seq_timing_event(unsigned char *event_rec)
break; break;
case TMR_ECHO: case TMR_ECHO:
if (seq_mode == SEQ_2)
seq_copy_to_input(event_rec, 8);
else
{
parm = (parm << 8 | SEQ_ECHO); parm = (parm << 8 | SEQ_ECHO);
seq_copy_to_input((unsigned char *) &parm, 4); seq_copy_to_input((unsigned char *) &parm, 4);
}
break; break;
default:; default:;
...@@ -1324,7 +1319,6 @@ int sequencer_ioctl(int dev, struct file *file, unsigned int cmd, void __user *a ...@@ -1324,7 +1319,6 @@ int sequencer_ioctl(int dev, struct file *file, unsigned int cmd, void __user *a
int mode = translate_mode(file); int mode = translate_mode(file);
struct synth_info inf; struct synth_info inf;
struct seq_event_rec event_rec; struct seq_event_rec event_rec;
unsigned long flags;
int __user *p = arg; int __user *p = arg;
orig_dev = dev = dev >> 4; orig_dev = dev = dev >> 4;
...@@ -1479,9 +1473,7 @@ int sequencer_ioctl(int dev, struct file *file, unsigned int cmd, void __user *a ...@@ -1479,9 +1473,7 @@ int sequencer_ioctl(int dev, struct file *file, unsigned int cmd, void __user *a
case SNDCTL_SEQ_OUTOFBAND: case SNDCTL_SEQ_OUTOFBAND:
if (copy_from_user(&event_rec, arg, sizeof(event_rec))) if (copy_from_user(&event_rec, arg, sizeof(event_rec)))
return -EFAULT; return -EFAULT;
spin_lock_irqsave(&lock,flags);
play_event(event_rec.arr); play_event(event_rec.arr);
spin_unlock_irqrestore(&lock,flags);
return 0; return 0;
case SNDCTL_MIDI_INFO: case SNDCTL_MIDI_INFO:
......
...@@ -2529,7 +2529,7 @@ static void set_dig_out(struct hda_codec *codec, hda_nid_t nid, ...@@ -2529,7 +2529,7 @@ static void set_dig_out(struct hda_codec *codec, hda_nid_t nid,
if (!d) if (!d)
return; return;
for (; *d; d++) for (; *d; d++)
snd_hdac_regmap_update(&codec->core, nid, snd_hdac_regmap_update(&codec->core, *d,
AC_VERB_SET_DIGI_CONVERT_1, mask, val); AC_VERB_SET_DIGI_CONVERT_1, mask, val);
} }
......
...@@ -404,7 +404,7 @@ struct azx { ...@@ -404,7 +404,7 @@ struct azx {
((chip)->ops->reg_readb((dev)->sd_addr + AZX_REG_##reg)) ((chip)->ops->reg_readb((dev)->sd_addr + AZX_REG_##reg))
#define azx_has_pm_runtime(chip) \ #define azx_has_pm_runtime(chip) \
(!AZX_DCAPS_PM_RUNTIME || ((chip)->driver_caps & AZX_DCAPS_PM_RUNTIME)) ((chip)->driver_caps & AZX_DCAPS_PM_RUNTIME)
/* PCM setup */ /* PCM setup */
static inline struct azx_dev *get_azx_dev(struct snd_pcm_substream *substream) static inline struct azx_dev *get_azx_dev(struct snd_pcm_substream *substream)
......
...@@ -55,6 +55,12 @@ void haswell_set_bclk(struct hda_intel *hda) ...@@ -55,6 +55,12 @@ void haswell_set_bclk(struct hda_intel *hda)
int cdclk_freq; int cdclk_freq;
unsigned int bclk_m, bclk_n; unsigned int bclk_m, bclk_n;
struct i915_audio_component *acomp = &hda->audio_component; struct i915_audio_component *acomp = &hda->audio_component;
struct pci_dev *pci = hda->chip.pci;
/* Only Haswell/Broadwell need set BCLK */
if (pci->device != 0x0a0c && pci->device != 0x0c0c
&& pci->device != 0x0d0c && pci->device != 0x160c)
return;
if (!acomp->ops) if (!acomp->ops)
return; return;
......
...@@ -297,6 +297,9 @@ enum { ...@@ -297,6 +297,9 @@ enum {
AZX_DCAPS_PM_RUNTIME | AZX_DCAPS_I915_POWERWELL |\ AZX_DCAPS_PM_RUNTIME | AZX_DCAPS_I915_POWERWELL |\
AZX_DCAPS_SNOOP_TYPE(SCH)) AZX_DCAPS_SNOOP_TYPE(SCH))
#define AZX_DCAPS_INTEL_BAYTRAIL \
(AZX_DCAPS_INTEL_PCH_NOPM | AZX_DCAPS_I915_POWERWELL)
#define AZX_DCAPS_INTEL_BRASWELL \ #define AZX_DCAPS_INTEL_BRASWELL \
(AZX_DCAPS_INTEL_PCH | AZX_DCAPS_I915_POWERWELL) (AZX_DCAPS_INTEL_PCH | AZX_DCAPS_I915_POWERWELL)
...@@ -1992,7 +1995,7 @@ static const struct pci_device_id azx_ids[] = { ...@@ -1992,7 +1995,7 @@ static const struct pci_device_id azx_ids[] = {
.driver_data = AZX_DRIVER_SCH | AZX_DCAPS_INTEL_PCH_NOPM }, .driver_data = AZX_DRIVER_SCH | AZX_DCAPS_INTEL_PCH_NOPM },
/* BayTrail */ /* BayTrail */
{ PCI_DEVICE(0x8086, 0x0f04), { PCI_DEVICE(0x8086, 0x0f04),
.driver_data = AZX_DRIVER_PCH | AZX_DCAPS_INTEL_PCH_NOPM }, .driver_data = AZX_DRIVER_PCH | AZX_DCAPS_INTEL_BAYTRAIL },
/* Braswell */ /* Braswell */
{ PCI_DEVICE(0x8086, 0x2284), { PCI_DEVICE(0x8086, 0x2284),
.driver_data = AZX_DRIVER_PCH | AZX_DCAPS_INTEL_BRASWELL }, .driver_data = AZX_DRIVER_PCH | AZX_DCAPS_INTEL_BRASWELL },
......
...@@ -582,8 +582,8 @@ static void print_conn_list(struct snd_info_buffer *buffer, ...@@ -582,8 +582,8 @@ static void print_conn_list(struct snd_info_buffer *buffer,
/* Get Cache connections info */ /* Get Cache connections info */
cache_len = snd_hda_get_conn_list(codec, nid, &list); cache_len = snd_hda_get_conn_list(codec, nid, &list);
if (cache_len != conn_len if (cache_len >= 0 && (cache_len != conn_len ||
|| memcmp(list, conn, conn_len)) { memcmp(list, conn, conn_len) != 0)) {
snd_iprintf(buffer, " In-driver Connection: %d\n", cache_len); snd_iprintf(buffer, " In-driver Connection: %d\n", cache_len);
if (cache_len > 0) { if (cache_len > 0) {
snd_iprintf(buffer, " "); snd_iprintf(buffer, " ");
......
...@@ -4176,17 +4176,15 @@ static void alc_fixup_disable_aamix(struct hda_codec *codec, ...@@ -4176,17 +4176,15 @@ static void alc_fixup_disable_aamix(struct hda_codec *codec,
} }
} }
static unsigned int alc_power_filter_xps13(struct hda_codec *codec, static void alc_shutup_dell_xps13(struct hda_codec *codec)
hda_nid_t nid,
unsigned int power_state)
{ {
struct alc_spec *spec = codec->spec; struct alc_spec *spec = codec->spec;
int hp_pin = spec->gen.autocfg.hp_pins[0];
/* Avoid pop noises when headphones are plugged in */ /* Prevent pop noises when headphones are plugged in */
if (spec->gen.hp_jack_present) snd_hda_codec_write(codec, hp_pin, 0,
if (nid == codec->core.afg || nid == 0x02 || nid == 0x15) AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
return AC_PWRST_D0; msleep(20);
return snd_hda_gen_path_power_filter(codec, nid, power_state);
} }
static void alc_fixup_dell_xps13(struct hda_codec *codec, static void alc_fixup_dell_xps13(struct hda_codec *codec,
...@@ -4197,8 +4195,7 @@ static void alc_fixup_dell_xps13(struct hda_codec *codec, ...@@ -4197,8 +4195,7 @@ static void alc_fixup_dell_xps13(struct hda_codec *codec,
struct hda_input_mux *imux = &spec->gen.input_mux; struct hda_input_mux *imux = &spec->gen.input_mux;
int i; int i;
spec->shutup = alc_no_shutup; spec->shutup = alc_shutup_dell_xps13;
codec->power_filter = alc_power_filter_xps13;
/* Make the internal mic the default input source. */ /* Make the internal mic the default input source. */
for (i = 0; i < imux->num_items; i++) { for (i = 0; i < imux->num_items; i++) {
...@@ -5231,6 +5228,16 @@ static const struct hda_model_fixup alc269_fixup_models[] = { ...@@ -5231,6 +5228,16 @@ static const struct hda_model_fixup alc269_fixup_models[] = {
{0x1b, 0x411111f0}, \ {0x1b, 0x411111f0}, \
{0x1e, 0x411111f0} {0x1e, 0x411111f0}
#define ALC256_STANDARD_PINS \
{0x12, 0x90a60140}, \
{0x14, 0x90170110}, \
{0x19, 0x411111f0}, \
{0x1a, 0x411111f0}, \
{0x1b, 0x411111f0}, \
{0x1d, 0x40700001}, \
{0x1e, 0x411111f0}, \
{0x21, 0x02211020}
#define ALC282_STANDARD_PINS \ #define ALC282_STANDARD_PINS \
{0x14, 0x90170110}, \ {0x14, 0x90170110}, \
{0x18, 0x411111f0}, \ {0x18, 0x411111f0}, \
...@@ -5331,15 +5338,11 @@ static const struct snd_hda_pin_quirk alc269_pin_fixup_tbl[] = { ...@@ -5331,15 +5338,11 @@ static const struct snd_hda_pin_quirk alc269_pin_fixup_tbl[] = {
{0x1d, 0x40700001}, {0x1d, 0x40700001},
{0x21, 0x02211050}), {0x21, 0x02211050}),
SND_HDA_PIN_QUIRK(0x10ec0256, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, SND_HDA_PIN_QUIRK(0x10ec0256, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
{0x12, 0x90a60140}, ALC256_STANDARD_PINS,
{0x13, 0x40000000}, {0x13, 0x40000000}),
{0x14, 0x90170110}, SND_HDA_PIN_QUIRK(0x10ec0256, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
{0x19, 0x411111f0}, ALC256_STANDARD_PINS,
{0x1a, 0x411111f0}, {0x13, 0x411111f0}),
{0x1b, 0x411111f0},
{0x1d, 0x40700001},
{0x1e, 0x411111f0},
{0x21, 0x02211020}),
SND_HDA_PIN_QUIRK(0x10ec0280, 0x103c, "HP", ALC280_FIXUP_HP_GPIO4, SND_HDA_PIN_QUIRK(0x10ec0280, 0x103c, "HP", ALC280_FIXUP_HP_GPIO4,
{0x12, 0x90a60130}, {0x12, 0x90a60130},
{0x13, 0x40000000}, {0x13, 0x40000000},
...@@ -5667,6 +5670,8 @@ static int patch_alc269(struct hda_codec *codec) ...@@ -5667,6 +5670,8 @@ static int patch_alc269(struct hda_codec *codec)
break; break;
case 0x10ec0256: case 0x10ec0256:
spec->codec_variant = ALC269_TYPE_ALC256; spec->codec_variant = ALC269_TYPE_ALC256;
spec->gen.mixer_nid = 0; /* ALC256 does not have any loopback mixer path */
alc_update_coef_idx(codec, 0x36, 1 << 13, 1 << 5); /* Switch pcbeep path to Line in path*/
break; break;
} }
...@@ -5680,8 +5685,8 @@ static int patch_alc269(struct hda_codec *codec) ...@@ -5680,8 +5685,8 @@ static int patch_alc269(struct hda_codec *codec)
if (err < 0) if (err < 0)
goto error; goto error;
if (!spec->gen.no_analog && spec->gen.beep_nid) if (!spec->gen.no_analog && spec->gen.beep_nid && spec->gen.mixer_nid)
set_beep_amp(spec, 0x0b, 0x04, HDA_INPUT); set_beep_amp(spec, spec->gen.mixer_nid, 0x04, HDA_INPUT);
codec->patch_ops = alc_patch_ops; codec->patch_ops = alc_patch_ops;
codec->patch_ops.stream_pm = snd_hda_gen_stream_pm; codec->patch_ops.stream_pm = snd_hda_gen_stream_pm;
......
...@@ -3101,13 +3101,13 @@ static int snd_intel8x0_create(struct snd_card *card, ...@@ -3101,13 +3101,13 @@ static int snd_intel8x0_create(struct snd_card *card,
chip->bmaddr = pci_iomap(pci, 3, 0); chip->bmaddr = pci_iomap(pci, 3, 0);
else else
chip->bmaddr = pci_iomap(pci, 1, 0); chip->bmaddr = pci_iomap(pci, 1, 0);
port_inited:
if (!chip->bmaddr) { if (!chip->bmaddr) {
dev_err(card->dev, "Controller space ioremap problem\n"); dev_err(card->dev, "Controller space ioremap problem\n");
snd_intel8x0_free(chip); snd_intel8x0_free(chip);
return -EIO; return -EIO;
} }
port_inited:
chip->bdbars_count = bdbars[device_type]; chip->bdbars_count = bdbars[device_type];
/* initialize offsets */ /* initialize offsets */
......
...@@ -79,7 +79,10 @@ static u64 parse_audio_format_i_type(struct snd_usb_audio *chip, ...@@ -79,7 +79,10 @@ static u64 parse_audio_format_i_type(struct snd_usb_audio *chip,
format = 1 << UAC_FORMAT_TYPE_I_PCM; format = 1 << UAC_FORMAT_TYPE_I_PCM;
} }
if (format & (1 << UAC_FORMAT_TYPE_I_PCM)) { if (format & (1 << UAC_FORMAT_TYPE_I_PCM)) {
if (chip->usb_id == USB_ID(0x0582, 0x0016) /* Edirol SD-90 */ && if (((chip->usb_id == USB_ID(0x0582, 0x0016)) ||
/* Edirol SD-90 */
(chip->usb_id == USB_ID(0x0582, 0x000c))) &&
/* Roland SC-D70 */
sample_width == 24 && sample_bytes == 2) sample_width == 24 && sample_bytes == 2)
sample_bytes = 3; sample_bytes = 3;
else if (sample_width > sample_bytes * 8) { else if (sample_width > sample_bytes * 8) {
......
...@@ -816,37 +816,11 @@ YAMAHA_DEVICE(0x7010, "UB99"), ...@@ -816,37 +816,11 @@ YAMAHA_DEVICE(0x7010, "UB99"),
.data = (const struct snd_usb_audio_quirk[]) { .data = (const struct snd_usb_audio_quirk[]) {
{ {
.ifnum = 0, .ifnum = 0,
.type = QUIRK_AUDIO_FIXED_ENDPOINT, .type = QUIRK_AUDIO_STANDARD_INTERFACE
.data = & (const struct audioformat) {
.formats = SNDRV_PCM_FMTBIT_S24_3LE,
.channels = 2,
.iface = 0,
.altsetting = 1,
.altset_idx = 1,
.attributes = 0,
.endpoint = 0x01,
.ep_attr = 0x01,
.rates = SNDRV_PCM_RATE_CONTINUOUS,
.rate_min = 44100,
.rate_max = 44100,
}
}, },
{ {
.ifnum = 1, .ifnum = 1,
.type = QUIRK_AUDIO_FIXED_ENDPOINT, .type = QUIRK_AUDIO_STANDARD_INTERFACE
.data = & (const struct audioformat) {
.formats = SNDRV_PCM_FMTBIT_S24_3LE,
.channels = 2,
.iface = 1,
.altsetting = 1,
.altset_idx = 1,
.attributes = 0,
.endpoint = 0x81,
.ep_attr = 0x01,
.rates = SNDRV_PCM_RATE_CONTINUOUS,
.rate_min = 44100,
.rate_max = 44100,
}
}, },
{ {
.ifnum = 2, .ifnum = 2,
......
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