diff options
author | Clemens Ladisch <clemens@ladisch.de> | 2007-08-27 09:20:31 +0200 |
---|---|---|
committer | Jaroslav Kysela <perex@perex.cz> | 2007-10-16 15:59:28 +0200 |
commit | 133271fef52c06de52ea9a8ee27899f18dae9af2 (patch) | |
tree | 1a9b94c6a90bcaa33b1ab7b953f504d7a5abb1aa /sound/pci/cmipci.c | |
parent | c9116ae45bd10eabe1e5cf88798092e184d8dbc2 (diff) | |
download | linux-stable-133271fef52c06de52ea9a8ee27899f18dae9af2.tar.gz linux-stable-133271fef52c06de52ea9a8ee27899f18dae9af2.tar.bz2 linux-stable-133271fef52c06de52ea9a8ee27899f18dae9af2.zip |
[ALSA] cmipci: reorganize chip version detection
Add a case for chip version 39 where no bit is set in register 0Ch, and
move the detection of version 39 before that of 8768. This makes the
logic more compatible with the driver on that other OS.
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Jaroslav Kysela <perex@suse.cz>
Diffstat (limited to 'sound/pci/cmipci.c')
-rw-r--r-- | sound/pci/cmipci.c | 44 |
1 files changed, 20 insertions, 24 deletions
diff --git a/sound/pci/cmipci.c b/sound/pci/cmipci.c index 6021e5c402ea..cc0977a8a3d6 100644 --- a/sound/pci/cmipci.c +++ b/sound/pci/cmipci.c @@ -2625,46 +2625,42 @@ static void __devinit query_chip(struct cmipci *cm) if (! detect) { /* check reg 08h, bit 24-28 */ detect = snd_cmipci_read(cm, CM_REG_CHFORMAT) & CM_CHIP_MASK1; - if (! detect) { + switch (detect) { + case 0: cm->chip_version = 33; - cm->max_channels = 2; if (cm->do_soft_ac3) cm->can_ac3_sw = 1; else cm->can_ac3_hw = 1; - cm->has_dual_dac = 1; - } else { + break; + case 1: cm->chip_version = 37; - cm->max_channels = 2; cm->can_ac3_hw = 1; - cm->has_dual_dac = 1; + break; + default: + cm->chip_version = 39; + cm->can_ac3_hw = 1; + break; } + cm->max_channels = 2; + cm->has_dual_dac = 1; } else { - /* check reg 0Ch, bit 26 */ - if (detect & CM_CHIP_8768) { - cm->chip_version = 68; - cm->max_channels = 8; - cm->can_ac3_hw = 1; - cm->has_dual_dac = 1; - cm->can_multi_ch = 1; - } else if (detect & CM_CHIP_055) { - cm->chip_version = 55; - cm->max_channels = 6; - cm->can_ac3_hw = 1; - cm->has_dual_dac = 1; - cm->can_multi_ch = 1; - } else if (detect & CM_CHIP_039) { + if (detect & CM_CHIP_039) { cm->chip_version = 39; if (detect & CM_CHIP_039_6CH) /* 4 or 6 channels */ cm->max_channels = 6; else cm->max_channels = 4; - cm->can_ac3_hw = 1; - cm->has_dual_dac = 1; - cm->can_multi_ch = 1; + } else if (detect & CM_CHIP_8768) { + cm->chip_version = 68; + cm->max_channels = 8; } else { - printk(KERN_ERR "chip %x version not supported\n", detect); + cm->chip_version = 55; + cm->max_channels = 6; } + cm->can_ac3_hw = 1; + cm->has_dual_dac = 1; + cm->can_multi_ch = 1; } } |