--- zzzz-none-000/linux-3.10.107/sound/pci/mixart/mixart_hwdep.c 2017-06-27 09:49:32.000000000 +0000 +++ scorpion-7490-727/linux-3.10.107/sound/pci/mixart/mixart_hwdep.c 2021-02-04 17:41:59.000000000 +0000 @@ -26,7 +26,7 @@ #include #include #include -#include +#include #include #include "mixart.h" #include "mixart_mixer.h" @@ -37,10 +37,11 @@ /** * wait for a value on a peudo register, exit with a timeout * - * @param mgr pointer to miXart manager structure - * @param offset unsigned pseudo_register base + offset of value - * @param value value - * @param timeout timeout in centisenconds + * @mgr: pointer to miXart manager structure + * @offset: unsigned pseudo_register base + offset of value + * @is_egal: wait for the equal value + * @value: value + * @timeout: timeout in centisenconds */ static int mixart_wait_nice_for_register_value(struct mixart_mgr *mgr, u32 offset, int is_egal, @@ -165,7 +166,8 @@ err = snd_mixart_send_msg(mgr, &request, sizeof(*connector), connector); if((err < 0) || (connector->error_code) || (connector->uid_count > MIXART_MAX_PHYS_CONNECTORS)) { - snd_printk(KERN_ERR "error MSG_SYSTEM_ENUM_PLAY_CONNECTOR\n"); + dev_err(&mgr->pci->dev, + "error MSG_SYSTEM_ENUM_PLAY_CONNECTOR\n"); err = -EINVAL; goto __error; } @@ -184,7 +186,7 @@ pipe->uid_left_connector = connector->uid[k]; /* even */ } - /* snd_printk(KERN_DEBUG "playback connector[%d].object_id = %x\n", k, connector->uid[k].object_id); */ + /* dev_dbg(&mgr->pci->dev, "playback connector[%d].object_id = %x\n", k, connector->uid[k].object_id); */ /* TODO: really need send_msg MSG_CONNECTOR_GET_AUDIO_INFO for each connector ? perhaps for analog level caps ? */ request.message_id = MSG_CONNECTOR_GET_AUDIO_INFO; @@ -194,10 +196,11 @@ err = snd_mixart_send_msg(mgr, &request, sizeof(*audio_info), audio_info); if( err < 0 ) { - snd_printk(KERN_ERR "error MSG_CONNECTOR_GET_AUDIO_INFO\n"); + dev_err(&mgr->pci->dev, + "error MSG_CONNECTOR_GET_AUDIO_INFO\n"); goto __error; } - /*snd_printk(KERN_DEBUG "play analog_info.analog_level_present = %x\n", audio_info->info.analog_info.analog_level_present);*/ + /*dev_dbg(&mgr->pci->dev, "play analog_info.analog_level_present = %x\n", audio_info->info.analog_info.analog_level_present);*/ } request.message_id = MSG_SYSTEM_ENUM_RECORD_CONNECTOR; @@ -207,7 +210,8 @@ err = snd_mixart_send_msg(mgr, &request, sizeof(*connector), connector); if((err < 0) || (connector->error_code) || (connector->uid_count > MIXART_MAX_PHYS_CONNECTORS)) { - snd_printk(KERN_ERR "error MSG_SYSTEM_ENUM_RECORD_CONNECTOR\n"); + dev_err(&mgr->pci->dev, + "error MSG_SYSTEM_ENUM_RECORD_CONNECTOR\n"); err = -EINVAL; goto __error; } @@ -226,7 +230,7 @@ pipe->uid_left_connector = connector->uid[k]; /* even */ } - /* snd_printk(KERN_DEBUG "capture connector[%d].object_id = %x\n", k, connector->uid[k].object_id); */ + /* dev_dbg(&mgr->pci->dev, "capture connector[%d].object_id = %x\n", k, connector->uid[k].object_id); */ /* TODO: really need send_msg MSG_CONNECTOR_GET_AUDIO_INFO for each connector ? perhaps for analog level caps ? */ request.message_id = MSG_CONNECTOR_GET_AUDIO_INFO; @@ -236,10 +240,11 @@ err = snd_mixart_send_msg(mgr, &request, sizeof(*audio_info), audio_info); if( err < 0 ) { - snd_printk(KERN_ERR "error MSG_CONNECTOR_GET_AUDIO_INFO\n"); + dev_err(&mgr->pci->dev, + "error MSG_CONNECTOR_GET_AUDIO_INFO\n"); goto __error; } - /*snd_printk(KERN_DEBUG "rec analog_info.analog_level_present = %x\n", audio_info->info.analog_info.analog_level_present);*/ + /*dev_dbg(&mgr->pci->dev, "rec analog_info.analog_level_present = %x\n", audio_info->info.analog_info.analog_level_present);*/ } err = 0; @@ -272,7 +277,9 @@ err = snd_mixart_send_msg(mgr, &request, sizeof(console_mgr), &console_mgr); if( (err < 0) || (console_mgr.error_code != 0) ) { - snd_printk(KERN_DEBUG "error MSG_CONSOLE_GET_CLOCK_UID : err=%x\n", console_mgr.error_code); + dev_dbg(&mgr->pci->dev, + "error MSG_CONSOLE_GET_CLOCK_UID : err=%x\n", + console_mgr.error_code); return -EINVAL; } @@ -286,7 +293,9 @@ err = snd_mixart_send_msg(mgr, &request, sizeof(phys_io), &phys_io); if( (err < 0) || ( phys_io.error_code != 0 ) ) { - snd_printk(KERN_ERR "error MSG_SYSTEM_ENUM_PHYSICAL_IO err(%x) error_code(%x)\n", err, phys_io.error_code ); + dev_err(&mgr->pci->dev, + "error MSG_SYSTEM_ENUM_PHYSICAL_IO err(%x) error_code(%x)\n", + err, phys_io.error_code); return -EINVAL; } @@ -322,7 +331,7 @@ /* this command has no data. response is a 32 bit status */ err = snd_mixart_send_msg(mgr, &request, sizeof(k), &k); if( (err < 0) || (k != 0) ) { - snd_printk(KERN_ERR "error MSG_SYSTEM_SEND_SYNCHRO_CMD\n"); + dev_err(&mgr->pci->dev, "error MSG_SYSTEM_SEND_SYNCHRO_CMD\n"); return err == 0 ? -EINVAL : err; } @@ -348,7 +357,7 @@ /* motherboard xilinx status 5 will say that the board is performing a reset */ if (status_xilinx == 5) { - snd_printk(KERN_ERR "miXart is resetting !\n"); + dev_err(&mgr->pci->dev, "miXart is resetting !\n"); return -EAGAIN; /* try again later */ } @@ -357,12 +366,13 @@ /* xilinx already loaded ? */ if (status_xilinx == 4) { - snd_printk(KERN_DEBUG "xilinx is already loaded !\n"); + dev_dbg(&mgr->pci->dev, "xilinx is already loaded !\n"); return 0; } /* the status should be 0 == "idle" */ if (status_xilinx != 0) { - snd_printk(KERN_ERR "xilinx load error ! status = %d\n", + dev_err(&mgr->pci->dev, + "xilinx load error ! status = %d\n", status_xilinx); return -EIO; /* modprob -r may help ? */ } @@ -393,13 +403,14 @@ case MIXART_MOTHERBOARD_ELF_INDEX: if (status_elf == 4) { - snd_printk(KERN_DEBUG "elf file already loaded !\n"); + dev_dbg(&mgr->pci->dev, "elf file already loaded !\n"); return 0; } /* the status should be 0 == "idle" */ if (status_elf != 0) { - snd_printk(KERN_ERR "elf load error ! status = %d\n", + dev_err(&mgr->pci->dev, + "elf load error ! status = %d\n", status_elf); return -EIO; /* modprob -r may help ? */ } @@ -407,7 +418,7 @@ /* wait for xilinx status == 4 */ err = mixart_wait_nice_for_register_value( mgr, MIXART_PSEUDOREG_MXLX_STATUS_OFFSET, 1, 4, 500); /* 5sec */ if (err < 0) { - snd_printk(KERN_ERR "xilinx was not loaded or " + dev_err(&mgr->pci->dev, "xilinx was not loaded or " "could not be started\n"); return err; } @@ -429,7 +440,7 @@ /* wait for elf status == 4 */ err = mixart_wait_nice_for_register_value( mgr, MIXART_PSEUDOREG_ELF_STATUS_OFFSET, 1, 4, 300); /* 3sec */ if (err < 0) { - snd_printk(KERN_ERR "elf could not be started\n"); + dev_err(&mgr->pci->dev, "elf could not be started\n"); return err; } @@ -443,7 +454,7 @@ /* elf and xilinx should be loaded */ if (status_elf != 4 || status_xilinx != 4) { - printk(KERN_ERR "xilinx or elf not " + dev_err(&mgr->pci->dev, "xilinx or elf not " "successfully loaded\n"); return -EIO; /* modprob -r may help ? */ } @@ -451,7 +462,7 @@ /* wait for daughter detection != 0 */ err = mixart_wait_nice_for_register_value( mgr, MIXART_PSEUDOREG_DBRD_PRESENCE_OFFSET, 0, 0, 30); /* 300msec */ if (err < 0) { - snd_printk(KERN_ERR "error starting elf file\n"); + dev_err(&mgr->pci->dev, "error starting elf file\n"); return err; } @@ -467,7 +478,8 @@ /* daughter should be idle */ if (status_daught != 0) { - printk(KERN_ERR "daughter load error ! status = %d\n", + dev_err(&mgr->pci->dev, + "daughter load error ! status = %d\n", status_daught); return -EIO; /* modprob -r may help ? */ } @@ -487,7 +499,7 @@ /* wait for status == 2 */ err = mixart_wait_nice_for_register_value( mgr, MIXART_PSEUDOREG_DXLX_STATUS_OFFSET, 1, 2, 30); /* 300msec */ if (err < 0) { - snd_printk(KERN_ERR "daughter board load error\n"); + dev_err(&mgr->pci->dev, "daughter board load error\n"); return err; } @@ -509,7 +521,7 @@ /* wait for daughter status == 3 */ err = mixart_wait_nice_for_register_value( mgr, MIXART_PSEUDOREG_DXLX_STATUS_OFFSET, 1, 3, 300); /* 3sec */ if (err < 0) { - snd_printk(KERN_ERR + dev_err(&mgr->pci->dev, "daughter board could not be initialised\n"); return err; } @@ -520,7 +532,7 @@ /* first communication with embedded */ err = mixart_first_init(mgr); if (err < 0) { - snd_printk(KERN_ERR "miXart could not be set up\n"); + dev_err(&mgr->pci->dev, "miXart could not be set up\n"); return err; } @@ -540,7 +552,8 @@ return err; } - snd_printdd("miXart firmware downloaded and successfully set up\n"); + dev_dbg(&mgr->pci->dev, + "miXart firmware downloaded and successfully set up\n"); return 0; } @@ -559,7 +572,8 @@ for (i = 0; i < 3; i++) { sprintf(path, "mixart/%s", fw_files[i]); if (request_firmware(&fw_entry, path, &mgr->pci->dev)) { - snd_printk(KERN_ERR "miXart: can't load firmware %s\n", path); + dev_err(&mgr->pci->dev, + "miXart: can't load firmware %s\n", path); return -ENOENT; } /* fake hwdep dsp record */