Commit ffb29b42 authored by Linus Torvalds's avatar Linus Torvalds

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

Pull sound fixes from Takashi Iwai:
 "Here is the additional fix patches that have been queued up since the
  previous pull request.  A few HD-audio fixes, a USB-audio quirk
  addition, and a couple of trivial cleanup for the legacy OSS codes"

* tag 'sound-fix-3.17-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound:
  ALSA: hda - Set TLV_DB_SCALE_MUTE bit for cx5051 vmaster
  ALSA: hda/ca0132 - Don't try loading firmware at resume when already failed
  ALSA: hda - Fix pop noises on reboot for Dell XPS 13 9333
  ALSA: hda - Set internal mic as default input source on Dell XPS 13 9333
  ALSA: usb-audio: fix BOSS ME-25 MIDI regression
  ALSA: hda - Fix parsing of CMI8888 codec
  ALSA: hda - Fix probing and stuttering on CMI8888 HD-audio controller
  ALSA: hda/realtek - Fixed ALC286/ALC288 recording delay for Headset Mic
  sound: oss: Remove typedefs wanc_info and wavnc_port_info
  sound: oss: uart401: Remove typedef uart401_devc
parents d22af68b 61074c1a
......@@ -30,7 +30,7 @@
#include "mpu401.h"
typedef struct uart401_devc
struct uart401_devc
{
int base;
int irq;
......@@ -41,14 +41,13 @@ typedef struct uart401_devc
int my_dev;
int share_irq;
spinlock_t lock;
}
uart401_devc;
};
#define DATAPORT (devc->base)
#define COMDPORT (devc->base+1)
#define STATPORT (devc->base+1)
static int uart401_status(uart401_devc * devc)
static int uart401_status(struct uart401_devc *devc)
{
return inb(STATPORT);
}
......@@ -56,17 +55,17 @@ static int uart401_status(uart401_devc * devc)
#define input_avail(devc) (!(uart401_status(devc)&INPUT_AVAIL))
#define output_ready(devc) (!(uart401_status(devc)&OUTPUT_READY))
static void uart401_cmd(uart401_devc * devc, unsigned char cmd)
static void uart401_cmd(struct uart401_devc *devc, unsigned char cmd)
{
outb((cmd), COMDPORT);
}
static int uart401_read(uart401_devc * devc)
static int uart401_read(struct uart401_devc *devc)
{
return inb(DATAPORT);
}
static void uart401_write(uart401_devc * devc, unsigned char byte)
static void uart401_write(struct uart401_devc *devc, unsigned char byte)
{
outb((byte), DATAPORT);
}
......@@ -77,10 +76,10 @@ static void uart401_write(uart401_devc * devc, unsigned char byte)
#define MPU_RESET 0xFF
#define UART_MODE_ON 0x3F
static int reset_uart401(uart401_devc * devc);
static void enter_uart_mode(uart401_devc * devc);
static int reset_uart401(struct uart401_devc *devc);
static void enter_uart_mode(struct uart401_devc *devc);
static void uart401_input_loop(uart401_devc * devc)
static void uart401_input_loop(struct uart401_devc *devc)
{
int work_limit=30000;
......@@ -99,7 +98,7 @@ static void uart401_input_loop(uart401_devc * devc)
irqreturn_t uart401intr(int irq, void *dev_id)
{
uart401_devc *devc = dev_id;
struct uart401_devc *devc = dev_id;
if (devc == NULL)
{
......@@ -118,7 +117,8 @@ uart401_open(int dev, int mode,
void (*output) (int dev)
)
{
uart401_devc *devc = (uart401_devc *) midi_devs[dev]->devc;
struct uart401_devc *devc = (struct uart401_devc *)
midi_devs[dev]->devc;
if (devc->opened)
return -EBUSY;
......@@ -138,7 +138,8 @@ uart401_open(int dev, int mode,
static void uart401_close(int dev)
{
uart401_devc *devc = (uart401_devc *) midi_devs[dev]->devc;
struct uart401_devc *devc = (struct uart401_devc *)
midi_devs[dev]->devc;
reset_uart401(devc);
devc->opened = 0;
......@@ -148,7 +149,8 @@ static int uart401_out(int dev, unsigned char midi_byte)
{
int timeout;
unsigned long flags;
uart401_devc *devc = (uart401_devc *) midi_devs[dev]->devc;
struct uart401_devc *devc = (struct uart401_devc *)
midi_devs[dev]->devc;
if (devc->disabled)
return 1;
......@@ -219,7 +221,7 @@ static const struct midi_operations uart401_operations =
.buffer_status = uart401_buffer_status,
};
static void enter_uart_mode(uart401_devc * devc)
static void enter_uart_mode(struct uart401_devc *devc)
{
int ok, timeout;
unsigned long flags;
......@@ -241,7 +243,7 @@ static void enter_uart_mode(uart401_devc * devc)
spin_unlock_irqrestore(&devc->lock,flags);
}
static int reset_uart401(uart401_devc * devc)
static int reset_uart401(struct uart401_devc *devc)
{
int ok, timeout, n;
......@@ -285,7 +287,7 @@ static int reset_uart401(uart401_devc * devc)
int probe_uart401(struct address_info *hw_config, struct module *owner)
{
uart401_devc *devc;
struct uart401_devc *devc;
char *name = "MPU-401 (UART) MIDI";
int ok = 0;
unsigned long flags;
......@@ -300,7 +302,7 @@ int probe_uart401(struct address_info *hw_config, struct module *owner)
return 0;
}
devc = kmalloc(sizeof(uart401_devc), GFP_KERNEL);
devc = kmalloc(sizeof(struct uart401_devc), GFP_KERNEL);
if (!devc) {
printk(KERN_WARNING "uart401: Can't allocate memory\n");
goto cleanup_region;
......@@ -392,7 +394,7 @@ int probe_uart401(struct address_info *hw_config, struct module *owner)
void unload_uart401(struct address_info *hw_config)
{
uart401_devc *devc;
struct uart401_devc *devc;
int n=hw_config->slots[4];
/* Not set up */
......
This diff is collapsed.
......@@ -265,6 +265,7 @@ enum {
AZX_DRIVER_TERA,
AZX_DRIVER_CTX,
AZX_DRIVER_CTHDA,
AZX_DRIVER_CMEDIA,
AZX_DRIVER_GENERIC,
AZX_NUM_DRIVERS, /* keep this as last entry */
};
......@@ -330,6 +331,7 @@ static char *driver_short_names[] = {
[AZX_DRIVER_TERA] = "HDA Teradici",
[AZX_DRIVER_CTX] = "HDA Creative",
[AZX_DRIVER_CTHDA] = "HDA Creative",
[AZX_DRIVER_CMEDIA] = "HDA C-Media",
[AZX_DRIVER_GENERIC] = "HD-Audio Generic",
};
......@@ -1373,6 +1375,7 @@ static void azx_check_snoop_available(struct azx *chip)
snoop = false;
break;
case AZX_DRIVER_CTHDA:
case AZX_DRIVER_CMEDIA:
snoop = false;
break;
}
......@@ -2154,6 +2157,10 @@ static const struct pci_device_id azx_ids[] = {
.driver_data = AZX_DRIVER_CTX | AZX_DCAPS_CTX_WORKAROUND |
AZX_DCAPS_RIRB_PRE_DELAY | AZX_DCAPS_POSFIX_LPIB },
#endif
/* CM8888 */
{ PCI_DEVICE(0x13f6, 0x5011),
.driver_data = AZX_DRIVER_CMEDIA |
AZX_DCAPS_NO_MSI | AZX_DCAPS_POSFIX_LPIB },
/* Vortex86MX */
{ PCI_DEVICE(0x17f3, 0x3010), .driver_data = AZX_DRIVER_GENERIC },
/* VMware HDAudio */
......
......@@ -4376,6 +4376,9 @@ static void ca0132_download_dsp(struct hda_codec *codec)
return; /* NOP */
#endif
if (spec->dsp_state == DSP_DOWNLOAD_FAILED)
return; /* don't retry failures */
chipio_enable_clocks(codec);
spec->dsp_state = DSP_DOWNLOADING;
if (!ca0132_download_dsp_images(codec))
......@@ -4552,7 +4555,8 @@ static int ca0132_init(struct hda_codec *codec)
struct auto_pin_cfg *cfg = &spec->autocfg;
int i;
spec->dsp_state = DSP_DOWNLOAD_INIT;
if (spec->dsp_state != DSP_DOWNLOAD_FAILED)
spec->dsp_state = DSP_DOWNLOAD_INIT;
spec->curr_chip_addx = INVALID_CHIP_ADDRESS;
snd_hda_power_up(codec);
......@@ -4663,6 +4667,7 @@ static int patch_ca0132(struct hda_codec *codec)
codec->spec = spec;
spec->codec = codec;
spec->dsp_state = DSP_DOWNLOAD_INIT;
spec->num_mixers = 1;
spec->mixers[0] = ca0132_mixer;
......
......@@ -75,15 +75,62 @@ static int patch_cmi9880(struct hda_codec *codec)
return err;
}
static int patch_cmi8888(struct hda_codec *codec)
{
struct cmi_spec *spec;
struct auto_pin_cfg *cfg;
int err;
spec = kzalloc(sizeof(*spec), GFP_KERNEL);
if (!spec)
return -ENOMEM;
codec->spec = spec;
cfg = &spec->gen.autocfg;
snd_hda_gen_spec_init(&spec->gen);
/* mask NID 0x10 from the playback volume selection;
* it's a headphone boost volume handled manually below
*/
spec->gen.out_vol_mask = (1ULL << 0x10);
err = snd_hda_parse_pin_defcfg(codec, cfg, NULL, 0);
if (err < 0)
goto error;
err = snd_hda_gen_parse_auto_config(codec, cfg);
if (err < 0)
goto error;
if (get_defcfg_device(snd_hda_codec_get_pincfg(codec, 0x10)) ==
AC_JACK_HP_OUT) {
static const struct snd_kcontrol_new amp_kctl =
HDA_CODEC_VOLUME("Headphone Amp Playback Volume",
0x10, 0, HDA_OUTPUT);
if (!snd_hda_gen_add_kctl(&spec->gen, NULL, &amp_kctl)) {
err = -ENOMEM;
goto error;
}
}
codec->patch_ops = cmi_auto_patch_ops;
return 0;
error:
snd_hda_gen_free(codec);
return err;
}
/*
* patch entries
*/
static const struct hda_codec_preset snd_hda_preset_cmedia[] = {
{ .id = 0x13f68888, .name = "CMI8888", .patch = patch_cmi8888 },
{ .id = 0x13f69880, .name = "CMI9880", .patch = patch_cmi9880 },
{ .id = 0x434d4980, .name = "CMI9880", .patch = patch_cmi9880 },
{} /* terminator */
};
MODULE_ALIAS("snd-hda-codec-id:13f68888");
MODULE_ALIAS("snd-hda-codec-id:13f69880");
MODULE_ALIAS("snd-hda-codec-id:434d4980");
......
......@@ -26,6 +26,7 @@
#include <linux/module.h>
#include <sound/core.h>
#include <sound/jack.h>
#include <sound/tlv.h>
#include "hda_codec.h"
#include "hda_local.h"
......@@ -859,6 +860,11 @@ static int patch_conexant_auto(struct hda_codec *codec)
if (err < 0)
goto error;
if (codec->vendor_id == 0x14f15051) {
/* minimum value is actually mute */
spec->gen.vmaster_tlv[3] |= TLV_DB_SCALE_MUTE;
}
codec->patch_ops = cx_auto_patch_ops;
/* Some laptops with Conexant chips show stalls in S3 resume,
......
......@@ -2782,6 +2782,27 @@ static int alc269_parse_auto_config(struct hda_codec *codec)
return alc_parse_auto_config(codec, alc269_ignore, ssids);
}
static int find_ext_mic_pin(struct hda_codec *codec);
static void alc286_shutup(struct hda_codec *codec)
{
int i;
int mic_pin = find_ext_mic_pin(codec);
/* don't shut up pins when unloading the driver; otherwise it breaks
* the default pin setup at the next load of the driver
*/
if (codec->bus->shutdown)
return;
for (i = 0; i < codec->init_pins.used; i++) {
struct hda_pincfg *pin = snd_array_elem(&codec->init_pins, i);
/* use read here for syncing after issuing each verb */
if (pin->nid != mic_pin)
snd_hda_codec_read(codec, pin->nid, 0,
AC_VERB_SET_PIN_WIDGET_CONTROL, 0);
}
codec->pins_shutup = 1;
}
static void alc269vb_toggle_power_output(struct hda_codec *codec, int power_up)
{
int val = alc_read_coef_idx(codec, 0x04);
......@@ -4072,7 +4093,7 @@ static unsigned int alc_power_filter_xps13(struct hda_codec *codec,
/* Avoid pop noises when headphones are plugged in */
if (spec->gen.hp_jack_present)
if (nid == codec->afg || nid == 0x02)
if (nid == codec->afg || nid == 0x02 || nid == 0x15)
return AC_PWRST_D0;
return power_state;
}
......@@ -4082,8 +4103,19 @@ static void alc_fixup_dell_xps13(struct hda_codec *codec,
{
if (action == HDA_FIXUP_ACT_PROBE) {
struct alc_spec *spec = codec->spec;
struct hda_input_mux *imux = &spec->gen.input_mux;
int i;
spec->shutup = alc_no_shutup;
codec->power_filter = alc_power_filter_xps13;
/* Make the internal mic the default input source. */
for (i = 0; i < imux->num_items; i++) {
if (spec->gen.imux_pins[i] == 0x12) {
spec->gen.cur_mux[0] = i;
break;
}
}
}
}
......@@ -5384,6 +5416,7 @@ static int patch_alc269(struct hda_codec *codec)
case 0x10ec0286:
case 0x10ec0288:
spec->codec_variant = ALC269_TYPE_ALC286;
spec->shutup = alc286_shutup;
break;
case 0x10ec0255:
spec->codec_variant = ALC269_TYPE_ALC255;
......
......@@ -1580,6 +1580,35 @@ YAMAHA_DEVICE(0x7010, "UB99"),
}
}
},
{
/* BOSS ME-25 */
USB_DEVICE(0x0582, 0x0113),
.driver_info = (unsigned long) & (const struct snd_usb_audio_quirk) {
.ifnum = QUIRK_ANY_INTERFACE,
.type = QUIRK_COMPOSITE,
.data = (const struct snd_usb_audio_quirk[]) {
{
.ifnum = 0,
.type = QUIRK_AUDIO_STANDARD_INTERFACE
},
{
.ifnum = 1,
.type = QUIRK_AUDIO_STANDARD_INTERFACE
},
{
.ifnum = 2,
.type = QUIRK_MIDI_FIXED_ENDPOINT,
.data = & (const struct snd_usb_midi_endpoint_info) {
.out_cables = 0x0001,
.in_cables = 0x0001
}
},
{
.ifnum = -1
}
}
}
},
{
/* only 44.1 kHz works at the moment */
USB_DEVICE(0x0582, 0x0120),
......
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