]> git.alsa-project.org Git - alsa.git/commitdiff
hda-analyzer: Fixed modem codec parsing
authorJaroslav Kysela <perex@perex.cz>
Tue, 2 Feb 2010 07:49:44 +0000 (08:49 +0100)
committerJaroslav Kysela <perex@perex.cz>
Tue, 2 Feb 2010 07:51:32 +0000 (08:51 +0100)
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
hda-analyzer/hda_codec.py

index 5d3de7d915dc0aa222c8b25673d468e8b1ec5a04..cbea3f8414ba697e8a00941010b692cff478374d 100644 (file)
@@ -827,8 +827,10 @@ class HDACodec:
     for i in range(total):
       self.function_id = func = self.param_read(nid, PARAMS['FUNCTION_TYPE'])
       if (func & 0xff) == 0x01:                # audio group
+        self.afg_unsol = (func & 0x100) and True or False
         self.afg = nid
       elif (func & 0xff) == 0x02:      # modem group
+        self.mfg_unsol = (func & 0x100) and True or False
         self.mfg = nid
       else:
         break
@@ -838,6 +840,10 @@ class HDACodec:
       self.subsystem_id = self.rw(self.afg and self.afg or self.mfg,
                                   VERBS['GET_SUBSYSTEM_ID'], 0)
 
+    # parse only audio function group
+    if self.afg == None:
+      return
+
     pcm = self.param_read(self.afg, PARAMS['PCM'])
     self.pcm_rate = pcm & 0xffff
     self.pcm_rates = self.analyze_pcm_rates(self.pcm_rate)
@@ -953,7 +959,7 @@ class HDACodec:
       str += 'Modem Function Group: 0x%x\n' % self.mfg
     else:
       str += 'No Modem Function Group found\n'
-    if not self.afg: return str
+    if self.afg is None: return str
     str += 'Default PCM:\n'
     str += print_pcm_caps(self)
     str += 'Default Amp-In caps: '