[PATCH 13/50] staging: comedi: cb_pcidas64: use struct comedi_kcmd

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Use `struct comedi_kcmd` instead of `struct comedi_cmd`.

Signed-off-by: Ian Abbott <abbotti@xxxxxxxxx>
---
 drivers/staging/comedi/drivers/cb_pcidas64.c | 70 ++++++++++++++--------------
 1 file changed, 36 insertions(+), 34 deletions(-)

diff --git a/drivers/staging/comedi/drivers/cb_pcidas64.c b/drivers/staging/comedi/drivers/cb_pcidas64.c
index 7168883..0d0ecd0 100644
--- a/drivers/staging/comedi/drivers/cb_pcidas64.c
+++ b/drivers/staging/comedi/drivers/cb_pcidas64.c
@@ -1110,12 +1110,12 @@ static int ao_readback_insn(struct comedi_device *dev,
 			    struct comedi_insn *insn, unsigned int *data);
 static int ai_cmd(struct comedi_device *dev, struct comedi_subdevice *s);
 static int ai_cmdtest(struct comedi_device *dev, struct comedi_subdevice *s,
-		      struct comedi_cmd *cmd);
+		      struct comedi_kcmd *cmd);
 static int ao_cmd(struct comedi_device *dev, struct comedi_subdevice *s);
 static int ao_inttrig(struct comedi_device *dev,
 		      struct comedi_subdevice *subdev, unsigned int trig_num);
 static int ao_cmdtest(struct comedi_device *dev, struct comedi_subdevice *s,
-		      struct comedi_cmd *cmd);
+		      struct comedi_kcmd *cmd);
 static irqreturn_t handle_interrupt(int irq, void *d);
 static int ai_cancel(struct comedi_device *dev, struct comedi_subdevice *s);
 static int ao_cancel(struct comedi_device *dev, struct comedi_subdevice *s);
@@ -1147,7 +1147,8 @@ static int ad8402_write_insn(struct comedi_device *dev,
 static int eeprom_read_insn(struct comedi_device *dev,
 			    struct comedi_subdevice *s,
 			    struct comedi_insn *insn, unsigned int *data);
-static void check_adc_timing(struct comedi_device *dev, struct comedi_cmd *cmd);
+static void check_adc_timing(struct comedi_device *dev,
+			     struct comedi_kcmd *cmd);
 static unsigned int get_divisor(unsigned int ns, unsigned int flags);
 static void i2c_write(struct comedi_device *dev, unsigned int address,
 		      const uint8_t *data, unsigned int length);
@@ -1168,10 +1169,10 @@ static int set_ai_fifo_segment_length(struct comedi_device *dev,
 static void disable_ai_pacing(struct comedi_device *dev);
 static void disable_ai_interrupts(struct comedi_device *dev);
 static void enable_ai_interrupts(struct comedi_device *dev,
-				 const struct comedi_cmd *cmd);
+				 const struct comedi_kcmd *cmd);
 static unsigned int get_ao_divisor(unsigned int ns, unsigned int flags);
 static void load_ao_dma(struct comedi_device *dev,
-			const struct comedi_cmd *cmd);
+			const struct comedi_kcmd *cmd);
 
 static unsigned int ai_range_bits_6xxx(const struct comedi_device *dev,
 				       unsigned int range_index)
@@ -2105,7 +2106,7 @@ static int ai_config_insn(struct comedi_device *dev, struct comedi_subdevice *s,
 }
 
 static int ai_cmdtest(struct comedi_device *dev, struct comedi_subdevice *s,
-		      struct comedi_cmd *cmd)
+		      struct comedi_kcmd *cmd)
 {
 	int err = 0;
 	int tmp;
@@ -2289,7 +2290,7 @@ static int ai_cmdtest(struct comedi_device *dev, struct comedi_subdevice *s,
 	return 0;
 }
 
-static int use_hw_sample_counter(struct comedi_cmd *cmd)
+static int use_hw_sample_counter(struct comedi_kcmd *cmd)
 {
 /* disable for now until I work out a race */
 	return 0;
@@ -2301,7 +2302,7 @@ static int use_hw_sample_counter(struct comedi_cmd *cmd)
 }
 
 static void setup_sample_counters(struct comedi_device *dev,
-				  struct comedi_cmd *cmd)
+				  struct comedi_kcmd *cmd)
 {
 	if (cmd->stop_src == TRIG_COUNT) {
 		/*  set software count */
@@ -2365,7 +2366,7 @@ static void disable_ai_interrupts(struct comedi_device *dev)
 }
 
 static void enable_ai_interrupts(struct comedi_device *dev,
-				 const struct comedi_cmd *cmd)
+				 const struct comedi_kcmd *cmd)
 {
 	uint32_t bits;
 	unsigned long flags;
@@ -2387,14 +2388,14 @@ static void enable_ai_interrupts(struct comedi_device *dev,
 }
 
 static uint32_t ai_convert_counter_6xxx(const struct comedi_device *dev,
-					const struct comedi_cmd *cmd)
+					const struct comedi_kcmd *cmd)
 {
 	/*  supposed to load counter with desired divisor minus 3 */
 	return cmd->convert_arg / TIMER_BASE - 3;
 }
 
 static uint32_t ai_scan_counter_6xxx(struct comedi_device *dev,
-				     struct comedi_cmd *cmd)
+				     struct comedi_kcmd *cmd)
 {
 	uint32_t count;
 	/*  figure out how long we need to delay at end of scan */
@@ -2415,7 +2416,7 @@ static uint32_t ai_scan_counter_6xxx(struct comedi_device *dev,
 }
 
 static uint32_t ai_convert_counter_4020(struct comedi_device *dev,
-					struct comedi_cmd *cmd)
+					struct comedi_kcmd *cmd)
 {
 	unsigned int divisor;
 
@@ -2437,7 +2438,7 @@ static uint32_t ai_convert_counter_4020(struct comedi_device *dev,
 }
 
 static void select_master_clock_4020(struct comedi_device *dev,
-				     const struct comedi_cmd *cmd)
+				     const struct comedi_kcmd *cmd)
 {
 	/*  select internal/external master clock */
 	priv(dev)->hw_config_bits &= ~MASTER_CLOCK_4020_MASK;
@@ -2456,7 +2457,7 @@ static void select_master_clock_4020(struct comedi_device *dev,
 }
 
 static void select_master_clock(struct comedi_device *dev,
-				const struct comedi_cmd *cmd)
+				const struct comedi_kcmd *cmd)
 {
 	switch (board(dev)->layout) {
 	case LAYOUT_4020:
@@ -2485,7 +2486,7 @@ static inline void dma_start_sync(struct comedi_device *dev,
 	spin_unlock_irqrestore(&dev->spinlock, flags);
 }
 
-static void set_ai_pacing(struct comedi_device *dev, struct comedi_cmd *cmd)
+static void set_ai_pacing(struct comedi_device *dev, struct comedi_kcmd *cmd)
 {
 	uint32_t convert_counter = 0, scan_counter = 0;
 
@@ -2516,7 +2517,7 @@ static void set_ai_pacing(struct comedi_device *dev, struct comedi_cmd *cmd)
 	DEBUG_PRINT("scan counter 0x%x\n", scan_counter);
 }
 
-static int use_internal_queue_6xxx(const struct comedi_cmd *cmd)
+static int use_internal_queue_6xxx(const struct comedi_kcmd *cmd)
 {
 	int i;
 	for (i = 0; i + 1 < cmd->chanlist_len; i++) {
@@ -2533,7 +2534,7 @@ static int use_internal_queue_6xxx(const struct comedi_cmd *cmd)
 }
 
 static int setup_channel_queue(struct comedi_device *dev,
-			       const struct comedi_cmd *cmd)
+			       const struct comedi_kcmd *cmd)
 {
 	unsigned short bits;
 	int i;
@@ -2671,7 +2672,7 @@ static inline void load_first_dma_descriptor(struct comedi_device *dev,
 static int ai_cmd(struct comedi_device *dev, struct comedi_subdevice *s)
 {
 	struct comedi_async *async = s->async;
-	struct comedi_cmd *cmd = &async->cmd;
+	struct comedi_kcmd *cmd = &async->cmd;
 	uint32_t bits;
 	unsigned int i;
 	unsigned long flags;
@@ -2792,7 +2793,7 @@ static void pio_drain_ai_fifo_16(struct comedi_device *dev)
 {
 	struct comedi_subdevice *s = dev->read_subdev;
 	struct comedi_async *async = s->async;
-	struct comedi_cmd *cmd = &async->cmd;
+	struct comedi_kcmd *cmd = &async->cmd;
 	unsigned int i;
 	uint16_t prepost_bits;
 	int read_segment, read_index, write_segment, write_index;
@@ -2860,7 +2861,7 @@ static void pio_drain_ai_fifo_32(struct comedi_device *dev)
 {
 	struct comedi_subdevice *s = dev->read_subdev;
 	struct comedi_async *async = s->async;
-	struct comedi_cmd *cmd = &async->cmd;
+	struct comedi_kcmd *cmd = &async->cmd;
 	unsigned int i;
 	unsigned int max_transfer = 100000;
 	uint32_t fifo_data;
@@ -2949,7 +2950,7 @@ static void handle_ai_interrupt(struct comedi_device *dev,
 {
 	struct comedi_subdevice *s = dev->read_subdev;
 	struct comedi_async *async = s->async;
-	struct comedi_cmd *cmd = &async->cmd;
+	struct comedi_kcmd *cmd = &async->cmd;
 	uint8_t dma1_status;
 	unsigned long flags;
 
@@ -3029,7 +3030,7 @@ static int last_ao_dma_load_completed(struct comedi_device *dev)
 }
 
 static int ao_stopped_by_error(struct comedi_device *dev,
-			       const struct comedi_cmd *cmd)
+			       const struct comedi_kcmd *cmd)
 {
 	if (cmd->stop_src == TRIG_NONE)
 		return 1;
@@ -3072,7 +3073,7 @@ static void handle_ao_interrupt(struct comedi_device *dev,
 {
 	struct comedi_subdevice *s = dev->write_subdev;
 	struct comedi_async *async;
-	struct comedi_cmd *cmd;
+	struct comedi_kcmd *cmd;
 	uint8_t dma0_status;
 	unsigned long flags;
 
@@ -3227,7 +3228,7 @@ static int ao_readback_insn(struct comedi_device *dev,
 }
 
 static void set_dac_control0_reg(struct comedi_device *dev,
-				 const struct comedi_cmd *cmd)
+				 const struct comedi_kcmd *cmd)
 {
 	unsigned int bits = DAC_ENABLE_BIT | WAVEFORM_GATE_LEVEL_BIT |
 	    WAVEFORM_GATE_ENABLE_BIT | WAVEFORM_GATE_SELECT_BIT;
@@ -3248,7 +3249,7 @@ static void set_dac_control0_reg(struct comedi_device *dev,
 }
 
 static void set_dac_control1_reg(struct comedi_device *dev,
-				 const struct comedi_cmd *cmd)
+				 const struct comedi_kcmd *cmd)
 {
 	int i;
 
@@ -3266,7 +3267,7 @@ static void set_dac_control1_reg(struct comedi_device *dev,
 }
 
 static void set_dac_select_reg(struct comedi_device *dev,
-			       const struct comedi_cmd *cmd)
+			       const struct comedi_kcmd *cmd)
 {
 	uint16_t bits;
 	unsigned int first_channel, last_channel;
@@ -3282,7 +3283,7 @@ static void set_dac_select_reg(struct comedi_device *dev,
 }
 
 static void set_dac_interval_regs(struct comedi_device *dev,
-				  const struct comedi_cmd *cmd)
+				  const struct comedi_kcmd *cmd)
 {
 	unsigned int divisor;
 
@@ -3301,7 +3302,7 @@ static void set_dac_interval_regs(struct comedi_device *dev,
 }
 
 static unsigned int load_ao_dma_buffer(struct comedi_device *dev,
-				       const struct comedi_cmd *cmd)
+				       const struct comedi_kcmd *cmd)
 {
 	unsigned int num_bytes, buffer_index, prev_buffer_index;
 	unsigned int next_bits;
@@ -3346,7 +3347,8 @@ static unsigned int load_ao_dma_buffer(struct comedi_device *dev,
 	return num_bytes;
 }
 
-static void load_ao_dma(struct comedi_device *dev, const struct comedi_cmd *cmd)
+static void load_ao_dma(struct comedi_device *dev,
+			const struct comedi_kcmd *cmd)
 {
 	unsigned int num_bytes;
 	unsigned int next_transfer_addr;
@@ -3368,7 +3370,7 @@ static void load_ao_dma(struct comedi_device *dev, const struct comedi_cmd *cmd)
 	} while (num_bytes >= DMA_BUFFER_SIZE);
 }
 
-static int prep_ao_dma(struct comedi_device *dev, const struct comedi_cmd *cmd)
+static int prep_ao_dma(struct comedi_device *dev, const struct comedi_kcmd *cmd)
 {
 	unsigned int num_bytes;
 	int i;
@@ -3416,7 +3418,7 @@ static inline int external_ai_queue_in_use(struct comedi_device *dev)
 
 static int ao_cmd(struct comedi_device *dev, struct comedi_subdevice *s)
 {
-	struct comedi_cmd *cmd = &s->async->cmd;
+	struct comedi_kcmd *cmd = &s->async->cmd;
 
 	if (external_ai_queue_in_use(dev)) {
 		warn_external_queue(dev);
@@ -3442,7 +3444,7 @@ static int ao_cmd(struct comedi_device *dev, struct comedi_subdevice *s)
 static int ao_inttrig(struct comedi_device *dev, struct comedi_subdevice *s,
 		      unsigned int trig_num)
 {
-	struct comedi_cmd *cmd = &s->async->cmd;
+	struct comedi_kcmd *cmd = &s->async->cmd;
 	int retval;
 
 	if (trig_num != 0)
@@ -3463,7 +3465,7 @@ static int ao_inttrig(struct comedi_device *dev, struct comedi_subdevice *s,
 }
 
 static int ao_cmdtest(struct comedi_device *dev, struct comedi_subdevice *s,
-		      struct comedi_cmd *cmd)
+		      struct comedi_kcmd *cmd)
 {
 	int err = 0;
 	int tmp;
@@ -3859,7 +3861,7 @@ static int eeprom_read_insn(struct comedi_device *dev,
  * sets cmd members appropriately.
  * adc paces conversions from master clock by dividing by (x + 3) where x is 24 bit number
  */
-static void check_adc_timing(struct comedi_device *dev, struct comedi_cmd *cmd)
+static void check_adc_timing(struct comedi_device *dev, struct comedi_kcmd *cmd)
 {
 	unsigned int convert_divisor = 0, scan_divisor;
 	static const int min_convert_divisor = 3;
-- 
1.7.12

_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/devel


[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux