Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6: ALSA: rawmidi: fix the get next midi device ioctl ALSA: hda - Fix wrong HP pin detection in snd_hda_parse_pin_def_config() ALSA: seq/oss - Fix double-free at error path of snd_seq_oss_open() ALSA: msnd-classic: Fix invalid cfg parameter ALSA: hda - Enable PC-beep for EeePC with ALC269 codec ALSA: hda - Add errata initverb sequence for CS42xx codecs ALSA: usb - Release capture substream URBs properly ALSA: virtuoso: fix setting of Xonar DS line-in/mic-in controls ALSA: virtuoso: work around missing reset in the Xonar DS Windows driver ALSA: hda - Add quirk for Lenovo T400s ALSA: usb-audio: fix detection of vendor-specific device protocol settings ALSA: usb-audio: Assume first control interface is for audio ALSA: hda - Add a new hp-laptop model for Conexant 5066, tested on HP G60
This commit is contained in:
Коммит
3657423c02
|
@ -296,6 +296,7 @@ Conexant 5051
|
||||||
Conexant 5066
|
Conexant 5066
|
||||||
=============
|
=============
|
||||||
laptop Basic Laptop config (default)
|
laptop Basic Laptop config (default)
|
||||||
|
hp-laptop HP laptops, e g G60
|
||||||
dell-laptop Dell laptops
|
dell-laptop Dell laptops
|
||||||
dell-vostro Dell Vostro
|
dell-vostro Dell Vostro
|
||||||
olpc-xo-1_5 OLPC XO 1.5
|
olpc-xo-1_5 OLPC XO 1.5
|
||||||
|
|
|
@ -829,6 +829,8 @@ static int snd_rawmidi_control_ioctl(struct snd_card *card,
|
||||||
|
|
||||||
if (get_user(device, (int __user *)argp))
|
if (get_user(device, (int __user *)argp))
|
||||||
return -EFAULT;
|
return -EFAULT;
|
||||||
|
if (device >= SNDRV_RAWMIDI_DEVICES) /* next device is -1 */
|
||||||
|
device = SNDRV_RAWMIDI_DEVICES - 1;
|
||||||
mutex_lock(®ister_mutex);
|
mutex_lock(®ister_mutex);
|
||||||
device = device < 0 ? 0 : device + 1;
|
device = device < 0 ? 0 : device + 1;
|
||||||
while (device < SNDRV_RAWMIDI_DEVICES) {
|
while (device < SNDRV_RAWMIDI_DEVICES) {
|
||||||
|
|
|
@ -281,13 +281,10 @@ snd_seq_oss_open(struct file *file, int level)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
_error:
|
_error:
|
||||||
snd_seq_oss_writeq_delete(dp->writeq);
|
|
||||||
snd_seq_oss_readq_delete(dp->readq);
|
|
||||||
snd_seq_oss_synth_cleanup(dp);
|
snd_seq_oss_synth_cleanup(dp);
|
||||||
snd_seq_oss_midi_cleanup(dp);
|
snd_seq_oss_midi_cleanup(dp);
|
||||||
delete_port(dp);
|
|
||||||
delete_seq_queue(dp->queue);
|
delete_seq_queue(dp->queue);
|
||||||
kfree(dp);
|
delete_port(dp);
|
||||||
|
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
@ -350,8 +347,10 @@ create_port(struct seq_oss_devinfo *dp)
|
||||||
static int
|
static int
|
||||||
delete_port(struct seq_oss_devinfo *dp)
|
delete_port(struct seq_oss_devinfo *dp)
|
||||||
{
|
{
|
||||||
if (dp->port < 0)
|
if (dp->port < 0) {
|
||||||
|
kfree(dp);
|
||||||
return 0;
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
debug_printk(("delete_port %i\n", dp->port));
|
debug_printk(("delete_port %i\n", dp->port));
|
||||||
return snd_seq_event_port_detach(dp->cseq, dp->port);
|
return snd_seq_event_port_detach(dp->cseq, dp->port);
|
||||||
|
|
|
@ -764,9 +764,9 @@ static long io[SNDRV_CARDS] = SNDRV_DEFAULT_PORT;
|
||||||
static int irq[SNDRV_CARDS] = SNDRV_DEFAULT_IRQ;
|
static int irq[SNDRV_CARDS] = SNDRV_DEFAULT_IRQ;
|
||||||
static long mem[SNDRV_CARDS] = SNDRV_DEFAULT_PORT;
|
static long mem[SNDRV_CARDS] = SNDRV_DEFAULT_PORT;
|
||||||
|
|
||||||
|
#ifndef MSND_CLASSIC
|
||||||
static long cfg[SNDRV_CARDS] = SNDRV_DEFAULT_PORT;
|
static long cfg[SNDRV_CARDS] = SNDRV_DEFAULT_PORT;
|
||||||
|
|
||||||
#ifndef MSND_CLASSIC
|
|
||||||
/* Extra Peripheral Configuration (Default: Disable) */
|
/* Extra Peripheral Configuration (Default: Disable) */
|
||||||
static long ide_io0[SNDRV_CARDS] = SNDRV_DEFAULT_PORT;
|
static long ide_io0[SNDRV_CARDS] = SNDRV_DEFAULT_PORT;
|
||||||
static long ide_io1[SNDRV_CARDS] = SNDRV_DEFAULT_PORT;
|
static long ide_io1[SNDRV_CARDS] = SNDRV_DEFAULT_PORT;
|
||||||
|
@ -894,7 +894,11 @@ static int __devinit snd_msnd_isa_probe(struct device *pdev, unsigned int idx)
|
||||||
struct snd_card *card;
|
struct snd_card *card;
|
||||||
struct snd_msnd *chip;
|
struct snd_msnd *chip;
|
||||||
|
|
||||||
if (has_isapnp(idx) || cfg[idx] == SNDRV_AUTO_PORT) {
|
if (has_isapnp(idx)
|
||||||
|
#ifndef MSND_CLASSIC
|
||||||
|
|| cfg[idx] == SNDRV_AUTO_PORT
|
||||||
|
#endif
|
||||||
|
) {
|
||||||
printk(KERN_INFO LOGNAME ": Assuming PnP mode\n");
|
printk(KERN_INFO LOGNAME ": Assuming PnP mode\n");
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
}
|
}
|
||||||
|
|
|
@ -4536,7 +4536,7 @@ int snd_hda_parse_pin_def_config(struct hda_codec *codec,
|
||||||
cfg->hp_outs--;
|
cfg->hp_outs--;
|
||||||
memmove(cfg->hp_pins + i, cfg->hp_pins + i + 1,
|
memmove(cfg->hp_pins + i, cfg->hp_pins + i + 1,
|
||||||
sizeof(cfg->hp_pins[0]) * (cfg->hp_outs - i));
|
sizeof(cfg->hp_pins[0]) * (cfg->hp_outs - i));
|
||||||
memmove(sequences_hp + i - 1, sequences_hp + i,
|
memmove(sequences_hp + i, sequences_hp + i + 1,
|
||||||
sizeof(sequences_hp[0]) * (cfg->hp_outs - i));
|
sizeof(sequences_hp[0]) * (cfg->hp_outs - i));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -972,6 +972,53 @@ static struct hda_verb cs_coef_init_verbs[] = {
|
||||||
{} /* terminator */
|
{} /* terminator */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/* Errata: CS4207 rev C0/C1/C2 Silicon
|
||||||
|
*
|
||||||
|
* http://www.cirrus.com/en/pubs/errata/ER880C3.pdf
|
||||||
|
*
|
||||||
|
* 6. At high temperature (TA > +85°C), the digital supply current (IVD)
|
||||||
|
* may be excessive (up to an additional 200 μA), which is most easily
|
||||||
|
* observed while the part is being held in reset (RESET# active low).
|
||||||
|
*
|
||||||
|
* Root Cause: At initial powerup of the device, the logic that drives
|
||||||
|
* the clock and write enable to the S/PDIF SRC RAMs is not properly
|
||||||
|
* initialized.
|
||||||
|
* Certain random patterns will cause a steady leakage current in those
|
||||||
|
* RAM cells. The issue will resolve once the SRCs are used (turned on).
|
||||||
|
*
|
||||||
|
* Workaround: The following verb sequence briefly turns on the S/PDIF SRC
|
||||||
|
* blocks, which will alleviate the issue.
|
||||||
|
*/
|
||||||
|
|
||||||
|
static struct hda_verb cs_errata_init_verbs[] = {
|
||||||
|
{0x01, AC_VERB_SET_POWER_STATE, 0x00}, /* AFG: D0 */
|
||||||
|
{0x11, AC_VERB_SET_PROC_STATE, 0x01}, /* VPW: processing on */
|
||||||
|
|
||||||
|
{0x11, AC_VERB_SET_COEF_INDEX, 0x0008},
|
||||||
|
{0x11, AC_VERB_SET_PROC_COEF, 0x9999},
|
||||||
|
{0x11, AC_VERB_SET_COEF_INDEX, 0x0017},
|
||||||
|
{0x11, AC_VERB_SET_PROC_COEF, 0xa412},
|
||||||
|
{0x11, AC_VERB_SET_COEF_INDEX, 0x0001},
|
||||||
|
{0x11, AC_VERB_SET_PROC_COEF, 0x0009},
|
||||||
|
|
||||||
|
{0x07, AC_VERB_SET_POWER_STATE, 0x00}, /* S/PDIF Rx: D0 */
|
||||||
|
{0x08, AC_VERB_SET_POWER_STATE, 0x00}, /* S/PDIF Tx: D0 */
|
||||||
|
|
||||||
|
{0x11, AC_VERB_SET_COEF_INDEX, 0x0017},
|
||||||
|
{0x11, AC_VERB_SET_PROC_COEF, 0x2412},
|
||||||
|
{0x11, AC_VERB_SET_COEF_INDEX, 0x0008},
|
||||||
|
{0x11, AC_VERB_SET_PROC_COEF, 0x0000},
|
||||||
|
{0x11, AC_VERB_SET_COEF_INDEX, 0x0001},
|
||||||
|
{0x11, AC_VERB_SET_PROC_COEF, 0x0008},
|
||||||
|
{0x11, AC_VERB_SET_PROC_STATE, 0x00},
|
||||||
|
|
||||||
|
{0x07, AC_VERB_SET_POWER_STATE, 0x03}, /* S/PDIF Rx: D3 */
|
||||||
|
{0x08, AC_VERB_SET_POWER_STATE, 0x03}, /* S/PDIF Tx: D3 */
|
||||||
|
/*{0x01, AC_VERB_SET_POWER_STATE, 0x03},*/ /* AFG: D3 This is already handled */
|
||||||
|
|
||||||
|
{} /* terminator */
|
||||||
|
};
|
||||||
|
|
||||||
/* SPDIF setup */
|
/* SPDIF setup */
|
||||||
static void init_digital(struct hda_codec *codec)
|
static void init_digital(struct hda_codec *codec)
|
||||||
{
|
{
|
||||||
|
@ -991,6 +1038,9 @@ static int cs_init(struct hda_codec *codec)
|
||||||
{
|
{
|
||||||
struct cs_spec *spec = codec->spec;
|
struct cs_spec *spec = codec->spec;
|
||||||
|
|
||||||
|
/* init_verb sequence for C0/C1/C2 errata*/
|
||||||
|
snd_hda_sequence_write(codec, cs_errata_init_verbs);
|
||||||
|
|
||||||
snd_hda_sequence_write(codec, cs_coef_init_verbs);
|
snd_hda_sequence_write(codec, cs_coef_init_verbs);
|
||||||
|
|
||||||
if (spec->gpio_mask) {
|
if (spec->gpio_mask) {
|
||||||
|
|
|
@ -116,6 +116,7 @@ struct conexant_spec {
|
||||||
unsigned int dell_vostro:1;
|
unsigned int dell_vostro:1;
|
||||||
unsigned int ideapad:1;
|
unsigned int ideapad:1;
|
||||||
unsigned int thinkpad:1;
|
unsigned int thinkpad:1;
|
||||||
|
unsigned int hp_laptop:1;
|
||||||
|
|
||||||
unsigned int ext_mic_present;
|
unsigned int ext_mic_present;
|
||||||
unsigned int recording;
|
unsigned int recording;
|
||||||
|
@ -2299,6 +2300,18 @@ static void cxt5066_ideapad_automic(struct hda_codec *codec)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* toggle input of built-in digital mic and mic jack appropriately */
|
||||||
|
static void cxt5066_hp_laptop_automic(struct hda_codec *codec)
|
||||||
|
{
|
||||||
|
unsigned int present;
|
||||||
|
|
||||||
|
present = snd_hda_jack_detect(codec, 0x1b);
|
||||||
|
snd_printdd("CXT5066: external microphone present=%d\n", present);
|
||||||
|
snd_hda_codec_write(codec, 0x17, 0, AC_VERB_SET_CONNECT_SEL,
|
||||||
|
present ? 1 : 3);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/* toggle input of built-in digital mic and mic jack appropriately
|
/* toggle input of built-in digital mic and mic jack appropriately
|
||||||
order is: external mic -> dock mic -> interal mic */
|
order is: external mic -> dock mic -> interal mic */
|
||||||
static void cxt5066_thinkpad_automic(struct hda_codec *codec)
|
static void cxt5066_thinkpad_automic(struct hda_codec *codec)
|
||||||
|
@ -2407,6 +2420,20 @@ static void cxt5066_ideapad_event(struct hda_codec *codec, unsigned int res)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* unsolicited event for jack sensing */
|
||||||
|
static void cxt5066_hp_laptop_event(struct hda_codec *codec, unsigned int res)
|
||||||
|
{
|
||||||
|
snd_printdd("CXT5066_hp_laptop: unsol event %x (%x)\n", res, res >> 26);
|
||||||
|
switch (res >> 26) {
|
||||||
|
case CONEXANT_HP_EVENT:
|
||||||
|
cxt5066_hp_automute(codec);
|
||||||
|
break;
|
||||||
|
case CONEXANT_MIC_EVENT:
|
||||||
|
cxt5066_hp_laptop_automic(codec);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* unsolicited event for jack sensing */
|
/* unsolicited event for jack sensing */
|
||||||
static void cxt5066_thinkpad_event(struct hda_codec *codec, unsigned int res)
|
static void cxt5066_thinkpad_event(struct hda_codec *codec, unsigned int res)
|
||||||
{
|
{
|
||||||
|
@ -2989,6 +3016,14 @@ static struct hda_verb cxt5066_init_verbs_portd_lo[] = {
|
||||||
{ } /* end */
|
{ } /* end */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
static struct hda_verb cxt5066_init_verbs_hp_laptop[] = {
|
||||||
|
{0x14, AC_VERB_SET_CONNECT_SEL, 0x0},
|
||||||
|
{0x19, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | CONEXANT_HP_EVENT},
|
||||||
|
{0x1b, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | CONEXANT_MIC_EVENT},
|
||||||
|
{ } /* end */
|
||||||
|
};
|
||||||
|
|
||||||
/* initialize jack-sensing, too */
|
/* initialize jack-sensing, too */
|
||||||
static int cxt5066_init(struct hda_codec *codec)
|
static int cxt5066_init(struct hda_codec *codec)
|
||||||
{
|
{
|
||||||
|
@ -3004,6 +3039,8 @@ static int cxt5066_init(struct hda_codec *codec)
|
||||||
cxt5066_ideapad_automic(codec);
|
cxt5066_ideapad_automic(codec);
|
||||||
else if (spec->thinkpad)
|
else if (spec->thinkpad)
|
||||||
cxt5066_thinkpad_automic(codec);
|
cxt5066_thinkpad_automic(codec);
|
||||||
|
else if (spec->hp_laptop)
|
||||||
|
cxt5066_hp_laptop_automic(codec);
|
||||||
}
|
}
|
||||||
cxt5066_set_mic_boost(codec);
|
cxt5066_set_mic_boost(codec);
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -3031,6 +3068,7 @@ enum {
|
||||||
CXT5066_DELL_VOSTO, /* Dell Vostro 1015i */
|
CXT5066_DELL_VOSTO, /* Dell Vostro 1015i */
|
||||||
CXT5066_IDEAPAD, /* Lenovo IdeaPad U150 */
|
CXT5066_IDEAPAD, /* Lenovo IdeaPad U150 */
|
||||||
CXT5066_THINKPAD, /* Lenovo ThinkPad T410s, others? */
|
CXT5066_THINKPAD, /* Lenovo ThinkPad T410s, others? */
|
||||||
|
CXT5066_HP_LAPTOP, /* HP Laptop */
|
||||||
CXT5066_MODELS
|
CXT5066_MODELS
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -3041,6 +3079,7 @@ static const char *cxt5066_models[CXT5066_MODELS] = {
|
||||||
[CXT5066_DELL_VOSTO] = "dell-vostro",
|
[CXT5066_DELL_VOSTO] = "dell-vostro",
|
||||||
[CXT5066_IDEAPAD] = "ideapad",
|
[CXT5066_IDEAPAD] = "ideapad",
|
||||||
[CXT5066_THINKPAD] = "thinkpad",
|
[CXT5066_THINKPAD] = "thinkpad",
|
||||||
|
[CXT5066_HP_LAPTOP] = "hp-laptop",
|
||||||
};
|
};
|
||||||
|
|
||||||
static struct snd_pci_quirk cxt5066_cfg_tbl[] = {
|
static struct snd_pci_quirk cxt5066_cfg_tbl[] = {
|
||||||
|
@ -3052,8 +3091,10 @@ static struct snd_pci_quirk cxt5066_cfg_tbl[] = {
|
||||||
SND_PCI_QUIRK(0x1028, 0x02d8, "Dell Vostro", CXT5066_DELL_VOSTO),
|
SND_PCI_QUIRK(0x1028, 0x02d8, "Dell Vostro", CXT5066_DELL_VOSTO),
|
||||||
SND_PCI_QUIRK(0x1028, 0x0402, "Dell Vostro", CXT5066_DELL_VOSTO),
|
SND_PCI_QUIRK(0x1028, 0x0402, "Dell Vostro", CXT5066_DELL_VOSTO),
|
||||||
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(0x103c, 0x360b, "HP G60", CXT5066_HP_LAPTOP),
|
||||||
SND_PCI_QUIRK(0x1179, 0xff50, "Toshiba Satellite P500-PSPGSC-01800T", CXT5066_OLPC_XO_1_5),
|
SND_PCI_QUIRK(0x1179, 0xff50, "Toshiba Satellite P500-PSPGSC-01800T", CXT5066_OLPC_XO_1_5),
|
||||||
SND_PCI_QUIRK(0x1179, 0xffe0, "Toshiba Satellite Pro T130-15F", CXT5066_OLPC_XO_1_5),
|
SND_PCI_QUIRK(0x1179, 0xffe0, "Toshiba Satellite Pro T130-15F", CXT5066_OLPC_XO_1_5),
|
||||||
|
SND_PCI_QUIRK(0x17aa, 0x20f2, "Lenovo T400s", CXT5066_THINKPAD),
|
||||||
SND_PCI_QUIRK(0x17aa, 0x21b2, "Thinkpad X100e", CXT5066_IDEAPAD),
|
SND_PCI_QUIRK(0x17aa, 0x21b2, "Thinkpad X100e", CXT5066_IDEAPAD),
|
||||||
SND_PCI_QUIRK(0x17aa, 0x21b3, "Thinkpad Edge 13 (197)", CXT5066_IDEAPAD),
|
SND_PCI_QUIRK(0x17aa, 0x21b3, "Thinkpad Edge 13 (197)", CXT5066_IDEAPAD),
|
||||||
SND_PCI_QUIRK(0x17aa, 0x21b4, "Thinkpad Edge", CXT5066_IDEAPAD),
|
SND_PCI_QUIRK(0x17aa, 0x21b4, "Thinkpad Edge", CXT5066_IDEAPAD),
|
||||||
|
@ -3116,6 +3157,23 @@ static int patch_cxt5066(struct hda_codec *codec)
|
||||||
spec->num_init_verbs++;
|
spec->num_init_verbs++;
|
||||||
spec->dell_automute = 1;
|
spec->dell_automute = 1;
|
||||||
break;
|
break;
|
||||||
|
case CXT5066_HP_LAPTOP:
|
||||||
|
codec->patch_ops.init = cxt5066_init;
|
||||||
|
codec->patch_ops.unsol_event = cxt5066_hp_laptop_event;
|
||||||
|
spec->init_verbs[spec->num_init_verbs] =
|
||||||
|
cxt5066_init_verbs_hp_laptop;
|
||||||
|
spec->num_init_verbs++;
|
||||||
|
spec->hp_laptop = 1;
|
||||||
|
spec->mixers[spec->num_mixers++] = cxt5066_mixer_master;
|
||||||
|
spec->mixers[spec->num_mixers++] = cxt5066_mixers;
|
||||||
|
/* no S/PDIF out */
|
||||||
|
spec->multiout.dig_out_nid = 0;
|
||||||
|
/* input source automatically selected */
|
||||||
|
spec->input_mux = NULL;
|
||||||
|
spec->port_d_mode = 0;
|
||||||
|
spec->mic_boost = 3; /* default 30dB gain */
|
||||||
|
break;
|
||||||
|
|
||||||
case CXT5066_OLPC_XO_1_5:
|
case CXT5066_OLPC_XO_1_5:
|
||||||
codec->patch_ops.init = cxt5066_olpc_init;
|
codec->patch_ops.init = cxt5066_olpc_init;
|
||||||
codec->patch_ops.unsol_event = cxt5066_olpc_unsol_event;
|
codec->patch_ops.unsol_event = cxt5066_olpc_unsol_event;
|
||||||
|
|
|
@ -5334,6 +5334,7 @@ static void fillup_priv_adc_nids(struct hda_codec *codec, hda_nid_t *nids,
|
||||||
|
|
||||||
static struct snd_pci_quirk beep_white_list[] = {
|
static struct snd_pci_quirk beep_white_list[] = {
|
||||||
SND_PCI_QUIRK(0x1043, 0x829f, "ASUS", 1),
|
SND_PCI_QUIRK(0x1043, 0x829f, "ASUS", 1),
|
||||||
|
SND_PCI_QUIRK(0x1043, 0x83ce, "EeePC", 1),
|
||||||
SND_PCI_QUIRK(0x8086, 0xd613, "Intel", 1),
|
SND_PCI_QUIRK(0x8086, 0xd613, "Intel", 1),
|
||||||
{}
|
{}
|
||||||
};
|
};
|
||||||
|
|
|
@ -155,6 +155,7 @@ void oxygen_pci_remove(struct pci_dev *pci);
|
||||||
int oxygen_pci_suspend(struct pci_dev *pci, pm_message_t state);
|
int oxygen_pci_suspend(struct pci_dev *pci, pm_message_t state);
|
||||||
int oxygen_pci_resume(struct pci_dev *pci);
|
int oxygen_pci_resume(struct pci_dev *pci);
|
||||||
#endif
|
#endif
|
||||||
|
void oxygen_pci_shutdown(struct pci_dev *pci);
|
||||||
|
|
||||||
/* oxygen_mixer.c */
|
/* oxygen_mixer.c */
|
||||||
|
|
||||||
|
|
|
@ -519,16 +519,21 @@ static void oxygen_init(struct oxygen *chip)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void oxygen_card_free(struct snd_card *card)
|
static void oxygen_shutdown(struct oxygen *chip)
|
||||||
{
|
{
|
||||||
struct oxygen *chip = card->private_data;
|
|
||||||
|
|
||||||
spin_lock_irq(&chip->reg_lock);
|
spin_lock_irq(&chip->reg_lock);
|
||||||
chip->interrupt_mask = 0;
|
chip->interrupt_mask = 0;
|
||||||
chip->pcm_running = 0;
|
chip->pcm_running = 0;
|
||||||
oxygen_write16(chip, OXYGEN_DMA_STATUS, 0);
|
oxygen_write16(chip, OXYGEN_DMA_STATUS, 0);
|
||||||
oxygen_write16(chip, OXYGEN_INTERRUPT_MASK, 0);
|
oxygen_write16(chip, OXYGEN_INTERRUPT_MASK, 0);
|
||||||
spin_unlock_irq(&chip->reg_lock);
|
spin_unlock_irq(&chip->reg_lock);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void oxygen_card_free(struct snd_card *card)
|
||||||
|
{
|
||||||
|
struct oxygen *chip = card->private_data;
|
||||||
|
|
||||||
|
oxygen_shutdown(chip);
|
||||||
if (chip->irq >= 0)
|
if (chip->irq >= 0)
|
||||||
free_irq(chip->irq, chip);
|
free_irq(chip->irq, chip);
|
||||||
flush_scheduled_work();
|
flush_scheduled_work();
|
||||||
|
@ -778,3 +783,13 @@ int oxygen_pci_resume(struct pci_dev *pci)
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL(oxygen_pci_resume);
|
EXPORT_SYMBOL(oxygen_pci_resume);
|
||||||
#endif /* CONFIG_PM */
|
#endif /* CONFIG_PM */
|
||||||
|
|
||||||
|
void oxygen_pci_shutdown(struct pci_dev *pci)
|
||||||
|
{
|
||||||
|
struct snd_card *card = pci_get_drvdata(pci);
|
||||||
|
struct oxygen *chip = card->private_data;
|
||||||
|
|
||||||
|
oxygen_shutdown(chip);
|
||||||
|
chip->model.cleanup(chip);
|
||||||
|
}
|
||||||
|
EXPORT_SYMBOL(oxygen_pci_shutdown);
|
||||||
|
|
|
@ -95,6 +95,7 @@ static struct pci_driver xonar_driver = {
|
||||||
.suspend = oxygen_pci_suspend,
|
.suspend = oxygen_pci_suspend,
|
||||||
.resume = oxygen_pci_resume,
|
.resume = oxygen_pci_resume,
|
||||||
#endif
|
#endif
|
||||||
|
.shutdown = oxygen_pci_shutdown,
|
||||||
};
|
};
|
||||||
|
|
||||||
static int __init alsa_card_xonar_init(void)
|
static int __init alsa_card_xonar_init(void)
|
||||||
|
|
|
@ -53,6 +53,8 @@ struct xonar_wm87x6 {
|
||||||
struct xonar_generic generic;
|
struct xonar_generic generic;
|
||||||
u16 wm8776_regs[0x17];
|
u16 wm8776_regs[0x17];
|
||||||
u16 wm8766_regs[0x10];
|
u16 wm8766_regs[0x10];
|
||||||
|
struct snd_kcontrol *line_adcmux_control;
|
||||||
|
struct snd_kcontrol *mic_adcmux_control;
|
||||||
struct snd_kcontrol *lc_controls[13];
|
struct snd_kcontrol *lc_controls[13];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -193,6 +195,7 @@ static void xonar_ds_init(struct oxygen *chip)
|
||||||
static void xonar_ds_cleanup(struct oxygen *chip)
|
static void xonar_ds_cleanup(struct oxygen *chip)
|
||||||
{
|
{
|
||||||
xonar_disable_output(chip);
|
xonar_disable_output(chip);
|
||||||
|
wm8776_write(chip, WM8776_RESET, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void xonar_ds_suspend(struct oxygen *chip)
|
static void xonar_ds_suspend(struct oxygen *chip)
|
||||||
|
@ -603,6 +606,7 @@ static int wm8776_input_mux_put(struct snd_kcontrol *ctl,
|
||||||
{
|
{
|
||||||
struct oxygen *chip = ctl->private_data;
|
struct oxygen *chip = ctl->private_data;
|
||||||
struct xonar_wm87x6 *data = chip->model_data;
|
struct xonar_wm87x6 *data = chip->model_data;
|
||||||
|
struct snd_kcontrol *other_ctl;
|
||||||
unsigned int mux_bit = ctl->private_value;
|
unsigned int mux_bit = ctl->private_value;
|
||||||
u16 reg;
|
u16 reg;
|
||||||
int changed;
|
int changed;
|
||||||
|
@ -610,8 +614,18 @@ static int wm8776_input_mux_put(struct snd_kcontrol *ctl,
|
||||||
mutex_lock(&chip->mutex);
|
mutex_lock(&chip->mutex);
|
||||||
reg = data->wm8776_regs[WM8776_ADCMUX];
|
reg = data->wm8776_regs[WM8776_ADCMUX];
|
||||||
if (value->value.integer.value[0]) {
|
if (value->value.integer.value[0]) {
|
||||||
reg &= ~0x003;
|
|
||||||
reg |= mux_bit;
|
reg |= mux_bit;
|
||||||
|
/* line-in and mic-in are exclusive */
|
||||||
|
mux_bit ^= 3;
|
||||||
|
if (reg & mux_bit) {
|
||||||
|
reg &= ~mux_bit;
|
||||||
|
if (mux_bit == 1)
|
||||||
|
other_ctl = data->line_adcmux_control;
|
||||||
|
else
|
||||||
|
other_ctl = data->mic_adcmux_control;
|
||||||
|
snd_ctl_notify(chip->card, SNDRV_CTL_EVENT_MASK_VALUE,
|
||||||
|
&other_ctl->id);
|
||||||
|
}
|
||||||
} else
|
} else
|
||||||
reg &= ~mux_bit;
|
reg &= ~mux_bit;
|
||||||
changed = reg != data->wm8776_regs[WM8776_ADCMUX];
|
changed = reg != data->wm8776_regs[WM8776_ADCMUX];
|
||||||
|
@ -963,7 +977,13 @@ static int xonar_ds_mixer_init(struct oxygen *chip)
|
||||||
err = snd_ctl_add(chip->card, ctl);
|
err = snd_ctl_add(chip->card, ctl);
|
||||||
if (err < 0)
|
if (err < 0)
|
||||||
return err;
|
return err;
|
||||||
|
if (!strcmp(ctl->id.name, "Line Capture Switch"))
|
||||||
|
data->line_adcmux_control = ctl;
|
||||||
|
else if (!strcmp(ctl->id.name, "Mic Capture Switch"))
|
||||||
|
data->mic_adcmux_control = ctl;
|
||||||
}
|
}
|
||||||
|
if (!data->line_adcmux_control || !data->mic_adcmux_control)
|
||||||
|
return -ENXIO;
|
||||||
BUILD_BUG_ON(ARRAY_SIZE(lc_controls) != ARRAY_SIZE(data->lc_controls));
|
BUILD_BUG_ON(ARRAY_SIZE(lc_controls) != ARRAY_SIZE(data->lc_controls));
|
||||||
for (i = 0; i < ARRAY_SIZE(lc_controls); ++i) {
|
for (i = 0; i < ARRAY_SIZE(lc_controls); ++i) {
|
||||||
ctl = snd_ctl_new1(&lc_controls[i], chip);
|
ctl = snd_ctl_new1(&lc_controls[i], chip);
|
||||||
|
|
|
@ -126,7 +126,7 @@ static void snd_usb_stream_disconnect(struct list_head *head)
|
||||||
for (idx = 0; idx < 2; idx++) {
|
for (idx = 0; idx < 2; idx++) {
|
||||||
subs = &as->substream[idx];
|
subs = &as->substream[idx];
|
||||||
if (!subs->num_formats)
|
if (!subs->num_formats)
|
||||||
return;
|
continue;
|
||||||
snd_usb_release_substream_urbs(subs, 1);
|
snd_usb_release_substream_urbs(subs, 1);
|
||||||
subs->interface = -1;
|
subs->interface = -1;
|
||||||
}
|
}
|
||||||
|
@ -216,6 +216,11 @@ static int snd_usb_create_streams(struct snd_usb_audio *chip, int ctrlif)
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (protocol) {
|
switch (protocol) {
|
||||||
|
default:
|
||||||
|
snd_printdd(KERN_WARNING "unknown interface protocol %#02x, assuming v1\n",
|
||||||
|
protocol);
|
||||||
|
/* fall through */
|
||||||
|
|
||||||
case UAC_VERSION_1: {
|
case UAC_VERSION_1: {
|
||||||
struct uac1_ac_header_descriptor *h1 = control_header;
|
struct uac1_ac_header_descriptor *h1 = control_header;
|
||||||
|
|
||||||
|
@ -253,10 +258,6 @@ static int snd_usb_create_streams(struct snd_usb_audio *chip, int ctrlif)
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
default:
|
|
||||||
snd_printk(KERN_ERR "unknown protocol version 0x%02x\n", protocol);
|
|
||||||
return -EINVAL;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -465,7 +466,13 @@ static void *snd_usb_audio_probe(struct usb_device *dev,
|
||||||
goto __error;
|
goto __error;
|
||||||
}
|
}
|
||||||
|
|
||||||
chip->ctrl_intf = alts;
|
/*
|
||||||
|
* For devices with more than one control interface, we assume the
|
||||||
|
* first contains the audio controls. We might need a more specific
|
||||||
|
* check here in the future.
|
||||||
|
*/
|
||||||
|
if (!chip->ctrl_intf)
|
||||||
|
chip->ctrl_intf = alts;
|
||||||
|
|
||||||
if (err > 0) {
|
if (err > 0) {
|
||||||
/* create normal USB audio interfaces */
|
/* create normal USB audio interfaces */
|
||||||
|
|
|
@ -295,12 +295,11 @@ int snd_usb_init_sample_rate(struct snd_usb_audio *chip, int iface,
|
||||||
|
|
||||||
switch (altsd->bInterfaceProtocol) {
|
switch (altsd->bInterfaceProtocol) {
|
||||||
case UAC_VERSION_1:
|
case UAC_VERSION_1:
|
||||||
|
default:
|
||||||
return set_sample_rate_v1(chip, iface, alts, fmt, rate);
|
return set_sample_rate_v1(chip, iface, alts, fmt, rate);
|
||||||
|
|
||||||
case UAC_VERSION_2:
|
case UAC_VERSION_2:
|
||||||
return set_sample_rate_v2(chip, iface, alts, fmt, rate);
|
return set_sample_rate_v2(chip, iface, alts, fmt, rate);
|
||||||
}
|
}
|
||||||
|
|
||||||
return -EINVAL;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -275,6 +275,12 @@ int snd_usb_parse_audio_endpoints(struct snd_usb_audio *chip, int iface_no)
|
||||||
|
|
||||||
/* get audio formats */
|
/* get audio formats */
|
||||||
switch (protocol) {
|
switch (protocol) {
|
||||||
|
default:
|
||||||
|
snd_printdd(KERN_WARNING "%d:%u:%d: unknown interface protocol %#02x, assuming v1\n",
|
||||||
|
dev->devnum, iface_no, altno, protocol);
|
||||||
|
protocol = UAC_VERSION_1;
|
||||||
|
/* fall through */
|
||||||
|
|
||||||
case UAC_VERSION_1: {
|
case UAC_VERSION_1: {
|
||||||
struct uac1_as_header_descriptor *as =
|
struct uac1_as_header_descriptor *as =
|
||||||
snd_usb_find_csint_desc(alts->extra, alts->extralen, NULL, UAC_AS_GENERAL);
|
snd_usb_find_csint_desc(alts->extra, alts->extralen, NULL, UAC_AS_GENERAL);
|
||||||
|
@ -336,11 +342,6 @@ int snd_usb_parse_audio_endpoints(struct snd_usb_audio *chip, int iface_no)
|
||||||
dev->devnum, iface_no, altno, as->bTerminalLink);
|
dev->devnum, iface_no, altno, as->bTerminalLink);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
default:
|
|
||||||
snd_printk(KERN_ERR "%d:%u:%d : unknown interface protocol %04x\n",
|
|
||||||
dev->devnum, iface_no, altno, protocol);
|
|
||||||
continue;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* get format type */
|
/* get format type */
|
||||||
|
|
|
@ -49,7 +49,8 @@ static u64 parse_audio_format_i_type(struct snd_usb_audio *chip,
|
||||||
u64 pcm_formats;
|
u64 pcm_formats;
|
||||||
|
|
||||||
switch (protocol) {
|
switch (protocol) {
|
||||||
case UAC_VERSION_1: {
|
case UAC_VERSION_1:
|
||||||
|
default: {
|
||||||
struct uac_format_type_i_discrete_descriptor *fmt = _fmt;
|
struct uac_format_type_i_discrete_descriptor *fmt = _fmt;
|
||||||
sample_width = fmt->bBitResolution;
|
sample_width = fmt->bBitResolution;
|
||||||
sample_bytes = fmt->bSubframeSize;
|
sample_bytes = fmt->bSubframeSize;
|
||||||
|
@ -64,9 +65,6 @@ static u64 parse_audio_format_i_type(struct snd_usb_audio *chip,
|
||||||
format <<= 1;
|
format <<= 1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
default:
|
|
||||||
return -EINVAL;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pcm_formats = 0;
|
pcm_formats = 0;
|
||||||
|
@ -384,6 +382,10 @@ static int parse_audio_format_i(struct snd_usb_audio *chip,
|
||||||
* audio class v2 uses class specific EP0 range requests for that.
|
* audio class v2 uses class specific EP0 range requests for that.
|
||||||
*/
|
*/
|
||||||
switch (protocol) {
|
switch (protocol) {
|
||||||
|
default:
|
||||||
|
snd_printdd(KERN_WARNING "%d:%u:%d : invalid protocol version %d, assuming v1\n",
|
||||||
|
chip->dev->devnum, fp->iface, fp->altsetting, protocol);
|
||||||
|
/* fall through */
|
||||||
case UAC_VERSION_1:
|
case UAC_VERSION_1:
|
||||||
fp->channels = fmt->bNrChannels;
|
fp->channels = fmt->bNrChannels;
|
||||||
ret = parse_audio_format_rates_v1(chip, fp, (unsigned char *) fmt, 7);
|
ret = parse_audio_format_rates_v1(chip, fp, (unsigned char *) fmt, 7);
|
||||||
|
@ -392,10 +394,6 @@ static int parse_audio_format_i(struct snd_usb_audio *chip,
|
||||||
/* fp->channels is already set in this case */
|
/* fp->channels is already set in this case */
|
||||||
ret = parse_audio_format_rates_v2(chip, fp);
|
ret = parse_audio_format_rates_v2(chip, fp);
|
||||||
break;
|
break;
|
||||||
default:
|
|
||||||
snd_printk(KERN_ERR "%d:%u:%d : invalid protocol version %d\n",
|
|
||||||
chip->dev->devnum, fp->iface, fp->altsetting, protocol);
|
|
||||||
return -EINVAL;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fp->channels < 1) {
|
if (fp->channels < 1) {
|
||||||
|
@ -438,6 +436,10 @@ static int parse_audio_format_ii(struct snd_usb_audio *chip,
|
||||||
fp->channels = 1;
|
fp->channels = 1;
|
||||||
|
|
||||||
switch (protocol) {
|
switch (protocol) {
|
||||||
|
default:
|
||||||
|
snd_printdd(KERN_WARNING "%d:%u:%d : invalid protocol version %d, assuming v1\n",
|
||||||
|
chip->dev->devnum, fp->iface, fp->altsetting, protocol);
|
||||||
|
/* fall through */
|
||||||
case UAC_VERSION_1: {
|
case UAC_VERSION_1: {
|
||||||
struct uac_format_type_ii_discrete_descriptor *fmt = _fmt;
|
struct uac_format_type_ii_discrete_descriptor *fmt = _fmt;
|
||||||
brate = le16_to_cpu(fmt->wMaxBitRate);
|
brate = le16_to_cpu(fmt->wMaxBitRate);
|
||||||
|
@ -456,10 +458,6 @@ static int parse_audio_format_ii(struct snd_usb_audio *chip,
|
||||||
ret = parse_audio_format_rates_v2(chip, fp);
|
ret = parse_audio_format_rates_v2(chip, fp);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default:
|
|
||||||
snd_printk(KERN_ERR "%d:%u:%d : invalid protocol version %d\n",
|
|
||||||
chip->dev->devnum, fp->iface, fp->altsetting, protocol);
|
|
||||||
return -EINVAL;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
|
|
@ -2175,7 +2175,15 @@ int snd_usb_create_mixer(struct snd_usb_audio *chip, int ctrlif,
|
||||||
}
|
}
|
||||||
|
|
||||||
host_iface = &usb_ifnum_to_if(chip->dev, ctrlif)->altsetting[0];
|
host_iface = &usb_ifnum_to_if(chip->dev, ctrlif)->altsetting[0];
|
||||||
mixer->protocol = get_iface_desc(host_iface)->bInterfaceProtocol;
|
switch (get_iface_desc(host_iface)->bInterfaceProtocol) {
|
||||||
|
case UAC_VERSION_1:
|
||||||
|
default:
|
||||||
|
mixer->protocol = UAC_VERSION_1;
|
||||||
|
break;
|
||||||
|
case UAC_VERSION_2:
|
||||||
|
mixer->protocol = UAC_VERSION_2;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
if ((err = snd_usb_mixer_controls(mixer)) < 0 ||
|
if ((err = snd_usb_mixer_controls(mixer)) < 0 ||
|
||||||
(err = snd_usb_mixer_status_create(mixer)) < 0)
|
(err = snd_usb_mixer_status_create(mixer)) < 0)
|
||||||
|
|
|
@ -173,13 +173,12 @@ int snd_usb_init_pitch(struct snd_usb_audio *chip, int iface,
|
||||||
|
|
||||||
switch (altsd->bInterfaceProtocol) {
|
switch (altsd->bInterfaceProtocol) {
|
||||||
case UAC_VERSION_1:
|
case UAC_VERSION_1:
|
||||||
|
default:
|
||||||
return init_pitch_v1(chip, iface, alts, fmt);
|
return init_pitch_v1(chip, iface, alts, fmt);
|
||||||
|
|
||||||
case UAC_VERSION_2:
|
case UAC_VERSION_2:
|
||||||
return init_pitch_v2(chip, iface, alts, fmt);
|
return init_pitch_v2(chip, iface, alts, fmt);
|
||||||
}
|
}
|
||||||
|
|
||||||
return -EINVAL;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
Загрузка…
Ссылка в новой задаче