staticint pcxhr_sub_init(struct pcxhr_mgr *mgr); /* * get basic information and init pcxhr card
*/ staticint pcxhr_init_board(struct pcxhr_mgr *mgr)
{ int err; struct pcxhr_rmh rmh; int card_streams;
/* calc the number of all streams used */ if (mgr->mono_capture)
card_streams = mgr->capture_chips * 2; else
card_streams = mgr->capture_chips;
card_streams += mgr->playback_chips * PCXHR_PLAYBACK_STREAMS;
/* enable interrupts */
pcxhr_enable_dsp(mgr);
pcxhr_init_rmh(&rmh, CMD_SUPPORTED);
err = pcxhr_send_msg(mgr, &rmh); if (err) return err; /* test 4, 8 or 12 phys out */ if ((rmh.stat[0] & MASK_FIRST_FIELD) < mgr->playback_chips * 2) return -EINVAL; /* test 4, 8 or 2 phys in */ if (((rmh.stat[0] >> (2 * FIELD_SIZE)) & MASK_FIRST_FIELD) <
mgr->capture_chips * 2) return -EINVAL; /* test max nb substream per board */ if ((rmh.stat[1] & 0x5F) < card_streams) return -EINVAL; /* test max nb substream per pipe */ if (((rmh.stat[1] >> 7) & 0x5F) < PCXHR_PLAYBACK_STREAMS) return -EINVAL;
dev_dbg(&mgr->pci->dev, "supported formats : playback=%x capture=%x\n",
rmh.stat[2], rmh.stat[3]);
pcxhr_init_rmh(&rmh, CMD_VERSION); /* firmware num for DSP */
rmh.cmd[0] |= mgr->firmware_num; /* transfer granularity in samples (should be multiple of 48) */
rmh.cmd[1] = (1<<23) + mgr->granularity;
rmh.cmd_len = 2;
err = pcxhr_send_msg(mgr, &rmh); if (err) return err;
dev_dbg(&mgr->pci->dev, "PCXHR DSP version is %d.%d.%d\n", (rmh.stat[0]>>16)&0xff,
(rmh.stat[0]>>8)&0xff, rmh.stat[0]&0xff);
mgr->dsp_version = rmh.stat[0];
switch (index) { case PCXHR_FIRMWARE_XLX_INT_INDEX:
pcxhr_reset_xilinx_com(mgr); return pcxhr_load_xilinx_binary(mgr, dsp, 0);
case PCXHR_FIRMWARE_XLX_COM_INDEX:
pcxhr_reset_xilinx_com(mgr); return pcxhr_load_xilinx_binary(mgr, dsp, 1);
case PCXHR_FIRMWARE_DSP_EPRM_INDEX:
pcxhr_reset_dsp(mgr); return pcxhr_load_eeprom_binary(mgr, dsp);
case PCXHR_FIRMWARE_DSP_BOOT_INDEX: return pcxhr_load_boot_binary(mgr, dsp);
case PCXHR_FIRMWARE_DSP_MAIN_INDEX:
err = pcxhr_load_dsp_binary(mgr, dsp); if (err) return err; break; /* continue with first init */ default:
dev_err(&mgr->pci->dev, "wrong file index\n"); return -EFAULT;
} /* end of switch file index*/
/* first communication with embedded */
err = pcxhr_init_board(mgr); if (err < 0) {
dev_err(&mgr->pci->dev, "pcxhr could not be set up\n"); return err;
}
err = pcxhr_config_pipes(mgr); if (err < 0) {
dev_err(&mgr->pci->dev, "pcxhr pipes could not be set up\n"); return err;
} /* create devices and mixer in accordance with HW options*/ for (card_index = 0; card_index < mgr->num_cards; card_index++) { struct snd_pcxhr *chip = mgr->chip[card_index];
err = pcxhr_create_pcm(chip); if (err < 0) return err;
if (card_index == 0) {
err = pcxhr_create_mixer(chip->mgr); if (err < 0) return err;
}
err = snd_card_register(chip->card); if (err < 0) return err;
}
err = pcxhr_start_pipes(mgr); if (err < 0) {
dev_err(&mgr->pci->dev, "pcxhr pipes could not be started\n"); return err;
}
dev_dbg(&mgr->pci->dev, "pcxhr firmware downloaded and successfully set up\n");
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.