diff options
author | Tim Blechmann <tim@klingt.org> | 2011-06-24 11:36:20 -0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2011-06-25 03:15:31 -0400 |
commit | 80b52490cdbfec7ea93d1158f13f0e49a1557423 (patch) | |
tree | ff40dd069882554e8e2e7b75a58c24af227f5fae /sound/pci/lx6464es/lx6464es.c | |
parent | 14705799138005dcb66fa9dfe3e9103e9ae7a897 (diff) |
ALSA: lx6464es - include mac address in device name
each device has a unique mac address, which can be used to distinguish
multiple devices in the same machine. we therefore include the full mac
address in the device shortname and the last 6 bytes in the device id.
Signed-off-by: Tim Blechmann <tim@klingt.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/lx6464es/lx6464es.c')
-rw-r--r-- | sound/pci/lx6464es/lx6464es.c | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/sound/pci/lx6464es/lx6464es.c b/sound/pci/lx6464es/lx6464es.c index 38ae83951de0..04ae84b2a107 100644 --- a/sound/pci/lx6464es/lx6464es.c +++ b/sound/pci/lx6464es/lx6464es.c | |||
@@ -762,7 +762,6 @@ static int lx_set_granularity(struct lx6464es *chip, u32 gran) | |||
762 | static int __devinit lx_init_dsp(struct lx6464es *chip) | 762 | static int __devinit lx_init_dsp(struct lx6464es *chip) |
763 | { | 763 | { |
764 | int err; | 764 | int err; |
765 | u8 mac_address[6]; | ||
766 | int i; | 765 | int i; |
767 | 766 | ||
768 | snd_printdd("->lx_init_dsp\n"); | 767 | snd_printdd("->lx_init_dsp\n"); |
@@ -787,11 +786,11 @@ static int __devinit lx_init_dsp(struct lx6464es *chip) | |||
787 | /** \todo the mac address should be ready by not, but it isn't, | 786 | /** \todo the mac address should be ready by not, but it isn't, |
788 | * so we wait for it */ | 787 | * so we wait for it */ |
789 | for (i = 0; i != 1000; ++i) { | 788 | for (i = 0; i != 1000; ++i) { |
790 | err = lx_dsp_get_mac(chip, mac_address); | 789 | err = lx_dsp_get_mac(chip); |
791 | if (err) | 790 | if (err) |
792 | return err; | 791 | return err; |
793 | if (mac_address[0] || mac_address[1] || mac_address[2] || | 792 | if (chip->mac_address[0] || chip->mac_address[1] || chip->mac_address[2] || |
794 | mac_address[3] || mac_address[4] || mac_address[5]) | 793 | chip->mac_address[3] || chip->mac_address[4] || chip->mac_address[5]) |
795 | goto mac_ready; | 794 | goto mac_ready; |
796 | msleep(1); | 795 | msleep(1); |
797 | } | 796 | } |
@@ -800,8 +799,8 @@ static int __devinit lx_init_dsp(struct lx6464es *chip) | |||
800 | mac_ready: | 799 | mac_ready: |
801 | snd_printd(LXP "mac address ready read after: %dms\n", i); | 800 | snd_printd(LXP "mac address ready read after: %dms\n", i); |
802 | snd_printk(LXP "mac address: %02X.%02X.%02X.%02X.%02X.%02X\n", | 801 | snd_printk(LXP "mac address: %02X.%02X.%02X.%02X.%02X.%02X\n", |
803 | mac_address[0], mac_address[1], mac_address[2], | 802 | chip->mac_address[0], chip->mac_address[1], chip->mac_address[2], |
804 | mac_address[3], mac_address[4], mac_address[5]); | 803 | chip->mac_address[3], chip->mac_address[4], chip->mac_address[5]); |
805 | 804 | ||
806 | err = lx_init_get_version_features(chip); | 805 | err = lx_init_get_version_features(chip); |
807 | if (err) | 806 | if (err) |
@@ -1108,8 +1107,14 @@ static int __devinit snd_lx6464es_probe(struct pci_dev *pci, | |||
1108 | goto out_free; | 1107 | goto out_free; |
1109 | } | 1108 | } |
1110 | 1109 | ||
1111 | strcpy(card->driver, "lx6464es"); | 1110 | strcpy(card->driver, "LX6464ES"); |
1112 | strcpy(card->shortname, "Digigram LX6464ES"); | 1111 | sprintf(card->id, "LX6464ES_%02X%02X%02X", |
1112 | chip->mac_address[3], chip->mac_address[4], chip->mac_address[5]); | ||
1113 | |||
1114 | sprintf(card->shortname, "LX6464ES %02X.%02X.%02X.%02X.%02X.%02X", | ||
1115 | chip->mac_address[0], chip->mac_address[1], chip->mac_address[2], | ||
1116 | chip->mac_address[3], chip->mac_address[4], chip->mac_address[5]); | ||
1117 | |||
1113 | sprintf(card->longname, "%s at 0x%lx, 0x%p, irq %i", | 1118 | sprintf(card->longname, "%s at 0x%lx, 0x%p, irq %i", |
1114 | card->shortname, chip->port_plx, | 1119 | card->shortname, chip->port_plx, |
1115 | chip->port_dsp_bar, chip->irq); | 1120 | chip->port_dsp_bar, chip->irq); |