mite_chan 216 drivers/staging/comedi/drivers/mite.c static u32 mite_device_bytes_transferred(struct mite_channel *mite_chan) mite_chan 218 drivers/staging/comedi/drivers/mite.c struct mite *mite = mite_chan->mite; mite_chan 220 drivers/staging/comedi/drivers/mite.c return readl(mite->mmio + MITE_DAR(mite_chan->channel)); mite_chan 227 drivers/staging/comedi/drivers/mite.c u32 mite_bytes_in_transit(struct mite_channel *mite_chan) mite_chan 229 drivers/staging/comedi/drivers/mite.c struct mite *mite = mite_chan->mite; mite_chan 231 drivers/staging/comedi/drivers/mite.c return readl(mite->mmio + MITE_FCR(mite_chan->channel)) & 0xff; mite_chan 236 drivers/staging/comedi/drivers/mite.c static u32 mite_bytes_written_to_memory_lb(struct mite_channel *mite_chan) mite_chan 240 drivers/staging/comedi/drivers/mite.c device_byte_count = mite_device_bytes_transferred(mite_chan); mite_chan 241 drivers/staging/comedi/drivers/mite.c return device_byte_count - mite_bytes_in_transit(mite_chan); mite_chan 245 drivers/staging/comedi/drivers/mite.c static u32 mite_bytes_written_to_memory_ub(struct mite_channel *mite_chan) mite_chan 249 drivers/staging/comedi/drivers/mite.c in_transit_count = mite_bytes_in_transit(mite_chan); mite_chan 250 drivers/staging/comedi/drivers/mite.c return mite_device_bytes_transferred(mite_chan) - in_transit_count; mite_chan 254 drivers/staging/comedi/drivers/mite.c static u32 mite_bytes_read_from_memory_lb(struct mite_channel *mite_chan) mite_chan 258 drivers/staging/comedi/drivers/mite.c device_byte_count = mite_device_bytes_transferred(mite_chan); mite_chan 259 drivers/staging/comedi/drivers/mite.c return device_byte_count + mite_bytes_in_transit(mite_chan); mite_chan 263 drivers/staging/comedi/drivers/mite.c static u32 mite_bytes_read_from_memory_ub(struct mite_channel *mite_chan) mite_chan 267 drivers/staging/comedi/drivers/mite.c in_transit_count = mite_bytes_in_transit(mite_chan); mite_chan 268 drivers/staging/comedi/drivers/mite.c return mite_device_bytes_transferred(mite_chan) + in_transit_count; mite_chan 271 drivers/staging/comedi/drivers/mite.c static void mite_sync_input_dma(struct mite_channel *mite_chan, mite_chan 282 drivers/staging/comedi/drivers/mite.c nbytes = mite_bytes_written_to_memory_lb(mite_chan); mite_chan 283 drivers/staging/comedi/drivers/mite.c if ((int)(mite_bytes_written_to_memory_ub(mite_chan) - mite_chan 303 drivers/staging/comedi/drivers/mite.c static void mite_sync_output_dma(struct mite_channel *mite_chan, mite_chan 316 drivers/staging/comedi/drivers/mite.c nbytes_lb = mite_bytes_read_from_memory_lb(mite_chan); mite_chan 319 drivers/staging/comedi/drivers/mite.c nbytes_ub = mite_bytes_read_from_memory_ub(mite_chan); mite_chan 352 drivers/staging/comedi/drivers/mite.c void mite_sync_dma(struct mite_channel *mite_chan, struct comedi_subdevice *s) mite_chan 354 drivers/staging/comedi/drivers/mite.c if (mite_chan->dir == COMEDI_INPUT) mite_chan 355 drivers/staging/comedi/drivers/mite.c mite_sync_input_dma(mite_chan, s); mite_chan 357 drivers/staging/comedi/drivers/mite.c mite_sync_output_dma(mite_chan, s); mite_chan 361 drivers/staging/comedi/drivers/mite.c static unsigned int mite_get_status(struct mite_channel *mite_chan) mite_chan 363 drivers/staging/comedi/drivers/mite.c struct mite *mite = mite_chan->mite; mite_chan 368 drivers/staging/comedi/drivers/mite.c status = readl(mite->mmio + MITE_CHSR(mite_chan->channel)); mite_chan 370 drivers/staging/comedi/drivers/mite.c mite_chan->done = 1; mite_chan 372 drivers/staging/comedi/drivers/mite.c mite->mmio + MITE_CHOR(mite_chan->channel)); mite_chan 386 drivers/staging/comedi/drivers/mite.c void mite_ack_linkc(struct mite_channel *mite_chan, mite_chan 390 drivers/staging/comedi/drivers/mite.c struct mite *mite = mite_chan->mite; mite_chan 393 drivers/staging/comedi/drivers/mite.c status = mite_get_status(mite_chan); mite_chan 395 drivers/staging/comedi/drivers/mite.c writel(CHOR_CLRLC, mite->mmio + MITE_CHOR(mite_chan->channel)); mite_chan 399 drivers/staging/comedi/drivers/mite.c mite_sync_dma(mite_chan, s); mite_chan 415 drivers/staging/comedi/drivers/mite.c int mite_done(struct mite_channel *mite_chan) mite_chan 417 drivers/staging/comedi/drivers/mite.c struct mite *mite = mite_chan->mite; mite_chan 421 drivers/staging/comedi/drivers/mite.c mite_get_status(mite_chan); mite_chan 423 drivers/staging/comedi/drivers/mite.c done = mite_chan->done; mite_chan 429 drivers/staging/comedi/drivers/mite.c static void mite_dma_reset(struct mite_channel *mite_chan) mite_chan 432 drivers/staging/comedi/drivers/mite.c mite_chan->mite->mmio + MITE_CHOR(mite_chan->channel)); mite_chan 439 drivers/staging/comedi/drivers/mite.c void mite_dma_arm(struct mite_channel *mite_chan) mite_chan 441 drivers/staging/comedi/drivers/mite.c struct mite *mite = mite_chan->mite; mite_chan 450 drivers/staging/comedi/drivers/mite.c mite_chan->done = 0; mite_chan 452 drivers/staging/comedi/drivers/mite.c writel(CHOR_START, mite->mmio + MITE_CHOR(mite_chan->channel)); mite_chan 461 drivers/staging/comedi/drivers/mite.c void mite_dma_disarm(struct mite_channel *mite_chan) mite_chan 463 drivers/staging/comedi/drivers/mite.c struct mite *mite = mite_chan->mite; mite_chan 466 drivers/staging/comedi/drivers/mite.c writel(CHOR_ABORT, mite->mmio + MITE_CHOR(mite_chan->channel)); mite_chan 476 drivers/staging/comedi/drivers/mite.c void mite_prep_dma(struct mite_channel *mite_chan, mite_chan 479 drivers/staging/comedi/drivers/mite.c struct mite *mite = mite_chan->mite; mite_chan 482 drivers/staging/comedi/drivers/mite.c mite_dma_reset(mite_chan); mite_chan 506 drivers/staging/comedi/drivers/mite.c if (mite_chan->dir == COMEDI_INPUT) mite_chan 509 drivers/staging/comedi/drivers/mite.c writel(chcr, mite->mmio + MITE_CHCR(mite_chan->channel)); mite_chan 527 drivers/staging/comedi/drivers/mite.c writel(mcr, mite->mmio + MITE_MCR(mite_chan->channel)); mite_chan 531 drivers/staging/comedi/drivers/mite.c dcr |= CR_PORTIO | CR_AMDEVICE | mite_drq_reqs(mite_chan->channel); mite_chan 546 drivers/staging/comedi/drivers/mite.c writel(dcr, mite->mmio + MITE_DCR(mite_chan->channel)); mite_chan 549 drivers/staging/comedi/drivers/mite.c writel(0, mite->mmio + MITE_DAR(mite_chan->channel)); mite_chan 553 drivers/staging/comedi/drivers/mite.c writel(lkcr, mite->mmio + MITE_LKCR(mite_chan->channel)); mite_chan 556 drivers/staging/comedi/drivers/mite.c writel(mite_chan->ring->dma_addr, mite_chan 557 drivers/staging/comedi/drivers/mite.c mite->mmio + MITE_LKAR(mite_chan->channel)); mite_chan 573 drivers/staging/comedi/drivers/mite.c struct mite_channel *mite_chan = NULL; mite_chan 583 drivers/staging/comedi/drivers/mite.c mite_chan = &mite->channels[i]; mite_chan 584 drivers/staging/comedi/drivers/mite.c if (!mite_chan->ring) { mite_chan 585 drivers/staging/comedi/drivers/mite.c mite_chan->ring = ring; mite_chan 588 drivers/staging/comedi/drivers/mite.c mite_chan = NULL; mite_chan 591 drivers/staging/comedi/drivers/mite.c return mite_chan; mite_chan 612 drivers/staging/comedi/drivers/mite.c void mite_release_channel(struct mite_channel *mite_chan) mite_chan 614 drivers/staging/comedi/drivers/mite.c struct mite *mite = mite_chan->mite; mite_chan 619 drivers/staging/comedi/drivers/mite.c if (mite_chan->ring) { mite_chan 620 drivers/staging/comedi/drivers/mite.c mite_dma_disarm(mite_chan); mite_chan 621 drivers/staging/comedi/drivers/mite.c mite_dma_reset(mite_chan); mite_chan 630 drivers/staging/comedi/drivers/mite.c mite->mmio + MITE_CHCR(mite_chan->channel)); mite_chan 631 drivers/staging/comedi/drivers/mite.c mite_chan->ring = NULL; mite_chan 54 drivers/staging/comedi/drivers/mite.h u32 mite_bytes_in_transit(struct mite_channel *mite_chan); mite_chan 56 drivers/staging/comedi/drivers/mite.h void mite_sync_dma(struct mite_channel *mite_chan, struct comedi_subdevice *s); mite_chan 57 drivers/staging/comedi/drivers/mite.h void mite_ack_linkc(struct mite_channel *mite_chan, struct comedi_subdevice *s, mite_chan 59 drivers/staging/comedi/drivers/mite.h int mite_done(struct mite_channel *mite_chan); mite_chan 61 drivers/staging/comedi/drivers/mite.h void mite_dma_arm(struct mite_channel *mite_chan); mite_chan 62 drivers/staging/comedi/drivers/mite.h void mite_dma_disarm(struct mite_channel *mite_chan); mite_chan 64 drivers/staging/comedi/drivers/mite.h void mite_prep_dma(struct mite_channel *mite_chan, mite_chan 73 drivers/staging/comedi/drivers/mite.h void mite_release_channel(struct mite_channel *mite_chan); mite_chan 343 drivers/staging/comedi/drivers/ni_660x.c struct mite_channel *mite_chan; mite_chan 348 drivers/staging/comedi/drivers/ni_660x.c mite_chan = mite_request_channel(devpriv->mite, ring); mite_chan 349 drivers/staging/comedi/drivers/ni_660x.c if (!mite_chan) { mite_chan 355 drivers/staging/comedi/drivers/ni_660x.c mite_chan->dir = direction; mite_chan 356 drivers/staging/comedi/drivers/ni_660x.c ni_tio_set_mite_channel(counter, mite_chan); mite_chan 357 drivers/staging/comedi/drivers/ni_660x.c ni_660x_set_dma_channel(dev, mite_chan->channel, counter); mite_chan 369 drivers/staging/comedi/drivers/ni_660x.c if (counter->mite_chan) { mite_chan 370 drivers/staging/comedi/drivers/ni_660x.c struct mite_channel *mite_chan = counter->mite_chan; mite_chan 372 drivers/staging/comedi/drivers/ni_660x.c ni_660x_unset_dma_channel(dev, mite_chan->channel, counter); mite_chan 374 drivers/staging/comedi/drivers/ni_660x.c mite_release_channel(mite_chan); mite_chan 463 drivers/staging/comedi/drivers/ni_660x.c mite_sync_dma(counter->mite_chan, s); mite_chan 564 drivers/staging/comedi/drivers/ni_mio_common.c struct mite_channel *mite_chan; mite_chan 569 drivers/staging/comedi/drivers/ni_mio_common.c mite_chan = mite_request_channel(devpriv->mite, devpriv->ai_mite_ring); mite_chan 570 drivers/staging/comedi/drivers/ni_mio_common.c if (!mite_chan) { mite_chan 576 drivers/staging/comedi/drivers/ni_mio_common.c mite_chan->dir = COMEDI_INPUT; mite_chan 577 drivers/staging/comedi/drivers/ni_mio_common.c devpriv->ai_mite_chan = mite_chan; mite_chan 579 drivers/staging/comedi/drivers/ni_mio_common.c bits = NI_STC_DMA_CHAN_SEL(mite_chan->channel); mite_chan 590 drivers/staging/comedi/drivers/ni_mio_common.c struct mite_channel *mite_chan; mite_chan 595 drivers/staging/comedi/drivers/ni_mio_common.c mite_chan = mite_request_channel(devpriv->mite, devpriv->ao_mite_ring); mite_chan 596 drivers/staging/comedi/drivers/ni_mio_common.c if (!mite_chan) { mite_chan 602 drivers/staging/comedi/drivers/ni_mio_common.c mite_chan->dir = COMEDI_OUTPUT; mite_chan 603 drivers/staging/comedi/drivers/ni_mio_common.c devpriv->ao_mite_chan = mite_chan; mite_chan 605 drivers/staging/comedi/drivers/ni_mio_common.c bits = NI_STC_DMA_CHAN_SEL(mite_chan->channel); mite_chan 619 drivers/staging/comedi/drivers/ni_mio_common.c struct mite_channel *mite_chan; mite_chan 624 drivers/staging/comedi/drivers/ni_mio_common.c mite_chan = mite_request_channel(devpriv->mite, mite_chan 626 drivers/staging/comedi/drivers/ni_mio_common.c if (!mite_chan) { mite_chan 632 drivers/staging/comedi/drivers/ni_mio_common.c mite_chan->dir = direction; mite_chan 633 drivers/staging/comedi/drivers/ni_mio_common.c ni_tio_set_mite_channel(counter, mite_chan); mite_chan 635 drivers/staging/comedi/drivers/ni_mio_common.c bits = NI_STC_DMA_CHAN_SEL(mite_chan->channel); mite_chan 647 drivers/staging/comedi/drivers/ni_mio_common.c struct mite_channel *mite_chan; mite_chan 652 drivers/staging/comedi/drivers/ni_mio_common.c mite_chan = mite_request_channel(devpriv->mite, devpriv->cdo_mite_ring); mite_chan 653 drivers/staging/comedi/drivers/ni_mio_common.c if (!mite_chan) { mite_chan 659 drivers/staging/comedi/drivers/ni_mio_common.c mite_chan->dir = COMEDI_OUTPUT; mite_chan 660 drivers/staging/comedi/drivers/ni_mio_common.c devpriv->cdo_mite_chan = mite_chan; mite_chan 668 drivers/staging/comedi/drivers/ni_mio_common.c bits = NI_STC_DMA_CHAN_SEL(mite_chan->channel); mite_chan 720 drivers/staging/comedi/drivers/ni_mio_common.c if (devpriv->counter_dev->counters[gpct_index].mite_chan) { mite_chan 721 drivers/staging/comedi/drivers/ni_mio_common.c struct mite_channel *mite_chan = mite_chan 722 drivers/staging/comedi/drivers/ni_mio_common.c devpriv->counter_dev->counters[gpct_index].mite_chan; mite_chan 729 drivers/staging/comedi/drivers/ni_mio_common.c mite_release_channel(mite_chan); mite_chan 98 drivers/staging/comedi/drivers/ni_tio.h struct mite_channel *mite_chan; mite_chan 142 drivers/staging/comedi/drivers/ni_tio.h struct mite_channel *mite_chan); mite_chan 87 drivers/staging/comedi/drivers/ni_tiocmd.c if (counter->mite_chan) mite_chan 88 drivers/staging/comedi/drivers/ni_tiocmd.c mite_dma_arm(counter->mite_chan); mite_chan 113 drivers/staging/comedi/drivers/ni_tiocmd.c counter->mite_chan->dir = COMEDI_INPUT; mite_chan 117 drivers/staging/comedi/drivers/ni_tiocmd.c mite_prep_dma(counter->mite_chan, 32, 32); mite_chan 120 drivers/staging/comedi/drivers/ni_tiocmd.c mite_prep_dma(counter->mite_chan, 16, 32); mite_chan 130 drivers/staging/comedi/drivers/ni_tiocmd.c mite_dma_arm(counter->mite_chan); mite_chan 213 drivers/staging/comedi/drivers/ni_tiocmd.c if (!counter->mite_chan) { mite_chan 339 drivers/staging/comedi/drivers/ni_tiocmd.c if (counter->mite_chan) mite_chan 340 drivers/staging/comedi/drivers/ni_tiocmd.c mite_dma_disarm(counter->mite_chan); mite_chan 372 drivers/staging/comedi/drivers/ni_tiocmd.c if (!counter->mite_chan || mite_chan 373 drivers/staging/comedi/drivers/ni_tiocmd.c counter->mite_chan->dir != COMEDI_INPUT || mite_chan 374 drivers/staging/comedi/drivers/ni_tiocmd.c (mite_done(counter->mite_chan))) { mite_chan 480 drivers/staging/comedi/drivers/ni_tiocmd.c if (counter->mite_chan) mite_chan 481 drivers/staging/comedi/drivers/ni_tiocmd.c mite_ack_linkc(counter->mite_chan, s, true); mite_chan 487 drivers/staging/comedi/drivers/ni_tiocmd.c struct mite_channel *mite_chan) mite_chan 492 drivers/staging/comedi/drivers/ni_tiocmd.c counter->mite_chan = mite_chan;