• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-WNDR4500v2-V1.0.0.60_1.0.38/src/linux/linux-2.6/sound/pci/pcxhr/

Lines Matching refs:rmh

508 static int pcxhr_read_rmh_status(struct pcxhr_mgr *mgr, struct pcxhr_rmh *rmh)
517 if (rmh->stat_len < PCXHR_SIZE_MAX_STATUS)
519 else max_stat_len = rmh->stat_len;
521 for (i = 0; i < rmh->stat_len; i++) {
535 /* need to update rmh->stat_len on the fly ?? */
537 if (rmh->dsp_stat != RMH_SSIZE_FIXED) {
538 if (rmh->dsp_stat == RMH_SSIZE_ARG) {
539 rmh->stat_len = (u16)(data & 0x0000ff) + 1;
542 /* rmh->dsp_stat == RMH_SSIZE_MASK */
543 rmh->stat_len = 1;
547 rmh->stat_len++;
554 if (rmh->cmd_idx < CMD_LAST_INDEX)
558 rmh->stat[i] = data;
560 if (rmh->stat_len > max_stat_len) {
561 snd_printdd("PCXHR : rmh->stat_len=%x too big\n", rmh->stat_len);
562 rmh->stat_len = max_stat_len;
567 static int pcxhr_send_msg_nolock(struct pcxhr_mgr *mgr, struct pcxhr_rmh *rmh)
574 snd_assert(rmh->cmd_len<PCXHR_SIZE_MAX_CMD, return -EINVAL);
595 data = rmh->cmd[0];
597 if (rmh->cmd_len > 1)
602 if (rmh->cmd_idx < CMD_LAST_INDEX)
603 snd_printdd("MSG cmd[0]=%x (%s)\n", data, cmd_names[rmh->cmd_idx]);
614 if (rmh->cmd_len > 1) {
616 data = rmh->cmd_len - 1;
625 for (i=1; i < rmh->cmd_len; i++) {
627 data = rmh->cmd[i];
629 if (rmh->cmd_idx < CMD_LAST_INDEX)
661 snd_printk(KERN_ERR "ERROR RMH(%d): 0x%x\n", rmh->cmd_idx, data);
665 err = pcxhr_read_rmh_status(mgr, rmh);
676 * @rmh: the rmh pointer to be initialized
677 * @cmd: the rmh command to be set
679 void pcxhr_init_rmh(struct pcxhr_rmh *rmh, int cmd)
682 rmh->cmd[0] = pcxhr_dsp_cmds[cmd].opcode;
683 rmh->cmd_len = 1;
684 rmh->stat_len = pcxhr_dsp_cmds[cmd].st_length;
685 rmh->dsp_stat = pcxhr_dsp_cmds[cmd].st_type;
686 rmh->cmd_idx = cmd;
690 void pcxhr_set_pipe_cmd_params(struct pcxhr_rmh *rmh, int capture,
696 rmh->cmd[0] |= 0x800; /* COMMAND_RECORD_MASK */
698 rmh->cmd[0] |= (param1 << FIELD_SIZE);
701 rmh->cmd[0] |= param2;
705 rmh->cmd[1] = param3;
706 rmh->cmd_len = 2;
712 * @rmh: the rmh record to send and receive
716 int pcxhr_send_msg(struct pcxhr_mgr *mgr, struct pcxhr_rmh *rmh)
721 err = pcxhr_send_msg_nolock(mgr, rmh);
743 struct pcxhr_rmh rmh;
750 pcxhr_init_rmh(&rmh, CMD_CAN_START_PIPE);
753 pcxhr_set_pipe_cmd_params(&rmh, 0, audio, 0, 0);
756 pcxhr_set_pipe_cmd_params(&rmh, 1, audio -
760 err = pcxhr_send_msg(mgr, &rmh);
768 if (rmh.stat[0] == 0)
779 struct pcxhr_rmh rmh;
785 pcxhr_init_rmh(&rmh, CMD_STOP_PIPE);
788 pcxhr_set_pipe_cmd_params(&rmh, 0, audio, 0, 0);
791 pcxhr_set_pipe_cmd_params(&rmh, 1, audio -
795 err = pcxhr_send_msg(mgr, &rmh);
811 struct pcxhr_rmh rmh;
817 pcxhr_init_rmh(&rmh, CMD_CONF_PIPE);
819 pcxhr_set_pipe_cmd_params(&rmh, 0, 0, 0, 1 << audio);
821 pcxhr_set_pipe_cmd_params(&rmh, 1, 0, 0,
823 err = pcxhr_send_msg(mgr, &rmh);
835 pcxhr_init_rmh(&rmh, CMD_SEND_IRQA);
836 err = pcxhr_send_msg(mgr, &rmh);
909 struct pcxhr_rmh rmh;
921 pcxhr_init_rmh(&rmh, CMD_ACCESS_IO_WRITE);
922 rmh.cmd[0] |= IO_NUM_REG_CONT;
923 rmh.cmd[1] = mask;
924 rmh.cmd[2] = value;
925 rmh.cmd_len = 3;
926 err = pcxhr_send_msg_nolock(mgr, &rmh);
1043 struct pcxhr_rmh rmh;
1049 pcxhr_init_rmh(&rmh, CMD_STREAM_SAMPLE_COUNT);
1050 pcxhr_set_pipe_cmd_params(&rmh, stream->pipe->is_capture,
1052 /* rmh.stat_len = 2; */ /* 2 resp data for each stream of the pipe */
1054 err = pcxhr_send_msg(mgr, &rmh);
1058 hw_sample_count = ((u_int64_t)rmh.stat[0]) << 24;
1059 hw_sample_count += (u_int64_t)rmh.stat[1];