int ai_convert_count; /* conversion counter */
unsigned int ai_convert_timer; /* time between conversion in
* units of the timer */
- uint16_t CounterIntEnabs; /* counter interrupt enable mask
+ uint16_t counter_int_enabs; /* counter interrupt enable mask
* for MISC2 register */
- uint8_t AdcItems; /* number of items in ADC poll list */
- struct buffer_dma RPSBuf; /* DMA buffer used to hold ADC (RPS1)
+ uint8_t adc_items; /* number of items in ADC poll list */
+ struct buffer_dma rps_buf; /* DMA buffer used to hold ADC (RPS1)
* program */
- struct buffer_dma ANABuf; /* DMA buffer used to receive ADC data
+ struct buffer_dma ana_buf; /* DMA buffer used to receive ADC data
* and hold DAC data */
- uint32_t *pDacWBuf; /* pointer to logical adrs of DMA buffer
+ uint32_t *dac_wbuf; /* pointer to logical adrs of DMA buffer
* used to hold DAC data */
- uint16_t Dacpol; /* image of DAC polarity register */
- uint8_t TrimSetpoint[12]; /* images of TrimDAC setpoints */
- uint32_t I2CAdrs; /* I2C device address for onboard EEPROM
+ uint16_t dacpol; /* image of DAC polarity register */
+ uint8_t trim_setpoint[12]; /* images of TrimDAC setpoints */
+ uint32_t i2c_adrs; /* I2C device address for onboard EEPROM
* (board rev dependent) */
unsigned int ao_readback[S626_DAC_CHANNELS];
};
* Byte1 = EEPROM internal target address.
* Byte0 = Not sent.
*/
- if (I2Chandshake(dev, I2C_B2(I2C_ATTRSTART, devpriv->I2CAdrs) |
+ if (I2Chandshake(dev, I2C_B2(I2C_ATTRSTART, devpriv->i2c_adrs) |
I2C_B1(I2C_ATTRSTOP, addr) |
I2C_B0(I2C_ATTRNOP, 0)))
/* Abort function and declare error if handshake failed. */
* Byte1 receives uint8_t from EEPROM.
* Byte0 = Not sent.
*/
- if (I2Chandshake(dev, I2C_B2(I2C_ATTRSTART, (devpriv->I2CAdrs | 1)) |
+ if (I2Chandshake(dev, I2C_B2(I2C_ATTRSTART, (devpriv->i2c_adrs | 1)) |
I2C_B1(I2C_ATTRSTOP, 0) |
I2C_B0(I2C_ATTRNOP, 0)))
/* Abort function and declare error if handshake failed. */
/*
* Private helper function: Transmit serial data to DAC via Audio
* channel 2. Assumes: (1) TSL2 slot records initialized, and (2)
- * Dacpol contains valid target image.
+ * dacpol contains valid target image.
*/
static void SendDAC(struct comedi_device *dev, uint32_t val)
{
* trailing edge of WS1/WS3 (which turns off the signals), thus
* causing the signals to be inactive during the DAC write.
*/
- DEBIwrite(dev, LP_DACPOL, devpriv->Dacpol);
+ DEBIwrite(dev, LP_DACPOL, devpriv->dacpol);
/* TRANSFER OUTPUT DWORD VALUE INTO A2'S OUTPUT FIFO ---------------- */
/* Copy DAC setpoint value to DAC's output DMA buffer. */
- /* writel(val, devpriv->mmio + (uint32_t)devpriv->pDacWBuf); */
- *devpriv->pDacWBuf = val;
+ /* writel(val, devpriv->mmio + (uint32_t)devpriv->dac_wbuf); */
+ *devpriv->dac_wbuf = val;
/*
* Enable the output DMA transfer. This will cause the DMAC to copy
signmask = 1 << chan;
if (dacdata < 0) {
dacdata = -dacdata;
- devpriv->Dacpol |= signmask;
+ devpriv->dacpol |= signmask;
} else {
- devpriv->Dacpol &= ~signmask;
+ devpriv->dacpol &= ~signmask;
}
/* Limit DAC setpoint value to valid range. */
* Save the new setpoint in case the application needs to read it back
* later.
*/
- devpriv->TrimSetpoint[LogicalChan] = (uint8_t)DacData;
+ devpriv->trim_setpoint[LogicalChan] = (uint8_t)DacData;
/* Map logical channel number to physical channel number. */
chan = trimchan[LogicalChan];
* first uint16_t in the buffer because it contains junk data
* from the final ADC of the previous poll list scan.
*/
- int32_t *readaddr = (int32_t *)devpriv->ANABuf.logical_base + 1;
+ int32_t *readaddr = (int32_t *)devpriv->ana_buf.logical_base + 1;
bool finished = false;
int i;
s626_mc_disable(dev, MC1_ERPS1, P_MC1);
/* Set starting logical address to write RPS commands. */
- pRPS = (uint32_t *)devpriv->RPSBuf.logical_base;
+ pRPS = (uint32_t *)devpriv->rps_buf.logical_base;
/* Initialize RPS instruction pointer */
- writel((uint32_t)devpriv->RPSBuf.physical_base,
+ writel((uint32_t)devpriv->rps_buf.physical_base,
devpriv->mmio + P_RPSADDR1);
- /* Construct RPS program in RPSBuf DMA buffer */
+ /* Construct RPS program in rps_buf DMA buffer */
if (cmd != NULL && cmd->scan_begin_src != TRIG_FOLLOW) {
/* Wait for Start trigger. */
*pRPS++ = RPS_PAUSE | RPS_SIGADC;
* for loop to limit the slot count to 16 in case the application
* forgot to set the EOPL flag in the final slot.
*/
- for (devpriv->AdcItems = 0; devpriv->AdcItems < 16;
- devpriv->AdcItems++) {
+ for (devpriv->adc_items = 0; devpriv->adc_items < 16;
+ devpriv->adc_items++) {
/*
* Convert application's poll list item to private board class
* format. Each app poll list item is an uint8_t with form
* instruction prefetch pipeline.
*/
JmpAdrs =
- (uint32_t)devpriv->RPSBuf.physical_base +
+ (uint32_t)devpriv->rps_buf.physical_base +
(uint32_t)((unsigned long)pRPS -
- (unsigned long)devpriv->RPSBuf.logical_base);
+ (unsigned long)devpriv->
+ rps_buf.logical_base);
for (i = 0; i < (10 * RPSCLK_PER_US / 2); i++) {
JmpAdrs += 8; /* Repeat to implement time delay: */
*pRPS++ = RPS_JUMP; /* Jump to next RPS instruction. */
/* Transfer ADC data from FB BUFFER 1 register to DMA buffer. */
*pRPS++ = RPS_STREG | (BUGFIX_STREG(P_FB_BUFFER1) >> 2);
- *pRPS++ = (uint32_t)devpriv->ANABuf.physical_base +
- (devpriv->AdcItems << 2);
+ *pRPS++ = (uint32_t)devpriv->ana_buf.physical_base +
+ (devpriv->adc_items << 2);
/*
* If this slot's EndOfPollList flag is set, all channels have
* now been processed.
*/
if (*ppl++ & EOPL) {
- devpriv->AdcItems++; /* Adjust poll list item count. */
+ devpriv->adc_items++; /* Adjust poll list item count. */
break; /* Exit poll list processing loop. */
}
}
/* Transfer final ADC data from FB BUFFER 1 register to DMA buffer. */
*pRPS++ = RPS_STREG | (BUGFIX_STREG(P_FB_BUFFER1) >> 2);
- *pRPS++ = (uint32_t)devpriv->ANABuf.physical_base +
- (devpriv->AdcItems << 2);
+ *pRPS++ = (uint32_t)devpriv->ana_buf.physical_base +
+ (devpriv->adc_items << 2);
/* Indicate ADC scan loop is finished. */
/* Signal ReadADC() that scan is done. */
/* Restart RPS program at its beginning. */
*pRPS++ = RPS_JUMP; /* Branch to start of RPS program. */
- *pRPS++ = (uint32_t)devpriv->RPSBuf.physical_base;
+ *pRPS++ = (uint32_t)devpriv->rps_buf.physical_base;
/* End of RPS program build */
}
* first uint16_t in the buffer because it contains junk data from
* the final ADC of the previous poll list scan.
*/
- readaddr = (uint32_t *)devpriv->ANABuf.logical_base + 1;
+ readaddr = (uint32_t *)devpriv->ana_buf.logical_base + 1;
/*
* Convert ADC data to 16-bit integer values and
* copy to application buffer.
*/
- for (i = 0; i < devpriv->AdcItems; i++) {
+ for (i = 0; i < devpriv->adc_items; i++) {
*data = s626_ai_reg_to_uint(*readaddr++);
data++;
}
* enable mask to indicate the counter interrupt is disabled.
*/
if (DisableIntSrc)
- devpriv->CounterIntEnabs &= ~k->MyEventBits[3];
+ devpriv->counter_int_enabs &= ~k->MyEventBits[3];
/*
* While retaining CounterB and LatchSrc configurations, program the
* enable mask to indicate the counter interrupt is disabled.
*/
if (DisableIntSrc)
- devpriv->CounterIntEnabs &= ~k->MyEventBits[3];
+ devpriv->counter_int_enabs &= ~k->MyEventBits[3];
/*
* While retaining CounterA and LatchSrc configurations, program the
IntSource << CRABIT_INTSRC_A);
/* Update MISC2 interrupt enable mask. */
- devpriv->CounterIntEnabs =
- (devpriv->CounterIntEnabs & ~k->
+ devpriv->counter_int_enabs =
+ (devpriv->counter_int_enabs & ~k->
MyEventBits[3]) | k->MyEventBits[IntSource];
}
(IntSource << CRBBIT_INTSRC_B)));
/* Update MISC2 interrupt enable mask. */
- devpriv->CounterIntEnabs =
- (devpriv->CounterIntEnabs & ~k->MyEventBits[3]) |
+ devpriv->counter_int_enabs =
+ (devpriv->counter_int_enabs & ~k->MyEventBits[3]) |
k->MyEventBits[IntSource];
}
addr = pci_alloc_consistent(pcidev, DMABUF_SIZE, &appdma);
if (!addr)
return -ENOMEM;
- devpriv->ANABuf.logical_base = addr;
- devpriv->ANABuf.physical_base = appdma;
+ devpriv->ana_buf.logical_base = addr;
+ devpriv->ana_buf.physical_base = appdma;
addr = pci_alloc_consistent(pcidev, DMABUF_SIZE, &appdma);
if (!addr)
return -ENOMEM;
- devpriv->RPSBuf.logical_base = addr;
- devpriv->RPSBuf.physical_base = appdma;
+ devpriv->rps_buf.logical_base = addr;
+ devpriv->rps_buf.physical_base = appdma;
return 0;
}
writel(GPIO_BASE | GPIO1_HI, devpriv->mmio + P_GPIO);
/* I2C device address for onboard eeprom (revb) */
- devpriv->I2CAdrs = 0xA0;
+ devpriv->i2c_adrs = 0xA0;
/*
* Issue an I2C ABORT command to halt any I2C
*/
/* Physical start of RPS program */
- writel((uint32_t)devpriv->RPSBuf.physical_base,
+ writel((uint32_t)devpriv->rps_buf.physical_base,
devpriv->mmio + P_RPSADDR1);
/* RPS program performs no explicit mem writes */
writel(0, devpriv->mmio + P_RPSPAGE1);
* single DWORD will be transferred each time a DMA transfer is
* enabled.
*/
- pPhysBuf = devpriv->ANABuf.physical_base +
+ pPhysBuf = devpriv->ana_buf.physical_base +
(DAC_WDMABUF_OS * sizeof(uint32_t));
writel((uint32_t)pPhysBuf, devpriv->mmio + P_BASEA2_OUT);
writel((uint32_t)(pPhysBuf + sizeof(uint32_t)),
* Cache Audio2's output DMA buffer logical address. This is
* where DAC data is buffered for A2 output DMA transfers.
*/
- devpriv->pDacWBuf = (uint32_t *)devpriv->ANABuf.logical_base +
+ devpriv->dac_wbuf = (uint32_t *)devpriv->ana_buf.logical_base +
DAC_WDMABUF_OS;
/*
writel(MC1_SHUTDOWN, devpriv->mmio + P_MC1);
writel(ACON1_BASE, devpriv->mmio + P_ACON1);
- CloseDMAB(dev, &devpriv->RPSBuf, DMABUF_SIZE);
- CloseDMAB(dev, &devpriv->ANABuf, DMABUF_SIZE);
+ CloseDMAB(dev, &devpriv->rps_buf, DMABUF_SIZE);
+ CloseDMAB(dev, &devpriv->ana_buf, DMABUF_SIZE);
}
if (dev->irq)