26 #include <linux/pci.h>
27 #include <linux/module.h>
38 #if defined(CONFIG_FW_LOADER) || defined(CONFIG_FW_LOADER_MODULE)
39 #if !defined(CONFIG_USE_PCXHRLOADER) && !defined(CONFIG_SND_PCXHR)
40 #define SND_PCXHR_FW_LOADER
45 static int pcxhr_sub_init(
struct pcxhr_mgr *mgr);
49 static int pcxhr_init_board(
struct pcxhr_mgr *mgr)
77 if ((rmh.stat[1] & 0x5F) < card_streams)
82 snd_printdd(
"supported formats : playback=%x capture=%x\n",
83 rmh.stat[2], rmh.stat[3]);
94 snd_printdd(
"PCXHR DSP version is %d.%d.%d\n", (rmh.stat[0]>>16)&0xff,
95 (rmh.stat[0]>>8)&0xff, rmh.stat[0]&0xff);
101 err = pcxhr_sub_init(mgr);
105 static int pcxhr_sub_init(
struct pcxhr_mgr *mgr)
171 static int pcxhr_dsp_allocate_pipe(
struct pcxhr_mgr *mgr,
173 int is_capture,
int pin)
190 pin, is_capture ?
'c' :
'p');
196 audio_count, stream_count);
197 rmh.cmd[1] |= 0x020000;
200 rmh.cmd[rmh.cmd_len++] = (audio_count == 1) ? 0x01 : 0x03;
205 "(CMD_RES_PIPE) err=%x!\n", err);
220 int capture_mask = 0;
221 int playback_mask = 0;
240 "(CMD_FREE_PIPE) err(%x)\n", err);
247 static int pcxhr_config_pipes(
struct pcxhr_mgr *mgr)
258 err = pcxhr_dsp_allocate_pipe( mgr, pipe, 0, i*2);
266 err = pcxhr_dsp_allocate_pipe(mgr, pipe, 1, i*2 + j);
275 static int pcxhr_start_pipes(
struct pcxhr_mgr *mgr)
279 int playback_mask = 0;
280 int capture_mask = 0;
328 err = pcxhr_init_board(mgr);
333 err = pcxhr_config_pipes(mgr);
339 for (card_index = 0; card_index < mgr->
num_cards; card_index++) {
345 if (card_index == 0) {
352 err = pcxhr_start_pipes(mgr);
357 snd_printdd(
"pcxhr firmware downloaded and successfully set up\n");
365 #ifdef SND_PCXHR_FW_LOADER
369 static char *fw_files[][5] = {
370 [0] = {
"xlxint.dat",
"xlxc882hr.dat",
371 "dspe882.e56",
"dspb882hr.b56",
"dspd882.d56" },
372 [1] = {
"xlxint.dat",
"xlxc882e.dat",
373 "dspe882.e56",
"dspb882e.b56",
"dspd882.d56" },
374 [2] = {
"xlxint.dat",
"xlxc1222hr.dat",
375 "dspe882.e56",
"dspb1222hr.b56",
"dspd1222.d56" },
376 [3] = {
"xlxint.dat",
"xlxc1222e.dat",
377 "dspe882.e56",
"dspb1222e.b56",
"dspd1222.d56" },
378 [4] = {
NULL,
"xlxc222.dat",
379 "dspe924.e56",
"dspb924.b56",
"dspd222.d56" },
380 [5] = {
NULL,
"xlxc924.dat",
381 "dspe924.e56",
"dspb924.b56",
"dspd222.d56" },
389 for (i = 0; i < 5; i++) {
390 if (!fw_files[fw_set][i])
392 sprintf(path,
"pcxhr/%s", fw_files[fw_set][i]);
399 err = pcxhr_dsp_load(mgr, i, fw_entry);
432 #define PCXHR_HWDEP_ID "pcxhr loader"
435 static int pcxhr_hwdep_dsp_status(
struct snd_hwdep *
hw,
449 static int pcxhr_hwdep_dsp_load(
struct snd_hwdep *
hw,
460 "(%lu bytes)\n", (
unsigned long)
fw.size);
467 err = pcxhr_dsp_load(mgr, dsp->
index, &
fw);
489 hw->
ops.dsp_status = pcxhr_hwdep_dsp_status;
490 hw->
ops.dsp_load = pcxhr_hwdep_dsp_load;