提交 2b20f61c 编写于 作者: H H Hartley Sweeten 提交者: Greg Kroah-Hartman

staging: comedi: rtd520: remove RtdPlxInterruptRead macro

This macro uses the 'devpriv' macro which relies on a local variable
having a specific name. Plus it's just a wrapper around a simple
'readl'. Remove the macro.
Signed-off-by: NH Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 ae964452
...@@ -407,8 +407,6 @@ struct rtdPrivate { ...@@ -407,8 +407,6 @@ struct rtdPrivate {
/* Macros to access registers */ /* Macros to access registers */
/* PLX9080 interrupt mask and status */ /* PLX9080 interrupt mask and status */
#define RtdPlxInterruptRead(dev) \
readl(devpriv->lcfg+LCFG_ITCSR)
#define RtdPlxInterruptWrite(dev, v) \ #define RtdPlxInterruptWrite(dev, v) \
writel(v, devpriv->lcfg+LCFG_ITCSR) writel(v, devpriv->lcfg+LCFG_ITCSR)
...@@ -900,7 +898,7 @@ static irqreturn_t rtd_interrupt(int irq, /* interrupt number (ignored) */ ...@@ -900,7 +898,7 @@ static irqreturn_t rtd_interrupt(int irq, /* interrupt number (ignored) */
} }
#ifdef USE_DMA #ifdef USE_DMA
if (devpriv->flags & DMA0_ACTIVE) { /* Check DMA */ if (devpriv->flags & DMA0_ACTIVE) { /* Check DMA */
u32 istatus = RtdPlxInterruptRead(dev); u32 istatus = readl(devpriv->lcfg + LCFG_ITCSR);
if (istatus & ICS_DMA0_A) { if (istatus & ICS_DMA0_A) {
if (ai_process_dma(dev, s) < 0) { if (ai_process_dma(dev, s) < 0) {
...@@ -1010,8 +1008,8 @@ static irqreturn_t rtd_interrupt(int irq, /* interrupt number (ignored) */ ...@@ -1010,8 +1008,8 @@ static irqreturn_t rtd_interrupt(int irq, /* interrupt number (ignored) */
writew(devpriv->intMask, devpriv->las0 + LAS0_IT); writew(devpriv->intMask, devpriv->las0 + LAS0_IT);
#ifdef USE_DMA #ifdef USE_DMA
if (devpriv->flags & DMA0_ACTIVE) { if (devpriv->flags & DMA0_ACTIVE) {
RtdPlxInterruptWrite(dev, /* disable any more interrupts */ RtdPlxInterruptWrite(dev,
RtdPlxInterruptRead(dev) & ~ICS_DMA0_E); readl(devpriv->lcfg + LCFG_ITCSR) & ~ICS_DMA0_E);
abort_dma(dev, 0); abort_dma(dev, 0);
devpriv->flags &= ~DMA0_ACTIVE; devpriv->flags &= ~DMA0_ACTIVE;
/* if Using DMA, then we should have read everything by now */ /* if Using DMA, then we should have read everything by now */
...@@ -1281,14 +1279,13 @@ static int rtd_ai_cmd(struct comedi_device *dev, struct comedi_subdevice *s) ...@@ -1281,14 +1279,13 @@ static int rtd_ai_cmd(struct comedi_device *dev, struct comedi_subdevice *s)
writew(devpriv->intMask, devpriv->las0 + LAS0_IT); writew(devpriv->intMask, devpriv->las0 + LAS0_IT);
#ifdef USE_DMA #ifdef USE_DMA
if (devpriv->flags & DMA0_ACTIVE) { /* cancel anything running */ if (devpriv->flags & DMA0_ACTIVE) { /* cancel anything running */
RtdPlxInterruptWrite(dev, /* disable any more interrupts */ RtdPlxInterruptWrite(dev,
RtdPlxInterruptRead(dev) & ~ICS_DMA0_E); readl(devpriv->lcfg + LCFG_ITCSR) & ~ICS_DMA0_E);
abort_dma(dev, 0); abort_dma(dev, 0);
devpriv->flags &= ~DMA0_ACTIVE; devpriv->flags &= ~DMA0_ACTIVE;
if (RtdPlxInterruptRead(dev) & ICS_DMA0_A) { /*clear pending int */ if (readl(devpriv->lcfg + LCFG_ITCSR) & ICS_DMA0_A)
RtdDma0Control(dev, PLX_CLEAR_DMA_INTR_BIT); RtdDma0Control(dev, PLX_CLEAR_DMA_INTR_BIT);
} }
}
writel(0, devpriv->las0 + LAS0_DMA0_RESET); writel(0, devpriv->las0 + LAS0_DMA0_RESET);
#endif /* USE_DMA */ #endif /* USE_DMA */
writel(0, devpriv->las0 + LAS0_ADC_FIFO_CLEAR); writel(0, devpriv->las0 + LAS0_ADC_FIFO_CLEAR);
...@@ -1449,14 +1446,13 @@ static int rtd_ai_cmd(struct comedi_device *dev, struct comedi_subdevice *s) ...@@ -1449,14 +1446,13 @@ static int rtd_ai_cmd(struct comedi_device *dev, struct comedi_subdevice *s)
RtdDma0Next(dev, /* point to first block */ RtdDma0Next(dev, /* point to first block */
devpriv->dma0Chain[DMA_CHAIN_COUNT - 1].next); devpriv->dma0Chain[DMA_CHAIN_COUNT - 1].next);
writel(DMAS_ADFIFO_HALF_FULL, devpriv->las0 + LAS0_DMA0_SRC); writel(DMAS_ADFIFO_HALF_FULL, devpriv->las0 + LAS0_DMA0_SRC);
RtdPlxInterruptWrite(dev,
RtdPlxInterruptWrite(dev, /* enable interrupt */ readl(devpriv->lcfg + LCFG_ITCSR) | ICS_DMA0_E);
RtdPlxInterruptRead(dev) | ICS_DMA0_E);
/* Must be 2 steps. See PLX app note about "Starting a DMA transfer" */ /* Must be 2 steps. See PLX app note about "Starting a DMA transfer" */
RtdDma0Control(dev, PLX_DMA_EN_BIT); /* enable DMA (clear INTR?) */ RtdDma0Control(dev, PLX_DMA_EN_BIT); /* enable DMA (clear INTR?) */
RtdDma0Control(dev, PLX_DMA_EN_BIT | PLX_DMA_START_BIT); /*start DMA */ RtdDma0Control(dev, PLX_DMA_EN_BIT | PLX_DMA_START_BIT); /*start DMA */
DPRINTK("rtd520: Using DMA0 transfers. plxInt %x RtdInt %x\n", DPRINTK("rtd520: Using DMA0 transfers. plxInt %x RtdInt %x\n",
RtdPlxInterruptRead(dev), devpriv->intMask); readl(devpriv->lcfg + LCFG_ITCSR), devpriv->intMask);
#else /* USE_DMA */ #else /* USE_DMA */
devpriv->intMask = IRQM_ADC_ABOUT_CNT; devpriv->intMask = IRQM_ADC_ABOUT_CNT;
writew(devpriv->intMask, devpriv->las0 + LAS0_IT); writew(devpriv->intMask, devpriv->las0 + LAS0_IT);
...@@ -1486,8 +1482,8 @@ static int rtd_ai_cancel(struct comedi_device *dev, struct comedi_subdevice *s) ...@@ -1486,8 +1482,8 @@ static int rtd_ai_cancel(struct comedi_device *dev, struct comedi_subdevice *s)
devpriv->aiCount = 0; /* stop and don't transfer any more */ devpriv->aiCount = 0; /* stop and don't transfer any more */
#ifdef USE_DMA #ifdef USE_DMA
if (devpriv->flags & DMA0_ACTIVE) { if (devpriv->flags & DMA0_ACTIVE) {
RtdPlxInterruptWrite(dev, /* disable any more interrupts */ RtdPlxInterruptWrite(dev,
RtdPlxInterruptRead(dev) & ~ICS_DMA0_E); readl(devpriv->lcfg + LCFG_ITCSR) & ~ICS_DMA0_E);
abort_dma(dev, 0); abort_dma(dev, 0);
devpriv->flags &= ~DMA0_ACTIVE; devpriv->flags &= ~DMA0_ACTIVE;
} }
...@@ -1983,9 +1979,9 @@ static int rtd_attach(struct comedi_device *dev, struct comedi_devconfig *it) ...@@ -1983,9 +1979,9 @@ static int rtd_attach(struct comedi_device *dev, struct comedi_devconfig *it)
#endif /* USE_DMA */ #endif /* USE_DMA */
/* subdevices and priv are freed by the core */ /* subdevices and priv are freed by the core */
if (dev->irq) { if (dev->irq) {
/* disable interrupt controller */ RtdPlxInterruptWrite(dev,
RtdPlxInterruptWrite(dev, RtdPlxInterruptRead(dev) readl(devpriv->lcfg + LCFG_ITCSR) &
& ~(ICS_PLIE | ICS_DMA0_E | ICS_DMA1_E)); ~(ICS_PLIE | ICS_DMA0_E | ICS_DMA1_E));
free_irq(dev->irq, dev); free_irq(dev->irq, dev);
} }
...@@ -2052,9 +2048,9 @@ static void rtd_detach(struct comedi_device *dev) ...@@ -2052,9 +2048,9 @@ static void rtd_detach(struct comedi_device *dev)
} }
#endif /* USE_DMA */ #endif /* USE_DMA */
if (dev->irq) { if (dev->irq) {
RtdPlxInterruptWrite(dev, RtdPlxInterruptRead(dev) RtdPlxInterruptWrite(dev,
& ~(ICS_PLIE | ICS_DMA0_E | readl(devpriv->lcfg + LCFG_ITCSR) &
ICS_DMA1_E)); ~(ICS_PLIE | ICS_DMA0_E | ICS_DMA1_E));
free_irq(dev->irq, dev); free_irq(dev->irq, dev);
} }
if (devpriv->las0) if (devpriv->las0)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册