ALSA: oxygen: show correct package ID
authorClemens Ladisch <clemens@ladisch.de>
Thu, 2 Dec 2010 10:42:00 +0000 (11:42 +0100)
committerTakashi Iwai <tiwai@suse.de>
Mon, 6 Dec 2010 13:48:34 +0000 (14:48 +0100)
Instead of the hardcoded "CMI8788", show the actual chip name.

Note: This is neither what the chip is (it's always the same),
      nor what the chip is actually called.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/pci/oxygen/oxygen_lib.c

index e581e7ab216cc6e2e310a11b9e59587dcec26432..3078ed66ad6197abede08cfc255688944ee81a3f 100644 (file)
@@ -202,7 +202,13 @@ static void oxygen_proc_read(struct snd_info_entry *entry,
        struct oxygen *chip = entry->private_data;
        int i, j;
 
-       snd_iprintf(buffer, "CMI8788:\n");
+       switch (oxygen_read8(chip, OXYGEN_REVISION) & OXYGEN_PACKAGE_ID_MASK) {
+       case OXYGEN_PACKAGE_ID_8786: i = '6'; break;
+       case OXYGEN_PACKAGE_ID_8787: i = '7'; break;
+       case OXYGEN_PACKAGE_ID_8788: i = '8'; break;
+       default:                     i = '?'; break;
+       }
+       snd_iprintf(buffer, "CMI878%c:\n", i);
        for (i = 0; i < OXYGEN_IO_SIZE; i += 0x10) {
                snd_iprintf(buffer, "%02x:", i);
                for (j = 0; j < 0x10; ++j)