Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=133271fef52c06de52ea9a8ee27899f18dae9af2
Commit:     133271fef52c06de52ea9a8ee27899f18dae9af2
Parent:     c9116ae45bd10eabe1e5cf88798092e184d8dbc2
Author:     Clemens Ladisch <[EMAIL PROTECTED]>
AuthorDate: Mon Aug 27 09:20:31 2007 +0200
Committer:  Jaroslav Kysela <[EMAIL PROTECTED]>
CommitDate: Tue Oct 16 15:59:28 2007 +0200

    [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 <[EMAIL PROTECTED]>
    Signed-off-by: Jaroslav Kysela <[EMAIL PROTECTED]>
---
 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 6021e5c..cc0977a 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;
        }
 }
 
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to