aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/cmipci.c
diff options
context:
space:
mode:
authorClemens Ladisch <clemens@ladisch.de>2007-08-27 03:22:31 -0400
committerJaroslav Kysela <perex@perex.cz>2007-10-16 09:59:30 -0400
commitd6426257d2c960399ff675b7807cde54b769e543 (patch)
tree022be2ff764ecaba3baf02463dff0f106e62e5c4 /sound/pci/cmipci.c
parentb080ebbf92f8d98a048b100e0b0c4aa7e6354ab9 (diff)
[ALSA] cmipci: show actual chip name in card longname
Show the actual name of CMI8762/CMI8768/CMI8769/CMI8770 chips in the card longname instead of just using 'CMI8738' for all of them. 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.c42
1 files changed, 35 insertions, 7 deletions
diff --git a/sound/pci/cmipci.c b/sound/pci/cmipci.c
index 42227012c0bd..315ba26bbd88 100644
--- a/sound/pci/cmipci.c
+++ b/sound/pci/cmipci.c
@@ -2818,7 +2818,7 @@ static int __devinit snd_cmipci_create(struct snd_card *card, struct pci_dev *pc
2818 static struct snd_device_ops ops = { 2818 static struct snd_device_ops ops = {
2819 .dev_free = snd_cmipci_dev_free, 2819 .dev_free = snd_cmipci_dev_free,
2820 }; 2820 };
2821 unsigned int val = 0; 2821 unsigned int val;
2822 long iomidi; 2822 long iomidi;
2823 int integrated_midi = 0; 2823 int integrated_midi = 0;
2824 int pcm_index, pcm_spdif_index; 2824 int pcm_index, pcm_spdif_index;
@@ -2920,18 +2920,46 @@ static int __devinit snd_cmipci_create(struct snd_card *card, struct pci_dev *pc
2920 break; 2920 break;
2921 } 2921 }
2922 2922
2923 sprintf(card->shortname, "C-Media PCI %s", card->driver); 2923 sprintf(card->shortname, "C-Media %s", card->driver);
2924 sprintf(card->longname, "%s (model %d) at 0x%lx, irq %i", 2924 if (cm->chip_version < 68) {
2925 card->shortname, 2925 val = pci->device < 0x110 ? 8338 : 8738;
2926 cm->chip_version, 2926 sprintf(card->longname,
2927 cm->iobase, 2927 "C-Media CMI%d (model %d) at 0x%lx, irq %i",
2928 cm->irq); 2928 val, cm->chip_version, cm->iobase, cm->irq);
2929 } else {
2930 switch (snd_cmipci_read_b(cm, CM_REG_INT_HLDCLR + 3) & 0x03) {
2931 case 0:
2932 val = 8769;
2933 break;
2934 case 2:
2935 val = 8762;
2936 break;
2937 default:
2938 switch ((pci->subsystem_vendor << 16) |
2939 pci->subsystem_device) {
2940 case 0x13f69761:
2941 case 0x584d3741:
2942 case 0x584d3751:
2943 case 0x584d3761:
2944 case 0x584d3771:
2945 case 0x72848384:
2946 val = 8770;
2947 break;
2948 default:
2949 val = 8768;
2950 break;
2951 }
2952 }
2953 sprintf(card->longname, "C-Media CMI%d at 0x%lx, irq %i",
2954 val, cm->iobase, cm->irq);
2955 }
2929 2956
2930 if ((err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, cm, &ops)) < 0) { 2957 if ((err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, cm, &ops)) < 0) {
2931 snd_cmipci_free(cm); 2958 snd_cmipci_free(cm);
2932 return err; 2959 return err;
2933 } 2960 }
2934 2961
2962 val = 0;
2935 if (cm->chip_version > 33 && mpu_port[dev] == 1) { 2963 if (cm->chip_version > 33 && mpu_port[dev] == 1) {
2936 val = snd_cmipci_read_b(cm, CM_REG_MPU_PCI + 1); 2964 val = snd_cmipci_read_b(cm, CM_REG_MPU_PCI + 1);
2937 if (val != 0x00 && val != 0xff) { 2965 if (val != 0x00 && val != 0xff) {