At Tue, 05 Sep 2006 11:10:48 +0200, I wrote: > > > One minor issue: if firmware was already uploaded, after reboot, > > firmware is not cached, since it's already present in the box. I > > suppose it is easy to fix. > > Will fix this soon later. The newer patch is below. Takashi diff -r 63e58b008259 pci/rme9652/hdsp.c --- a/pci/rme9652/hdsp.c Mon Sep 04 13:03:51 2006 +0200 +++ b/pci/rme9652/hdsp.c Tue Sep 05 15:00:17 2006 +0200 @@ -726,22 +726,37 @@ static int hdsp_get_iobox_version (struc } -static int hdsp_check_for_firmware (struct hdsp *hdsp, int show_err) -{ - if (hdsp->io_type == H9652 || hdsp->io_type == H9632) return 0; +#ifdef HDSP_FW_LOADER +static int __devinit hdsp_request_fw_loader(struct hdsp *hdsp); +#endif + +static int hdsp_check_for_firmware (struct hdsp *hdsp, int load_on_demand) +{ + if (hdsp->io_type == H9652 || hdsp->io_type == H9632) + return 0; if ((hdsp_read (hdsp, HDSP_statusRegister) & HDSP_DllError) != 0) { + hdsp->state &= ~HDSP_FirmwareLoaded; + if (! load_on_demand) + return -EIO; snd_printk(KERN_ERR "Hammerfall-DSP: firmware not present.\n"); - hdsp->state &= ~HDSP_FirmwareLoaded; - if (! show_err) + /* try to load firmware */ + if (! (hdsp->state & HDSP_FirmwareCached)) { +#ifdef HDSP_FW_LOADER + err = hdsp_request_fw_loader(hdsp); + if (!err) + return 0; +#endif + snd_printk(KERN_ERR + "Hammerfall-DSP: No firmware loaded nor " + "cached, please upload firmware.\n"); return -EIO; - /* try to load firmware */ - if (hdsp->state & HDSP_FirmwareCached) { - if (snd_hdsp_load_firmware_from_cache(hdsp) != 0) - snd_printk(KERN_ERR "Hammerfall-DSP: Firmware loading from cache failed, please upload manually.\n"); - } else { - snd_printk(KERN_ERR "Hammerfall-DSP: No firmware loaded nor cached, please upload firmware.\n"); } - return -EIO; + if (snd_hdsp_load_firmware_from_cache(hdsp) != 0) { + snd_printk(KERN_ERR + "Hammerfall-DSP: Firmware loading from " + "cache failed, please upload manually.\n"); + return -EIO; + } } return 0; } @@ -3181,8 +3196,16 @@ snd_hdsp_proc_read(struct snd_info_entry return; } } else { - snd_iprintf(buffer, "No firmware loaded nor cached, please upload firmware.\n"); - return; + int err = -EINVAL; +#ifdef HDSP_FW_LOADER + err = hdsp_request_fw_loader(hdsp); +#endif + if (err < 0) { + snd_iprintf(buffer, + "No firmware loaded nor cached, " + "please upload firmware.\n"); + return; + } } } @@ -3851,7 +3874,7 @@ static int snd_hdsp_trigger(struct snd_p if (hdsp_check_for_iobox (hdsp)) return -EIO; - if (hdsp_check_for_firmware(hdsp, 1)) + if (hdsp_check_for_firmware(hdsp, 0)) /* no auto-loading in trigger */ return -EIO; spin_lock(&hdsp->lock); ------------------------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 _______________________________________________ Alsa-devel mailing list Alsa-devel@xxxxxxxxxxxxxxxxxxxxx https://lists.sourceforge.net/lists/listinfo/alsa-devel