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>

authored by Clemens Ladisch and committed by Takashi Iwai 5430c72b 9e6dd47b

+58 -27
+2 -8
Documentation/sound/alsa/ALSA-Configuration.txt
··· 1144 1144 1145 1145 This module supports autoprobe and multiple cards. 1146 1146 1147 - Power management is _not_ supported. 1148 - 1149 1147 Module snd-ice1712 1150 1148 ------------------ 1151 1149 ··· 1626 1628 1627 1629 This module supports autoprobe and multiple cards. 1628 1630 1629 - Power management is _not_ supported. 1630 - 1631 1631 Module snd-pcsp 1632 1632 ----------------- 1633 1633 ··· 2077 2081 Module snd-virtuoso 2078 2082 ------------------- 2079 2083 2080 - Module for sound cards based on the Asus AV200 chip, i.e., 2081 - Xonar D2 and Xonar D2X. 2084 + Module for sound cards based on the Asus AV100/AV200 chips, 2085 + i.e., Xonar D1, DX, D2 and D2X. 2082 2086 2083 2087 This module supports autoprobe and multiple cards. 2084 - 2085 - Power management is _not_ supported. 2086 2088 2087 2089 Module snd-vx222 2088 2090 ----------------
+1 -1
sound/pci/Kconfig
··· 845 845 select SND_OXYGEN_LIB 846 846 help 847 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 850 To compile this driver as a module, choose M here: the module 851 851 will be called snd-virtuoso.
+55 -18
sound/pci/oxygen/virtuoso.c
··· 36 36 */ 37 37 38 38 /* 39 - * Xonar DX 40 - * -------- 39 + * Xonar D1/DX 40 + * ----------- 41 41 * 42 42 * CMI8788: 43 43 * 44 44 * I²C <-> CS4398 (front) 45 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 49 * GPIO 0 -> enable output to speakers 50 50 * GPIO 1 -> enable front panel I/O ··· 96 96 enum { 97 97 MODEL_D2, 98 98 MODEL_D2X, 99 + MODEL_D1, 99 100 MODEL_DX, 100 101 }; 101 102 ··· 104 103 { OXYGEN_PCI_SUBID(0x1043, 0x8269), .driver_data = MODEL_D2 }, 105 104 { OXYGEN_PCI_SUBID(0x1043, 0x8275), .driver_data = MODEL_DX }, 106 105 { OXYGEN_PCI_SUBID(0x1043, 0x82b7), .driver_data = MODEL_D2X }, 106 + { OXYGEN_PCI_SUBID(0x1043, 0x834f), .driver_data = MODEL_D1 }, 107 107 { } 108 108 }; 109 109 MODULE_DEVICE_TABLE(pci, xonar_ids); ··· 315 313 cs4362a_write(chip, 0x01, CS4362A_CPEN); 316 314 } 317 315 318 - static void xonar_dx_init(struct oxygen *chip) 316 + static void xonar_d1_init(struct oxygen *chip) 319 317 { 320 318 struct xonar_data *data = chip->model_data; 321 319 322 320 data->anti_pop_delay = 800; 323 321 data->output_enable_bit = GPIO_DX_OUTPUT_ENABLE; 324 - data->ext_power_reg = OXYGEN_GPI_DATA; 325 - data->ext_power_int_reg = OXYGEN_GPI_INTERRUPT_MASK; 326 - data->ext_power_bit = GPI_DX_EXT_POWER; 327 322 data->cs4398_fm = CS4398_FM_SINGLE | CS4398_DEM_NONE | CS4398_DIF_LJUST; 328 323 data->cs4362a_fm = CS4362A_FM_SINGLE | 329 324 CS4362A_ATAPI_B_R | CS4362A_ATAPI_A_L; ··· 344 345 snd_component_add(chip->card, "CS5361"); 345 346 } 346 347 348 + static void xonar_dx_init(struct oxygen *chip) 349 + { 350 + struct xonar_data *data = chip->model_data; 351 + 352 + data->ext_power_reg = OXYGEN_GPI_DATA; 353 + data->ext_power_int_reg = OXYGEN_GPI_INTERRUPT_MASK; 354 + data->ext_power_bit = GPI_DX_EXT_POWER; 355 + xonar_d1_init(chip); 356 + } 357 + 347 358 static void xonar_cleanup(struct oxygen *chip) 348 359 { 349 360 struct xonar_data *data = chip->model_data; ··· 361 352 oxygen_clear_bits16(chip, OXYGEN_GPIO_DATA, data->output_enable_bit); 362 353 } 363 354 364 - static void xonar_dx_cleanup(struct oxygen *chip) 355 + static void xonar_d1_cleanup(struct oxygen *chip) 365 356 { 366 357 xonar_cleanup(chip); 367 358 cs4362a_write(chip, 0x01, CS4362A_PDN | CS4362A_CPEN); ··· 374 365 xonar_enable_output(chip); 375 366 } 376 367 377 - static void xonar_dx_resume(struct oxygen *chip) 368 + static void xonar_d1_resume(struct oxygen *chip) 378 369 { 379 370 cs43xx_init(chip); 380 371 xonar_enable_output(chip); ··· 522 513 .put = front_panel_put, 523 514 }; 524 515 525 - static void xonar_dx_ac97_switch(struct oxygen *chip, 516 + static void xonar_d1_ac97_switch(struct oxygen *chip, 526 517 unsigned int reg, unsigned int mute) 527 518 { 528 519 if (reg == AC97_LINE) { ··· 545 536 return 0; 546 537 } 547 538 548 - static int xonar_dx_control_filter(struct snd_kcontrol_new *template) 539 + static int xonar_d1_control_filter(struct snd_kcontrol_new *template) 549 540 { 550 541 if (!strncmp(template->name, "CD Capture ", 11)) 551 542 return 1; /* no CD input */ ··· 557 548 return snd_ctl_add(chip->card, snd_ctl_new1(&alt_switch, chip)); 558 549 } 559 550 560 - static int xonar_dx_mixer_init(struct oxygen *chip) 551 + static int xonar_d1_mixer_init(struct oxygen *chip) 561 552 { 562 553 return snd_ctl_add(chip->card, snd_ctl_new1(&front_panel_switch, chip)); 563 554 } ··· 624 615 .dac_i2s_format = OXYGEN_I2S_FORMAT_LJUST, 625 616 .adc_i2s_format = OXYGEN_I2S_FORMAT_LJUST, 626 617 }, 618 + [MODEL_D1] = { 619 + .shortname = "Xonar D1", 620 + .longname = "Asus Virtuoso 100", 621 + .chip = "AV200", 622 + .owner = THIS_MODULE, 623 + .init = xonar_d1_init, 624 + .control_filter = xonar_d1_control_filter, 625 + .mixer_init = xonar_d1_mixer_init, 626 + .cleanup = xonar_d1_cleanup, 627 + .suspend = xonar_d1_cleanup, 628 + .resume = xonar_d1_resume, 629 + .set_dac_params = set_cs43xx_params, 630 + .set_adc_params = set_cs53x1_params, 631 + .update_dac_volume = update_cs43xx_volume, 632 + .update_dac_mute = update_cs43xx_mute, 633 + .ac97_switch = xonar_d1_ac97_switch, 634 + .dac_tlv = cs4362a_db_scale, 635 + .model_data_size = sizeof(struct xonar_data), 636 + .pcm_dev_cfg = PLAYBACK_0_TO_I2S | 637 + PLAYBACK_1_TO_SPDIF | 638 + CAPTURE_0_FROM_I2S_2, 639 + .dac_channels = 8, 640 + .dac_volume_min = 0, 641 + .dac_volume_max = 127, 642 + .function_flags = OXYGEN_FUNCTION_2WIRE, 643 + .dac_i2s_format = OXYGEN_I2S_FORMAT_LJUST, 644 + .adc_i2s_format = OXYGEN_I2S_FORMAT_LJUST, 645 + }, 627 646 [MODEL_DX] = { 628 647 .shortname = "Xonar DX", 629 648 .longname = "Asus Virtuoso 100", 630 649 .chip = "AV200", 631 650 .owner = THIS_MODULE, 632 651 .init = xonar_dx_init, 633 - .control_filter = xonar_dx_control_filter, 634 - .mixer_init = xonar_dx_mixer_init, 635 - .cleanup = xonar_dx_cleanup, 636 - .suspend = xonar_dx_cleanup, 637 - .resume = xonar_dx_resume, 652 + .control_filter = xonar_d1_control_filter, 653 + .mixer_init = xonar_d1_mixer_init, 654 + .cleanup = xonar_d1_cleanup, 655 + .suspend = xonar_d1_cleanup, 656 + .resume = xonar_d1_resume, 638 657 .set_dac_params = set_cs43xx_params, 639 658 .set_adc_params = set_cs53x1_params, 640 659 .update_dac_volume = update_cs43xx_volume, 641 660 .update_dac_mute = update_cs43xx_mute, 642 661 .gpio_changed = xonar_gpio_changed, 643 - .ac97_switch = xonar_dx_ac97_switch, 662 + .ac97_switch = xonar_d1_ac97_switch, 644 663 .dac_tlv = cs4362a_db_scale, 645 664 .model_data_size = sizeof(struct xonar_data), 646 665 .pcm_dev_cfg = PLAYBACK_0_TO_I2S |