Commit 3a387506 authored by Ian Abbott's avatar Ian Abbott Committed by Greg Kroah-Hartman

staging: comedi: s626: replace CamelCase struct bufferDMA

Rename `struct bufferDMA` and its members to avoid CamelCase.
Signed-off-by: default avatarIan Abbott <abbotti@mev.co.uk>
Reviewed-by: default avatarH Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 6e3fc69d
...@@ -84,9 +84,9 @@ struct s626_private { ...@@ -84,9 +84,9 @@ struct s626_private {
uint16_t CounterIntEnabs; /* counter interrupt enable mask uint16_t CounterIntEnabs; /* counter interrupt enable mask
* for MISC2 register */ * for MISC2 register */
uint8_t AdcItems; /* number of items in ADC poll list */ uint8_t AdcItems; /* number of items in ADC poll list */
struct bufferDMA RPSBuf; /* DMA buffer used to hold ADC (RPS1) struct buffer_dma RPSBuf; /* DMA buffer used to hold ADC (RPS1)
* program */ * program */
struct bufferDMA ANABuf; /* DMA buffer used to receive ADC data struct buffer_dma ANABuf; /* DMA buffer used to receive ADC data
* and hold DAC data */ * and hold DAC data */
uint32_t *pDacWBuf; /* pointer to logical adrs of DMA buffer uint32_t *pDacWBuf; /* pointer to logical adrs of DMA buffer
* used to hold DAC data */ * used to hold DAC data */
...@@ -857,7 +857,7 @@ static bool handle_eos_interrupt(struct comedi_device *dev) ...@@ -857,7 +857,7 @@ static bool handle_eos_interrupt(struct comedi_device *dev)
* first uint16_t in the buffer because it contains junk data * first uint16_t in the buffer because it contains junk data
* from the final ADC of the previous poll list scan. * from the final ADC of the previous poll list scan.
*/ */
int32_t *readaddr = (int32_t *)devpriv->ANABuf.LogicalBase + 1; int32_t *readaddr = (int32_t *)devpriv->ANABuf.logical_base + 1;
bool finished = false; bool finished = false;
int i; int i;
...@@ -964,10 +964,10 @@ static void ResetADC(struct comedi_device *dev, uint8_t *ppl) ...@@ -964,10 +964,10 @@ static void ResetADC(struct comedi_device *dev, uint8_t *ppl)
s626_mc_disable(dev, MC1_ERPS1, P_MC1); s626_mc_disable(dev, MC1_ERPS1, P_MC1);
/* Set starting logical address to write RPS commands. */ /* Set starting logical address to write RPS commands. */
pRPS = (uint32_t *)devpriv->RPSBuf.LogicalBase; pRPS = (uint32_t *)devpriv->RPSBuf.logical_base;
/* Initialize RPS instruction pointer */ /* Initialize RPS instruction pointer */
writel((uint32_t)devpriv->RPSBuf.PhysicalBase, writel((uint32_t)devpriv->RPSBuf.physical_base,
devpriv->mmio + P_RPSADDR1); devpriv->mmio + P_RPSADDR1);
/* Construct RPS program in RPSBuf DMA buffer */ /* Construct RPS program in RPSBuf DMA buffer */
...@@ -1047,9 +1047,9 @@ static void ResetADC(struct comedi_device *dev, uint8_t *ppl) ...@@ -1047,9 +1047,9 @@ static void ResetADC(struct comedi_device *dev, uint8_t *ppl)
* instruction prefetch pipeline. * instruction prefetch pipeline.
*/ */
JmpAdrs = JmpAdrs =
(uint32_t)devpriv->RPSBuf.PhysicalBase + (uint32_t)devpriv->RPSBuf.physical_base +
(uint32_t)((unsigned long)pRPS - (uint32_t)((unsigned long)pRPS -
(unsigned long)devpriv->RPSBuf.LogicalBase); (unsigned long)devpriv->RPSBuf.logical_base);
for (i = 0; i < (10 * RPSCLK_PER_US / 2); i++) { for (i = 0; i < (10 * RPSCLK_PER_US / 2); i++) {
JmpAdrs += 8; /* Repeat to implement time delay: */ JmpAdrs += 8; /* Repeat to implement time delay: */
*pRPS++ = RPS_JUMP; /* Jump to next RPS instruction. */ *pRPS++ = RPS_JUMP; /* Jump to next RPS instruction. */
...@@ -1079,7 +1079,7 @@ static void ResetADC(struct comedi_device *dev, uint8_t *ppl) ...@@ -1079,7 +1079,7 @@ static void ResetADC(struct comedi_device *dev, uint8_t *ppl)
/* Transfer ADC data from FB BUFFER 1 register to DMA buffer. */ /* Transfer ADC data from FB BUFFER 1 register to DMA buffer. */
*pRPS++ = RPS_STREG | (BUGFIX_STREG(P_FB_BUFFER1) >> 2); *pRPS++ = RPS_STREG | (BUGFIX_STREG(P_FB_BUFFER1) >> 2);
*pRPS++ = (uint32_t)devpriv->ANABuf.PhysicalBase + *pRPS++ = (uint32_t)devpriv->ANABuf.physical_base +
(devpriv->AdcItems << 2); (devpriv->AdcItems << 2);
/* /*
...@@ -1122,7 +1122,7 @@ static void ResetADC(struct comedi_device *dev, uint8_t *ppl) ...@@ -1122,7 +1122,7 @@ static void ResetADC(struct comedi_device *dev, uint8_t *ppl)
/* Transfer final ADC data from FB BUFFER 1 register to DMA buffer. */ /* Transfer final ADC data from FB BUFFER 1 register to DMA buffer. */
*pRPS++ = RPS_STREG | (BUGFIX_STREG(P_FB_BUFFER1) >> 2); *pRPS++ = RPS_STREG | (BUGFIX_STREG(P_FB_BUFFER1) >> 2);
*pRPS++ = (uint32_t)devpriv->ANABuf.PhysicalBase + *pRPS++ = (uint32_t)devpriv->ANABuf.physical_base +
(devpriv->AdcItems << 2); (devpriv->AdcItems << 2);
/* Indicate ADC scan loop is finished. */ /* Indicate ADC scan loop is finished. */
...@@ -1135,7 +1135,7 @@ static void ResetADC(struct comedi_device *dev, uint8_t *ppl) ...@@ -1135,7 +1135,7 @@ static void ResetADC(struct comedi_device *dev, uint8_t *ppl)
/* Restart RPS program at its beginning. */ /* Restart RPS program at its beginning. */
*pRPS++ = RPS_JUMP; /* Branch to start of RPS program. */ *pRPS++ = RPS_JUMP; /* Branch to start of RPS program. */
*pRPS++ = (uint32_t)devpriv->RPSBuf.PhysicalBase; *pRPS++ = (uint32_t)devpriv->RPSBuf.physical_base;
/* End of RPS program build */ /* End of RPS program build */
} }
...@@ -1162,7 +1162,7 @@ static int s626_ai_rinsn(struct comedi_device *dev, ...@@ -1162,7 +1162,7 @@ static int s626_ai_rinsn(struct comedi_device *dev,
* first uint16_t in the buffer because it contains junk data from * first uint16_t in the buffer because it contains junk data from
* the final ADC of the previous poll list scan. * the final ADC of the previous poll list scan.
*/ */
readaddr = (uint32_t *)devpriv->ANABuf.LogicalBase + 1; readaddr = (uint32_t *)devpriv->ANABuf.logical_base + 1;
/* /*
* Convert ADC data to 16-bit integer values and * Convert ADC data to 16-bit integer values and
...@@ -1789,7 +1789,7 @@ static void WriteMISC2(struct comedi_device *dev, uint16_t NewImage) ...@@ -1789,7 +1789,7 @@ static void WriteMISC2(struct comedi_device *dev, uint16_t NewImage)
DEBIwrite(dev, LP_MISC1, MISC1_WDISABLE); /* Disable writes to MISC2. */ DEBIwrite(dev, LP_MISC1, MISC1_WDISABLE); /* Disable writes to MISC2. */
} }
static void CloseDMAB(struct comedi_device *dev, struct bufferDMA *pdma, static void CloseDMAB(struct comedi_device *dev, struct buffer_dma *pdma,
size_t bsize) size_t bsize)
{ {
struct pci_dev *pcidev = comedi_to_pci_dev(dev); struct pci_dev *pcidev = comedi_to_pci_dev(dev);
...@@ -1800,12 +1800,12 @@ static void CloseDMAB(struct comedi_device *dev, struct bufferDMA *pdma, ...@@ -1800,12 +1800,12 @@ static void CloseDMAB(struct comedi_device *dev, struct bufferDMA *pdma,
return; return;
/* find the matching allocation from the board struct */ /* find the matching allocation from the board struct */
vbptr = pdma->LogicalBase; vbptr = pdma->logical_base;
vpptr = pdma->PhysicalBase; vpptr = pdma->physical_base;
if (vbptr) { if (vbptr) {
pci_free_consistent(pcidev, bsize, vbptr, vpptr); pci_free_consistent(pcidev, bsize, vbptr, vpptr);
pdma->LogicalBase = NULL; pdma->logical_base = NULL;
pdma->PhysicalBase = 0; pdma->physical_base = 0;
} }
} }
...@@ -2470,14 +2470,14 @@ static int s626_allocate_dma_buffers(struct comedi_device *dev) ...@@ -2470,14 +2470,14 @@ static int s626_allocate_dma_buffers(struct comedi_device *dev)
addr = pci_alloc_consistent(pcidev, DMABUF_SIZE, &appdma); addr = pci_alloc_consistent(pcidev, DMABUF_SIZE, &appdma);
if (!addr) if (!addr)
return -ENOMEM; return -ENOMEM;
devpriv->ANABuf.LogicalBase = addr; devpriv->ANABuf.logical_base = addr;
devpriv->ANABuf.PhysicalBase = appdma; devpriv->ANABuf.physical_base = appdma;
addr = pci_alloc_consistent(pcidev, DMABUF_SIZE, &appdma); addr = pci_alloc_consistent(pcidev, DMABUF_SIZE, &appdma);
if (!addr) if (!addr)
return -ENOMEM; return -ENOMEM;
devpriv->RPSBuf.LogicalBase = addr; devpriv->RPSBuf.logical_base = addr;
devpriv->RPSBuf.PhysicalBase = appdma; devpriv->RPSBuf.physical_base = appdma;
return 0; return 0;
} }
...@@ -2557,7 +2557,7 @@ static void s626_initialize(struct comedi_device *dev) ...@@ -2557,7 +2557,7 @@ static void s626_initialize(struct comedi_device *dev)
*/ */
/* Physical start of RPS program */ /* Physical start of RPS program */
writel((uint32_t)devpriv->RPSBuf.PhysicalBase, writel((uint32_t)devpriv->RPSBuf.physical_base,
devpriv->mmio + P_RPSADDR1); devpriv->mmio + P_RPSADDR1);
/* RPS program performs no explicit mem writes */ /* RPS program performs no explicit mem writes */
writel(0, devpriv->mmio + P_RPSPAGE1); writel(0, devpriv->mmio + P_RPSPAGE1);
...@@ -2625,7 +2625,7 @@ static void s626_initialize(struct comedi_device *dev) ...@@ -2625,7 +2625,7 @@ static void s626_initialize(struct comedi_device *dev)
* single DWORD will be transferred each time a DMA transfer is * single DWORD will be transferred each time a DMA transfer is
* enabled. * enabled.
*/ */
pPhysBuf = devpriv->ANABuf.PhysicalBase + pPhysBuf = devpriv->ANABuf.physical_base +
(DAC_WDMABUF_OS * sizeof(uint32_t)); (DAC_WDMABUF_OS * sizeof(uint32_t));
writel((uint32_t)pPhysBuf, devpriv->mmio + P_BASEA2_OUT); writel((uint32_t)pPhysBuf, devpriv->mmio + P_BASEA2_OUT);
writel((uint32_t)(pPhysBuf + sizeof(uint32_t)), writel((uint32_t)(pPhysBuf + sizeof(uint32_t)),
...@@ -2635,7 +2635,7 @@ static void s626_initialize(struct comedi_device *dev) ...@@ -2635,7 +2635,7 @@ static void s626_initialize(struct comedi_device *dev)
* Cache Audio2's output DMA buffer logical address. This is * Cache Audio2's output DMA buffer logical address. This is
* where DAC data is buffered for A2 output DMA transfers. * where DAC data is buffered for A2 output DMA transfers.
*/ */
devpriv->pDacWBuf = (uint32_t *)devpriv->ANABuf.LogicalBase + devpriv->pDacWBuf = (uint32_t *)devpriv->ANABuf.logical_base +
DAC_WDMABUF_OS; DAC_WDMABUF_OS;
/* /*
......
...@@ -622,9 +622,9 @@ ...@@ -622,9 +622,9 @@
#define STDMSK_CLKMULT (3 << STDBIT_CLKMULT) #define STDMSK_CLKMULT (3 << STDBIT_CLKMULT)
#define STDMSK_CLKENAB (1 << STDBIT_CLKENAB) #define STDMSK_CLKENAB (1 << STDBIT_CLKENAB)
struct bufferDMA { struct buffer_dma {
dma_addr_t PhysicalBase; dma_addr_t physical_base;
void *LogicalBase; void *logical_base;
}; };
#endif #endif
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment