Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 257620
b: refs/heads/master
c: 80b5249
h: refs/heads/master
v: v3
  • Loading branch information
Tim Blechmann authored and Takashi Iwai committed Jun 25, 2011
1 parent d8f6562 commit 49fe537
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 17 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 14705799138005dcb66fa9dfe3e9103e9ae7a897
refs/heads/master: 80b52490cdbfec7ea93d1158f13f0e49a1557423
21 changes: 13 additions & 8 deletions trunk/sound/pci/lx6464es/lx6464es.c
Original file line number Diff line number Diff line change
Expand Up @@ -762,7 +762,6 @@ static int lx_set_granularity(struct lx6464es *chip, u32 gran)
static int __devinit lx_init_dsp(struct lx6464es *chip)
{
int err;
u8 mac_address[6];
int i;

snd_printdd("->lx_init_dsp\n");
Expand All @@ -787,11 +786,11 @@ static int __devinit lx_init_dsp(struct lx6464es *chip)
/** \todo the mac address should be ready by not, but it isn't,
* so we wait for it */
for (i = 0; i != 1000; ++i) {
err = lx_dsp_get_mac(chip, mac_address);
err = lx_dsp_get_mac(chip);
if (err)
return err;
if (mac_address[0] || mac_address[1] || mac_address[2] ||
mac_address[3] || mac_address[4] || mac_address[5])
if (chip->mac_address[0] || chip->mac_address[1] || chip->mac_address[2] ||
chip->mac_address[3] || chip->mac_address[4] || chip->mac_address[5])
goto mac_ready;
msleep(1);
}
Expand All @@ -800,8 +799,8 @@ static int __devinit lx_init_dsp(struct lx6464es *chip)
mac_ready:
snd_printd(LXP "mac address ready read after: %dms\n", i);
snd_printk(LXP "mac address: %02X.%02X.%02X.%02X.%02X.%02X\n",
mac_address[0], mac_address[1], mac_address[2],
mac_address[3], mac_address[4], mac_address[5]);
chip->mac_address[0], chip->mac_address[1], chip->mac_address[2],
chip->mac_address[3], chip->mac_address[4], chip->mac_address[5]);

err = lx_init_get_version_features(chip);
if (err)
Expand Down Expand Up @@ -1108,8 +1107,14 @@ static int __devinit snd_lx6464es_probe(struct pci_dev *pci,
goto out_free;
}

strcpy(card->driver, "lx6464es");
strcpy(card->shortname, "Digigram LX6464ES");
strcpy(card->driver, "LX6464ES");
sprintf(card->id, "LX6464ES_%02X%02X%02X",
chip->mac_address[3], chip->mac_address[4], chip->mac_address[5]);

sprintf(card->shortname, "LX6464ES %02X.%02X.%02X.%02X.%02X.%02X",
chip->mac_address[0], chip->mac_address[1], chip->mac_address[2],
chip->mac_address[3], chip->mac_address[4], chip->mac_address[5]);

sprintf(card->longname, "%s at 0x%lx, 0x%p, irq %i",
card->shortname, chip->port_plx,
chip->port_dsp_bar, chip->irq);
Expand Down
2 changes: 2 additions & 0 deletions trunk/sound/pci/lx6464es/lx6464es.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ struct lx6464es {
struct pci_dev *pci;
int irq;

u8 mac_address[6];

spinlock_t lock; /* interrupt spinlock */
struct mutex setup_mutex; /* mutex used in hw_params, open
* and close */
Expand Down
14 changes: 7 additions & 7 deletions trunk/sound/pci/lx6464es/lx_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -424,20 +424,20 @@ int lx_dsp_get_clock_frequency(struct lx6464es *chip, u32 *rfreq)
return ret;
}

int lx_dsp_get_mac(struct lx6464es *chip, u8 *mac_address)
int lx_dsp_get_mac(struct lx6464es *chip)
{
u32 macmsb, maclsb;

macmsb = lx_dsp_reg_read(chip, eReg_ADMACESMSB) & 0x00FFFFFF;
maclsb = lx_dsp_reg_read(chip, eReg_ADMACESLSB) & 0x00FFFFFF;

/* todo: endianess handling */
mac_address[5] = ((u8 *)(&maclsb))[0];
mac_address[4] = ((u8 *)(&maclsb))[1];
mac_address[3] = ((u8 *)(&maclsb))[2];
mac_address[2] = ((u8 *)(&macmsb))[0];
mac_address[1] = ((u8 *)(&macmsb))[1];
mac_address[0] = ((u8 *)(&macmsb))[2];
chip->mac_address[5] = ((u8 *)(&maclsb))[0];
chip->mac_address[4] = ((u8 *)(&maclsb))[1];
chip->mac_address[3] = ((u8 *)(&maclsb))[2];
chip->mac_address[2] = ((u8 *)(&macmsb))[0];
chip->mac_address[1] = ((u8 *)(&macmsb))[1];
chip->mac_address[0] = ((u8 *)(&macmsb))[2];

return 0;
}
Expand Down
2 changes: 1 addition & 1 deletion trunk/sound/pci/lx6464es/lx_core.h
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ int __devinit lx_dsp_get_version(struct lx6464es *chip, u32 *rdsp_version);
int lx_dsp_get_clock_frequency(struct lx6464es *chip, u32 *rfreq);
int lx_dsp_set_granularity(struct lx6464es *chip, u32 gran);
int lx_dsp_read_async_events(struct lx6464es *chip, u32 *data);
int lx_dsp_get_mac(struct lx6464es *chip, u8 *mac_address);
int lx_dsp_get_mac(struct lx6464es *chip);


/* low-level pipe handling */
Expand Down

0 comments on commit 49fe537

Please sign in to comment.