aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/lx6464es
diff options
context:
space:
mode:
authorTim Blechmann <tim@klingt.org>2011-06-24 11:36:20 -0400
committerTakashi Iwai <tiwai@suse.de>2011-06-25 03:15:31 -0400
commit80b52490cdbfec7ea93d1158f13f0e49a1557423 (patch)
treeff40dd069882554e8e2e7b75a58c24af227f5fae /sound/pci/lx6464es
parent14705799138005dcb66fa9dfe3e9103e9ae7a897 (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')
-rw-r--r--sound/pci/lx6464es/lx6464es.c21
-rw-r--r--sound/pci/lx6464es/lx6464es.h2
-rw-r--r--sound/pci/lx6464es/lx_core.c14
-rw-r--r--sound/pci/lx6464es/lx_core.h2
4 files changed, 23 insertions, 16 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)
762static int __devinit lx_init_dsp(struct lx6464es *chip) 762static 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)
800mac_ready: 799mac_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);
diff --git a/sound/pci/lx6464es/lx6464es.h b/sound/pci/lx6464es/lx6464es.h
index aea621eafbb5..e2a124ae27e8 100644
--- a/sound/pci/lx6464es/lx6464es.h
+++ b/sound/pci/lx6464es/lx6464es.h
@@ -69,6 +69,8 @@ struct lx6464es {
69 struct pci_dev *pci; 69 struct pci_dev *pci;
70 int irq; 70 int irq;
71 71
72 u8 mac_address[6];
73
72 spinlock_t lock; /* interrupt spinlock */ 74 spinlock_t lock; /* interrupt spinlock */
73 struct mutex setup_mutex; /* mutex used in hw_params, open 75 struct mutex setup_mutex; /* mutex used in hw_params, open
74 * and close */ 76 * and close */
diff --git a/sound/pci/lx6464es/lx_core.c b/sound/pci/lx6464es/lx_core.c
index 617f98b0cbae..5c8717e29eeb 100644
--- a/sound/pci/lx6464es/lx_core.c
+++ b/sound/pci/lx6464es/lx_core.c
@@ -424,7 +424,7 @@ int lx_dsp_get_clock_frequency(struct lx6464es *chip, u32 *rfreq)
424 return ret; 424 return ret;
425} 425}
426 426
427int lx_dsp_get_mac(struct lx6464es *chip, u8 *mac_address) 427int lx_dsp_get_mac(struct lx6464es *chip)
428{ 428{
429 u32 macmsb, maclsb; 429 u32 macmsb, maclsb;
430 430
@@ -432,12 +432,12 @@ int lx_dsp_get_mac(struct lx6464es *chip, u8 *mac_address)
432 maclsb = lx_dsp_reg_read(chip, eReg_ADMACESLSB) & 0x00FFFFFF; 432 maclsb = lx_dsp_reg_read(chip, eReg_ADMACESLSB) & 0x00FFFFFF;
433 433
434 /* todo: endianess handling */ 434 /* todo: endianess handling */
435 mac_address[5] = ((u8 *)(&maclsb))[0]; 435 chip->mac_address[5] = ((u8 *)(&maclsb))[0];
436 mac_address[4] = ((u8 *)(&maclsb))[1]; 436 chip->mac_address[4] = ((u8 *)(&maclsb))[1];
437 mac_address[3] = ((u8 *)(&maclsb))[2]; 437 chip->mac_address[3] = ((u8 *)(&maclsb))[2];
438 mac_address[2] = ((u8 *)(&macmsb))[0]; 438 chip->mac_address[2] = ((u8 *)(&macmsb))[0];
439 mac_address[1] = ((u8 *)(&macmsb))[1]; 439 chip->mac_address[1] = ((u8 *)(&macmsb))[1];
440 mac_address[0] = ((u8 *)(&macmsb))[2]; 440 chip->mac_address[0] = ((u8 *)(&macmsb))[2];
441 441
442 return 0; 442 return 0;
443} 443}
diff --git a/sound/pci/lx6464es/lx_core.h b/sound/pci/lx6464es/lx_core.h
index 6bd9cbbbc68d..1dd562980b6c 100644
--- a/sound/pci/lx6464es/lx_core.h
+++ b/sound/pci/lx6464es/lx_core.h
@@ -116,7 +116,7 @@ int __devinit lx_dsp_get_version(struct lx6464es *chip, u32 *rdsp_version);
116int lx_dsp_get_clock_frequency(struct lx6464es *chip, u32 *rfreq); 116int lx_dsp_get_clock_frequency(struct lx6464es *chip, u32 *rfreq);
117int lx_dsp_set_granularity(struct lx6464es *chip, u32 gran); 117int lx_dsp_set_granularity(struct lx6464es *chip, u32 gran);
118int lx_dsp_read_async_events(struct lx6464es *chip, u32 *data); 118int lx_dsp_read_async_events(struct lx6464es *chip, u32 *data);
119int lx_dsp_get_mac(struct lx6464es *chip, u8 *mac_address); 119int lx_dsp_get_mac(struct lx6464es *chip);
120 120
121 121
122/* low-level pipe handling */ 122/* low-level pipe handling */