• Home
  • Raw
  • Download

Lines Matching refs:devpriv

246 	struct pci9118_private *devpriv = dev->private;  in pci9118_amcc_setup_dma()  local
247 struct pci9118_dmabuf *dmabuf = &devpriv->dmabuf[buf]; in pci9118_amcc_setup_dma()
250 outl(dmabuf->hw, devpriv->iobase_a + AMCC_OP_REG_MWAR); in pci9118_amcc_setup_dma()
251 outl(dmabuf->use_size, devpriv->iobase_a + AMCC_OP_REG_MWTC); in pci9118_amcc_setup_dma()
256 struct pci9118_private *devpriv = dev->private; in pci9118_amcc_dma_ena() local
259 mcsr = inl(devpriv->iobase_a + AMCC_OP_REG_MCSR); in pci9118_amcc_dma_ena()
264 outl(mcsr, devpriv->iobase_a + AMCC_OP_REG_MCSR); in pci9118_amcc_dma_ena()
269 struct pci9118_private *devpriv = dev->private; in pci9118_amcc_int_ena() local
273 intcsr = inl(devpriv->iobase_a + AMCC_OP_REG_INTCSR); in pci9118_amcc_int_ena()
278 outl(intcsr, devpriv->iobase_a + AMCC_OP_REG_INTCSR); in pci9118_amcc_int_ena()
291 struct pci9118_private *devpriv = dev->private; in pci9118_ai_check_chanlist() local
316 if (!devpriv->usemux && aref == AREF_DIFF && in pci9118_ai_check_chanlist()
332 struct pci9118_private *devpriv = dev->private; in pci9118_set_chanlist() local
345 devpriv->ai_ctrl = 0; in pci9118_set_chanlist()
347 devpriv->ai_ctrl |= PCI9118_AI_CTRL_UNIP; in pci9118_set_chanlist()
349 devpriv->ai_ctrl |= PCI9118_AI_CTRL_DIFF; in pci9118_set_chanlist()
350 outl(devpriv->ai_ctrl, dev->iobase + PCI9118_AI_CTRL_REG); in pci9118_set_chanlist()
361 ssh = devpriv->softsshsample; in pci9118_set_chanlist()
364 ssh = devpriv->softsshhold; in pci9118_set_chanlist()
393 struct pci9118_private *devpriv = dev->private; in pci9118_ai_mode4_switch() local
394 struct pci9118_dmabuf *dmabuf = &devpriv->dmabuf[next_buf]; in pci9118_ai_mode4_switch()
396 devpriv->ai_cfg = PCI9118_AI_CFG_PDTRG | PCI9118_AI_CFG_PETRG | in pci9118_ai_mode4_switch()
398 outl(devpriv->ai_cfg, dev->iobase + PCI9118_AI_CFG_REG); in pci9118_ai_mode4_switch()
401 devpriv->ai_cfg |= PCI9118_AI_CFG_START; in pci9118_ai_mode4_switch()
402 outl(devpriv->ai_cfg, dev->iobase + PCI9118_AI_CFG_REG); in pci9118_ai_mode4_switch()
409 struct pci9118_private *devpriv = dev->private; in pci9118_ai_samples_ready() local
411 unsigned int start_pos = devpriv->ai_add_front; in pci9118_ai_samples_ready()
413 unsigned int span_len = stop_pos + devpriv->ai_add_back; in pci9118_ai_samples_ready()
414 unsigned int dma_pos = devpriv->ai_act_dmapos; in pci9118_ai_samples_ready()
466 struct pci9118_private *devpriv = dev->private; in pci9118_ai_dma_xfer() local
468 unsigned int start_pos = devpriv->ai_add_front; in pci9118_ai_dma_xfer()
470 unsigned int span_len = stop_pos + devpriv->ai_add_back; in pci9118_ai_dma_xfer()
471 unsigned int dma_pos = devpriv->ai_act_dmapos; in pci9118_ai_dma_xfer()
510 devpriv->ai_act_dmapos = dma_pos % span_len; in pci9118_ai_dma_xfer()
515 struct pci9118_private *devpriv = dev->private; in pci9118_exttrg_enable() local
518 devpriv->int_ctrl |= PCI9118_INT_CTRL_DTRG; in pci9118_exttrg_enable()
520 devpriv->int_ctrl &= ~PCI9118_INT_CTRL_DTRG; in pci9118_exttrg_enable()
521 outl(devpriv->int_ctrl, dev->iobase + PCI9118_INT_CTRL_REG); in pci9118_exttrg_enable()
523 if (devpriv->int_ctrl) in pci9118_exttrg_enable()
565 struct pci9118_private *devpriv = dev->private; in pci9118_ai_cancel() local
567 if (devpriv->usedma) in pci9118_ai_cancel()
572 devpriv->ai_cfg = PCI9118_AI_CFG_PDTRG | PCI9118_AI_CFG_PETRG; in pci9118_ai_cancel()
573 outl(devpriv->ai_cfg, dev->iobase + PCI9118_AI_CFG_REG); in pci9118_ai_cancel()
575 devpriv->ai_ctrl = 0; in pci9118_ai_cancel()
576 outl(devpriv->ai_ctrl, dev->iobase + PCI9118_AI_CTRL_REG); in pci9118_ai_cancel()
583 devpriv->int_ctrl = 0; in pci9118_ai_cancel()
584 outl(devpriv->int_ctrl, dev->iobase + PCI9118_INT_CTRL_REG); in pci9118_ai_cancel()
587 devpriv->ai_do = 0; in pci9118_ai_cancel()
588 devpriv->usedma = 0; in pci9118_ai_cancel()
590 devpriv->ai_act_dmapos = 0; in pci9118_ai_cancel()
592 devpriv->ai_neverending = 0; in pci9118_ai_cancel()
593 devpriv->dma_actbuf = 0; in pci9118_ai_cancel()
603 struct pci9118_private *devpriv = dev->private; in pci9118_ai_munge() local
610 if (devpriv->usedma) in pci9118_ai_munge()
622 struct pci9118_private *devpriv = dev->private; in pci9118_ai_get_onesample() local
630 if (!devpriv->ai_neverending) { in pci9118_ai_get_onesample()
639 struct pci9118_private *devpriv = dev->private; in pci9118_ai_get_dma() local
641 struct pci9118_dmabuf *dmabuf = &devpriv->dmabuf[devpriv->dma_actbuf]; in pci9118_ai_get_dma()
651 if (more_dma && devpriv->dma_doublebuf) { in pci9118_ai_get_dma()
652 devpriv->dma_actbuf = 1 - devpriv->dma_actbuf; in pci9118_ai_get_dma()
653 pci9118_amcc_setup_dma(dev, devpriv->dma_actbuf); in pci9118_ai_get_dma()
654 if (devpriv->ai_do == 4) in pci9118_ai_get_dma()
655 pci9118_ai_mode4_switch(dev, devpriv->dma_actbuf); in pci9118_ai_get_dma()
661 if (!devpriv->ai_neverending) { in pci9118_ai_get_dma()
670 if (more_dma && !devpriv->dma_doublebuf) { in pci9118_ai_get_dma()
672 if (devpriv->ai_do == 4) in pci9118_ai_get_dma()
681 struct pci9118_private *devpriv = dev->private; in pci9118_interrupt() local
690 intcsr = inl(devpriv->iobase_a + AMCC_OP_REG_INTCSR); in pci9118_interrupt()
695 outl(intcsr | 0x00ff0000, devpriv->iobase_a + AMCC_OP_REG_INTCSR); in pci9118_interrupt()
733 if (!devpriv->ai_do) in pci9118_interrupt()
736 if (devpriv->ai12_startstop) { in pci9118_interrupt()
740 if (devpriv->ai12_startstop & START_AI_EXT) { in pci9118_interrupt()
742 devpriv->ai12_startstop &= ~START_AI_EXT; in pci9118_interrupt()
743 if (!(devpriv->ai12_startstop & STOP_AI_EXT)) in pci9118_interrupt()
747 pci9118_start_pacer(dev, devpriv->ai_do); in pci9118_interrupt()
748 outl(devpriv->ai_ctrl, in pci9118_interrupt()
750 } else if (devpriv->ai12_startstop & STOP_AI_EXT) { in pci9118_interrupt()
752 devpriv->ai12_startstop &= ~STOP_AI_EXT; in pci9118_interrupt()
756 devpriv->ai_neverending = 0; in pci9118_interrupt()
761 if (devpriv->usedma) in pci9118_interrupt()
773 struct pci9118_private *devpriv = dev->private; in pci9118_ai_cmd_start() local
775 outl(devpriv->int_ctrl, dev->iobase + PCI9118_INT_CTRL_REG); in pci9118_ai_cmd_start()
776 outl(devpriv->ai_cfg, dev->iobase + PCI9118_AI_CFG_REG); in pci9118_ai_cmd_start()
777 if (devpriv->ai_do != 3) { in pci9118_ai_cmd_start()
778 pci9118_start_pacer(dev, devpriv->ai_do); in pci9118_ai_cmd_start()
779 devpriv->ai_ctrl |= PCI9118_AI_CTRL_SOFTG; in pci9118_ai_cmd_start()
781 outl(devpriv->ai_ctrl, dev->iobase + PCI9118_AI_CTRL_REG); in pci9118_ai_cmd_start()
802 struct pci9118_private *devpriv = dev->private; in pci9118_ai_setup_dma() local
804 struct pci9118_dmabuf *dmabuf0 = &devpriv->dmabuf[0]; in pci9118_ai_setup_dma()
805 struct pci9118_dmabuf *dmabuf1 = &devpriv->dmabuf[1]; in pci9118_ai_setup_dma()
808 unsigned int scan_bytes = devpriv->ai_n_realscanlen * in pci9118_ai_setup_dma()
822 if (devpriv->ai_flags & CMDF_WAKE_EOS) { in pci9118_ai_setup_dma()
825 devpriv->ai_flags &= (~CMDF_WAKE_EOS); in pci9118_ai_setup_dma()
840 if (devpriv->ai_flags & CMDF_WAKE_EOS) { in pci9118_ai_setup_dma()
843 devpriv->ai_flags &= (~CMDF_WAKE_EOS); in pci9118_ai_setup_dma()
860 if (!(devpriv->ai_flags & CMDF_WAKE_EOS)) { in pci9118_ai_setup_dma()
878 if (!devpriv->ai_neverending) { in pci9118_ai_setup_dma()
899 devpriv->dma_actbuf = 0; in pci9118_ai_setup_dma()
907 devpriv->iobase_a + AMCC_OP_REG_INTCSR); in pci9118_ai_setup_dma()
910 outl(inl(devpriv->iobase_a + AMCC_OP_REG_INTCSR) | EN_A2P_TRANSFERS, in pci9118_ai_setup_dma()
911 devpriv->iobase_a + AMCC_OP_REG_INTCSR); in pci9118_ai_setup_dma()
919 struct pci9118_private *devpriv = dev->private; in pci9118_ai_cmd() local
925 devpriv->ai12_startstop = 0; in pci9118_ai_cmd()
926 devpriv->ai_flags = cmd->flags; in pci9118_ai_cmd()
927 devpriv->ai_add_front = 0; in pci9118_ai_cmd()
928 devpriv->ai_add_back = 0; in pci9118_ai_cmd()
932 devpriv->ai12_startstop |= START_AI_EXT; in pci9118_ai_cmd()
934 devpriv->ai_neverending = 1; in pci9118_ai_cmd()
935 devpriv->ai12_startstop |= STOP_AI_EXT; in pci9118_ai_cmd()
938 devpriv->ai_neverending = 1; in pci9118_ai_cmd()
940 devpriv->ai_neverending = 0; in pci9118_ai_cmd()
946 devpriv->ai_add_front = 0; in pci9118_ai_cmd()
947 devpriv->ai_add_back = 0; in pci9118_ai_cmd()
948 if (devpriv->master) { in pci9118_ai_cmd()
949 devpriv->usedma = 1; in pci9118_ai_cmd()
953 devpriv->ai_add_back = 1; in pci9118_ai_cmd()
955 devpriv->usedma = 0; in pci9118_ai_cmd()
966 devpriv->usedma = 0; in pci9118_ai_cmd()
974 devpriv->ai_add_back = 1; in pci9118_ai_cmd()
978 devpriv->usedma = 0; in pci9118_ai_cmd()
985 if (cmd->convert_src == TRIG_NOW && devpriv->softsshdelay) { in pci9118_ai_cmd()
986 devpriv->ai_add_front = 2; in pci9118_ai_cmd()
987 if ((devpriv->usedma == 1) && (devpriv->ai_add_back == 1)) { in pci9118_ai_cmd()
989 devpriv->ai_add_front++; in pci9118_ai_cmd()
990 devpriv->ai_add_back = 0; in pci9118_ai_cmd()
992 if (cmd->convert_arg < devpriv->ai_ns_min) in pci9118_ai_cmd()
993 cmd->convert_arg = devpriv->ai_ns_min; in pci9118_ai_cmd()
994 addchans = devpriv->softsshdelay / cmd->convert_arg; in pci9118_ai_cmd()
995 if (devpriv->softsshdelay % cmd->convert_arg) in pci9118_ai_cmd()
997 if (addchans > (devpriv->ai_add_front - 1)) { in pci9118_ai_cmd()
999 devpriv->ai_add_front = addchans + 1; in pci9118_ai_cmd()
1000 if (devpriv->usedma == 1) in pci9118_ai_cmd()
1001 if ((devpriv->ai_add_front + in pci9118_ai_cmd()
1003 devpriv->ai_add_back) & 1) in pci9118_ai_cmd()
1004 devpriv->ai_add_front++; in pci9118_ai_cmd()
1009 scanlen = devpriv->ai_add_front + cmd->chanlist_len + in pci9118_ai_cmd()
1010 devpriv->ai_add_back; in pci9118_ai_cmd()
1015 devpriv->ai_n_realscanlen = scanlen * in pci9118_ai_cmd()
1029 devpriv->ai_add_front, devpriv->ai_add_back); in pci9118_ai_cmd()
1032 devpriv->ai_do = 0; in pci9118_ai_cmd()
1037 devpriv->ai_do = 4; in pci9118_ai_cmd()
1039 devpriv->ai_do = 1; in pci9118_ai_cmd()
1042 devpriv->ai_flags & in pci9118_ai_cmd()
1046 devpriv->ai_ctrl |= PCI9118_AI_CTRL_TMRTR; in pci9118_ai_cmd()
1048 if (!devpriv->usedma) { in pci9118_ai_cmd()
1049 devpriv->ai_ctrl |= PCI9118_AI_CTRL_INT; in pci9118_ai_cmd()
1050 devpriv->int_ctrl |= PCI9118_INT_CTRL_TIMER; in pci9118_ai_cmd()
1054 struct pci9118_dmabuf *dmabuf = &devpriv->dmabuf[0]; in pci9118_ai_cmd()
1056 devpriv->ai_cfg |= PCI9118_AI_CFG_AM; in pci9118_ai_cmd()
1057 outl(devpriv->ai_cfg, dev->iobase + PCI9118_AI_CFG_REG); in pci9118_ai_cmd()
1060 devpriv->ai_cfg |= PCI9118_AI_CFG_START; in pci9118_ai_cmd()
1066 if (!devpriv->usedma) { in pci9118_ai_cmd()
1073 devpriv->ai_do = 2; in pci9118_ai_cmd()
1077 devpriv->ai_flags, in pci9118_ai_cmd()
1078 devpriv->ai_n_realscanlen, in pci9118_ai_cmd()
1081 devpriv->ai_add_front); in pci9118_ai_cmd()
1083 devpriv->ai_ctrl |= PCI9118_AI_CTRL_TMRTR; in pci9118_ai_cmd()
1084 devpriv->ai_cfg |= PCI9118_AI_CFG_BM | PCI9118_AI_CFG_BS; in pci9118_ai_cmd()
1085 if (cmd->convert_src == TRIG_NOW && !devpriv->softsshdelay) in pci9118_ai_cmd()
1086 devpriv->ai_cfg |= PCI9118_AI_CFG_BSSH; in pci9118_ai_cmd()
1087 outl(devpriv->ai_n_realscanlen, in pci9118_ai_cmd()
1094 devpriv->ai_do = 3; in pci9118_ai_cmd()
1096 devpriv->ai_ctrl |= PCI9118_AI_CTRL_EXTM; in pci9118_ai_cmd()
1099 if (devpriv->ai_do == 0) { in pci9118_ai_cmd()
1105 if (devpriv->usedma) in pci9118_ai_cmd()
1106 devpriv->ai_ctrl |= PCI9118_AI_CTRL_DMA; in pci9118_ai_cmd()
1109 devpriv->ai_cfg = PCI9118_AI_CFG_PDTRG | PCI9118_AI_CFG_PETRG; in pci9118_ai_cmd()
1110 outl(devpriv->ai_cfg, dev->iobase + PCI9118_AI_CFG_REG); in pci9118_ai_cmd()
1118 devpriv->ai_act_dmapos = 0; in pci9118_ai_cmd()
1120 if (devpriv->usedma) { in pci9118_ai_cmd()
1124 devpriv->iobase_a + AMCC_OP_REG_INTCSR); in pci9118_ai_cmd()
1146 struct pci9118_private *devpriv = dev->private; in pci9118_ai_cmdtest() local
1157 if (devpriv->master) in pci9118_ai_cmdtest()
1162 if (devpriv->master) in pci9118_ai_cmdtest()
1223 devpriv->ai_ns_min); in pci9118_ai_cmdtest()
1237 devpriv->ai_ns_min); in pci9118_ai_cmdtest()
1278 arg = devpriv->ai_ns_min * in pci9118_ai_cmdtest()
1326 struct pci9118_private *devpriv = dev->private; in pci9118_ai_insn_read() local
1338 devpriv->ai_cfg = PCI9118_AI_CFG_PDTRG | PCI9118_AI_CFG_PETRG; in pci9118_ai_insn_read()
1339 outl(devpriv->ai_cfg, dev->iobase + PCI9118_AI_CFG_REG); in pci9118_ai_insn_read()
1462 struct pci9118_private *devpriv = dev->private; in pci9118_alloc_dma() local
1468 dmabuf = &devpriv->dmabuf[i]; in pci9118_alloc_dma()
1481 devpriv->master = 1; in pci9118_alloc_dma()
1483 devpriv->dma_doublebuf = 1; in pci9118_alloc_dma()
1489 struct pci9118_private *devpriv = dev->private; in pci9118_free_dma() local
1493 if (!devpriv) in pci9118_free_dma()
1497 dmabuf = &devpriv->dmabuf[i]; in pci9118_free_dma()
1510 struct pci9118_private *devpriv; in pci9118_common_attach() local
1516 devpriv = comedi_alloc_devpriv(dev, sizeof(*devpriv)); in pci9118_common_attach()
1517 if (!devpriv) in pci9118_common_attach()
1525 devpriv->iobase_a = pci_resource_start(pcidev, 0); in pci9118_common_attach()
1551 devpriv->usemux = 1; in pci9118_common_attach()
1553 devpriv->usemux = 0; in pci9118_common_attach()
1558 devpriv->softsshdelay = -softsshdelay; in pci9118_common_attach()
1559 devpriv->softsshsample = 0x80; in pci9118_common_attach()
1560 devpriv->softsshhold = 0x00; in pci9118_common_attach()
1562 devpriv->softsshdelay = softsshdelay; in pci9118_common_attach()
1563 devpriv->softsshsample = 0x00; in pci9118_common_attach()
1564 devpriv->softsshhold = 0x80; in pci9118_common_attach()
1579 s->n_chan = (devpriv->usemux) ? ext_mux : 16; in pci9118_common_attach()
1599 devpriv->ai_ns_min = 10000; in pci9118_common_attach()
1605 devpriv->ai_ns_min = 3000; in pci9118_common_attach()