}
unsigned int mite_ack_linkc(struct mite_channel *mite_chan,
- struct comedi_subdevice *s)
+ struct comedi_subdevice *s,
+ bool sync)
{
struct mite_struct *mite = mite_chan->mite;
unsigned int status;
status = mite_get_status(mite_chan);
- if (status & CHSR_LINKC)
+ if (status & CHSR_LINKC) {
writel(CHOR_CLRLC,
mite->mite_io_addr + MITE_CHOR(mite_chan->channel));
+ sync = true;
+ }
+ if (sync)
+ mite_sync_dma(mite_chan, s);
+
if (status & CHSR_XFERR) {
dev_err(s->device->class_dev,
"mite: transfer error %08x\n", status);
void mite_dma_disarm(struct mite_channel *mite_chan);
void mite_sync_dma(struct mite_channel *mite_chan, struct comedi_subdevice *s);
u32 mite_bytes_in_transit(struct mite_channel *mite_chan);
-unsigned int mite_ack_linkc(struct mite_channel *mite_chan,
- struct comedi_subdevice *s);
+unsigned int mite_ack_linkc(struct mite_channel *, struct comedi_subdevice *,
+ bool sync);
int mite_done(struct mite_channel *mite_chan);
void mite_prep_dma(struct mite_channel *mite_chan,
unsigned long flags;
spin_lock_irqsave(&devpriv->mite_channel_lock, flags);
- if (devpriv->cdo_mite_chan) {
- mite_ack_linkc(devpriv->cdo_mite_chan, s);
- mite_sync_dma(devpriv->cdo_mite_chan, s);
- }
+ if (devpriv->cdo_mite_chan)
+ mite_ack_linkc(devpriv->cdo_mite_chan, s, true);
spin_unlock_irqrestore(&devpriv->mite_channel_lock, flags);
cdio_status = ni_readl(dev, NI_M_CDIO_STATUS_REG);
#ifdef PCIDMA
if (devpriv->mite) {
unsigned long flags_too;
- unsigned int m_status;
spin_lock_irqsave(&devpriv->mite_channel_lock, flags_too);
- if (s_ai && devpriv->ai_mite_chan) {
- m_status = mite_ack_linkc(devpriv->ai_mite_chan, s_ai);
- if (m_status & CHSR_LINKC)
- mite_sync_dma(devpriv->ai_mite_chan, s_ai);
- }
-
- if (s_ao && devpriv->ao_mite_chan) {
- m_status = mite_ack_linkc(devpriv->ao_mite_chan, s_ao);
- if (m_status & CHSR_LINKC)
- mite_sync_dma(devpriv->ao_mite_chan, s_ao);
- }
-
+ if (s_ai && devpriv->ai_mite_chan)
+ mite_ack_linkc(devpriv->ai_mite_chan, s_ai, false);
+ if (s_ao && devpriv->ao_mite_chan)
+ mite_ack_linkc(devpriv->ao_mite_chan, s_ao, false);
spin_unlock_irqrestore(&devpriv->mite_channel_lock, flags_too);
}
#endif
spin_lock(&devpriv->mite_channel_lock);
if (devpriv->di_mite_chan) {
- unsigned int m_status = mite_ack_linkc(devpriv->di_mite_chan,
- s);
-
- if (m_status & CHSR_LINKC) {
- mite_sync_dma(devpriv->di_mite_chan, s);
- /* XXX need to byteswap */
- }
+ mite_ack_linkc(devpriv->di_mite_chan, s, false);
+ /* XXX need to byteswap sync'ed dma */
}
spin_unlock(&devpriv->mite_channel_lock);
break;
}
spin_lock_irqsave(&counter->lock, flags);
- if (counter->mite_chan) {
- mite_ack_linkc(counter->mite_chan, s);
- mite_sync_dma(counter->mite_chan, s);
- }
+ if (counter->mite_chan)
+ mite_ack_linkc(counter->mite_chan, s, true);
spin_unlock_irqrestore(&counter->lock, flags);
}
EXPORT_SYMBOL_GPL(ni_tio_handle_interrupt);