aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci
diff options
context:
space:
mode:
authorClemens Ladisch <clemens@ladisch.de>2008-04-07 04:25:30 -0400
committerTakashi Iwai <tiwai@suse.de>2008-04-24 06:00:31 -0400
commita694a6a0e4ab4752d1a145b9b32e231d7c9611b5 (patch)
treea9da08370ed6530ba640e1cba290896c03687f9d /sound/pci
parent271ebfca5823875cc4f134515b6c3887d99b8dc2 (diff)
[ALSA] virtuoso: allow both CS5381 and CS5361
Rename all CS5381 symbols to CS53x1 because they can also be used for Xonar models with a CS5361. Signed-off-by: Clemens Ladisch <clemens@ladisch.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci')
-rw-r--r--sound/pci/oxygen/virtuoso.c29
1 files changed, 15 insertions, 14 deletions
diff --git a/sound/pci/oxygen/virtuoso.c b/sound/pci/oxygen/virtuoso.c
index b3259fa0a0b6..1627197f1689 100644
--- a/sound/pci/oxygen/virtuoso.c
+++ b/sound/pci/oxygen/virtuoso.c
@@ -74,10 +74,11 @@ static struct pci_device_id xonar_ids[] __devinitdata = {
74MODULE_DEVICE_TABLE(pci, xonar_ids); 74MODULE_DEVICE_TABLE(pci, xonar_ids);
75 75
76 76
77#define GPIO_CS5381_M_MASK 0x000c 77#define GPIO_CS53x1_M_MASK 0x000c
78#define GPIO_CS5381_M_SINGLE 0x0000 78#define GPIO_CS53x1_M_SINGLE 0x0000
79#define GPIO_CS5381_M_DOUBLE 0x0004 79#define GPIO_CS53x1_M_DOUBLE 0x0004
80#define GPIO_CS5381_M_QUAD 0x0008 80#define GPIO_CS53x1_M_QUAD 0x0008
81
81#define GPIO_EXT_POWER 0x0020 82#define GPIO_EXT_POWER 0x0020
82#define GPIO_ALT 0x0080 83#define GPIO_ALT 0x0080
83#define GPIO_OUTPUT_ENABLE 0x0100 84#define GPIO_OUTPUT_ENABLE 0x0100
@@ -115,10 +116,10 @@ static void xonar_d2_init(struct oxygen *chip)
115 } 116 }
116 117
117 oxygen_set_bits16(chip, OXYGEN_GPIO_CONTROL, 118 oxygen_set_bits16(chip, OXYGEN_GPIO_CONTROL,
118 GPIO_CS5381_M_MASK | GPIO_ALT); 119 GPIO_CS53x1_M_MASK | GPIO_ALT);
119 oxygen_write16_masked(chip, OXYGEN_GPIO_DATA, 120 oxygen_write16_masked(chip, OXYGEN_GPIO_DATA,
120 GPIO_CS5381_M_SINGLE, 121 GPIO_CS53x1_M_SINGLE,
121 GPIO_CS5381_M_MASK | GPIO_ALT); 122 GPIO_CS53x1_M_MASK | GPIO_ALT);
122 oxygen_ac97_set_bits(chip, 0, CM9780_JACK, CM9780_FMIC2MIC); 123 oxygen_ac97_set_bits(chip, 0, CM9780_JACK, CM9780_FMIC2MIC);
123 msleep(300); 124 msleep(300);
124 oxygen_set_bits16(chip, OXYGEN_GPIO_CONTROL, GPIO_OUTPUT_ENABLE); 125 oxygen_set_bits16(chip, OXYGEN_GPIO_CONTROL, GPIO_OUTPUT_ENABLE);
@@ -180,19 +181,19 @@ static void update_pcm1796_mute(struct oxygen *chip)
180 pcm1796_write(chip, i, 18, value); 181 pcm1796_write(chip, i, 18, value);
181} 182}
182 183
183static void set_cs5381_params(struct oxygen *chip, 184static void set_cs53x1_params(struct oxygen *chip,
184 struct snd_pcm_hw_params *params) 185 struct snd_pcm_hw_params *params)
185{ 186{
186 unsigned int value; 187 unsigned int value;
187 188
188 if (params_rate(params) <= 54000) 189 if (params_rate(params) <= 54000)
189 value = GPIO_CS5381_M_SINGLE; 190 value = GPIO_CS53x1_M_SINGLE;
190 else if (params_rate(params) <= 108000) 191 else if (params_rate(params) <= 108000)
191 value = GPIO_CS5381_M_DOUBLE; 192 value = GPIO_CS53x1_M_DOUBLE;
192 else 193 else
193 value = GPIO_CS5381_M_QUAD; 194 value = GPIO_CS53x1_M_QUAD;
194 oxygen_write16_masked(chip, OXYGEN_GPIO_DATA, 195 oxygen_write16_masked(chip, OXYGEN_GPIO_DATA,
195 value, GPIO_CS5381_M_MASK); 196 value, GPIO_CS53x1_M_MASK);
196} 197}
197 198
198static void xonar_gpio_changed(struct oxygen *chip) 199static void xonar_gpio_changed(struct oxygen *chip)
@@ -293,7 +294,7 @@ static const struct oxygen_model xonar_models[] = {
293 .mixer_init = xonar_mixer_init, 294 .mixer_init = xonar_mixer_init,
294 .cleanup = xonar_cleanup, 295 .cleanup = xonar_cleanup,
295 .set_dac_params = set_pcm1796_params, 296 .set_dac_params = set_pcm1796_params,
296 .set_adc_params = set_cs5381_params, 297 .set_adc_params = set_cs53x1_params,
297 .update_dac_volume = update_pcm1796_volume, 298 .update_dac_volume = update_pcm1796_volume,
298 .update_dac_mute = update_pcm1796_mute, 299 .update_dac_mute = update_pcm1796_mute,
299 .model_data_size = sizeof(struct xonar_data), 300 .model_data_size = sizeof(struct xonar_data),
@@ -318,7 +319,7 @@ static const struct oxygen_model xonar_models[] = {
318 .mixer_init = xonar_mixer_init, 319 .mixer_init = xonar_mixer_init,
319 .cleanup = xonar_cleanup, 320 .cleanup = xonar_cleanup,
320 .set_dac_params = set_pcm1796_params, 321 .set_dac_params = set_pcm1796_params,
321 .set_adc_params = set_cs5381_params, 322 .set_adc_params = set_cs53x1_params,
322 .update_dac_volume = update_pcm1796_volume, 323 .update_dac_volume = update_pcm1796_volume,
323 .update_dac_mute = update_pcm1796_mute, 324 .update_dac_mute = update_pcm1796_mute,
324 .gpio_changed = xonar_gpio_changed, 325 .gpio_changed = xonar_gpio_changed,