aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorClemens Ladisch <clemens@ladisch.de>2008-07-28 04:28:43 -0400
committerTakashi Iwai <tiwai@suse.de>2008-08-14 04:44:13 -0400
commit5430c72b14a06b12e8fe46bca18ca0d7095fb717 (patch)
treecc426e8480a011c5f5cb88df6639d4089b2f2a62 /sound
parent9e6dd47bf365f8f7bccea10f22fbbdbecce429e8 (diff)
ALSA: virtuoso: add Xonar D1 support
Add support for the Asus Xonar D1. It is the same as the DX, but without the external power detection. Signed-off-by: Clemens Ladisch <clemens@ladisch.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound')
-rw-r--r--sound/pci/Kconfig2
-rw-r--r--sound/pci/oxygen/virtuoso.c73
2 files changed, 56 insertions, 19 deletions
diff --git a/sound/pci/Kconfig b/sound/pci/Kconfig
index f7d95b224a98..31f52d3fc21f 100644
--- a/sound/pci/Kconfig
+++ b/sound/pci/Kconfig
@@ -845,7 +845,7 @@ config SND_VIRTUOSO
845 select SND_OXYGEN_LIB 845 select SND_OXYGEN_LIB
846 help 846 help
847 Say Y here to include support for sound cards based on the 847 Say Y here to include support for sound cards based on the
848 Asus AV100/AV200 chips, i.e., Xonar D2, DX and D2X. 848 Asus AV100/AV200 chips, i.e., Xonar D1, DX, D2 and D2X.
849 849
850 To compile this driver as a module, choose M here: the module 850 To compile this driver as a module, choose M here: the module
851 will be called snd-virtuoso. 851 will be called snd-virtuoso.
diff --git a/sound/pci/oxygen/virtuoso.c b/sound/pci/oxygen/virtuoso.c
index 9a2c16bf94e0..01d7b75f9182 100644
--- a/sound/pci/oxygen/virtuoso.c
+++ b/sound/pci/oxygen/virtuoso.c
@@ -36,15 +36,15 @@
36 */ 36 */
37 37
38/* 38/*
39 * Xonar DX 39 * Xonar D1/DX
40 * -------- 40 * -----------
41 * 41 *
42 * CMI8788: 42 * CMI8788:
43 * 43 *
44 * I²C <-> CS4398 (front) 44 * I²C <-> CS4398 (front)
45 * <-> CS4362A (surround, center/LFE, back) 45 * <-> CS4362A (surround, center/LFE, back)
46 * 46 *
47 * GPI 0 <- external power present 47 * GPI 0 <- external power present (DX only)
48 * 48 *
49 * GPIO 0 -> enable output to speakers 49 * GPIO 0 -> enable output to speakers
50 * GPIO 1 -> enable front panel I/O 50 * GPIO 1 -> enable front panel I/O
@@ -96,6 +96,7 @@ MODULE_PARM_DESC(enable, "enable card");
96enum { 96enum {
97 MODEL_D2, 97 MODEL_D2,
98 MODEL_D2X, 98 MODEL_D2X,
99 MODEL_D1,
99 MODEL_DX, 100 MODEL_DX,
100}; 101};
101 102
@@ -103,6 +104,7 @@ static struct pci_device_id xonar_ids[] __devinitdata = {
103 { OXYGEN_PCI_SUBID(0x1043, 0x8269), .driver_data = MODEL_D2 }, 104 { OXYGEN_PCI_SUBID(0x1043, 0x8269), .driver_data = MODEL_D2 },
104 { OXYGEN_PCI_SUBID(0x1043, 0x8275), .driver_data = MODEL_DX }, 105 { OXYGEN_PCI_SUBID(0x1043, 0x8275), .driver_data = MODEL_DX },
105 { OXYGEN_PCI_SUBID(0x1043, 0x82b7), .driver_data = MODEL_D2X }, 106 { OXYGEN_PCI_SUBID(0x1043, 0x82b7), .driver_data = MODEL_D2X },
107 { OXYGEN_PCI_SUBID(0x1043, 0x834f), .driver_data = MODEL_D1 },
106 { } 108 { }
107}; 109};
108MODULE_DEVICE_TABLE(pci, xonar_ids); 110MODULE_DEVICE_TABLE(pci, xonar_ids);
@@ -313,15 +315,12 @@ static void cs43xx_init(struct oxygen *chip)
313 cs4362a_write(chip, 0x01, CS4362A_CPEN); 315 cs4362a_write(chip, 0x01, CS4362A_CPEN);
314} 316}
315 317
316static void xonar_dx_init(struct oxygen *chip) 318static void xonar_d1_init(struct oxygen *chip)
317{ 319{
318 struct xonar_data *data = chip->model_data; 320 struct xonar_data *data = chip->model_data;
319 321
320 data->anti_pop_delay = 800; 322 data->anti_pop_delay = 800;
321 data->output_enable_bit = GPIO_DX_OUTPUT_ENABLE; 323 data->output_enable_bit = GPIO_DX_OUTPUT_ENABLE;
322 data->ext_power_reg = OXYGEN_GPI_DATA;
323 data->ext_power_int_reg = OXYGEN_GPI_INTERRUPT_MASK;
324 data->ext_power_bit = GPI_DX_EXT_POWER;
325 data->cs4398_fm = CS4398_FM_SINGLE | CS4398_DEM_NONE | CS4398_DIF_LJUST; 324 data->cs4398_fm = CS4398_FM_SINGLE | CS4398_DEM_NONE | CS4398_DIF_LJUST;
326 data->cs4362a_fm = CS4362A_FM_SINGLE | 325 data->cs4362a_fm = CS4362A_FM_SINGLE |
327 CS4362A_ATAPI_B_R | CS4362A_ATAPI_A_L; 326 CS4362A_ATAPI_B_R | CS4362A_ATAPI_A_L;
@@ -345,6 +344,16 @@ static void xonar_dx_init(struct oxygen *chip)
345 snd_component_add(chip->card, "CS5361"); 344 snd_component_add(chip->card, "CS5361");
346} 345}
347 346
347static void xonar_dx_init(struct oxygen *chip)
348{
349 struct xonar_data *data = chip->model_data;
350
351 data->ext_power_reg = OXYGEN_GPI_DATA;
352 data->ext_power_int_reg = OXYGEN_GPI_INTERRUPT_MASK;
353 data->ext_power_bit = GPI_DX_EXT_POWER;
354 xonar_d1_init(chip);
355}
356
348static void xonar_cleanup(struct oxygen *chip) 357static void xonar_cleanup(struct oxygen *chip)
349{ 358{
350 struct xonar_data *data = chip->model_data; 359 struct xonar_data *data = chip->model_data;
@@ -352,7 +361,7 @@ static void xonar_cleanup(struct oxygen *chip)
352 oxygen_clear_bits16(chip, OXYGEN_GPIO_DATA, data->output_enable_bit); 361 oxygen_clear_bits16(chip, OXYGEN_GPIO_DATA, data->output_enable_bit);
353} 362}
354 363
355static void xonar_dx_cleanup(struct oxygen *chip) 364static void xonar_d1_cleanup(struct oxygen *chip)
356{ 365{
357 xonar_cleanup(chip); 366 xonar_cleanup(chip);
358 cs4362a_write(chip, 0x01, CS4362A_PDN | CS4362A_CPEN); 367 cs4362a_write(chip, 0x01, CS4362A_PDN | CS4362A_CPEN);
@@ -365,7 +374,7 @@ static void xonar_d2_resume(struct oxygen *chip)
365 xonar_enable_output(chip); 374 xonar_enable_output(chip);
366} 375}
367 376
368static void xonar_dx_resume(struct oxygen *chip) 377static void xonar_d1_resume(struct oxygen *chip)
369{ 378{
370 cs43xx_init(chip); 379 cs43xx_init(chip);
371 xonar_enable_output(chip); 380 xonar_enable_output(chip);
@@ -513,7 +522,7 @@ static const struct snd_kcontrol_new front_panel_switch = {
513 .put = front_panel_put, 522 .put = front_panel_put,
514}; 523};
515 524
516static void xonar_dx_ac97_switch(struct oxygen *chip, 525static void xonar_d1_ac97_switch(struct oxygen *chip,
517 unsigned int reg, unsigned int mute) 526 unsigned int reg, unsigned int mute)
518{ 527{
519 if (reg == AC97_LINE) { 528 if (reg == AC97_LINE) {
@@ -536,7 +545,7 @@ static int xonar_d2_control_filter(struct snd_kcontrol_new *template)
536 return 0; 545 return 0;
537} 546}
538 547
539static int xonar_dx_control_filter(struct snd_kcontrol_new *template) 548static int xonar_d1_control_filter(struct snd_kcontrol_new *template)
540{ 549{
541 if (!strncmp(template->name, "CD Capture ", 11)) 550 if (!strncmp(template->name, "CD Capture ", 11))
542 return 1; /* no CD input */ 551 return 1; /* no CD input */
@@ -548,7 +557,7 @@ static int xonar_mixer_init(struct oxygen *chip)
548 return snd_ctl_add(chip->card, snd_ctl_new1(&alt_switch, chip)); 557 return snd_ctl_add(chip->card, snd_ctl_new1(&alt_switch, chip));
549} 558}
550 559
551static int xonar_dx_mixer_init(struct oxygen *chip) 560static int xonar_d1_mixer_init(struct oxygen *chip)
552{ 561{
553 return snd_ctl_add(chip->card, snd_ctl_new1(&front_panel_switch, chip)); 562 return snd_ctl_add(chip->card, snd_ctl_new1(&front_panel_switch, chip));
554} 563}
@@ -615,23 +624,51 @@ static const struct oxygen_model xonar_models[] = {
615 .dac_i2s_format = OXYGEN_I2S_FORMAT_LJUST, 624 .dac_i2s_format = OXYGEN_I2S_FORMAT_LJUST,
616 .adc_i2s_format = OXYGEN_I2S_FORMAT_LJUST, 625 .adc_i2s_format = OXYGEN_I2S_FORMAT_LJUST,
617 }, 626 },
627 [MODEL_D1] = {
628 .shortname = "Xonar D1",
629 .longname = "Asus Virtuoso 100",
630 .chip = "AV200",
631 .owner = THIS_MODULE,
632 .init = xonar_d1_init,
633 .control_filter = xonar_d1_control_filter,
634 .mixer_init = xonar_d1_mixer_init,
635 .cleanup = xonar_d1_cleanup,
636 .suspend = xonar_d1_cleanup,
637 .resume = xonar_d1_resume,
638 .set_dac_params = set_cs43xx_params,
639 .set_adc_params = set_cs53x1_params,
640 .update_dac_volume = update_cs43xx_volume,
641 .update_dac_mute = update_cs43xx_mute,
642 .ac97_switch = xonar_d1_ac97_switch,
643 .dac_tlv = cs4362a_db_scale,
644 .model_data_size = sizeof(struct xonar_data),
645 .pcm_dev_cfg = PLAYBACK_0_TO_I2S |
646 PLAYBACK_1_TO_SPDIF |
647 CAPTURE_0_FROM_I2S_2,
648 .dac_channels = 8,
649 .dac_volume_min = 0,
650 .dac_volume_max = 127,
651 .function_flags = OXYGEN_FUNCTION_2WIRE,
652 .dac_i2s_format = OXYGEN_I2S_FORMAT_LJUST,
653 .adc_i2s_format = OXYGEN_I2S_FORMAT_LJUST,
654 },
618 [MODEL_DX] = { 655 [MODEL_DX] = {
619 .shortname = "Xonar DX", 656 .shortname = "Xonar DX",
620 .longname = "Asus Virtuoso 100", 657 .longname = "Asus Virtuoso 100",
621 .chip = "AV200", 658 .chip = "AV200",
622 .owner = THIS_MODULE, 659 .owner = THIS_MODULE,
623 .init = xonar_dx_init, 660 .init = xonar_dx_init,
624 .control_filter = xonar_dx_control_filter, 661 .control_filter = xonar_d1_control_filter,
625 .mixer_init = xonar_dx_mixer_init, 662 .mixer_init = xonar_d1_mixer_init,
626 .cleanup = xonar_dx_cleanup, 663 .cleanup = xonar_d1_cleanup,
627 .suspend = xonar_dx_cleanup, 664 .suspend = xonar_d1_cleanup,
628 .resume = xonar_dx_resume, 665 .resume = xonar_d1_resume,
629 .set_dac_params = set_cs43xx_params, 666 .set_dac_params = set_cs43xx_params,
630 .set_adc_params = set_cs53x1_params, 667 .set_adc_params = set_cs53x1_params,
631 .update_dac_volume = update_cs43xx_volume, 668 .update_dac_volume = update_cs43xx_volume,
632 .update_dac_mute = update_cs43xx_mute, 669 .update_dac_mute = update_cs43xx_mute,
633 .gpio_changed = xonar_gpio_changed, 670 .gpio_changed = xonar_gpio_changed,
634 .ac97_switch = xonar_dx_ac97_switch, 671 .ac97_switch = xonar_d1_ac97_switch,
635 .dac_tlv = cs4362a_db_scale, 672 .dac_tlv = cs4362a_db_scale,
636 .model_data_size = sizeof(struct xonar_data), 673 .model_data_size = sizeof(struct xonar_data),
637 .pcm_dev_cfg = PLAYBACK_0_TO_I2S | 674 .pcm_dev_cfg = PLAYBACK_0_TO_I2S |