diff options
Diffstat (limited to 'sound/pci/rme9652/hdspm.c')
-rw-r--r-- | sound/pci/rme9652/hdspm.c | 32 |
1 files changed, 26 insertions, 6 deletions
diff --git a/sound/pci/rme9652/hdspm.c b/sound/pci/rme9652/hdspm.c index 19ee2203cbb5..cc9f6c83d661 100644 --- a/sound/pci/rme9652/hdspm.c +++ b/sound/pci/rme9652/hdspm.c | |||
@@ -61,7 +61,7 @@ | |||
61 | 61 | ||
62 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */ | 62 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */ |
63 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ | 63 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ |
64 | static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP;/* Enable this card */ | 64 | static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP;/* Enable this card */ |
65 | 65 | ||
66 | module_param_array(index, int, NULL, 0444); | 66 | module_param_array(index, int, NULL, 0444); |
67 | MODULE_PARM_DESC(index, "Index value for RME HDSPM interface."); | 67 | MODULE_PARM_DESC(index, "Index value for RME HDSPM interface."); |
@@ -941,6 +941,8 @@ struct hdspm { | |||
941 | 941 | ||
942 | cycles_t last_interrupt; | 942 | cycles_t last_interrupt; |
943 | 943 | ||
944 | unsigned int serial; | ||
945 | |||
944 | struct hdspm_peak_rms peak_rms; | 946 | struct hdspm_peak_rms peak_rms; |
945 | }; | 947 | }; |
946 | 948 | ||
@@ -4694,7 +4696,7 @@ snd_hdspm_proc_read_madi(struct snd_info_entry * entry, | |||
4694 | 4696 | ||
4695 | snd_iprintf(buffer, "HW Serial: 0x%06x%06x\n", | 4697 | snd_iprintf(buffer, "HW Serial: 0x%06x%06x\n", |
4696 | (hdspm_read(hdspm, HDSPM_midiStatusIn1)>>8) & 0xFFFFFF, | 4698 | (hdspm_read(hdspm, HDSPM_midiStatusIn1)>>8) & 0xFFFFFF, |
4697 | (hdspm_read(hdspm, HDSPM_midiStatusIn0)>>8) & 0xFFFFFF); | 4699 | hdspm->serial); |
4698 | 4700 | ||
4699 | snd_iprintf(buffer, "IRQ: %d Registers bus: 0x%lx VM: 0x%lx\n", | 4701 | snd_iprintf(buffer, "IRQ: %d Registers bus: 0x%lx VM: 0x%lx\n", |
4700 | hdspm->irq, hdspm->port, (unsigned long)hdspm->iobase); | 4702 | hdspm->irq, hdspm->port, (unsigned long)hdspm->iobase); |
@@ -6266,8 +6268,7 @@ static int snd_hdspm_hwdep_ioctl(struct snd_hwdep *hw, struct file *file, | |||
6266 | hdspm_version.card_type = hdspm->io_type; | 6268 | hdspm_version.card_type = hdspm->io_type; |
6267 | strncpy(hdspm_version.cardname, hdspm->card_name, | 6269 | strncpy(hdspm_version.cardname, hdspm->card_name, |
6268 | sizeof(hdspm_version.cardname)); | 6270 | sizeof(hdspm_version.cardname)); |
6269 | hdspm_version.serial = (hdspm_read(hdspm, | 6271 | hdspm_version.serial = hdspm->serial; |
6270 | HDSPM_midiStatusIn0)>>8) & 0xFFFFFF; | ||
6271 | hdspm_version.firmware_rev = hdspm->firmware_rev; | 6272 | hdspm_version.firmware_rev = hdspm->firmware_rev; |
6272 | hdspm_version.addons = 0; | 6273 | hdspm_version.addons = 0; |
6273 | if (hdspm->tco) | 6274 | if (hdspm->tco) |
@@ -6782,6 +6783,25 @@ static int __devinit snd_hdspm_create(struct snd_card *card, | |||
6782 | tasklet_init(&hdspm->midi_tasklet, | 6783 | tasklet_init(&hdspm->midi_tasklet, |
6783 | hdspm_midi_tasklet, (unsigned long) hdspm); | 6784 | hdspm_midi_tasklet, (unsigned long) hdspm); |
6784 | 6785 | ||
6786 | |||
6787 | if (hdspm->io_type != MADIface) { | ||
6788 | hdspm->serial = (hdspm_read(hdspm, | ||
6789 | HDSPM_midiStatusIn0)>>8) & 0xFFFFFF; | ||
6790 | /* id contains either a user-provided value or the default | ||
6791 | * NULL. If it's the default, we're safe to | ||
6792 | * fill card->id with the serial number. | ||
6793 | * | ||
6794 | * If the serial number is 0xFFFFFF, then we're dealing with | ||
6795 | * an old PCI revision that comes without a sane number. In | ||
6796 | * this case, we don't set card->id to avoid collisions | ||
6797 | * when running with multiple cards. | ||
6798 | */ | ||
6799 | if (NULL == id[hdspm->dev] && hdspm->serial != 0xFFFFFF) { | ||
6800 | sprintf(card->id, "HDSPMx%06x", hdspm->serial); | ||
6801 | snd_card_set_id(card, card->id); | ||
6802 | } | ||
6803 | } | ||
6804 | |||
6785 | snd_printdd("create alsa devices.\n"); | 6805 | snd_printdd("create alsa devices.\n"); |
6786 | err = snd_hdspm_create_alsa_devices(card, hdspm); | 6806 | err = snd_hdspm_create_alsa_devices(card, hdspm); |
6787 | if (err < 0) | 6807 | if (err < 0) |
@@ -6868,10 +6888,10 @@ static int __devinit snd_hdspm_probe(struct pci_dev *pci, | |||
6868 | if (hdspm->io_type != MADIface) { | 6888 | if (hdspm->io_type != MADIface) { |
6869 | sprintf(card->shortname, "%s_%x", | 6889 | sprintf(card->shortname, "%s_%x", |
6870 | hdspm->card_name, | 6890 | hdspm->card_name, |
6871 | (hdspm_read(hdspm, HDSPM_midiStatusIn0)>>8) & 0xFFFFFF); | 6891 | hdspm->serial); |
6872 | sprintf(card->longname, "%s S/N 0x%x at 0x%lx, irq %d", | 6892 | sprintf(card->longname, "%s S/N 0x%x at 0x%lx, irq %d", |
6873 | hdspm->card_name, | 6893 | hdspm->card_name, |
6874 | (hdspm_read(hdspm, HDSPM_midiStatusIn0)>>8) & 0xFFFFFF, | 6894 | hdspm->serial, |
6875 | hdspm->port, hdspm->irq); | 6895 | hdspm->port, hdspm->irq); |
6876 | } else { | 6896 | } else { |
6877 | sprintf(card->shortname, "%s", hdspm->card_name); | 6897 | sprintf(card->shortname, "%s", hdspm->card_name); |