ALSA: hdspm - Provide unique driver id based on card serial
authorAdrian Knoth <adi@drcomp.erfurt.thur.de>
Tue, 10 Jan 2012 19:58:40 +0000 (20:58 +0100)
committerTakashi Iwai <tiwai@suse.de>
Wed, 11 Jan 2012 07:55:58 +0000 (08:55 +0100)
commitf7de8ba3fcf19487d2f0af9aee0c510fc79efa15
tree422003d6891ef94c6a2c57de625f3dbc8f24c97c
parent74eeb141d3bdf5a9a65c84dd637c41f12c40f41c
ALSA: hdspm - Provide unique driver id based on card serial

Before, /proc/asound looked like this:

 2 [Default        ]: HDSPM - RME RayDAT_f1cd85
                      RME RayDAT S/N 0xf1cd85 at 0xf7300000, irq 18

In case of a second HDSPM card, its name would be Default_1. This is
cumbersome, because the order of the cards isn't stable across reboots.

To help userspace tools referring to the correct card, this commit
provides a unique id for each card:

 2 [HDSPMxf1cd85   ]: HDSPM - RME RayDAT_f1cd85
                      RME RayDAT S/N 0xf1cd85 at 0xf7300000, irq 18

In this example, userspace (configuration files) would then use
hw:HDSPMxf1cd85 to choose the right card.

The serial is masked to 24bits, so this string is always shorter than
sixteen chars.

Signed-off-by: Adrian Knoth <adi@drcomp.erfurt.thur.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/pci/rme9652/hdspm.c