diff options
author | Clemens Ladisch <clemens@ladisch.de> | 2008-03-19 03:20:13 -0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2008-04-24 06:00:28 -0400 |
commit | 87eedd2fd409d5cd515ccd6fc454cef15c5fa38b (patch) | |
tree | c955e0f3073e743e00f01a8aad8fe55b09d6556c /sound/pci/oxygen | |
parent | f009ad9b39e6484d8e36e9e5029c07eab8c12e8f (diff) |
[ALSA] oxygen: make SPI/2-wire configuration model-specific
Allow the model drivers to specify if the codec communication goes over
SPI or a 2-wire bus.
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/oxygen')
-rw-r--r-- | sound/pci/oxygen/hifier.c | 2 | ||||
-rw-r--r-- | sound/pci/oxygen/oxygen.c | 6 | ||||
-rw-r--r-- | sound/pci/oxygen/oxygen_lib.c | 10 | ||||
-rw-r--r-- | sound/pci/oxygen/virtuoso.c | 3 |
4 files changed, 12 insertions, 9 deletions
diff --git a/sound/pci/oxygen/hifier.c b/sound/pci/oxygen/hifier.c index fa489ed3ed46..143d83d916dc 100644 --- a/sound/pci/oxygen/hifier.c +++ b/sound/pci/oxygen/hifier.c | |||
@@ -164,7 +164,7 @@ static const struct oxygen_model model_hifier = { | |||
164 | PLAYBACK_1_TO_SPDIF | | 164 | PLAYBACK_1_TO_SPDIF | |
165 | CAPTURE_0_FROM_I2S_1, | 165 | CAPTURE_0_FROM_I2S_1, |
166 | .dac_channels = 2, | 166 | .dac_channels = 2, |
167 | .function_flags = 0, | 167 | .function_flags = OXYGEN_FUNCTION_SPI, |
168 | .dac_i2s_format = OXYGEN_I2S_FORMAT_LJUST, | 168 | .dac_i2s_format = OXYGEN_I2S_FORMAT_LJUST, |
169 | .adc_i2s_format = OXYGEN_I2S_FORMAT_LJUST, | 169 | .adc_i2s_format = OXYGEN_I2S_FORMAT_LJUST, |
170 | }; | 170 | }; |
diff --git a/sound/pci/oxygen/oxygen.c b/sound/pci/oxygen/oxygen.c index 9faf43c949b2..e9031ede9621 100644 --- a/sound/pci/oxygen/oxygen.c +++ b/sound/pci/oxygen/oxygen.c | |||
@@ -310,7 +310,8 @@ static const struct oxygen_model model_generic = { | |||
310 | CAPTURE_1_FROM_SPDIF | | 310 | CAPTURE_1_FROM_SPDIF | |
311 | CAPTURE_2_FROM_AC97_1, | 311 | CAPTURE_2_FROM_AC97_1, |
312 | .dac_channels = 8, | 312 | .dac_channels = 8, |
313 | .function_flags = OXYGEN_FUNCTION_ENABLE_SPI_4_5, | 313 | .function_flags = OXYGEN_FUNCTION_SPI | |
314 | OXYGEN_FUNCTION_ENABLE_SPI_4_5, | ||
314 | .dac_i2s_format = OXYGEN_I2S_FORMAT_LJUST, | 315 | .dac_i2s_format = OXYGEN_I2S_FORMAT_LJUST, |
315 | .adc_i2s_format = OXYGEN_I2S_FORMAT_LJUST, | 316 | .adc_i2s_format = OXYGEN_I2S_FORMAT_LJUST, |
316 | }; | 317 | }; |
@@ -335,7 +336,8 @@ static const struct oxygen_model model_meridian = { | |||
335 | CAPTURE_1_FROM_SPDIF | | 336 | CAPTURE_1_FROM_SPDIF | |
336 | CAPTURE_2_FROM_AC97_1, | 337 | CAPTURE_2_FROM_AC97_1, |
337 | .dac_channels = 8, | 338 | .dac_channels = 8, |
338 | .function_flags = OXYGEN_FUNCTION_ENABLE_SPI_4_5, | 339 | .function_flags = OXYGEN_FUNCTION_SPI | |
340 | OXYGEN_FUNCTION_ENABLE_SPI_4_5, | ||
339 | .dac_i2s_format = OXYGEN_I2S_FORMAT_LJUST, | 341 | .dac_i2s_format = OXYGEN_I2S_FORMAT_LJUST, |
340 | .adc_i2s_format = OXYGEN_I2S_FORMAT_LJUST, | 342 | .adc_i2s_format = OXYGEN_I2S_FORMAT_LJUST, |
341 | }; | 343 | }; |
diff --git a/sound/pci/oxygen/oxygen_lib.c b/sound/pci/oxygen/oxygen_lib.c index a1abb50eedb5..b7c7eb33106c 100644 --- a/sound/pci/oxygen/oxygen_lib.c +++ b/sound/pci/oxygen/oxygen_lib.c | |||
@@ -240,12 +240,12 @@ static void oxygen_init(struct oxygen *chip) | |||
240 | chip->has_ac97_0 = (i & OXYGEN_AC97_CODEC_0) != 0; | 240 | chip->has_ac97_0 = (i & OXYGEN_AC97_CODEC_0) != 0; |
241 | chip->has_ac97_1 = (i & OXYGEN_AC97_CODEC_1) != 0; | 241 | chip->has_ac97_1 = (i & OXYGEN_AC97_CODEC_1) != 0; |
242 | 242 | ||
243 | oxygen_set_bits8(chip, OXYGEN_FUNCTION, | ||
244 | OXYGEN_FUNCTION_RESET_CODEC | | ||
245 | chip->model->function_flags); | ||
246 | oxygen_write8_masked(chip, OXYGEN_FUNCTION, | 243 | oxygen_write8_masked(chip, OXYGEN_FUNCTION, |
247 | OXYGEN_FUNCTION_SPI, | 244 | OXYGEN_FUNCTION_RESET_CODEC | |
248 | OXYGEN_FUNCTION_2WIRE_SPI_MASK); | 245 | chip->model->function_flags, |
246 | OXYGEN_FUNCTION_RESET_CODEC | | ||
247 | OXYGEN_FUNCTION_2WIRE_SPI_MASK | | ||
248 | OXYGEN_FUNCTION_ENABLE_SPI_4_5); | ||
249 | oxygen_write8(chip, OXYGEN_DMA_STATUS, 0); | 249 | oxygen_write8(chip, OXYGEN_DMA_STATUS, 0); |
250 | oxygen_write8(chip, OXYGEN_DMA_PAUSE, 0); | 250 | oxygen_write8(chip, OXYGEN_DMA_PAUSE, 0); |
251 | oxygen_write8(chip, OXYGEN_PLAY_CHANNELS, | 251 | oxygen_write8(chip, OXYGEN_PLAY_CHANNELS, |
diff --git a/sound/pci/oxygen/virtuoso.c b/sound/pci/oxygen/virtuoso.c index 5cd1fac14132..5bf3661ab1fe 100644 --- a/sound/pci/oxygen/virtuoso.c +++ b/sound/pci/oxygen/virtuoso.c | |||
@@ -353,7 +353,8 @@ static const struct oxygen_model model_xonar = { | |||
353 | CAPTURE_0_FROM_I2S_2 | | 353 | CAPTURE_0_FROM_I2S_2 | |
354 | CAPTURE_1_FROM_SPDIF, | 354 | CAPTURE_1_FROM_SPDIF, |
355 | .dac_channels = 8, | 355 | .dac_channels = 8, |
356 | .function_flags = OXYGEN_FUNCTION_ENABLE_SPI_4_5, | 356 | .function_flags = OXYGEN_FUNCTION_SPI | |
357 | OXYGEN_FUNCTION_ENABLE_SPI_4_5, | ||
357 | .dac_i2s_format = OXYGEN_I2S_FORMAT_LJUST, | 358 | .dac_i2s_format = OXYGEN_I2S_FORMAT_LJUST, |
358 | .adc_i2s_format = OXYGEN_I2S_FORMAT_LJUST, | 359 | .adc_i2s_format = OXYGEN_I2S_FORMAT_LJUST, |
359 | }; | 360 | }; |