Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 133142
b: refs/heads/master
c: e588ed8
h: refs/heads/master
v: v3
  • Loading branch information
Tim Blechmann authored and Takashi Iwai committed Feb 23, 2009
1 parent e6e22e6 commit 0e2ee5c
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 5 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: 66a101dda6b26ee566aa9cadcbea904a41d2b268
refs/heads/master: e588ed8304f76cbb396ee85e657a58990298a675
29 changes: 25 additions & 4 deletions trunk/sound/pci/rme9652/hdsp.c
Original file line number Diff line number Diff line change
Expand Up @@ -653,15 +653,36 @@ static unsigned int hdsp_read(struct hdsp *hdsp, int reg)

static int hdsp_check_for_iobox (struct hdsp *hdsp)
{

if (hdsp->io_type == H9652 || hdsp->io_type == H9632) return 0;
if (hdsp_read (hdsp, HDSP_statusRegister) & HDSP_ConfigError) {
snd_printk ("Hammerfall-DSP: no Digiface or Multiface connected!\n");
hdsp->state &= ~HDSP_FirmwareLoaded;
return -EIO;
}
return 0;
}

static int hdsp_wait_for_iobox(struct hdsp *hdsp, unsigned int loops,
unsigned int delay)
{
unsigned int i;

if (hdsp->io_type == H9652 || hdsp->io_type == H9632)
return 0;

for (i = 0; i != loops; ++i) {
if (hdsp_read(hdsp, HDSP_statusRegister) & HDSP_ConfigError)
msleep(delay);
else {
snd_printd("Hammerfall-DSP: iobox found after %ums!\n",
i * delay);
return 0;
}
}

snd_printk("Hammerfall-DSP: no Digiface or Multiface connected!\n");
hdsp->state &= ~HDSP_FirmwareLoaded;
return -EIO;
}

static int snd_hdsp_load_firmware_from_cache(struct hdsp *hdsp) {
Expand Down Expand Up @@ -5046,10 +5067,10 @@ static int __devinit snd_hdsp_create(struct snd_card *card,
return err;

if (!is_9652 && !is_9632) {
/* we wait 2 seconds to let freshly inserted cardbus cards do their hardware init */
ssleep(2);
/* we wait a maximum of 10 seconds to let freshly
* inserted cardbus cards do their hardware init */
err = hdsp_wait_for_iobox(hdsp, 1000, 10);

err = hdsp_check_for_iobox(hdsp);
if (err < 0)
return err;

Expand Down

0 comments on commit 0e2ee5c

Please sign in to comment.