]> err.no Git - linux-2.6/commitdiff
[ALSA] oxygen: make SPI configuration configurable
authorClemens Ladisch <clemens@ladisch.de>
Wed, 16 Jan 2008 07:28:54 +0000 (08:28 +0100)
committerJaroslav Kysela <perex@perex.cz>
Thu, 31 Jan 2008 16:29:59 +0000 (17:29 +0100)
Add a field to the model structure so that it is possible to have a card
where the SPI outputs 4 and 5 are used for an EEPROM.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
sound/pci/oxygen/oxygen.c
sound/pci/oxygen/oxygen.h
sound/pci/oxygen/oxygen_lib.c
sound/pci/oxygen/virtuoso.c

index ecc0e6f9d2771753f23c0024127aea24b175ece4..83c6fab425feef7db9bfc8bb36ddccb2a328e07c 100644 (file)
@@ -256,6 +256,7 @@ static const struct oxygen_model model_generic = {
        .update_dac_volume = update_ak4396_volume,
        .update_dac_mute = update_ak4396_mute,
        .dac_tlv = ak4396_db_scale,
+       .function_flags = OXYGEN_FUNCTION_ENABLE_SPI_4_5,
 };
 static const struct oxygen_model model_meridian = {
        .shortname = "C-Media CMI8788",
@@ -270,6 +271,7 @@ static const struct oxygen_model model_meridian = {
        .update_dac_mute = update_ak4396_mute,
        .dac_tlv = ak4396_db_scale,
        .record_from_dma_b = 1,
+       .function_flags = OXYGEN_FUNCTION_ENABLE_SPI_4_5,
 };
 
 static int __devinit generic_oxygen_probe(struct pci_dev *pci,
index 66dee95043401ab86965d7cf1f8ad7795baed5c7..fb9cb36b87b1171589fffbe5780c98d50bf7d881 100644 (file)
@@ -83,6 +83,7 @@ struct oxygen_model {
        u8 record_from_dma_b;
        u8 cd_in_from_video_in;
        u8 dac_minimum_volume;
+       u8 function_flags;
 };
 
 /* oxygen_lib.c */
index ba2bb4995d1eba6d58fba1b9bfbb0263e6a46ef6..4edf40b65ae12d4d4fa7c5830d4f4707a6e63269 100644 (file)
@@ -202,7 +202,7 @@ static void __devinit oxygen_init(struct oxygen *chip)
 
        oxygen_set_bits8(chip, OXYGEN_FUNCTION,
                         OXYGEN_FUNCTION_RESET_CODEC |
-                        OXYGEN_FUNCTION_ENABLE_SPI_4_5);
+                        chip->model->function_flags);
        oxygen_write16(chip, OXYGEN_I2S_MULTICH_FORMAT, 0x010a);
        oxygen_write16(chip, OXYGEN_I2S_A_FORMAT, 0x010a);
        oxygen_write16(chip, OXYGEN_I2S_B_FORMAT, 0x010a);
index bfd1f3c3dfcd6b4a94e85acb1266ac551a16929d..247d5e1ccb68a31e258f91c012ee2eb4ece58ed3 100644 (file)
@@ -227,6 +227,7 @@ static const struct oxygen_model model_xonar = {
        .record_from_dma_b = 1,
        .cd_in_from_video_in = 1,
        .dac_minimum_volume = 15,
+       .function_flags = OXYGEN_FUNCTION_ENABLE_SPI_4_5,
 };
 
 static int __devinit xonar_probe(struct pci_dev *pci,