aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/oxygen/virtuoso.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/pci/oxygen/virtuoso.c')
-rw-r--r--sound/pci/oxygen/virtuoso.c64
1 files changed, 44 insertions, 20 deletions
diff --git a/sound/pci/oxygen/virtuoso.c b/sound/pci/oxygen/virtuoso.c
index bc5ce11c8b14..bf971f7cfdc6 100644
--- a/sound/pci/oxygen/virtuoso.c
+++ b/sound/pci/oxygen/virtuoso.c
@@ -113,8 +113,8 @@
113 */ 113 */
114 114
115/* 115/*
116 * Xonar Essence STX 116 * Xonar Essence ST (Deluxe)/STX
117 * ----------------- 117 * -----------------------------
118 * 118 *
119 * CMI8788: 119 * CMI8788:
120 * 120 *
@@ -180,6 +180,8 @@ enum {
180 MODEL_DX, 180 MODEL_DX,
181 MODEL_HDAV, /* without daughterboard */ 181 MODEL_HDAV, /* without daughterboard */
182 MODEL_HDAV_H6, /* with H6 daughterboard */ 182 MODEL_HDAV_H6, /* with H6 daughterboard */
183 MODEL_ST,
184 MODEL_ST_H6,
183 MODEL_STX, 185 MODEL_STX,
184}; 186};
185 187
@@ -188,8 +190,10 @@ static struct pci_device_id xonar_ids[] __devinitdata = {
188 { OXYGEN_PCI_SUBID(0x1043, 0x8275), .driver_data = MODEL_DX }, 190 { OXYGEN_PCI_SUBID(0x1043, 0x8275), .driver_data = MODEL_DX },
189 { OXYGEN_PCI_SUBID(0x1043, 0x82b7), .driver_data = MODEL_D2X }, 191 { OXYGEN_PCI_SUBID(0x1043, 0x82b7), .driver_data = MODEL_D2X },
190 { OXYGEN_PCI_SUBID(0x1043, 0x8314), .driver_data = MODEL_HDAV }, 192 { OXYGEN_PCI_SUBID(0x1043, 0x8314), .driver_data = MODEL_HDAV },
193 { OXYGEN_PCI_SUBID(0x1043, 0x8327), .driver_data = MODEL_DX },
191 { OXYGEN_PCI_SUBID(0x1043, 0x834f), .driver_data = MODEL_D1 }, 194 { OXYGEN_PCI_SUBID(0x1043, 0x834f), .driver_data = MODEL_D1 },
192 { OXYGEN_PCI_SUBID(0x1043, 0x835c), .driver_data = MODEL_STX }, 195 { OXYGEN_PCI_SUBID(0x1043, 0x835c), .driver_data = MODEL_STX },
196 { OXYGEN_PCI_SUBID(0x1043, 0x835d), .driver_data = MODEL_ST },
193 { OXYGEN_PCI_SUBID_BROKEN_EEPROM }, 197 { OXYGEN_PCI_SUBID_BROKEN_EEPROM },
194 { } 198 { }
195}; 199};
@@ -210,9 +214,9 @@ MODULE_DEVICE_TABLE(pci, xonar_ids);
210#define GPIO_DX_FRONT_PANEL 0x0002 214#define GPIO_DX_FRONT_PANEL 0x0002
211#define GPIO_DX_INPUT_ROUTE 0x0100 215#define GPIO_DX_INPUT_ROUTE 0x0100
212 216
213#define GPIO_HDAV_DB_MASK 0x0030 217#define GPIO_DB_MASK 0x0030
214#define GPIO_HDAV_DB_H6 0x0000 218#define GPIO_DB_H6 0x0000
215#define GPIO_HDAV_DB_XX 0x0020 219#define GPIO_DB_XX 0x0020
216 220
217#define GPIO_ST_HP_REAR 0x0002 221#define GPIO_ST_HP_REAR 0x0002
218#define GPIO_ST_HP 0x0080 222#define GPIO_ST_HP 0x0080
@@ -530,7 +534,7 @@ static void xonar_hdav_init(struct oxygen *chip)
530 snd_component_add(chip->card, "CS5381"); 534 snd_component_add(chip->card, "CS5381");
531} 535}
532 536
533static void xonar_stx_init(struct oxygen *chip) 537static void xonar_st_init(struct oxygen *chip)
534{ 538{
535 struct xonar_data *data = chip->model_data; 539 struct xonar_data *data = chip->model_data;
536 540
@@ -539,12 +543,11 @@ static void xonar_stx_init(struct oxygen *chip)
539 OXYGEN_2WIRE_INTERRUPT_MASK | 543 OXYGEN_2WIRE_INTERRUPT_MASK |
540 OXYGEN_2WIRE_SPEED_FAST); 544 OXYGEN_2WIRE_SPEED_FAST);
541 545
546 if (chip->model.private_data == MODEL_ST_H6)
547 chip->model.dac_channels = 8;
542 data->anti_pop_delay = 100; 548 data->anti_pop_delay = 100;
543 data->dacs = 1; 549 data->dacs = chip->model.private_data == MODEL_ST_H6 ? 4 : 1;
544 data->output_enable_bit = GPIO_DX_OUTPUT_ENABLE; 550 data->output_enable_bit = GPIO_DX_OUTPUT_ENABLE;
545 data->ext_power_reg = OXYGEN_GPI_DATA;
546 data->ext_power_int_reg = OXYGEN_GPI_INTERRUPT_MASK;
547 data->ext_power_bit = GPI_DX_EXT_POWER;
548 data->pcm1796_oversampling = PCM1796_OS_64; 551 data->pcm1796_oversampling = PCM1796_OS_64;
549 552
550 pcm1796_init(chip); 553 pcm1796_init(chip);
@@ -560,6 +563,17 @@ static void xonar_stx_init(struct oxygen *chip)
560 snd_component_add(chip->card, "CS5381"); 563 snd_component_add(chip->card, "CS5381");
561} 564}
562 565
566static void xonar_stx_init(struct oxygen *chip)
567{
568 struct xonar_data *data = chip->model_data;
569
570 data->ext_power_reg = OXYGEN_GPI_DATA;
571 data->ext_power_int_reg = OXYGEN_GPI_INTERRUPT_MASK;
572 data->ext_power_bit = GPI_DX_EXT_POWER;
573
574 xonar_st_init(chip);
575}
576
563static void xonar_disable_output(struct oxygen *chip) 577static void xonar_disable_output(struct oxygen *chip)
564{ 578{
565 struct xonar_data *data = chip->model_data; 579 struct xonar_data *data = chip->model_data;
@@ -1021,7 +1035,8 @@ static const struct oxygen_model model_xonar_hdav = {
1021 .model_data_size = sizeof(struct xonar_data), 1035 .model_data_size = sizeof(struct xonar_data),
1022 .device_config = PLAYBACK_0_TO_I2S | 1036 .device_config = PLAYBACK_0_TO_I2S |
1023 PLAYBACK_1_TO_SPDIF | 1037 PLAYBACK_1_TO_SPDIF |
1024 CAPTURE_0_FROM_I2S_2, 1038 CAPTURE_0_FROM_I2S_2 |
1039 CAPTURE_1_FROM_SPDIF,
1025 .dac_channels = 8, 1040 .dac_channels = 8,
1026 .dac_volume_min = 255 - 2*60, 1041 .dac_volume_min = 255 - 2*60,
1027 .dac_volume_max = 255, 1042 .dac_volume_max = 255,
@@ -1034,7 +1049,7 @@ static const struct oxygen_model model_xonar_hdav = {
1034static const struct oxygen_model model_xonar_st = { 1049static const struct oxygen_model model_xonar_st = {
1035 .longname = "Asus Virtuoso 100", 1050 .longname = "Asus Virtuoso 100",
1036 .chip = "AV200", 1051 .chip = "AV200",
1037 .init = xonar_stx_init, 1052 .init = xonar_st_init,
1038 .control_filter = xonar_st_control_filter, 1053 .control_filter = xonar_st_control_filter,
1039 .mixer_init = xonar_st_mixer_init, 1054 .mixer_init = xonar_st_mixer_init,
1040 .cleanup = xonar_st_cleanup, 1055 .cleanup = xonar_st_cleanup,
@@ -1067,6 +1082,7 @@ static int __devinit get_xonar_model(struct oxygen *chip,
1067 [MODEL_D2] = &model_xonar_d2, 1082 [MODEL_D2] = &model_xonar_d2,
1068 [MODEL_D2X] = &model_xonar_d2, 1083 [MODEL_D2X] = &model_xonar_d2,
1069 [MODEL_HDAV] = &model_xonar_hdav, 1084 [MODEL_HDAV] = &model_xonar_hdav,
1085 [MODEL_ST] = &model_xonar_st,
1070 [MODEL_STX] = &model_xonar_st, 1086 [MODEL_STX] = &model_xonar_st,
1071 }; 1087 };
1072 static const char *const names[] = { 1088 static const char *const names[] = {
@@ -1076,6 +1092,8 @@ static int __devinit get_xonar_model(struct oxygen *chip,
1076 [MODEL_D2X] = "Xonar D2X", 1092 [MODEL_D2X] = "Xonar D2X",
1077 [MODEL_HDAV] = "Xonar HDAV1.3", 1093 [MODEL_HDAV] = "Xonar HDAV1.3",
1078 [MODEL_HDAV_H6] = "Xonar HDAV1.3+H6", 1094 [MODEL_HDAV_H6] = "Xonar HDAV1.3+H6",
1095 [MODEL_ST] = "Xonar Essence ST",
1096 [MODEL_ST_H6] = "Xonar Essence ST+H6",
1079 [MODEL_STX] = "Xonar Essence STX", 1097 [MODEL_STX] = "Xonar Essence STX",
1080 }; 1098 };
1081 unsigned int model = id->driver_data; 1099 unsigned int model = id->driver_data;
@@ -1092,21 +1110,27 @@ static int __devinit get_xonar_model(struct oxygen *chip,
1092 chip->model.init = xonar_dx_init; 1110 chip->model.init = xonar_dx_init;
1093 break; 1111 break;
1094 case MODEL_HDAV: 1112 case MODEL_HDAV:
1095 oxygen_clear_bits16(chip, OXYGEN_GPIO_CONTROL, 1113 oxygen_clear_bits16(chip, OXYGEN_GPIO_CONTROL, GPIO_DB_MASK);
1096 GPIO_HDAV_DB_MASK); 1114 switch (oxygen_read16(chip, OXYGEN_GPIO_DATA) & GPIO_DB_MASK) {
1097 switch (oxygen_read16(chip, OXYGEN_GPIO_DATA) & 1115 case GPIO_DB_H6:
1098 GPIO_HDAV_DB_MASK) {
1099 case GPIO_HDAV_DB_H6:
1100 model = MODEL_HDAV_H6; 1116 model = MODEL_HDAV_H6;
1101 break; 1117 break;
1102 case GPIO_HDAV_DB_XX: 1118 case GPIO_DB_XX:
1103 snd_printk(KERN_ERR "unknown daughterboard\n"); 1119 snd_printk(KERN_ERR "unknown daughterboard\n");
1104 return -ENODEV; 1120 return -ENODEV;
1105 } 1121 }
1106 break; 1122 break;
1123 case MODEL_ST:
1124 oxygen_clear_bits16(chip, OXYGEN_GPIO_CONTROL, GPIO_DB_MASK);
1125 switch (oxygen_read16(chip, OXYGEN_GPIO_DATA) & GPIO_DB_MASK) {
1126 case GPIO_DB_H6:
1127 model = MODEL_ST_H6;
1128 break;
1129 }
1130 break;
1107 case MODEL_STX: 1131 case MODEL_STX:
1108 oxygen_clear_bits16(chip, OXYGEN_GPIO_CONTROL, 1132 chip->model.init = xonar_stx_init;
1109 GPIO_HDAV_DB_MASK); 1133 oxygen_clear_bits16(chip, OXYGEN_GPIO_CONTROL, GPIO_DB_MASK);
1110 break; 1134 break;
1111 } 1135 }
1112 1136