ALSA: asihpi - Switch to dev_printk.
Signed-off-by: Eliot Blennerhassett <eblennerhassett@audioscience.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
parent
8121d91c02
commit
5ed15dafa3
|
@ -71,47 +71,51 @@ short hpi_dsp_code_open(u32 adapter, struct dsp_code *ps_dsp_code,
|
||||||
int err;
|
int err;
|
||||||
|
|
||||||
sprintf(fw_name, "asihpi/dsp%04x.bin", adapter);
|
sprintf(fw_name, "asihpi/dsp%04x.bin", adapter);
|
||||||
HPI_DEBUG_LOG(INFO, "requesting firmware for %s\n", fw_name);
|
|
||||||
|
|
||||||
err = request_firmware(&ps_firmware, fw_name,
|
err = request_firmware(&ps_firmware, fw_name,
|
||||||
&ps_dsp_code->ps_dev->dev);
|
&ps_dsp_code->ps_dev->dev);
|
||||||
|
|
||||||
if (err != 0) {
|
if (err != 0) {
|
||||||
HPI_DEBUG_LOG(ERROR, "%d, request_firmware failed for %s\n",
|
dev_printk(KERN_ERR, &ps_dsp_code->ps_dev->dev,
|
||||||
err, fw_name);
|
"%d, request_firmware failed for %s\n", err,
|
||||||
|
fw_name);
|
||||||
goto error1;
|
goto error1;
|
||||||
}
|
}
|
||||||
if (ps_firmware->size < sizeof(header)) {
|
if (ps_firmware->size < sizeof(header)) {
|
||||||
HPI_DEBUG_LOG(ERROR, "header size too small %s\n", fw_name);
|
dev_printk(KERN_ERR, &ps_dsp_code->ps_dev->dev,
|
||||||
|
"Header size too small %s\n", fw_name);
|
||||||
goto error2;
|
goto error2;
|
||||||
}
|
}
|
||||||
memcpy(&header, ps_firmware->data, sizeof(header));
|
memcpy(&header, ps_firmware->data, sizeof(header));
|
||||||
if (header.adapter != adapter) {
|
if (header.adapter != adapter) {
|
||||||
HPI_DEBUG_LOG(ERROR, "adapter type incorrect %4x != %4x\n",
|
dev_printk(KERN_ERR, &ps_dsp_code->ps_dev->dev,
|
||||||
header.adapter, adapter);
|
"Adapter type incorrect %4x != %4x\n", header.adapter,
|
||||||
|
adapter);
|
||||||
goto error2;
|
goto error2;
|
||||||
}
|
}
|
||||||
if (header.size != ps_firmware->size) {
|
if (header.size != ps_firmware->size) {
|
||||||
HPI_DEBUG_LOG(ERROR, "code size wrong %d != %ld\n",
|
dev_printk(KERN_ERR, &ps_dsp_code->ps_dev->dev,
|
||||||
header.size, (unsigned long)ps_firmware->size);
|
"Code size wrong %d != %ld\n", header.size,
|
||||||
|
(unsigned long)ps_firmware->size);
|
||||||
goto error2;
|
goto error2;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (header.version / 10000 != HPI_VER_DECIMAL / 10000) {
|
if (header.version / 10000 != HPI_VER_DECIMAL / 10000) {
|
||||||
HPI_DEBUG_LOG(ERROR,
|
dev_printk(KERN_ERR, &ps_dsp_code->ps_dev->dev,
|
||||||
"firmware major version mismatch "
|
"Firmware Major Version mismatch "
|
||||||
"DSP image %d != driver %d\n", header.version,
|
"DSP image %d != Driver %d\n", header.version,
|
||||||
HPI_VER_DECIMAL);
|
HPI_VER_DECIMAL);
|
||||||
goto error2;
|
goto error2;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (header.version != HPI_VER_DECIMAL) {
|
if (header.version != HPI_VER_DECIMAL) {
|
||||||
HPI_DEBUG_LOG(WARNING,
|
dev_printk(KERN_WARNING, &ps_dsp_code->ps_dev->dev,
|
||||||
"version mismatch DSP image %d != driver %d\n",
|
"firmware: version mismatch DSP image %d != Driver %d\n",
|
||||||
header.version, HPI_VER_DECIMAL);
|
header.version, HPI_VER_DECIMAL);
|
||||||
/* goto error2; still allow driver to load */
|
/* goto error2; still allow driver to load */
|
||||||
}
|
}
|
||||||
|
|
||||||
HPI_DEBUG_LOG(INFO, "dsp code %s opened\n", fw_name);
|
HPI_DEBUG_LOG(DEBUG, "dsp code %s opened\n", fw_name);
|
||||||
ps_dsp_code->ps_firmware = ps_firmware;
|
ps_dsp_code->ps_firmware = ps_firmware;
|
||||||
ps_dsp_code->block_length = header.size / sizeof(u32);
|
ps_dsp_code->block_length = header.size / sizeof(u32);
|
||||||
ps_dsp_code->word_count = sizeof(header) / sizeof(u32);
|
ps_dsp_code->word_count = sizeof(header) / sizeof(u32);
|
||||||
|
@ -148,7 +152,7 @@ void hpi_dsp_code_rewind(struct dsp_code *ps_dsp_code)
|
||||||
short hpi_dsp_code_read_word(struct dsp_code *ps_dsp_code, u32 *pword)
|
short hpi_dsp_code_read_word(struct dsp_code *ps_dsp_code, u32 *pword)
|
||||||
{
|
{
|
||||||
if (ps_dsp_code->word_count + 1 > ps_dsp_code->block_length)
|
if (ps_dsp_code->word_count + 1 > ps_dsp_code->block_length)
|
||||||
return (HPI_ERROR_DSP_FILE_FORMAT);
|
return HPI_ERROR_DSP_FILE_FORMAT;
|
||||||
|
|
||||||
*pword = ((u32 *)(ps_dsp_code->ps_firmware->data))[ps_dsp_code->
|
*pword = ((u32 *)(ps_dsp_code->ps_firmware->data))[ps_dsp_code->
|
||||||
word_count];
|
word_count];
|
||||||
|
|
Loading…
Reference in New Issue