]> err.no Git - linux-2.6/commitdiff
[ALSA] oxygen: make SPI/2-wire configuration model-specific
authorClemens Ladisch <clemens@ladisch.de>
Wed, 19 Mar 2008 07:20:13 +0000 (08:20 +0100)
committerTakashi Iwai <tiwai@suse.de>
Thu, 24 Apr 2008 10:00:28 +0000 (12:00 +0200)
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>
sound/pci/oxygen/hifier.c
sound/pci/oxygen/oxygen.c
sound/pci/oxygen/oxygen_lib.c
sound/pci/oxygen/virtuoso.c

index fa489ed3ed46fdcdf8b65dd9d93450de4b8a1d4c..143d83d916dc965ddbf6804aa2d51f6c45241d86 100644 (file)
@@ -164,7 +164,7 @@ static const struct oxygen_model model_hifier = {
                       PLAYBACK_1_TO_SPDIF |
                       CAPTURE_0_FROM_I2S_1,
        .dac_channels = 2,
-       .function_flags = 0,
+       .function_flags = OXYGEN_FUNCTION_SPI,
        .dac_i2s_format = OXYGEN_I2S_FORMAT_LJUST,
        .adc_i2s_format = OXYGEN_I2S_FORMAT_LJUST,
 };
index 9faf43c949b22e929e8162ce3ec37acd4e35d4e3..e9031ede96210be5448c8a76aa062a79a47a6542 100644 (file)
@@ -310,7 +310,8 @@ static const struct oxygen_model model_generic = {
                       CAPTURE_1_FROM_SPDIF |
                       CAPTURE_2_FROM_AC97_1,
        .dac_channels = 8,
-       .function_flags = OXYGEN_FUNCTION_ENABLE_SPI_4_5,
+       .function_flags = OXYGEN_FUNCTION_SPI |
+                         OXYGEN_FUNCTION_ENABLE_SPI_4_5,
        .dac_i2s_format = OXYGEN_I2S_FORMAT_LJUST,
        .adc_i2s_format = OXYGEN_I2S_FORMAT_LJUST,
 };
@@ -335,7 +336,8 @@ static const struct oxygen_model model_meridian = {
                       CAPTURE_1_FROM_SPDIF |
                       CAPTURE_2_FROM_AC97_1,
        .dac_channels = 8,
-       .function_flags = OXYGEN_FUNCTION_ENABLE_SPI_4_5,
+       .function_flags = OXYGEN_FUNCTION_SPI |
+                         OXYGEN_FUNCTION_ENABLE_SPI_4_5,
        .dac_i2s_format = OXYGEN_I2S_FORMAT_LJUST,
        .adc_i2s_format = OXYGEN_I2S_FORMAT_LJUST,
 };
index a1abb50eedb55d6fd8aceb5b944b9aa53aded146..b7c7eb33106c753e21abf48c16f3bb91672f7efd 100644 (file)
@@ -240,12 +240,12 @@ static void oxygen_init(struct oxygen *chip)
        chip->has_ac97_0 = (i & OXYGEN_AC97_CODEC_0) != 0;
        chip->has_ac97_1 = (i & OXYGEN_AC97_CODEC_1) != 0;
 
-       oxygen_set_bits8(chip, OXYGEN_FUNCTION,
-                        OXYGEN_FUNCTION_RESET_CODEC |
-                        chip->model->function_flags);
        oxygen_write8_masked(chip, OXYGEN_FUNCTION,
-                            OXYGEN_FUNCTION_SPI,
-                            OXYGEN_FUNCTION_2WIRE_SPI_MASK);
+                            OXYGEN_FUNCTION_RESET_CODEC |
+                            chip->model->function_flags,
+                            OXYGEN_FUNCTION_RESET_CODEC |
+                            OXYGEN_FUNCTION_2WIRE_SPI_MASK |
+                            OXYGEN_FUNCTION_ENABLE_SPI_4_5);
        oxygen_write8(chip, OXYGEN_DMA_STATUS, 0);
        oxygen_write8(chip, OXYGEN_DMA_PAUSE, 0);
        oxygen_write8(chip, OXYGEN_PLAY_CHANNELS,
index 5cd1fac141321f128eb8e86b6db3dbc5663aa992..5bf3661ab1fe5df44f092fcc6d0acfbfe4011ee3 100644 (file)
@@ -353,7 +353,8 @@ static const struct oxygen_model model_xonar = {
                       CAPTURE_0_FROM_I2S_2 |
                       CAPTURE_1_FROM_SPDIF,
        .dac_channels = 8,
-       .function_flags = OXYGEN_FUNCTION_ENABLE_SPI_4_5,
+       .function_flags = OXYGEN_FUNCTION_SPI |
+                         OXYGEN_FUNCTION_ENABLE_SPI_4_5,
        .dac_i2s_format = OXYGEN_I2S_FORMAT_LJUST,
        .adc_i2s_format = OXYGEN_I2S_FORMAT_LJUST,
 };