From c329f14751b24e41d9607e14e3dfdfa93d7d6d56 Mon Sep 17 00:00:00 2001 From: Adrian Knoth Date: Tue, 10 Jan 2012 20:58:40 +0100 Subject: [PATCH] --- yaml --- r: 284145 b: refs/heads/master c: f7de8ba3fcf19487d2f0af9aee0c510fc79efa15 h: refs/heads/master i: 284143: f756df3ae52f7b7b0c2a983bd43c15f6dd90749e v: v3 --- [refs] | 2 +- trunk/sound/pci/rme9652/hdspm.c | 21 +++++++++++++++++++-- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/[refs] b/[refs] index aef9fa81b1bc..f9ddcace16f7 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 74eeb141d3bdf5a9a65c84dd637c41f12c40f41c +refs/heads/master: f7de8ba3fcf19487d2f0af9aee0c510fc79efa15 diff --git a/trunk/sound/pci/rme9652/hdspm.c b/trunk/sound/pci/rme9652/hdspm.c index 16092538e0bb..cc9f6c83d661 100644 --- a/trunk/sound/pci/rme9652/hdspm.c +++ b/trunk/sound/pci/rme9652/hdspm.c @@ -6783,6 +6783,25 @@ static int __devinit snd_hdspm_create(struct snd_card *card, tasklet_init(&hdspm->midi_tasklet, hdspm_midi_tasklet, (unsigned long) hdspm); + + if (hdspm->io_type != MADIface) { + hdspm->serial = (hdspm_read(hdspm, + HDSPM_midiStatusIn0)>>8) & 0xFFFFFF; + /* id contains either a user-provided value or the default + * NULL. If it's the default, we're safe to + * fill card->id with the serial number. + * + * If the serial number is 0xFFFFFF, then we're dealing with + * an old PCI revision that comes without a sane number. In + * this case, we don't set card->id to avoid collisions + * when running with multiple cards. + */ + if (NULL == id[hdspm->dev] && hdspm->serial != 0xFFFFFF) { + sprintf(card->id, "HDSPMx%06x", hdspm->serial); + snd_card_set_id(card, card->id); + } + } + snd_printdd("create alsa devices.\n"); err = snd_hdspm_create_alsa_devices(card, hdspm); if (err < 0) @@ -6867,8 +6886,6 @@ static int __devinit snd_hdspm_probe(struct pci_dev *pci, } if (hdspm->io_type != MADIface) { - hdspm->serial = (hdspm_read(hdspm, - HDSPM_midiStatusIn0)>>8) & 0xFFFFFF; sprintf(card->shortname, "%s_%x", hdspm->card_name, hdspm->serial);