[PATCH v2 3/3] Staging: comedi: s626: fix line over 80 characters issue
This fixes up a line over 80 characters issues found by the checkpatch.pl tool. Signed-off-by: Ravishankar Karkala Mallikarjunayya <ravishankark...@gmail.com> --- Change log v1->v2 - No Change --- drivers/staging/comedi/drivers/s626.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/staging/comedi/drivers/s626.c b/drivers/staging/comedi/drivers/s626.c index f6806ae..73196c7 100644 --- a/drivers/staging/comedi/drivers/s626.c +++ b/drivers/staging/comedi/drivers/s626.c @@ -2500,7 +2500,8 @@ static int s626_initialize(struct comedi_device *dev) for (i = 0; i < 2; i++) { writel(S626_I2C_CLKSEL, dev->mmio + S626_P_I2CSTAT); s626_mc_enable(dev, S626_MC2_UPLD_IIC, S626_P_MC2); - ret = comedi_timeout(dev, NULL, NULL, s626_i2c_handshake_eoc, 0); + ret = comedi_timeout(dev, NULL, +NULL, s626_i2c_handshake_eoc, 0); if (ret) return ret; } -- 1.9.1
[PATCH v2 3/3] Staging: comedi: s626: fix line over 80 characters issue
This fixes up a line over 80 characters issues found by the checkpatch.pl tool. Signed-off-by: Ravishankar Karkala Mallikarjunayya --- Change log v1->v2 - No Change --- drivers/staging/comedi/drivers/s626.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/staging/comedi/drivers/s626.c b/drivers/staging/comedi/drivers/s626.c index f6806ae..73196c7 100644 --- a/drivers/staging/comedi/drivers/s626.c +++ b/drivers/staging/comedi/drivers/s626.c @@ -2500,7 +2500,8 @@ static int s626_initialize(struct comedi_device *dev) for (i = 0; i < 2; i++) { writel(S626_I2C_CLKSEL, dev->mmio + S626_P_I2CSTAT); s626_mc_enable(dev, S626_MC2_UPLD_IIC, S626_P_MC2); - ret = comedi_timeout(dev, NULL, NULL, s626_i2c_handshake_eoc, 0); + ret = comedi_timeout(dev, NULL, +NULL, s626_i2c_handshake_eoc, 0); if (ret) return ret; } -- 1.9.1
[PATCH] Staging: comedi: pcmuio: fix bare use of 'unsigned'
This fixes up a WARNING: Prefer 'unsigned int' to bare use of 'unsigned' found by the checkpatch.pl tool Signed-off-by: Ravishankar Karkala Mallikarjunayya <ravishankark...@gmail.com> --- drivers/staging/comedi/drivers/pcmuio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/comedi/drivers/pcmuio.c b/drivers/staging/comedi/drivers/pcmuio.c index 7ea8130..8ad64f2 100644 --- a/drivers/staging/comedi/drivers/pcmuio.c +++ b/drivers/staging/comedi/drivers/pcmuio.c @@ -307,7 +307,7 @@ static void pcmuio_stop_intr(struct comedi_device *dev, static void pcmuio_handle_intr_subdev(struct comedi_device *dev, struct comedi_subdevice *s, - unsigned triggered) + unsigned int triggered) { struct pcmuio_private *devpriv = dev->private; int asic = pcmuio_subdevice_to_asic(s); -- 1.9.1
[PATCH] Staging: comedi: pcmuio: fix bare use of 'unsigned'
This fixes up a WARNING: Prefer 'unsigned int' to bare use of 'unsigned' found by the checkpatch.pl tool Signed-off-by: Ravishankar Karkala Mallikarjunayya --- drivers/staging/comedi/drivers/pcmuio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/comedi/drivers/pcmuio.c b/drivers/staging/comedi/drivers/pcmuio.c index 7ea8130..8ad64f2 100644 --- a/drivers/staging/comedi/drivers/pcmuio.c +++ b/drivers/staging/comedi/drivers/pcmuio.c @@ -307,7 +307,7 @@ static void pcmuio_stop_intr(struct comedi_device *dev, static void pcmuio_handle_intr_subdev(struct comedi_device *dev, struct comedi_subdevice *s, - unsigned triggered) + unsigned int triggered) { struct pcmuio_private *devpriv = dev->private; int asic = pcmuio_subdevice_to_asic(s); -- 1.9.1
[PATCH v2 2/3] Staging: comedi: s626: Fix Warning issues.
This fixes up a WARNING: Prefer 'unsigned int' to bare use of 'unsigned' found by the checkpatch.pl tool Signed-off-by: Ravishankar Karkala Mallikarjunayya <ravishankark...@gmail.com> --- Change log v1->v2 - No Change --- drivers/staging/comedi/drivers/s626.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/staging/comedi/drivers/s626.c b/drivers/staging/comedi/drivers/s626.c index 18757b6..f6806ae 100644 --- a/drivers/staging/comedi/drivers/s626.c +++ b/drivers/staging/comedi/drivers/s626.c @@ -708,7 +708,7 @@ static uint16_t s626_get_mode_a(struct comedi_device *dev, u16 cra; u16 crb; u16 setup; - unsigned cntsrc, clkmult, clkpol, encmode; + unsigned int cntsrc, clkmult, clkpol, encmode; /* Fetch CRA and CRB register images. */ cra = s626_debi_read(dev, S626_LP_CRA(chan)); @@ -763,7 +763,7 @@ static uint16_t s626_get_mode_b(struct comedi_device *dev, u16 cra; u16 crb; u16 setup; - unsigned cntsrc, clkmult, clkpol, encmode; + unsigned int cntsrc, clkmult, clkpol, encmode; /* Fetch CRA and CRB register images. */ cra = s626_debi_read(dev, S626_LP_CRA(chan)); @@ -838,7 +838,7 @@ static void s626_set_mode_a(struct comedi_device *dev, struct s626_private *devpriv = dev->private; u16 cra; u16 crb; - unsigned cntsrc, clkmult, clkpol; + unsigned int cntsrc, clkmult, clkpol; /* Initialize CRA and CRB images. */ /* Preload trigger is passed through. */ @@ -916,7 +916,7 @@ static void s626_set_mode_b(struct comedi_device *dev, struct s626_private *devpriv = dev->private; u16 cra; u16 crb; - unsigned cntsrc, clkmult, clkpol; + unsigned int cntsrc, clkmult, clkpol; /* Initialize CRA and CRB images. */ /* IndexSrc is passed through. */ -- 1.9.1
[PATCH v2 2/3] Staging: comedi: s626: Fix Warning issues.
This fixes up a WARNING: Prefer 'unsigned int' to bare use of 'unsigned' found by the checkpatch.pl tool Signed-off-by: Ravishankar Karkala Mallikarjunayya --- Change log v1->v2 - No Change --- drivers/staging/comedi/drivers/s626.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/staging/comedi/drivers/s626.c b/drivers/staging/comedi/drivers/s626.c index 18757b6..f6806ae 100644 --- a/drivers/staging/comedi/drivers/s626.c +++ b/drivers/staging/comedi/drivers/s626.c @@ -708,7 +708,7 @@ static uint16_t s626_get_mode_a(struct comedi_device *dev, u16 cra; u16 crb; u16 setup; - unsigned cntsrc, clkmult, clkpol, encmode; + unsigned int cntsrc, clkmult, clkpol, encmode; /* Fetch CRA and CRB register images. */ cra = s626_debi_read(dev, S626_LP_CRA(chan)); @@ -763,7 +763,7 @@ static uint16_t s626_get_mode_b(struct comedi_device *dev, u16 cra; u16 crb; u16 setup; - unsigned cntsrc, clkmult, clkpol, encmode; + unsigned int cntsrc, clkmult, clkpol, encmode; /* Fetch CRA and CRB register images. */ cra = s626_debi_read(dev, S626_LP_CRA(chan)); @@ -838,7 +838,7 @@ static void s626_set_mode_a(struct comedi_device *dev, struct s626_private *devpriv = dev->private; u16 cra; u16 crb; - unsigned cntsrc, clkmult, clkpol; + unsigned int cntsrc, clkmult, clkpol; /* Initialize CRA and CRB images. */ /* Preload trigger is passed through. */ @@ -916,7 +916,7 @@ static void s626_set_mode_b(struct comedi_device *dev, struct s626_private *devpriv = dev->private; u16 cra; u16 crb; - unsigned cntsrc, clkmult, clkpol; + unsigned int cntsrc, clkmult, clkpol; /* Initialize CRA and CRB images. */ /* IndexSrc is passed through. */ -- 1.9.1
[PATCH v2 1/3] staging : comedi : s626: fix type issues.
This fixes up a type issues like i.e Prefer kernel type 'u8' over 'uint8_t' Prefer kernel type 'u16' over 'uint16_t' Prefer kernel type 'u32' over 'uint32_t' Prefer kernel type 's16' over 'int16_t' Prefer kernel type 's32' over 'int32_t' found by the checkpatch.pl tool. Signed-off-by: Ravishankar Karkala Mallikarjunayya <ravishankark...@gmail.com> --- Change log v1->v2 - No Change --- drivers/staging/comedi/drivers/s626.c | 178 +- 1 file changed, 89 insertions(+), 89 deletions(-) diff --git a/drivers/staging/comedi/drivers/s626.c b/drivers/staging/comedi/drivers/s626.c index c5e0863..18757b6 100644 --- a/drivers/staging/comedi/drivers/s626.c +++ b/drivers/staging/comedi/drivers/s626.c @@ -75,24 +75,24 @@ struct s626_buffer_dma { }; struct s626_private { - uint8_t ai_cmd_running; /* ai_cmd is running */ + u8 ai_cmd_running; /* ai_cmd is running */ unsigned int ai_sample_timer; /* time between samples in * units of the timer */ int ai_convert_count; /* conversion counter */ unsigned int ai_convert_timer; /* time between conversion in * units of the timer */ - uint16_t counter_int_enabs; /* counter interrupt enable mask + u16 counter_int_enabs; /* counter interrupt enable mask * for MISC2 register */ - uint8_t adc_items; /* number of items in ADC poll list */ + u8 adc_items; /* number of items in ADC poll list */ struct s626_buffer_dma rps_buf; /* DMA buffer used to hold ADC (RPS1) * program */ struct s626_buffer_dma ana_buf; /* DMA buffer used to receive ADC data * and hold DAC data */ - uint32_t *dac_wbuf; /* pointer to logical adrs of DMA buffer + u32 *dac_wbuf; /* pointer to logical adrs of DMA buffer * used to hold DAC data */ - 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 + u16 dacpol; /* image of DAC polarity register */ + u8 trim_setpoint[12]; /* images of TrimDAC setpoints */ + u32 i2c_adrs; /* I2C device address for onboard EEPROM * (board rev dependent) */ }; @@ -304,10 +304,10 @@ static uint8_t s626_i2c_read(struct comedi_device *dev, uint8_t addr) /* *** DAC FUNCTIONS *** */ /* TrimDac LogicalChan-to-PhysicalChan mapping table. */ -static const uint8_t s626_trimchan[] = { 10, 9, 8, 3, 2, 7, 6, 1, 0, 5, 4 }; +static const u8 s626_trimchan[] = { 10, 9, 8, 3, 2, 7, 6, 1, 0, 5, 4 }; /* TrimDac LogicalChan-to-EepromAdrs mapping table. */ -static const uint8_t s626_trimadrs[] = { +static const u8 s626_trimadrs[] = { 0x40, 0x41, 0x42, 0x50, 0x51, 0x52, 0x53, 0x60, 0x61, 0x62, 0x63 }; @@ -516,12 +516,12 @@ static int s626_send_dac(struct comedi_device *dev, uint32_t val) * Private helper function: Write setpoint to an application DAC channel. */ static int s626_set_dac(struct comedi_device *dev, - uint16_t chan, int16_t dacdata) + u16 chan, s16 dacdata) { struct s626_private *devpriv = dev->private; - uint16_t signmask; - uint32_t ws_image; - uint32_t val; + u16 signmask; + u32 ws_image; + u32 val; /* * Adjust DAC data polarity and set up Polarity Control Register image. @@ -582,16 +582,16 @@ static int s626_set_dac(struct comedi_device *dev, } static int s626_write_trim_dac(struct comedi_device *dev, - uint8_t logical_chan, uint8_t dac_data) + u8 logical_chan, u8 dac_data) { struct s626_private *devpriv = dev->private; - uint32_t chan; + u32 chan; /* * Save the new setpoint in case the application needs to read it back * later. */ - devpriv->trim_setpoint[logical_chan] = (uint8_t)dac_data; + devpriv->trim_setpoint[logical_chan] = (u8)dac_data; /* Map logical channel number to physical channel number. */ chan = s626_trimchan[logical_chan]; @@ -633,7 +633,7 @@ static int s626_write_trim_dac(struct comedi_device *dev, static int s626_load_trim_dacs(struct comedi_device *dev) { - uint8_t i; + u8 i; int ret; /* Copy TrimDac setpoint values from EEPROM to TrimDacs. */ @@ -686,7 +686,7 @@ static void s626_preload(struct comedi_device *dev, static void s626_reset_cap_flags
[PATCH v2 1/3] staging : comedi : s626: fix type issues.
This fixes up a type issues like i.e Prefer kernel type 'u8' over 'uint8_t' Prefer kernel type 'u16' over 'uint16_t' Prefer kernel type 'u32' over 'uint32_t' Prefer kernel type 's16' over 'int16_t' Prefer kernel type 's32' over 'int32_t' found by the checkpatch.pl tool. Signed-off-by: Ravishankar Karkala Mallikarjunayya --- Change log v1->v2 - No Change --- drivers/staging/comedi/drivers/s626.c | 178 +- 1 file changed, 89 insertions(+), 89 deletions(-) diff --git a/drivers/staging/comedi/drivers/s626.c b/drivers/staging/comedi/drivers/s626.c index c5e0863..18757b6 100644 --- a/drivers/staging/comedi/drivers/s626.c +++ b/drivers/staging/comedi/drivers/s626.c @@ -75,24 +75,24 @@ struct s626_buffer_dma { }; struct s626_private { - uint8_t ai_cmd_running; /* ai_cmd is running */ + u8 ai_cmd_running; /* ai_cmd is running */ unsigned int ai_sample_timer; /* time between samples in * units of the timer */ int ai_convert_count; /* conversion counter */ unsigned int ai_convert_timer; /* time between conversion in * units of the timer */ - uint16_t counter_int_enabs; /* counter interrupt enable mask + u16 counter_int_enabs; /* counter interrupt enable mask * for MISC2 register */ - uint8_t adc_items; /* number of items in ADC poll list */ + u8 adc_items; /* number of items in ADC poll list */ struct s626_buffer_dma rps_buf; /* DMA buffer used to hold ADC (RPS1) * program */ struct s626_buffer_dma ana_buf; /* DMA buffer used to receive ADC data * and hold DAC data */ - uint32_t *dac_wbuf; /* pointer to logical adrs of DMA buffer + u32 *dac_wbuf; /* pointer to logical adrs of DMA buffer * used to hold DAC data */ - 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 + u16 dacpol; /* image of DAC polarity register */ + u8 trim_setpoint[12]; /* images of TrimDAC setpoints */ + u32 i2c_adrs; /* I2C device address for onboard EEPROM * (board rev dependent) */ }; @@ -304,10 +304,10 @@ static uint8_t s626_i2c_read(struct comedi_device *dev, uint8_t addr) /* *** DAC FUNCTIONS *** */ /* TrimDac LogicalChan-to-PhysicalChan mapping table. */ -static const uint8_t s626_trimchan[] = { 10, 9, 8, 3, 2, 7, 6, 1, 0, 5, 4 }; +static const u8 s626_trimchan[] = { 10, 9, 8, 3, 2, 7, 6, 1, 0, 5, 4 }; /* TrimDac LogicalChan-to-EepromAdrs mapping table. */ -static const uint8_t s626_trimadrs[] = { +static const u8 s626_trimadrs[] = { 0x40, 0x41, 0x42, 0x50, 0x51, 0x52, 0x53, 0x60, 0x61, 0x62, 0x63 }; @@ -516,12 +516,12 @@ static int s626_send_dac(struct comedi_device *dev, uint32_t val) * Private helper function: Write setpoint to an application DAC channel. */ static int s626_set_dac(struct comedi_device *dev, - uint16_t chan, int16_t dacdata) + u16 chan, s16 dacdata) { struct s626_private *devpriv = dev->private; - uint16_t signmask; - uint32_t ws_image; - uint32_t val; + u16 signmask; + u32 ws_image; + u32 val; /* * Adjust DAC data polarity and set up Polarity Control Register image. @@ -582,16 +582,16 @@ static int s626_set_dac(struct comedi_device *dev, } static int s626_write_trim_dac(struct comedi_device *dev, - uint8_t logical_chan, uint8_t dac_data) + u8 logical_chan, u8 dac_data) { struct s626_private *devpriv = dev->private; - uint32_t chan; + u32 chan; /* * Save the new setpoint in case the application needs to read it back * later. */ - devpriv->trim_setpoint[logical_chan] = (uint8_t)dac_data; + devpriv->trim_setpoint[logical_chan] = (u8)dac_data; /* Map logical channel number to physical channel number. */ chan = s626_trimchan[logical_chan]; @@ -633,7 +633,7 @@ static int s626_write_trim_dac(struct comedi_device *dev, static int s626_load_trim_dacs(struct comedi_device *dev) { - uint8_t i; + u8 i; int ret; /* Copy TrimDac setpoint values from EEPROM to TrimDacs. */ @@ -686,7 +686,7 @@ static void s626_preload(struct comedi_device *dev, static void s626_reset_cap_flags(struct com
[PATCH 1/4] Staging: comedi: dt2814: Block comment issue fixed
This fixes up a WARNING: 'Block comments use a trailing */ on a separate line' found by the checkpatch.pl tool. Signed-off-by: Ravishankar Karkala Mallikarjunayya <ravishankark...@gmail.com> --- drivers/staging/comedi/drivers/dt2814.c | 72 + 1 file changed, 37 insertions(+), 35 deletions(-) diff --git a/drivers/staging/comedi/drivers/dt2814.c b/drivers/staging/comedi/drivers/dt2814.c index 66705f9..2f903be 100644 --- a/drivers/staging/comedi/drivers/dt2814.c +++ b/drivers/staging/comedi/drivers/dt2814.c @@ -1,38 +1,38 @@ /* -comedi/drivers/dt2814.c -Hardware driver for Data Translation DT2814 - -COMEDI - Linux Control and Measurement Device Interface -Copyright (C) 1998 David A. Schleef <d...@schleef.org> - -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. -*/ + * comedi/drivers/dt2814.c + * Hardware driver for Data Translation DT2814 + * + * COMEDI - Linux Control and Measurement Device Interface + * Copyright (C) 1998 David A. Schleef <d...@schleef.org> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ /* -Driver: dt2814 -Description: Data Translation DT2814 -Author: ds -Status: complete -Devices: [Data Translation] DT2814 (dt2814) - -Configuration options: - [0] - I/O port base address - [1] - IRQ - -This card has 16 analog inputs multiplexed onto a 12 bit ADC. There -is a minimally useful onboard clock. The base frequency for the -clock is selected by jumpers, and the clock divider can be selected -via programmed I/O. Unfortunately, the clock divider can only be -a power of 10, from 1 to 10^7, of which only 3 or 4 are useful. In -addition, the clock does not seem to be very accurate. -*/ + * Driver: dt2814 + * Description: Data Translation DT2814 + * Author: ds + * Status: complete + * Devices: [Data Translation] DT2814 (dt2814) + * + * Configuration options: + * [0] - I/O port base address + * [1] - IRQ + * + * This card has 16 analog inputs multiplexed onto a 12 bit ADC. There + * is a minimally useful onboard clock. The base frequency for the + * clock is selected by jumpers, and the clock divider can be selected + * via programmed I/O. Unfortunately, the clock divider can only be + * a power of 10, from 1 to 10^7, of which only 3 or 4 are useful. In + * addition, the clock does not seem to be very accurate. + */ #include #include @@ -215,8 +215,10 @@ static irqreturn_t dt2814_interrupt(int irq, void *d) int i; outb(0, dev->iobase + DT2814_CSR); - /* note: turning off timed mode triggers another - sample. */ + /* +* note: turning off timed mode triggers another +* sample. +*/ for (i = 0; i < DT2814_TIMEOUT; i++) { if (inb(dev->iobase + DT2814_CSR) & DT2814_FINISH) -- 1.9.1
[PATCH 1/4] Staging: comedi: dt2814: Block comment issue fixed
This fixes up a WARNING: 'Block comments use a trailing */ on a separate line' found by the checkpatch.pl tool. Signed-off-by: Ravishankar Karkala Mallikarjunayya --- drivers/staging/comedi/drivers/dt2814.c | 72 + 1 file changed, 37 insertions(+), 35 deletions(-) diff --git a/drivers/staging/comedi/drivers/dt2814.c b/drivers/staging/comedi/drivers/dt2814.c index 66705f9..2f903be 100644 --- a/drivers/staging/comedi/drivers/dt2814.c +++ b/drivers/staging/comedi/drivers/dt2814.c @@ -1,38 +1,38 @@ /* -comedi/drivers/dt2814.c -Hardware driver for Data Translation DT2814 - -COMEDI - Linux Control and Measurement Device Interface -Copyright (C) 1998 David A. Schleef - -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. -*/ + * comedi/drivers/dt2814.c + * Hardware driver for Data Translation DT2814 + * + * COMEDI - Linux Control and Measurement Device Interface + * Copyright (C) 1998 David A. Schleef + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ /* -Driver: dt2814 -Description: Data Translation DT2814 -Author: ds -Status: complete -Devices: [Data Translation] DT2814 (dt2814) - -Configuration options: - [0] - I/O port base address - [1] - IRQ - -This card has 16 analog inputs multiplexed onto a 12 bit ADC. There -is a minimally useful onboard clock. The base frequency for the -clock is selected by jumpers, and the clock divider can be selected -via programmed I/O. Unfortunately, the clock divider can only be -a power of 10, from 1 to 10^7, of which only 3 or 4 are useful. In -addition, the clock does not seem to be very accurate. -*/ + * Driver: dt2814 + * Description: Data Translation DT2814 + * Author: ds + * Status: complete + * Devices: [Data Translation] DT2814 (dt2814) + * + * Configuration options: + * [0] - I/O port base address + * [1] - IRQ + * + * This card has 16 analog inputs multiplexed onto a 12 bit ADC. There + * is a minimally useful onboard clock. The base frequency for the + * clock is selected by jumpers, and the clock divider can be selected + * via programmed I/O. Unfortunately, the clock divider can only be + * a power of 10, from 1 to 10^7, of which only 3 or 4 are useful. In + * addition, the clock does not seem to be very accurate. + */ #include #include @@ -215,8 +215,10 @@ static irqreturn_t dt2814_interrupt(int irq, void *d) int i; outb(0, dev->iobase + DT2814_CSR); - /* note: turning off timed mode triggers another - sample. */ + /* +* note: turning off timed mode triggers another +* sample. +*/ for (i = 0; i < DT2814_TIMEOUT; i++) { if (inb(dev->iobase + DT2814_CSR) & DT2814_FINISH) -- 1.9.1
[PATCH 4/4] Staging: comedi: dt2817: Coding style issue fixed.
This fixes up a WARNING: 'Block comments use a trailing */ on a separate line' found by the checkpatch.pl tool. Signed-off-by: Ravishankar Karkala Mallikarjunayya <ravishankark...@gmail.com> --- drivers/staging/comedi/drivers/dt2817.c | 64 - 1 file changed, 32 insertions(+), 32 deletions(-) diff --git a/drivers/staging/comedi/drivers/dt2817.c b/drivers/staging/comedi/drivers/dt2817.c index 5131dee..39d2566 100644 --- a/drivers/staging/comedi/drivers/dt2817.c +++ b/drivers/staging/comedi/drivers/dt2817.c @@ -1,37 +1,37 @@ /* -comedi/drivers/dt2817.c -Hardware driver for Data Translation DT2817 - -COMEDI - Linux Control and Measurement Device Interface -Copyright (C) 1998 David A. Schleef <d...@schleef.org> - -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. -*/ + * comedi/drivers/dt2817.c + * Hardware driver for Data Translation DT2817 + * + * COMEDI - Linux Control and Measurement Device Interface + * Copyright (C) 1998 David A. Schleef <d...@schleef.org> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ /* -Driver: dt2817 -Description: Data Translation DT2817 -Author: ds -Status: complete -Devices: [Data Translation] DT2817 (dt2817) - -A very simple digital I/O card. Four banks of 8 lines, each bank -is configurable for input or output. One wonders why it takes a -50 page manual to describe this thing. - -The driver (which, btw, is much less than 50 pages) has 1 subdevice -with 32 channels, configurable in groups of 8. - -Configuration options: - [0] - I/O port base base address -*/ + * Driver: dt2817 + * Description: Data Translation DT2817 + * Author: ds + * Status: complete + * Devices: [Data Translation] DT2817 (dt2817) + * + * A very simple digital I/O card. Four banks of 8 lines, each bank + * is configurable for input or output. One wonders why it takes a + * 50 page manual to describe this thing. + * + * The driver (which, btw, is much less than 50 pages) has 1 subdevice + * with 32 channels, configurable in groups of 8. + * + * Configuration options: + * [0] - I/O port base base address + */ #include #include "../comedidev.h" -- 1.9.1
[PATCH 4/4] Staging: comedi: dt2817: Coding style issue fixed.
This fixes up a WARNING: 'Block comments use a trailing */ on a separate line' found by the checkpatch.pl tool. Signed-off-by: Ravishankar Karkala Mallikarjunayya --- drivers/staging/comedi/drivers/dt2817.c | 64 - 1 file changed, 32 insertions(+), 32 deletions(-) diff --git a/drivers/staging/comedi/drivers/dt2817.c b/drivers/staging/comedi/drivers/dt2817.c index 5131dee..39d2566 100644 --- a/drivers/staging/comedi/drivers/dt2817.c +++ b/drivers/staging/comedi/drivers/dt2817.c @@ -1,37 +1,37 @@ /* -comedi/drivers/dt2817.c -Hardware driver for Data Translation DT2817 - -COMEDI - Linux Control and Measurement Device Interface -Copyright (C) 1998 David A. Schleef - -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. -*/ + * comedi/drivers/dt2817.c + * Hardware driver for Data Translation DT2817 + * + * COMEDI - Linux Control and Measurement Device Interface + * Copyright (C) 1998 David A. Schleef + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ /* -Driver: dt2817 -Description: Data Translation DT2817 -Author: ds -Status: complete -Devices: [Data Translation] DT2817 (dt2817) - -A very simple digital I/O card. Four banks of 8 lines, each bank -is configurable for input or output. One wonders why it takes a -50 page manual to describe this thing. - -The driver (which, btw, is much less than 50 pages) has 1 subdevice -with 32 channels, configurable in groups of 8. - -Configuration options: - [0] - I/O port base base address -*/ + * Driver: dt2817 + * Description: Data Translation DT2817 + * Author: ds + * Status: complete + * Devices: [Data Translation] DT2817 (dt2817) + * + * A very simple digital I/O card. Four banks of 8 lines, each bank + * is configurable for input or output. One wonders why it takes a + * 50 page manual to describe this thing. + * + * The driver (which, btw, is much less than 50 pages) has 1 subdevice + * with 32 channels, configurable in groups of 8. + * + * Configuration options: + * [0] - I/O port base base address + */ #include #include "../comedidev.h" -- 1.9.1
[PATCH 3/4] Staging: comedi: dt2811: Warning issue fixed
This fixes up a WARNING: 'Block comments use a trailing */ on a separate line' found by the checkpatch.pl tool. Signed-off-by: Ravishankar Karkala Mallikarjunayya <ravishankark...@gmail.com> --- drivers/staging/comedi/drivers/dt2811.c | 248 1 file changed, 124 insertions(+), 124 deletions(-) diff --git a/drivers/staging/comedi/drivers/dt2811.c b/drivers/staging/comedi/drivers/dt2811.c index a807732..08f324d 100644 --- a/drivers/staging/comedi/drivers/dt2811.c +++ b/drivers/staging/comedi/drivers/dt2811.c @@ -1,45 +1,45 @@ /* - comedi/drivers/dt2811.c - Hardware driver for Data Translation DT2811 - - COMEDI - Linux Control and Measurement Device Interface - History: - Base Version - David A. Schleef <d...@schleef.org> - December 1998 - Updated to work. David does not have a DT2811 - board any longer so this was suffering from bitrot. - Updated performed by ... - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. + * comedi/drivers/dt2811.c + * Hardware driver for Data Translation DT2811 + * + * COMEDI - Linux Control and Measurement Device Interface + * History: + * Base Version - David A. Schleef <d...@schleef.org> + * December 1998 - Updated to work. David does not have a DT2811 + * board any longer so this was suffering from bitrot. + * Updated performed by ... + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. */ /* -Driver: dt2811 -Description: Data Translation DT2811 -Author: ds -Devices: [Data Translation] DT2811-PGL (dt2811-pgl), DT2811-PGH (dt2811-pgh) -Status: works - -Configuration options: - [0] - I/O port base address - [1] - IRQ, although this is currently unused - [2] - A/D reference - 0 = signle-ended - 1 = differential - 2 = pseudo-differential (common reference) - [3] - A/D range - 0 = [-5, 5] - 1 = [-2.5, 2.5] - 2 = [0, 5] - [4] - D/A 0 range (same choices) - [4] - D/A 1 range (same choices) -*/ + * Driver: dt2811 + * Description: Data Translation DT2811 + * Author: ds + * Devices: [Data Translation] DT2811-PGL (dt2811-pgl), DT2811-PGH (dt2811-pgh) + * Status: works + * + * Configuration options: + * [0] - I/O port base address + * [1] - IRQ, although this is currently unused + * [2] - A/D reference + * 0 = signle-ended + * 1 = differential + * 2 = pseudo-differential (common reference) + * [3] - A/D range + * 0 = [-5, 5] + * 1 = [-2.5, 2.5] + * 2 = [0, 5] + * [4] - D/A 0 range (same choices) + * [4] - D/A 1 range (same choices) + */ #include #include "../comedidev.h" @@ -99,72 +99,72 @@ static const struct comedi_lrange range_dt2811_pgl_ai_5_bipolar = { }; /* - - 0x00ADCSR R/W A/D Control/Status Register - bit 7 - (R) 1 indicates A/D conversion done - reading ADDAT clears bit - (W) ignored - bit 6 - (R) 1 indicates A/D error - (W) ignored - bit 5 - (R) 1 indicates A/D busy, cleared at end - of conversion - (W) ignored - bit 4 - (R) 0 - (W) - bit 3 - (R) 0 - bit 2 - (R/W) 1 indicates interrupts enabled - bits 1,0 - (R/W) mode bits - 00 single conversion on ADGCR load - 01 continuous conversion, internal clock, - (clock enabled on ADGCR load) - 10 continuous conversion, internal clock, - external trigger - 11 continuous conversion, external clock, - external trigger - - 0x01ADGCR R/W A/D Gain/Channel Register - bit 6,7 - (R/W) gain select - 00 gain=1, both PGH, PGL models - 01 gain=2 PGH, 10 PGL - 10 gain=4 PGH, 100 PGL - 11 gain=8 PGH, 500 PGL - bit 4,5 - reserved - bit 3-0 - (R/W) channel select - channel number from 0-15 - - 0x02,0x03 (R) ADDAT A/D Data Register - (W) DADAT0 D/A Data Register 0 - 0x02 low byte - 0x03 high byte - - 0x04,0x05 (W) DADAT0 D/A Data Register 1 - - 0x06 (R) DIO0 Digital Input Port 0 - (W) DIO1 Digital Output Port 1 - - 0x07 TMRCTR (R/W) Timer/Counter Register - bits 6,7 - reserved - bits 5-3 - Timer frequency control (mantissa) - 543 divisor freqency (kHz) - 000 1
[PATCH 3/4] Staging: comedi: dt2811: Warning issue fixed
This fixes up a WARNING: 'Block comments use a trailing */ on a separate line' found by the checkpatch.pl tool. Signed-off-by: Ravishankar Karkala Mallikarjunayya --- drivers/staging/comedi/drivers/dt2811.c | 248 1 file changed, 124 insertions(+), 124 deletions(-) diff --git a/drivers/staging/comedi/drivers/dt2811.c b/drivers/staging/comedi/drivers/dt2811.c index a807732..08f324d 100644 --- a/drivers/staging/comedi/drivers/dt2811.c +++ b/drivers/staging/comedi/drivers/dt2811.c @@ -1,45 +1,45 @@ /* - comedi/drivers/dt2811.c - Hardware driver for Data Translation DT2811 - - COMEDI - Linux Control and Measurement Device Interface - History: - Base Version - David A. Schleef - December 1998 - Updated to work. David does not have a DT2811 - board any longer so this was suffering from bitrot. - Updated performed by ... - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. + * comedi/drivers/dt2811.c + * Hardware driver for Data Translation DT2811 + * + * COMEDI - Linux Control and Measurement Device Interface + * History: + * Base Version - David A. Schleef + * December 1998 - Updated to work. David does not have a DT2811 + * board any longer so this was suffering from bitrot. + * Updated performed by ... + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. */ /* -Driver: dt2811 -Description: Data Translation DT2811 -Author: ds -Devices: [Data Translation] DT2811-PGL (dt2811-pgl), DT2811-PGH (dt2811-pgh) -Status: works - -Configuration options: - [0] - I/O port base address - [1] - IRQ, although this is currently unused - [2] - A/D reference - 0 = signle-ended - 1 = differential - 2 = pseudo-differential (common reference) - [3] - A/D range - 0 = [-5, 5] - 1 = [-2.5, 2.5] - 2 = [0, 5] - [4] - D/A 0 range (same choices) - [4] - D/A 1 range (same choices) -*/ + * Driver: dt2811 + * Description: Data Translation DT2811 + * Author: ds + * Devices: [Data Translation] DT2811-PGL (dt2811-pgl), DT2811-PGH (dt2811-pgh) + * Status: works + * + * Configuration options: + * [0] - I/O port base address + * [1] - IRQ, although this is currently unused + * [2] - A/D reference + * 0 = signle-ended + * 1 = differential + * 2 = pseudo-differential (common reference) + * [3] - A/D range + * 0 = [-5, 5] + * 1 = [-2.5, 2.5] + * 2 = [0, 5] + * [4] - D/A 0 range (same choices) + * [4] - D/A 1 range (same choices) + */ #include #include "../comedidev.h" @@ -99,72 +99,72 @@ static const struct comedi_lrange range_dt2811_pgl_ai_5_bipolar = { }; /* - - 0x00ADCSR R/W A/D Control/Status Register - bit 7 - (R) 1 indicates A/D conversion done - reading ADDAT clears bit - (W) ignored - bit 6 - (R) 1 indicates A/D error - (W) ignored - bit 5 - (R) 1 indicates A/D busy, cleared at end - of conversion - (W) ignored - bit 4 - (R) 0 - (W) - bit 3 - (R) 0 - bit 2 - (R/W) 1 indicates interrupts enabled - bits 1,0 - (R/W) mode bits - 00 single conversion on ADGCR load - 01 continuous conversion, internal clock, - (clock enabled on ADGCR load) - 10 continuous conversion, internal clock, - external trigger - 11 continuous conversion, external clock, - external trigger - - 0x01ADGCR R/W A/D Gain/Channel Register - bit 6,7 - (R/W) gain select - 00 gain=1, both PGH, PGL models - 01 gain=2 PGH, 10 PGL - 10 gain=4 PGH, 100 PGL - 11 gain=8 PGH, 500 PGL - bit 4,5 - reserved - bit 3-0 - (R/W) channel select - channel number from 0-15 - - 0x02,0x03 (R) ADDAT A/D Data Register - (W) DADAT0 D/A Data Register 0 - 0x02 low byte - 0x03 high byte - - 0x04,0x05 (W) DADAT0 D/A Data Register 1 - - 0x06 (R) DIO0 Digital Input Port 0 - (W) DIO1 Digital Output Port 1 - - 0x07 TMRCTR (R/W) Timer/Counter Register - bits 6,7 - reserved - bits 5-3 - Timer frequency control (mantissa) - 543 divisor freqency (kHz) - 000 1600 - 001 10 60 - 010 2300 - 011 3200
[PATCH 2/4] Staging: comedi: dt2815: Comment issue fixed
This fixes up a WARNING: 'Block comments use a trailing */ on a separate line' found by the checkpatch.pl tool. Signed-off-by: Ravishankar Karkala Mallikarjunayya <ravishankark...@gmail.com> --- drivers/staging/comedi/drivers/dt2815.c | 140 1 file changed, 70 insertions(+), 70 deletions(-) diff --git a/drivers/staging/comedi/drivers/dt2815.c b/drivers/staging/comedi/drivers/dt2815.c index fb08569..0be77cc 100644 --- a/drivers/staging/comedi/drivers/dt2815.c +++ b/drivers/staging/comedi/drivers/dt2815.c @@ -1,55 +1,55 @@ /* - comedi/drivers/dt2815.c - Hardware driver for Data Translation DT2815 - - COMEDI - Linux Control and Measurement Device Interface - Copyright (C) 1999 Anders Blomdell <anders.blomd...@control.lth.se> - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. + * comedi/drivers/dt2815.c + * Hardware driver for Data Translation DT2815 + * + * COMEDI - Linux Control and Measurement Device Interface + * Copyright (C) 1999 Anders Blomdell <anders.blomd...@control.lth.se> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. */ /* -Driver: dt2815 -Description: Data Translation DT2815 -Author: ds -Status: mostly complete, untested -Devices: [Data Translation] DT2815 (dt2815) - -I'm not sure anyone has ever tested this board. If you have information -contrary, please update. - -Configuration options: - [0] - I/O port base base address - [1] - IRQ (unused) - [2] - Voltage unipolar/bipolar configuration - 0 == unipolar 5V (0V -- +5V) - 1 == bipolar 5V (-5V -- +5V) - [3] - Current offset configuration - 0 == disabled (0mA -- +32mAV) - 1 == enabled (+4mA -- +20mAV) - [4] - Firmware program configuration - 0 == program 1 (see manual table 5-4) - 1 == program 2 (see manual table 5-4) - 2 == program 3 (see manual table 5-4) - 3 == program 4 (see manual table 5-4) - [5] - Analog output 0 range configuration - 0 == voltage - 1 == current - [6] - Analog output 1 range configuration (same options) - [7] - Analog output 2 range configuration (same options) - [8] - Analog output 3 range configuration (same options) - [9] - Analog output 4 range configuration (same options) - [10] - Analog output 5 range configuration (same options) - [11] - Analog output 6 range configuration (same options) - [12] - Analog output 7 range configuration (same options) -*/ + * Driver: dt2815 + * Description: Data Translation DT2815 + * Author: ds + * Status: mostly complete, untested + * Devices: [Data Translation] DT2815 (dt2815) + * + * I'm not sure anyone has ever tested this board. If you have information + * contrary, please update. + * + * Configuration options: + * [0] - I/O port base base address + * [1] - IRQ (unused) + * [2] - Voltage unipolar/bipolar configuration + * 0 == unipolar 5V (0V -- +5V) + * 1 == bipolar 5V (-5V -- +5V) + * [3] - Current offset configuration + * 0 == disabled (0mA -- +32mAV) + * 1 == enabled (+4mA -- +20mAV) + * [4] - Firmware program configuration + * 0 == program 1 (see manual table 5-4) + * 1 == program 2 (see manual table 5-4) + * 2 == program 3 (see manual table 5-4) + * 3 == program 4 (see manual table 5-4) + * [5] - Analog output 0 range configuration + * 0 == voltage + * 1 == current + * [6] - Analog output 1 range configuration (same options) + * [7] - Analog output 2 range configuration (same options) + * [8] - Analog output 3 range configuration (same options) + * [9] - Analog output 4 range configuration (same options) + * [10] - Analog output 5 range configuration (same options) + * [11] - Analog output 6 range configuration (same options) + * [12] - Analog output 7 range configuration (same options) + */ #include #include "../comedidev.h" @@ -120,27 +120,27 @@ static int dt2815_ao_insn(struct comedi_device *dev, struct comedi_subdevice *s, } /* - options[0] Board base address - options[1] IRQ (not applicable) - options[2] Voltage unipolar/bipolar configuration -
[PATCH 2/4] Staging: comedi: dt2815: Comment issue fixed
This fixes up a WARNING: 'Block comments use a trailing */ on a separate line' found by the checkpatch.pl tool. Signed-off-by: Ravishankar Karkala Mallikarjunayya --- drivers/staging/comedi/drivers/dt2815.c | 140 1 file changed, 70 insertions(+), 70 deletions(-) diff --git a/drivers/staging/comedi/drivers/dt2815.c b/drivers/staging/comedi/drivers/dt2815.c index fb08569..0be77cc 100644 --- a/drivers/staging/comedi/drivers/dt2815.c +++ b/drivers/staging/comedi/drivers/dt2815.c @@ -1,55 +1,55 @@ /* - comedi/drivers/dt2815.c - Hardware driver for Data Translation DT2815 - - COMEDI - Linux Control and Measurement Device Interface - Copyright (C) 1999 Anders Blomdell - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. + * comedi/drivers/dt2815.c + * Hardware driver for Data Translation DT2815 + * + * COMEDI - Linux Control and Measurement Device Interface + * Copyright (C) 1999 Anders Blomdell + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. */ /* -Driver: dt2815 -Description: Data Translation DT2815 -Author: ds -Status: mostly complete, untested -Devices: [Data Translation] DT2815 (dt2815) - -I'm not sure anyone has ever tested this board. If you have information -contrary, please update. - -Configuration options: - [0] - I/O port base base address - [1] - IRQ (unused) - [2] - Voltage unipolar/bipolar configuration - 0 == unipolar 5V (0V -- +5V) - 1 == bipolar 5V (-5V -- +5V) - [3] - Current offset configuration - 0 == disabled (0mA -- +32mAV) - 1 == enabled (+4mA -- +20mAV) - [4] - Firmware program configuration - 0 == program 1 (see manual table 5-4) - 1 == program 2 (see manual table 5-4) - 2 == program 3 (see manual table 5-4) - 3 == program 4 (see manual table 5-4) - [5] - Analog output 0 range configuration - 0 == voltage - 1 == current - [6] - Analog output 1 range configuration (same options) - [7] - Analog output 2 range configuration (same options) - [8] - Analog output 3 range configuration (same options) - [9] - Analog output 4 range configuration (same options) - [10] - Analog output 5 range configuration (same options) - [11] - Analog output 6 range configuration (same options) - [12] - Analog output 7 range configuration (same options) -*/ + * Driver: dt2815 + * Description: Data Translation DT2815 + * Author: ds + * Status: mostly complete, untested + * Devices: [Data Translation] DT2815 (dt2815) + * + * I'm not sure anyone has ever tested this board. If you have information + * contrary, please update. + * + * Configuration options: + * [0] - I/O port base base address + * [1] - IRQ (unused) + * [2] - Voltage unipolar/bipolar configuration + * 0 == unipolar 5V (0V -- +5V) + * 1 == bipolar 5V (-5V -- +5V) + * [3] - Current offset configuration + * 0 == disabled (0mA -- +32mAV) + * 1 == enabled (+4mA -- +20mAV) + * [4] - Firmware program configuration + * 0 == program 1 (see manual table 5-4) + * 1 == program 2 (see manual table 5-4) + * 2 == program 3 (see manual table 5-4) + * 3 == program 4 (see manual table 5-4) + * [5] - Analog output 0 range configuration + * 0 == voltage + * 1 == current + * [6] - Analog output 1 range configuration (same options) + * [7] - Analog output 2 range configuration (same options) + * [8] - Analog output 3 range configuration (same options) + * [9] - Analog output 4 range configuration (same options) + * [10] - Analog output 5 range configuration (same options) + * [11] - Analog output 6 range configuration (same options) + * [12] - Analog output 7 range configuration (same options) + */ #include #include "../comedidev.h" @@ -120,27 +120,27 @@ static int dt2815_ao_insn(struct comedi_device *dev, struct comedi_subdevice *s, } /* - options[0] Board base address - options[1] IRQ (not applicable) - options[2] Voltage unipolar/bipolar configuration - 0 == unipolar 5V (0V -- +5V) - 1 == bipolar 5V (-5V -- +5V) - options[3] Curr
[PATCH v2 1/1] Staging: comedi: dmm32at: fix BIT macro issue.
This Replace all occurences of (1<<x) by BIT(x) and DMM32AT_CTRL_PAGE(x), DMM32AT_AI_CFG_SCINT(x) macros to get rid of checkpatch.pl "CHECK" output "Prefer using the BIT macro" Signed-off-by: Ravishankar Karkala Mallikarjunayya <ravishankark...@gmail.com> --- Changes V1 -> V2: - BIT macros added(suggested by Ian Abbott) -i.e.DMM32AT_AI_CFG_SCINT(x), DMM32AT_CTRL_PAGE(x) --- drivers/staging/comedi/drivers/dmm32at.c | 98 1 file changed, 50 insertions(+), 48 deletions(-) diff --git a/drivers/staging/comedi/drivers/dmm32at.c b/drivers/staging/comedi/drivers/dmm32at.c index 958c0d4..b8606de 100644 --- a/drivers/staging/comedi/drivers/dmm32at.c +++ b/drivers/staging/comedi/drivers/dmm32at.c @@ -46,73 +46,75 @@ #define DMM32AT_AI_START_CONV_REG 0x00 #define DMM32AT_AI_LSB_REG 0x00 #define DMM32AT_AUX_DOUT_REG 0x01 -#define DMM32AT_AUX_DOUT2 (1 << 2) /* J3.42 - OUT2 (OUT2EN) */ -#define DMM32AT_AUX_DOUT1 (1 << 1) /* J3.43 */ -#define DMM32AT_AUX_DOUT0 (1 << 0) /* J3.44 - OUT0 (OUT0EN) */ +#define DMM32AT_AUX_DOUT2 BIT(2) /* J3.42 - OUT2 (OUT2EN) */ +#define DMM32AT_AUX_DOUT1 BIT(1) /* J3.43 */ +#define DMM32AT_AUX_DOUT0 BIT(0) /* J3.44 - OUT0 (OUT0EN) */ #define DMM32AT_AI_MSB_REG 0x01 #define DMM32AT_AI_LO_CHAN_REG 0x02 #define DMM32AT_AI_HI_CHAN_REG 0x03 #define DMM32AT_AUX_DI_REG 0x04 -#define DMM32AT_AUX_DI_DACBUSY (1 << 7) -#define DMM32AT_AUX_DI_CALBUSY (1 << 6) -#define DMM32AT_AUX_DI3(1 << 3) /* J3.45 - ADCLK (CLKSEL) */ -#define DMM32AT_AUX_DI2(1 << 2) /* J3.46 - GATE12 (GT12EN) */ -#define DMM32AT_AUX_DI1(1 << 1) /* J3.47 - GATE0 (GT0EN) */ -#define DMM32AT_AUX_DI0(1 << 0) /* J3.48 - CLK0 (SRC0) */ +#define DMM32AT_AUX_DI_DACBUSY BIT(7) +#define DMM32AT_AUX_DI_CALBUSY BIT(6) +#define DMM32AT_AUX_DI3BIT(3) /* J3.45 - ADCLK (CLKSEL) */ +#define DMM32AT_AUX_DI2BIT(2) /* J3.46 - GATE12 (GT12EN) */ +#define DMM32AT_AUX_DI1BIT(1) /* J3.47 - GATE0 (GT0EN) */ +#define DMM32AT_AUX_DI0BIT(0) /* J3.48 - CLK0 (SRC0) */ #define DMM32AT_AO_LSB_REG 0x04 #define DMM32AT_AO_MSB_REG 0x05 #define DMM32AT_AO_MSB_DACH(x) ((x) << 6) #define DMM32AT_FIFO_DEPTH_REG 0x06 #define DMM32AT_FIFO_CTRL_REG 0x07 -#define DMM32AT_FIFO_CTRL_FIFOEN (1 << 3) -#define DMM32AT_FIFO_CTRL_SCANEN (1 << 2) -#define DMM32AT_FIFO_CTRL_FIFORST (1 << 1) +#define DMM32AT_FIFO_CTRL_FIFOEN BIT(3) +#define DMM32AT_FIFO_CTRL_SCANEN BIT(2) +#define DMM32AT_FIFO_CTRL_FIFORST BIT(1) #define DMM32AT_FIFO_STATUS_REG0x07 -#define DMM32AT_FIFO_STATUS_EF (1 << 7) -#define DMM32AT_FIFO_STATUS_HF (1 << 6) -#define DMM32AT_FIFO_STATUS_FF (1 << 5) -#define DMM32AT_FIFO_STATUS_OVF(1 << 4) -#define DMM32AT_FIFO_STATUS_FIFOEN (1 << 3) -#define DMM32AT_FIFO_STATUS_SCANEN (1 << 2) +#define DMM32AT_FIFO_STATUS_EF BIT(7) +#define DMM32AT_FIFO_STATUS_HF BIT(6) +#define DMM32AT_FIFO_STATUS_FF BIT(5) +#define DMM32AT_FIFO_STATUS_OVFBIT(4) +#define DMM32AT_FIFO_STATUS_FIFOEN BIT(3) +#define DMM32AT_FIFO_STATUS_SCANEN BIT(2) #define DMM32AT_FIFO_STATUS_PAGE_MASK (3 << 0) #define DMM32AT_CTRL_REG 0x08 -#define DMM32AT_CTRL_RESETA(1 << 5) -#define DMM32AT_CTRL_RESETD(1 << 4) -#define DMM32AT_CTRL_INTRST(1 << 3) -#define DMM32AT_CTRL_PAGE_8254 (0 << 0) -#define DMM32AT_CTRL_PAGE_8255 (1 << 0) -#define DMM32AT_CTRL_PAGE_CALIB(3 << 0) +#define DMM32AT_CTRL_RESETABIT(5) +#define DMM32AT_CTRL_RESETDBIT(4) +#define DMM32AT_CTRL_INTRSTBIT(3) +#define DMM32AT_CTRL_PAGE(x) ((x) << 0) +#define DMM32AT_CTRL_PAGE_8254 DMM32AT_CTRL_PAGE(0) +#define DMM32AT_CTRL_PAGE_8255 DMM32AT_CTRL_PAGE(1) +#define DMM32AT_CTRL_PAGE_CALIBDMM32AT_CTRL_PAGE(3) #define DMM32AT_AI_STATUS_REG 0x08 -#define DMM32AT_AI_STATUS_STS (1 << 7) -#define DMM32AT_AI_STATUS_SD1 (1 << 6) -#define DMM32AT_AI_STATUS_SD0 (1 << 5) +#define DMM32AT_AI_STATUS_STS BIT(7) +#define DMM32AT_AI_STATUS_SD1 BIT(6) +#define DMM32AT_AI_STATUS_SD0 BIT(5) #define DMM32AT_AI_STATUS_ADCH_MASK(0x1f << 0) #define DMM32AT_INTCLK_REG 0x09 -#
[PATCH v2 1/1] Staging: comedi: dmm32at: fix BIT macro issue.
This Replace all occurences of (1< --- Changes V1 -> V2: - BIT macros added(suggested by Ian Abbott) -i.e.DMM32AT_AI_CFG_SCINT(x), DMM32AT_CTRL_PAGE(x) --- drivers/staging/comedi/drivers/dmm32at.c | 98 1 file changed, 50 insertions(+), 48 deletions(-) diff --git a/drivers/staging/comedi/drivers/dmm32at.c b/drivers/staging/comedi/drivers/dmm32at.c index 958c0d4..b8606de 100644 --- a/drivers/staging/comedi/drivers/dmm32at.c +++ b/drivers/staging/comedi/drivers/dmm32at.c @@ -46,73 +46,75 @@ #define DMM32AT_AI_START_CONV_REG 0x00 #define DMM32AT_AI_LSB_REG 0x00 #define DMM32AT_AUX_DOUT_REG 0x01 -#define DMM32AT_AUX_DOUT2 (1 << 2) /* J3.42 - OUT2 (OUT2EN) */ -#define DMM32AT_AUX_DOUT1 (1 << 1) /* J3.43 */ -#define DMM32AT_AUX_DOUT0 (1 << 0) /* J3.44 - OUT0 (OUT0EN) */ +#define DMM32AT_AUX_DOUT2 BIT(2) /* J3.42 - OUT2 (OUT2EN) */ +#define DMM32AT_AUX_DOUT1 BIT(1) /* J3.43 */ +#define DMM32AT_AUX_DOUT0 BIT(0) /* J3.44 - OUT0 (OUT0EN) */ #define DMM32AT_AI_MSB_REG 0x01 #define DMM32AT_AI_LO_CHAN_REG 0x02 #define DMM32AT_AI_HI_CHAN_REG 0x03 #define DMM32AT_AUX_DI_REG 0x04 -#define DMM32AT_AUX_DI_DACBUSY (1 << 7) -#define DMM32AT_AUX_DI_CALBUSY (1 << 6) -#define DMM32AT_AUX_DI3(1 << 3) /* J3.45 - ADCLK (CLKSEL) */ -#define DMM32AT_AUX_DI2(1 << 2) /* J3.46 - GATE12 (GT12EN) */ -#define DMM32AT_AUX_DI1(1 << 1) /* J3.47 - GATE0 (GT0EN) */ -#define DMM32AT_AUX_DI0(1 << 0) /* J3.48 - CLK0 (SRC0) */ +#define DMM32AT_AUX_DI_DACBUSY BIT(7) +#define DMM32AT_AUX_DI_CALBUSY BIT(6) +#define DMM32AT_AUX_DI3BIT(3) /* J3.45 - ADCLK (CLKSEL) */ +#define DMM32AT_AUX_DI2BIT(2) /* J3.46 - GATE12 (GT12EN) */ +#define DMM32AT_AUX_DI1BIT(1) /* J3.47 - GATE0 (GT0EN) */ +#define DMM32AT_AUX_DI0BIT(0) /* J3.48 - CLK0 (SRC0) */ #define DMM32AT_AO_LSB_REG 0x04 #define DMM32AT_AO_MSB_REG 0x05 #define DMM32AT_AO_MSB_DACH(x) ((x) << 6) #define DMM32AT_FIFO_DEPTH_REG 0x06 #define DMM32AT_FIFO_CTRL_REG 0x07 -#define DMM32AT_FIFO_CTRL_FIFOEN (1 << 3) -#define DMM32AT_FIFO_CTRL_SCANEN (1 << 2) -#define DMM32AT_FIFO_CTRL_FIFORST (1 << 1) +#define DMM32AT_FIFO_CTRL_FIFOEN BIT(3) +#define DMM32AT_FIFO_CTRL_SCANEN BIT(2) +#define DMM32AT_FIFO_CTRL_FIFORST BIT(1) #define DMM32AT_FIFO_STATUS_REG0x07 -#define DMM32AT_FIFO_STATUS_EF (1 << 7) -#define DMM32AT_FIFO_STATUS_HF (1 << 6) -#define DMM32AT_FIFO_STATUS_FF (1 << 5) -#define DMM32AT_FIFO_STATUS_OVF(1 << 4) -#define DMM32AT_FIFO_STATUS_FIFOEN (1 << 3) -#define DMM32AT_FIFO_STATUS_SCANEN (1 << 2) +#define DMM32AT_FIFO_STATUS_EF BIT(7) +#define DMM32AT_FIFO_STATUS_HF BIT(6) +#define DMM32AT_FIFO_STATUS_FF BIT(5) +#define DMM32AT_FIFO_STATUS_OVFBIT(4) +#define DMM32AT_FIFO_STATUS_FIFOEN BIT(3) +#define DMM32AT_FIFO_STATUS_SCANEN BIT(2) #define DMM32AT_FIFO_STATUS_PAGE_MASK (3 << 0) #define DMM32AT_CTRL_REG 0x08 -#define DMM32AT_CTRL_RESETA(1 << 5) -#define DMM32AT_CTRL_RESETD(1 << 4) -#define DMM32AT_CTRL_INTRST(1 << 3) -#define DMM32AT_CTRL_PAGE_8254 (0 << 0) -#define DMM32AT_CTRL_PAGE_8255 (1 << 0) -#define DMM32AT_CTRL_PAGE_CALIB(3 << 0) +#define DMM32AT_CTRL_RESETABIT(5) +#define DMM32AT_CTRL_RESETDBIT(4) +#define DMM32AT_CTRL_INTRSTBIT(3) +#define DMM32AT_CTRL_PAGE(x) ((x) << 0) +#define DMM32AT_CTRL_PAGE_8254 DMM32AT_CTRL_PAGE(0) +#define DMM32AT_CTRL_PAGE_8255 DMM32AT_CTRL_PAGE(1) +#define DMM32AT_CTRL_PAGE_CALIBDMM32AT_CTRL_PAGE(3) #define DMM32AT_AI_STATUS_REG 0x08 -#define DMM32AT_AI_STATUS_STS (1 << 7) -#define DMM32AT_AI_STATUS_SD1 (1 << 6) -#define DMM32AT_AI_STATUS_SD0 (1 << 5) +#define DMM32AT_AI_STATUS_STS BIT(7) +#define DMM32AT_AI_STATUS_SD1 BIT(6) +#define DMM32AT_AI_STATUS_SD0 BIT(5) #define DMM32AT_AI_STATUS_ADCH_MASK(0x1f << 0) #define DMM32AT_INTCLK_REG 0x09 -#define DMM32AT_INTCLK_ADINT (1 << 7) -#define DMM32AT_INTCLK_DINT(1 << 6) -#define DMM32AT_INTCLK_TINT(1 << 5) -#define DMM32AT_INTCLK_CLKEN (1 << 1) /* 1=see below 0=software */ -#define DMM32AT_INTCLK_CLKSEL (1 << 0) /* 1=OUT2 0=EXTCLK */ +#define DMM32AT_INTCLK_ADINT BIT(7) +#define DMM32AT_INTCLK_DINTBIT(6) +#define DMM32AT_INTCLK_TINTBIT(5) +#define
[PATCH 1/1] Staging: comedi: dmm32at: fix BIT macro issue.
This Replace all occurences of (1<<x) by BIT(x) and DMM32AT_CTRL_PAGE(x), DMM32AT_AI_CFG_SCINT(x) macros to get rid of checkpatch.pl "CHECK" output "Prefer using the BIT macro" Signed-off-by: Ravishankar Karkala Mallikarjunayya <ravishankark...@gmail.com> --- drivers/staging/comedi/drivers/dmm32at.c | 98 1 file changed, 50 insertions(+), 48 deletions(-) diff --git a/drivers/staging/comedi/drivers/dmm32at.c b/drivers/staging/comedi/drivers/dmm32at.c index 958c0d4..b8606de 100644 --- a/drivers/staging/comedi/drivers/dmm32at.c +++ b/drivers/staging/comedi/drivers/dmm32at.c @@ -46,73 +46,75 @@ #define DMM32AT_AI_START_CONV_REG 0x00 #define DMM32AT_AI_LSB_REG 0x00 #define DMM32AT_AUX_DOUT_REG 0x01 -#define DMM32AT_AUX_DOUT2 (1 << 2) /* J3.42 - OUT2 (OUT2EN) */ -#define DMM32AT_AUX_DOUT1 (1 << 1) /* J3.43 */ -#define DMM32AT_AUX_DOUT0 (1 << 0) /* J3.44 - OUT0 (OUT0EN) */ +#define DMM32AT_AUX_DOUT2 BIT(2) /* J3.42 - OUT2 (OUT2EN) */ +#define DMM32AT_AUX_DOUT1 BIT(1) /* J3.43 */ +#define DMM32AT_AUX_DOUT0 BIT(0) /* J3.44 - OUT0 (OUT0EN) */ #define DMM32AT_AI_MSB_REG 0x01 #define DMM32AT_AI_LO_CHAN_REG 0x02 #define DMM32AT_AI_HI_CHAN_REG 0x03 #define DMM32AT_AUX_DI_REG 0x04 -#define DMM32AT_AUX_DI_DACBUSY (1 << 7) -#define DMM32AT_AUX_DI_CALBUSY (1 << 6) -#define DMM32AT_AUX_DI3(1 << 3) /* J3.45 - ADCLK (CLKSEL) */ -#define DMM32AT_AUX_DI2(1 << 2) /* J3.46 - GATE12 (GT12EN) */ -#define DMM32AT_AUX_DI1(1 << 1) /* J3.47 - GATE0 (GT0EN) */ -#define DMM32AT_AUX_DI0(1 << 0) /* J3.48 - CLK0 (SRC0) */ +#define DMM32AT_AUX_DI_DACBUSY BIT(7) +#define DMM32AT_AUX_DI_CALBUSY BIT(6) +#define DMM32AT_AUX_DI3BIT(3) /* J3.45 - ADCLK (CLKSEL) */ +#define DMM32AT_AUX_DI2BIT(2) /* J3.46 - GATE12 (GT12EN) */ +#define DMM32AT_AUX_DI1BIT(1) /* J3.47 - GATE0 (GT0EN) */ +#define DMM32AT_AUX_DI0BIT(0) /* J3.48 - CLK0 (SRC0) */ #define DMM32AT_AO_LSB_REG 0x04 #define DMM32AT_AO_MSB_REG 0x05 #define DMM32AT_AO_MSB_DACH(x) ((x) << 6) #define DMM32AT_FIFO_DEPTH_REG 0x06 #define DMM32AT_FIFO_CTRL_REG 0x07 -#define DMM32AT_FIFO_CTRL_FIFOEN (1 << 3) -#define DMM32AT_FIFO_CTRL_SCANEN (1 << 2) -#define DMM32AT_FIFO_CTRL_FIFORST (1 << 1) +#define DMM32AT_FIFO_CTRL_FIFOEN BIT(3) +#define DMM32AT_FIFO_CTRL_SCANEN BIT(2) +#define DMM32AT_FIFO_CTRL_FIFORST BIT(1) #define DMM32AT_FIFO_STATUS_REG0x07 -#define DMM32AT_FIFO_STATUS_EF (1 << 7) -#define DMM32AT_FIFO_STATUS_HF (1 << 6) -#define DMM32AT_FIFO_STATUS_FF (1 << 5) -#define DMM32AT_FIFO_STATUS_OVF(1 << 4) -#define DMM32AT_FIFO_STATUS_FIFOEN (1 << 3) -#define DMM32AT_FIFO_STATUS_SCANEN (1 << 2) +#define DMM32AT_FIFO_STATUS_EF BIT(7) +#define DMM32AT_FIFO_STATUS_HF BIT(6) +#define DMM32AT_FIFO_STATUS_FF BIT(5) +#define DMM32AT_FIFO_STATUS_OVFBIT(4) +#define DMM32AT_FIFO_STATUS_FIFOEN BIT(3) +#define DMM32AT_FIFO_STATUS_SCANEN BIT(2) #define DMM32AT_FIFO_STATUS_PAGE_MASK (3 << 0) #define DMM32AT_CTRL_REG 0x08 -#define DMM32AT_CTRL_RESETA(1 << 5) -#define DMM32AT_CTRL_RESETD(1 << 4) -#define DMM32AT_CTRL_INTRST(1 << 3) -#define DMM32AT_CTRL_PAGE_8254 (0 << 0) -#define DMM32AT_CTRL_PAGE_8255 (1 << 0) -#define DMM32AT_CTRL_PAGE_CALIB(3 << 0) +#define DMM32AT_CTRL_RESETABIT(5) +#define DMM32AT_CTRL_RESETDBIT(4) +#define DMM32AT_CTRL_INTRSTBIT(3) +#define DMM32AT_CTRL_PAGE(x) ((x) << 0) +#define DMM32AT_CTRL_PAGE_8254 DMM32AT_CTRL_PAGE(0) +#define DMM32AT_CTRL_PAGE_8255 DMM32AT_CTRL_PAGE(1) +#define DMM32AT_CTRL_PAGE_CALIBDMM32AT_CTRL_PAGE(3) #define DMM32AT_AI_STATUS_REG 0x08 -#define DMM32AT_AI_STATUS_STS (1 << 7) -#define DMM32AT_AI_STATUS_SD1 (1 << 6) -#define DMM32AT_AI_STATUS_SD0 (1 << 5) +#define DMM32AT_AI_STATUS_STS BIT(7) +#define DMM32AT_AI_STATUS_SD1 BIT(6) +#define DMM32AT_AI_STATUS_SD0 BIT(5) #define DMM32AT_AI_STATUS_ADCH_MASK(0x1f << 0) #define DMM32AT_INTCLK_REG 0x09 -#define DMM32AT_INTCLK_ADINT (1 << 7) -#define DMM32AT_INTCLK_DINT(1 << 6) -#define DMM32AT_INTCLK_TIN
[PATCH 1/1] Staging: comedi: dmm32at: fix BIT macro issue.
This Replace all occurences of (1< --- drivers/staging/comedi/drivers/dmm32at.c | 98 1 file changed, 50 insertions(+), 48 deletions(-) diff --git a/drivers/staging/comedi/drivers/dmm32at.c b/drivers/staging/comedi/drivers/dmm32at.c index 958c0d4..b8606de 100644 --- a/drivers/staging/comedi/drivers/dmm32at.c +++ b/drivers/staging/comedi/drivers/dmm32at.c @@ -46,73 +46,75 @@ #define DMM32AT_AI_START_CONV_REG 0x00 #define DMM32AT_AI_LSB_REG 0x00 #define DMM32AT_AUX_DOUT_REG 0x01 -#define DMM32AT_AUX_DOUT2 (1 << 2) /* J3.42 - OUT2 (OUT2EN) */ -#define DMM32AT_AUX_DOUT1 (1 << 1) /* J3.43 */ -#define DMM32AT_AUX_DOUT0 (1 << 0) /* J3.44 - OUT0 (OUT0EN) */ +#define DMM32AT_AUX_DOUT2 BIT(2) /* J3.42 - OUT2 (OUT2EN) */ +#define DMM32AT_AUX_DOUT1 BIT(1) /* J3.43 */ +#define DMM32AT_AUX_DOUT0 BIT(0) /* J3.44 - OUT0 (OUT0EN) */ #define DMM32AT_AI_MSB_REG 0x01 #define DMM32AT_AI_LO_CHAN_REG 0x02 #define DMM32AT_AI_HI_CHAN_REG 0x03 #define DMM32AT_AUX_DI_REG 0x04 -#define DMM32AT_AUX_DI_DACBUSY (1 << 7) -#define DMM32AT_AUX_DI_CALBUSY (1 << 6) -#define DMM32AT_AUX_DI3(1 << 3) /* J3.45 - ADCLK (CLKSEL) */ -#define DMM32AT_AUX_DI2(1 << 2) /* J3.46 - GATE12 (GT12EN) */ -#define DMM32AT_AUX_DI1(1 << 1) /* J3.47 - GATE0 (GT0EN) */ -#define DMM32AT_AUX_DI0(1 << 0) /* J3.48 - CLK0 (SRC0) */ +#define DMM32AT_AUX_DI_DACBUSY BIT(7) +#define DMM32AT_AUX_DI_CALBUSY BIT(6) +#define DMM32AT_AUX_DI3BIT(3) /* J3.45 - ADCLK (CLKSEL) */ +#define DMM32AT_AUX_DI2BIT(2) /* J3.46 - GATE12 (GT12EN) */ +#define DMM32AT_AUX_DI1BIT(1) /* J3.47 - GATE0 (GT0EN) */ +#define DMM32AT_AUX_DI0BIT(0) /* J3.48 - CLK0 (SRC0) */ #define DMM32AT_AO_LSB_REG 0x04 #define DMM32AT_AO_MSB_REG 0x05 #define DMM32AT_AO_MSB_DACH(x) ((x) << 6) #define DMM32AT_FIFO_DEPTH_REG 0x06 #define DMM32AT_FIFO_CTRL_REG 0x07 -#define DMM32AT_FIFO_CTRL_FIFOEN (1 << 3) -#define DMM32AT_FIFO_CTRL_SCANEN (1 << 2) -#define DMM32AT_FIFO_CTRL_FIFORST (1 << 1) +#define DMM32AT_FIFO_CTRL_FIFOEN BIT(3) +#define DMM32AT_FIFO_CTRL_SCANEN BIT(2) +#define DMM32AT_FIFO_CTRL_FIFORST BIT(1) #define DMM32AT_FIFO_STATUS_REG0x07 -#define DMM32AT_FIFO_STATUS_EF (1 << 7) -#define DMM32AT_FIFO_STATUS_HF (1 << 6) -#define DMM32AT_FIFO_STATUS_FF (1 << 5) -#define DMM32AT_FIFO_STATUS_OVF(1 << 4) -#define DMM32AT_FIFO_STATUS_FIFOEN (1 << 3) -#define DMM32AT_FIFO_STATUS_SCANEN (1 << 2) +#define DMM32AT_FIFO_STATUS_EF BIT(7) +#define DMM32AT_FIFO_STATUS_HF BIT(6) +#define DMM32AT_FIFO_STATUS_FF BIT(5) +#define DMM32AT_FIFO_STATUS_OVFBIT(4) +#define DMM32AT_FIFO_STATUS_FIFOEN BIT(3) +#define DMM32AT_FIFO_STATUS_SCANEN BIT(2) #define DMM32AT_FIFO_STATUS_PAGE_MASK (3 << 0) #define DMM32AT_CTRL_REG 0x08 -#define DMM32AT_CTRL_RESETA(1 << 5) -#define DMM32AT_CTRL_RESETD(1 << 4) -#define DMM32AT_CTRL_INTRST(1 << 3) -#define DMM32AT_CTRL_PAGE_8254 (0 << 0) -#define DMM32AT_CTRL_PAGE_8255 (1 << 0) -#define DMM32AT_CTRL_PAGE_CALIB(3 << 0) +#define DMM32AT_CTRL_RESETABIT(5) +#define DMM32AT_CTRL_RESETDBIT(4) +#define DMM32AT_CTRL_INTRSTBIT(3) +#define DMM32AT_CTRL_PAGE(x) ((x) << 0) +#define DMM32AT_CTRL_PAGE_8254 DMM32AT_CTRL_PAGE(0) +#define DMM32AT_CTRL_PAGE_8255 DMM32AT_CTRL_PAGE(1) +#define DMM32AT_CTRL_PAGE_CALIBDMM32AT_CTRL_PAGE(3) #define DMM32AT_AI_STATUS_REG 0x08 -#define DMM32AT_AI_STATUS_STS (1 << 7) -#define DMM32AT_AI_STATUS_SD1 (1 << 6) -#define DMM32AT_AI_STATUS_SD0 (1 << 5) +#define DMM32AT_AI_STATUS_STS BIT(7) +#define DMM32AT_AI_STATUS_SD1 BIT(6) +#define DMM32AT_AI_STATUS_SD0 BIT(5) #define DMM32AT_AI_STATUS_ADCH_MASK(0x1f << 0) #define DMM32AT_INTCLK_REG 0x09 -#define DMM32AT_INTCLK_ADINT (1 << 7) -#define DMM32AT_INTCLK_DINT(1 << 6) -#define DMM32AT_INTCLK_TINT(1 << 5) -#define DMM32AT_INTCLK_CLKEN (1 << 1) /* 1=see below 0=software */ -#define DMM32AT_INTCLK_CLKSEL (1 << 0) /* 1=OUT2 0=EXTCLK */ +#define DMM32AT_INTCLK_ADINT BIT(7) +#define DMM32AT_INTCLK_DINTBIT(6) +#define DMM32AT_INTCLK_TINTBIT(5) +#define DMM32AT_INTCLK_CLKEN BIT(1) /* 1=see below 0=software */ +#define DMM32AT_INTCLK_CLKSEL BIT(0) /* 1=OUT2
[PATCH 1/1] Staging: comedi: dmm32at: fix BIT macro issue.
This Replace all occurences of (1<<x) by BIT(x) and DMM32AT_CTRL(x), DMM32AT_AI_CFG(x) macros to get rid of checkpatch.pl "CHECK" output "Prefer using the BIT macro" Signed-off-by: Ravishankar Karkala Mallikarjunayya <ravishankark...@gmail.com> --- drivers/staging/comedi/drivers/dmm32at.c | 98 1 file changed, 50 insertions(+), 48 deletions(-) diff --git a/drivers/staging/comedi/drivers/dmm32at.c b/drivers/staging/comedi/drivers/dmm32at.c index 958c0d4..0d50105 100644 --- a/drivers/staging/comedi/drivers/dmm32at.c +++ b/drivers/staging/comedi/drivers/dmm32at.c @@ -46,73 +46,75 @@ #define DMM32AT_AI_START_CONV_REG 0x00 #define DMM32AT_AI_LSB_REG 0x00 #define DMM32AT_AUX_DOUT_REG 0x01 -#define DMM32AT_AUX_DOUT2 (1 << 2) /* J3.42 - OUT2 (OUT2EN) */ -#define DMM32AT_AUX_DOUT1 (1 << 1) /* J3.43 */ -#define DMM32AT_AUX_DOUT0 (1 << 0) /* J3.44 - OUT0 (OUT0EN) */ +#define DMM32AT_AUX_DOUT2 BIT(2) /* J3.42 - OUT2 (OUT2EN) */ +#define DMM32AT_AUX_DOUT1 BIT(1) /* J3.43 */ +#define DMM32AT_AUX_DOUT0 BIT(0) /* J3.44 - OUT0 (OUT0EN) */ #define DMM32AT_AI_MSB_REG 0x01 #define DMM32AT_AI_LO_CHAN_REG 0x02 #define DMM32AT_AI_HI_CHAN_REG 0x03 #define DMM32AT_AUX_DI_REG 0x04 -#define DMM32AT_AUX_DI_DACBUSY (1 << 7) -#define DMM32AT_AUX_DI_CALBUSY (1 << 6) -#define DMM32AT_AUX_DI3(1 << 3) /* J3.45 - ADCLK (CLKSEL) */ -#define DMM32AT_AUX_DI2(1 << 2) /* J3.46 - GATE12 (GT12EN) */ -#define DMM32AT_AUX_DI1(1 << 1) /* J3.47 - GATE0 (GT0EN) */ -#define DMM32AT_AUX_DI0(1 << 0) /* J3.48 - CLK0 (SRC0) */ +#define DMM32AT_AUX_DI_DACBUSY BIT(7) +#define DMM32AT_AUX_DI_CALBUSY BIT(6) +#define DMM32AT_AUX_DI3BIT(3) /* J3.45 - ADCLK (CLKSEL) */ +#define DMM32AT_AUX_DI2BIT(2) /* J3.46 - GATE12 (GT12EN) */ +#define DMM32AT_AUX_DI1BIT(1) /* J3.47 - GATE0 (GT0EN) */ +#define DMM32AT_AUX_DI0BIT(0) /* J3.48 - CLK0 (SRC0) */ #define DMM32AT_AO_LSB_REG 0x04 #define DMM32AT_AO_MSB_REG 0x05 #define DMM32AT_AO_MSB_DACH(x) ((x) << 6) #define DMM32AT_FIFO_DEPTH_REG 0x06 #define DMM32AT_FIFO_CTRL_REG 0x07 -#define DMM32AT_FIFO_CTRL_FIFOEN (1 << 3) -#define DMM32AT_FIFO_CTRL_SCANEN (1 << 2) -#define DMM32AT_FIFO_CTRL_FIFORST (1 << 1) +#define DMM32AT_FIFO_CTRL_FIFOEN BIT(3) +#define DMM32AT_FIFO_CTRL_SCANEN BIT(2) +#define DMM32AT_FIFO_CTRL_FIFORST BIT(1) #define DMM32AT_FIFO_STATUS_REG0x07 -#define DMM32AT_FIFO_STATUS_EF (1 << 7) -#define DMM32AT_FIFO_STATUS_HF (1 << 6) -#define DMM32AT_FIFO_STATUS_FF (1 << 5) -#define DMM32AT_FIFO_STATUS_OVF(1 << 4) -#define DMM32AT_FIFO_STATUS_FIFOEN (1 << 3) -#define DMM32AT_FIFO_STATUS_SCANEN (1 << 2) +#define DMM32AT_FIFO_STATUS_EF BIT(7) +#define DMM32AT_FIFO_STATUS_HF BIT(6) +#define DMM32AT_FIFO_STATUS_FF BIT(5) +#define DMM32AT_FIFO_STATUS_OVFBIT(4) +#define DMM32AT_FIFO_STATUS_FIFOEN BIT(3) +#define DMM32AT_FIFO_STATUS_SCANEN BIT(2) #define DMM32AT_FIFO_STATUS_PAGE_MASK (3 << 0) #define DMM32AT_CTRL_REG 0x08 -#define DMM32AT_CTRL_RESETA(1 << 5) -#define DMM32AT_CTRL_RESETD(1 << 4) -#define DMM32AT_CTRL_INTRST(1 << 3) -#define DMM32AT_CTRL_PAGE_8254 (0 << 0) -#define DMM32AT_CTRL_PAGE_8255 (1 << 0) -#define DMM32AT_CTRL_PAGE_CALIB(3 << 0) +#define DMM32AT_CTRL_RESETABIT(5) +#define DMM32AT_CTRL_RESETDBIT(4) +#define DMM32AT_CTRL_INTRSTBIT(3) +#define DMM32AT_CTRL(x)((x) << 0) +#define DMM32AT_CTRL_PAGE_8254 DMM32AT_CTRL(0) +#define DMM32AT_CTRL_PAGE_8255 DMM32AT_CTRL(1) +#define DMM32AT_CTRL_PAGE_CALIBDMM32AT_CTRL(3) #define DMM32AT_AI_STATUS_REG 0x08 -#define DMM32AT_AI_STATUS_STS (1 << 7) -#define DMM32AT_AI_STATUS_SD1 (1 << 6) -#define DMM32AT_AI_STATUS_SD0 (1 << 5) +#define DMM32AT_AI_STATUS_STS BIT(7) +#define DMM32AT_AI_STATUS_SD1 BIT(6) +#define DMM32AT_AI_STATUS_SD0 BIT(5) #define DMM32AT_AI_STATUS_ADCH_MASK(0x1f << 0) #define DMM32AT_INTCLK_REG 0x09 -#define DMM32AT_INTCLK_ADINT (1 << 7) -#define DMM32AT_INTCLK_DINT(1 << 6) -#define DMM32AT_INTCLK_TINT(1 <
[PATCH 1/1] Staging: comedi: dmm32at: fix BIT macro issue.
This Replace all occurences of (1< --- drivers/staging/comedi/drivers/dmm32at.c | 98 1 file changed, 50 insertions(+), 48 deletions(-) diff --git a/drivers/staging/comedi/drivers/dmm32at.c b/drivers/staging/comedi/drivers/dmm32at.c index 958c0d4..0d50105 100644 --- a/drivers/staging/comedi/drivers/dmm32at.c +++ b/drivers/staging/comedi/drivers/dmm32at.c @@ -46,73 +46,75 @@ #define DMM32AT_AI_START_CONV_REG 0x00 #define DMM32AT_AI_LSB_REG 0x00 #define DMM32AT_AUX_DOUT_REG 0x01 -#define DMM32AT_AUX_DOUT2 (1 << 2) /* J3.42 - OUT2 (OUT2EN) */ -#define DMM32AT_AUX_DOUT1 (1 << 1) /* J3.43 */ -#define DMM32AT_AUX_DOUT0 (1 << 0) /* J3.44 - OUT0 (OUT0EN) */ +#define DMM32AT_AUX_DOUT2 BIT(2) /* J3.42 - OUT2 (OUT2EN) */ +#define DMM32AT_AUX_DOUT1 BIT(1) /* J3.43 */ +#define DMM32AT_AUX_DOUT0 BIT(0) /* J3.44 - OUT0 (OUT0EN) */ #define DMM32AT_AI_MSB_REG 0x01 #define DMM32AT_AI_LO_CHAN_REG 0x02 #define DMM32AT_AI_HI_CHAN_REG 0x03 #define DMM32AT_AUX_DI_REG 0x04 -#define DMM32AT_AUX_DI_DACBUSY (1 << 7) -#define DMM32AT_AUX_DI_CALBUSY (1 << 6) -#define DMM32AT_AUX_DI3(1 << 3) /* J3.45 - ADCLK (CLKSEL) */ -#define DMM32AT_AUX_DI2(1 << 2) /* J3.46 - GATE12 (GT12EN) */ -#define DMM32AT_AUX_DI1(1 << 1) /* J3.47 - GATE0 (GT0EN) */ -#define DMM32AT_AUX_DI0(1 << 0) /* J3.48 - CLK0 (SRC0) */ +#define DMM32AT_AUX_DI_DACBUSY BIT(7) +#define DMM32AT_AUX_DI_CALBUSY BIT(6) +#define DMM32AT_AUX_DI3BIT(3) /* J3.45 - ADCLK (CLKSEL) */ +#define DMM32AT_AUX_DI2BIT(2) /* J3.46 - GATE12 (GT12EN) */ +#define DMM32AT_AUX_DI1BIT(1) /* J3.47 - GATE0 (GT0EN) */ +#define DMM32AT_AUX_DI0BIT(0) /* J3.48 - CLK0 (SRC0) */ #define DMM32AT_AO_LSB_REG 0x04 #define DMM32AT_AO_MSB_REG 0x05 #define DMM32AT_AO_MSB_DACH(x) ((x) << 6) #define DMM32AT_FIFO_DEPTH_REG 0x06 #define DMM32AT_FIFO_CTRL_REG 0x07 -#define DMM32AT_FIFO_CTRL_FIFOEN (1 << 3) -#define DMM32AT_FIFO_CTRL_SCANEN (1 << 2) -#define DMM32AT_FIFO_CTRL_FIFORST (1 << 1) +#define DMM32AT_FIFO_CTRL_FIFOEN BIT(3) +#define DMM32AT_FIFO_CTRL_SCANEN BIT(2) +#define DMM32AT_FIFO_CTRL_FIFORST BIT(1) #define DMM32AT_FIFO_STATUS_REG0x07 -#define DMM32AT_FIFO_STATUS_EF (1 << 7) -#define DMM32AT_FIFO_STATUS_HF (1 << 6) -#define DMM32AT_FIFO_STATUS_FF (1 << 5) -#define DMM32AT_FIFO_STATUS_OVF(1 << 4) -#define DMM32AT_FIFO_STATUS_FIFOEN (1 << 3) -#define DMM32AT_FIFO_STATUS_SCANEN (1 << 2) +#define DMM32AT_FIFO_STATUS_EF BIT(7) +#define DMM32AT_FIFO_STATUS_HF BIT(6) +#define DMM32AT_FIFO_STATUS_FF BIT(5) +#define DMM32AT_FIFO_STATUS_OVFBIT(4) +#define DMM32AT_FIFO_STATUS_FIFOEN BIT(3) +#define DMM32AT_FIFO_STATUS_SCANEN BIT(2) #define DMM32AT_FIFO_STATUS_PAGE_MASK (3 << 0) #define DMM32AT_CTRL_REG 0x08 -#define DMM32AT_CTRL_RESETA(1 << 5) -#define DMM32AT_CTRL_RESETD(1 << 4) -#define DMM32AT_CTRL_INTRST(1 << 3) -#define DMM32AT_CTRL_PAGE_8254 (0 << 0) -#define DMM32AT_CTRL_PAGE_8255 (1 << 0) -#define DMM32AT_CTRL_PAGE_CALIB(3 << 0) +#define DMM32AT_CTRL_RESETABIT(5) +#define DMM32AT_CTRL_RESETDBIT(4) +#define DMM32AT_CTRL_INTRSTBIT(3) +#define DMM32AT_CTRL(x)((x) << 0) +#define DMM32AT_CTRL_PAGE_8254 DMM32AT_CTRL(0) +#define DMM32AT_CTRL_PAGE_8255 DMM32AT_CTRL(1) +#define DMM32AT_CTRL_PAGE_CALIBDMM32AT_CTRL(3) #define DMM32AT_AI_STATUS_REG 0x08 -#define DMM32AT_AI_STATUS_STS (1 << 7) -#define DMM32AT_AI_STATUS_SD1 (1 << 6) -#define DMM32AT_AI_STATUS_SD0 (1 << 5) +#define DMM32AT_AI_STATUS_STS BIT(7) +#define DMM32AT_AI_STATUS_SD1 BIT(6) +#define DMM32AT_AI_STATUS_SD0 BIT(5) #define DMM32AT_AI_STATUS_ADCH_MASK(0x1f << 0) #define DMM32AT_INTCLK_REG 0x09 -#define DMM32AT_INTCLK_ADINT (1 << 7) -#define DMM32AT_INTCLK_DINT(1 << 6) -#define DMM32AT_INTCLK_TINT(1 << 5) -#define DMM32AT_INTCLK_CLKEN (1 << 1) /* 1=see below 0=software */ -#define DMM32AT_INTCLK_CLKSEL (1 << 0) /* 1=OUT2 0=EXTCLK */ +#define DMM32AT_INTCLK_ADINT BIT(7) +#define DMM32AT_INTCLK_DINTBIT(6) +#define DMM32AT_INTCLK_TINTBIT(5) +#define DMM32AT_INTCLK_CLKEN BIT(1) /* 1=see below 0=software */ +#define DMM32AT_INTCLK_CLKSEL BIT(0) /* 1=OUT2 0=EXTCLK */
[PATCH 1/1] Staging: comedi: s626: fix comment issue
This fixes up a WARNING: 'Block comments use a trailing */ on a separate line'found by the checkpatch.pl tool. Signed-off-by: Ravishankar Karkala Mallikarjunayya <ravishankark...@gmail.com> --- drivers/staging/comedi/drivers/s626.h | 356 ++ 1 file changed, 237 insertions(+), 119 deletions(-) diff --git a/drivers/staging/comedi/drivers/s626.h b/drivers/staging/comedi/drivers/s626.h index b83424e..6a00a64 100644 --- a/drivers/staging/comedi/drivers/s626.h +++ b/drivers/staging/comedi/drivers/s626.h @@ -29,8 +29,10 @@ #define S626_ENCODER_CHANNELS 6 #define S626_DIO_CHANNELS 48 #define S626_DIO_BANKS 3 /* Number of DIO groups. */ -#define S626_DIO_EXTCHANS 40 /* Number of extended-capability -* DIO channels. */ +#define S626_DIO_EXTCHANS 40 /* +* Number of extended-capability +* DIO channels. +*/ #define S626_NUM_TRIMDACS 12 /* Number of valid TrimDAC channels. */ @@ -48,21 +50,29 @@ #define S626_GSEL_BIPOLAR10V 0x00A0 /* S626_LP_GSEL setting 10V bipolar. */ /* Error codes that must be visible to this base class. */ -#define S626_ERR_ILLEGAL_PARM 0x0001 /* Illegal function parameter -* value was specified. */ +#define S626_ERR_ILLEGAL_PARM 0x0001 /* +* Illegal function parameter +* value was specified. +*/ #define S626_ERR_I2C 0x0002 /* I2C error. */ -#define S626_ERR_COUNTERSETUP 0x0020 /* Illegal setup specified for -* counter channel. */ +#define S626_ERR_COUNTERSETUP 0x0020 /* +* Illegal setup specified for +* counter channel. +*/ #define S626_ERR_DEBI_TIMEOUT 0x0040 /* DEBI transfer timed out. */ /* * Organization (physical order) and size (in DWORDs) of logical DMA buffers * contained by ANA_DMABUF. */ -#define S626_ADC_DMABUF_DWORDS 40 /* ADC DMA buffer must hold 16 samples, -* plus pre/post garbage samples. */ -#define S626_DAC_WDMABUF_DWORDS1 /* DAC output DMA buffer holds a single -* sample. */ +#define S626_ADC_DMABUF_DWORDS 40 /* +* ADC DMA buffer must hold 16 samples, +* plus pre/post garbage samples. +*/ +#define S626_DAC_WDMABUF_DWORDS1 /* +* DAC output DMA buffer holds a single +* sample. +*/ /* All remaining space in 4KB DMA buffer is available for the RPS1 program. */ @@ -95,60 +105,90 @@ #define S626_RPS_IRQ 0x6000 /* IRQ */ #define S626_RPS_LOGICAL_OR0x0800 /* Logical OR conditionals. */ -#define S626_RPS_INVERT0x0400 /* Test for negated -* semaphores. */ +#define S626_RPS_INVERT0x0400 /* +* Test for negated +* semaphores. +*/ #define S626_RPS_DEBI 0x0002 /* DEBI done */ -#define S626_RPS_SIG0 0x0020 /* RPS semaphore 0 -* (used by ADC). */ -#define S626_RPS_SIG1 0x0040 /* RPS semaphore 1 -* (used by DAC). */ -#define S626_RPS_SIG2 0x0080 /* RPS semaphore 2 -* (not used). */ +#define S626_RPS_SIG0 0x0020 /* +* RPS semaphore 0 +* (used by ADC). +*/ +#define S626_RPS_SIG1 0x0040 /* +* RPS semaphore 1 +* (used by DAC). +*/ +#define S626_RPS_SIG2 0x0080 /* +* RPS semaphore 2 +* (not used). +*/ #define S626_RPS_GPIO2 0x0008 /* RPS
[PATCH 1/1] Staging: comedi: s626: fix comment issue
This fixes up a WARNING: 'Block comments use a trailing */ on a separate line'found by the checkpatch.pl tool. Signed-off-by: Ravishankar Karkala Mallikarjunayya --- drivers/staging/comedi/drivers/s626.h | 356 ++ 1 file changed, 237 insertions(+), 119 deletions(-) diff --git a/drivers/staging/comedi/drivers/s626.h b/drivers/staging/comedi/drivers/s626.h index b83424e..6a00a64 100644 --- a/drivers/staging/comedi/drivers/s626.h +++ b/drivers/staging/comedi/drivers/s626.h @@ -29,8 +29,10 @@ #define S626_ENCODER_CHANNELS 6 #define S626_DIO_CHANNELS 48 #define S626_DIO_BANKS 3 /* Number of DIO groups. */ -#define S626_DIO_EXTCHANS 40 /* Number of extended-capability -* DIO channels. */ +#define S626_DIO_EXTCHANS 40 /* +* Number of extended-capability +* DIO channels. +*/ #define S626_NUM_TRIMDACS 12 /* Number of valid TrimDAC channels. */ @@ -48,21 +50,29 @@ #define S626_GSEL_BIPOLAR10V 0x00A0 /* S626_LP_GSEL setting 10V bipolar. */ /* Error codes that must be visible to this base class. */ -#define S626_ERR_ILLEGAL_PARM 0x0001 /* Illegal function parameter -* value was specified. */ +#define S626_ERR_ILLEGAL_PARM 0x0001 /* +* Illegal function parameter +* value was specified. +*/ #define S626_ERR_I2C 0x0002 /* I2C error. */ -#define S626_ERR_COUNTERSETUP 0x0020 /* Illegal setup specified for -* counter channel. */ +#define S626_ERR_COUNTERSETUP 0x0020 /* +* Illegal setup specified for +* counter channel. +*/ #define S626_ERR_DEBI_TIMEOUT 0x0040 /* DEBI transfer timed out. */ /* * Organization (physical order) and size (in DWORDs) of logical DMA buffers * contained by ANA_DMABUF. */ -#define S626_ADC_DMABUF_DWORDS 40 /* ADC DMA buffer must hold 16 samples, -* plus pre/post garbage samples. */ -#define S626_DAC_WDMABUF_DWORDS1 /* DAC output DMA buffer holds a single -* sample. */ +#define S626_ADC_DMABUF_DWORDS 40 /* +* ADC DMA buffer must hold 16 samples, +* plus pre/post garbage samples. +*/ +#define S626_DAC_WDMABUF_DWORDS1 /* +* DAC output DMA buffer holds a single +* sample. +*/ /* All remaining space in 4KB DMA buffer is available for the RPS1 program. */ @@ -95,60 +105,90 @@ #define S626_RPS_IRQ 0x6000 /* IRQ */ #define S626_RPS_LOGICAL_OR0x0800 /* Logical OR conditionals. */ -#define S626_RPS_INVERT0x0400 /* Test for negated -* semaphores. */ +#define S626_RPS_INVERT0x0400 /* +* Test for negated +* semaphores. +*/ #define S626_RPS_DEBI 0x0002 /* DEBI done */ -#define S626_RPS_SIG0 0x0020 /* RPS semaphore 0 -* (used by ADC). */ -#define S626_RPS_SIG1 0x0040 /* RPS semaphore 1 -* (used by DAC). */ -#define S626_RPS_SIG2 0x0080 /* RPS semaphore 2 -* (not used). */ +#define S626_RPS_SIG0 0x0020 /* +* RPS semaphore 0 +* (used by ADC). +*/ +#define S626_RPS_SIG1 0x0040 /* +* RPS semaphore 1 +* (used by DAC). +*/ +#define S626_RPS_SIG2 0x0080 /* +* RPS semaphore 2 +* (not used). +*/ #define S626_RPS_GPIO2 0x0008 /* RPS GPIO2 */ #define S626_RPS_GPIO3
[PATCH 5/5] Staging: comedi: dmm32at: Prefer using the BIT macro
This fixes all occurences of (1<<x) by BIT(x) to get rid of checkpatch.pl "CHECK" output "Prefer using the BIT macro" Signed-off-by: Ravishankar Karkala Mallikarjunayya <ravishankark...@gmail.com> --- drivers/staging/comedi/drivers/dmm32at.c | 86 1 file changed, 43 insertions(+), 43 deletions(-) diff --git a/drivers/staging/comedi/drivers/dmm32at.c b/drivers/staging/comedi/drivers/dmm32at.c index 958c0d4..4ca6104 100644 --- a/drivers/staging/comedi/drivers/dmm32at.c +++ b/drivers/staging/comedi/drivers/dmm32at.c @@ -46,73 +46,73 @@ #define DMM32AT_AI_START_CONV_REG 0x00 #define DMM32AT_AI_LSB_REG 0x00 #define DMM32AT_AUX_DOUT_REG 0x01 -#define DMM32AT_AUX_DOUT2 (1 << 2) /* J3.42 - OUT2 (OUT2EN) */ -#define DMM32AT_AUX_DOUT1 (1 << 1) /* J3.43 */ -#define DMM32AT_AUX_DOUT0 (1 << 0) /* J3.44 - OUT0 (OUT0EN) */ +#define DMM32AT_AUX_DOUT2 BIT(2) /* J3.42 - OUT2 (OUT2EN) */ +#define DMM32AT_AUX_DOUT1 BIT(1) /* J3.43 */ +#define DMM32AT_AUX_DOUT0 BIT(0) /* J3.44 - OUT0 (OUT0EN) */ #define DMM32AT_AI_MSB_REG 0x01 #define DMM32AT_AI_LO_CHAN_REG 0x02 #define DMM32AT_AI_HI_CHAN_REG 0x03 #define DMM32AT_AUX_DI_REG 0x04 -#define DMM32AT_AUX_DI_DACBUSY (1 << 7) -#define DMM32AT_AUX_DI_CALBUSY (1 << 6) -#define DMM32AT_AUX_DI3(1 << 3) /* J3.45 - ADCLK (CLKSEL) */ -#define DMM32AT_AUX_DI2(1 << 2) /* J3.46 - GATE12 (GT12EN) */ -#define DMM32AT_AUX_DI1(1 << 1) /* J3.47 - GATE0 (GT0EN) */ -#define DMM32AT_AUX_DI0(1 << 0) /* J3.48 - CLK0 (SRC0) */ +#define DMM32AT_AUX_DI_DACBUSY BIT(7) +#define DMM32AT_AUX_DI_CALBUSY BIT(6) +#define DMM32AT_AUX_DI3BIT(3) /* J3.45 - ADCLK (CLKSEL) */ +#define DMM32AT_AUX_DI2BIT(2) /* J3.46 - GATE12 (GT12EN) */ +#define DMM32AT_AUX_DI1BIT(1) /* J3.47 - GATE0 (GT0EN) */ +#define DMM32AT_AUX_DI0BIT(0) /* J3.48 - CLK0 (SRC0) */ #define DMM32AT_AO_LSB_REG 0x04 #define DMM32AT_AO_MSB_REG 0x05 #define DMM32AT_AO_MSB_DACH(x) ((x) << 6) #define DMM32AT_FIFO_DEPTH_REG 0x06 #define DMM32AT_FIFO_CTRL_REG 0x07 -#define DMM32AT_FIFO_CTRL_FIFOEN (1 << 3) -#define DMM32AT_FIFO_CTRL_SCANEN (1 << 2) -#define DMM32AT_FIFO_CTRL_FIFORST (1 << 1) +#define DMM32AT_FIFO_CTRL_FIFOEN BIT(3) +#define DMM32AT_FIFO_CTRL_SCANEN BIT(2) +#define DMM32AT_FIFO_CTRL_FIFORST BIT(1) #define DMM32AT_FIFO_STATUS_REG0x07 -#define DMM32AT_FIFO_STATUS_EF (1 << 7) -#define DMM32AT_FIFO_STATUS_HF (1 << 6) -#define DMM32AT_FIFO_STATUS_FF (1 << 5) -#define DMM32AT_FIFO_STATUS_OVF(1 << 4) -#define DMM32AT_FIFO_STATUS_FIFOEN (1 << 3) -#define DMM32AT_FIFO_STATUS_SCANEN (1 << 2) +#define DMM32AT_FIFO_STATUS_EF BIT(7) +#define DMM32AT_FIFO_STATUS_HF BIT(6) +#define DMM32AT_FIFO_STATUS_FF BIT(5) +#define DMM32AT_FIFO_STATUS_OVFBIT(4) +#define DMM32AT_FIFO_STATUS_FIFOEN BIT(3) +#define DMM32AT_FIFO_STATUS_SCANEN BIT(2) #define DMM32AT_FIFO_STATUS_PAGE_MASK (3 << 0) #define DMM32AT_CTRL_REG 0x08 -#define DMM32AT_CTRL_RESETA(1 << 5) -#define DMM32AT_CTRL_RESETD(1 << 4) -#define DMM32AT_CTRL_INTRST(1 << 3) +#define DMM32AT_CTRL_RESETABIT(5) +#define DMM32AT_CTRL_RESETDBIT(4) +#define DMM32AT_CTRL_INTRSTBIT(3) #define DMM32AT_CTRL_PAGE_8254 (0 << 0) -#define DMM32AT_CTRL_PAGE_8255 (1 << 0) +#define DMM32AT_CTRL_PAGE_8255 BIT(0) #define DMM32AT_CTRL_PAGE_CALIB(3 << 0) #define DMM32AT_AI_STATUS_REG 0x08 -#define DMM32AT_AI_STATUS_STS (1 << 7) -#define DMM32AT_AI_STATUS_SD1 (1 << 6) -#define DMM32AT_AI_STATUS_SD0 (1 << 5) +#define DMM32AT_AI_STATUS_STS BIT(7) +#define DMM32AT_AI_STATUS_SD1 BIT(6) +#define DMM32AT_AI_STATUS_SD0 BIT(5) #define DMM32AT_AI_STATUS_ADCH_MASK(0x1f << 0) #define DMM32AT_INTCLK_REG 0x09 -#define DMM32AT_INTCLK_ADINT (1 << 7) -#define DMM32AT_INTCLK_DINT(1 << 6) -#define DMM32AT_INTCLK_TINT(1 << 5) -#define DMM32AT_INTCLK_CLKEN (1 << 1) /* 1=see below 0=software */ -#define DMM32AT_INTCLK_CLKSEL (1 << 0) /* 1=OUT2 0=EXTCLK */ +#define DMM32AT_INTCLK_ADINT BIT(7) +#define
[PATCH 5/5] Staging: comedi: dmm32at: Prefer using the BIT macro
This fixes all occurences of (1< --- drivers/staging/comedi/drivers/dmm32at.c | 86 1 file changed, 43 insertions(+), 43 deletions(-) diff --git a/drivers/staging/comedi/drivers/dmm32at.c b/drivers/staging/comedi/drivers/dmm32at.c index 958c0d4..4ca6104 100644 --- a/drivers/staging/comedi/drivers/dmm32at.c +++ b/drivers/staging/comedi/drivers/dmm32at.c @@ -46,73 +46,73 @@ #define DMM32AT_AI_START_CONV_REG 0x00 #define DMM32AT_AI_LSB_REG 0x00 #define DMM32AT_AUX_DOUT_REG 0x01 -#define DMM32AT_AUX_DOUT2 (1 << 2) /* J3.42 - OUT2 (OUT2EN) */ -#define DMM32AT_AUX_DOUT1 (1 << 1) /* J3.43 */ -#define DMM32AT_AUX_DOUT0 (1 << 0) /* J3.44 - OUT0 (OUT0EN) */ +#define DMM32AT_AUX_DOUT2 BIT(2) /* J3.42 - OUT2 (OUT2EN) */ +#define DMM32AT_AUX_DOUT1 BIT(1) /* J3.43 */ +#define DMM32AT_AUX_DOUT0 BIT(0) /* J3.44 - OUT0 (OUT0EN) */ #define DMM32AT_AI_MSB_REG 0x01 #define DMM32AT_AI_LO_CHAN_REG 0x02 #define DMM32AT_AI_HI_CHAN_REG 0x03 #define DMM32AT_AUX_DI_REG 0x04 -#define DMM32AT_AUX_DI_DACBUSY (1 << 7) -#define DMM32AT_AUX_DI_CALBUSY (1 << 6) -#define DMM32AT_AUX_DI3(1 << 3) /* J3.45 - ADCLK (CLKSEL) */ -#define DMM32AT_AUX_DI2(1 << 2) /* J3.46 - GATE12 (GT12EN) */ -#define DMM32AT_AUX_DI1(1 << 1) /* J3.47 - GATE0 (GT0EN) */ -#define DMM32AT_AUX_DI0(1 << 0) /* J3.48 - CLK0 (SRC0) */ +#define DMM32AT_AUX_DI_DACBUSY BIT(7) +#define DMM32AT_AUX_DI_CALBUSY BIT(6) +#define DMM32AT_AUX_DI3BIT(3) /* J3.45 - ADCLK (CLKSEL) */ +#define DMM32AT_AUX_DI2BIT(2) /* J3.46 - GATE12 (GT12EN) */ +#define DMM32AT_AUX_DI1BIT(1) /* J3.47 - GATE0 (GT0EN) */ +#define DMM32AT_AUX_DI0BIT(0) /* J3.48 - CLK0 (SRC0) */ #define DMM32AT_AO_LSB_REG 0x04 #define DMM32AT_AO_MSB_REG 0x05 #define DMM32AT_AO_MSB_DACH(x) ((x) << 6) #define DMM32AT_FIFO_DEPTH_REG 0x06 #define DMM32AT_FIFO_CTRL_REG 0x07 -#define DMM32AT_FIFO_CTRL_FIFOEN (1 << 3) -#define DMM32AT_FIFO_CTRL_SCANEN (1 << 2) -#define DMM32AT_FIFO_CTRL_FIFORST (1 << 1) +#define DMM32AT_FIFO_CTRL_FIFOEN BIT(3) +#define DMM32AT_FIFO_CTRL_SCANEN BIT(2) +#define DMM32AT_FIFO_CTRL_FIFORST BIT(1) #define DMM32AT_FIFO_STATUS_REG0x07 -#define DMM32AT_FIFO_STATUS_EF (1 << 7) -#define DMM32AT_FIFO_STATUS_HF (1 << 6) -#define DMM32AT_FIFO_STATUS_FF (1 << 5) -#define DMM32AT_FIFO_STATUS_OVF(1 << 4) -#define DMM32AT_FIFO_STATUS_FIFOEN (1 << 3) -#define DMM32AT_FIFO_STATUS_SCANEN (1 << 2) +#define DMM32AT_FIFO_STATUS_EF BIT(7) +#define DMM32AT_FIFO_STATUS_HF BIT(6) +#define DMM32AT_FIFO_STATUS_FF BIT(5) +#define DMM32AT_FIFO_STATUS_OVFBIT(4) +#define DMM32AT_FIFO_STATUS_FIFOEN BIT(3) +#define DMM32AT_FIFO_STATUS_SCANEN BIT(2) #define DMM32AT_FIFO_STATUS_PAGE_MASK (3 << 0) #define DMM32AT_CTRL_REG 0x08 -#define DMM32AT_CTRL_RESETA(1 << 5) -#define DMM32AT_CTRL_RESETD(1 << 4) -#define DMM32AT_CTRL_INTRST(1 << 3) +#define DMM32AT_CTRL_RESETABIT(5) +#define DMM32AT_CTRL_RESETDBIT(4) +#define DMM32AT_CTRL_INTRSTBIT(3) #define DMM32AT_CTRL_PAGE_8254 (0 << 0) -#define DMM32AT_CTRL_PAGE_8255 (1 << 0) +#define DMM32AT_CTRL_PAGE_8255 BIT(0) #define DMM32AT_CTRL_PAGE_CALIB(3 << 0) #define DMM32AT_AI_STATUS_REG 0x08 -#define DMM32AT_AI_STATUS_STS (1 << 7) -#define DMM32AT_AI_STATUS_SD1 (1 << 6) -#define DMM32AT_AI_STATUS_SD0 (1 << 5) +#define DMM32AT_AI_STATUS_STS BIT(7) +#define DMM32AT_AI_STATUS_SD1 BIT(6) +#define DMM32AT_AI_STATUS_SD0 BIT(5) #define DMM32AT_AI_STATUS_ADCH_MASK(0x1f << 0) #define DMM32AT_INTCLK_REG 0x09 -#define DMM32AT_INTCLK_ADINT (1 << 7) -#define DMM32AT_INTCLK_DINT(1 << 6) -#define DMM32AT_INTCLK_TINT(1 << 5) -#define DMM32AT_INTCLK_CLKEN (1 << 1) /* 1=see below 0=software */ -#define DMM32AT_INTCLK_CLKSEL (1 << 0) /* 1=OUT2 0=EXTCLK */ +#define DMM32AT_INTCLK_ADINT BIT(7) +#define DMM32AT_INTCLK_DINTBIT(6) +#define DMM32AT_INTCLK_TINTBIT(5) +#define DMM32AT_INTCLK_CLKEN BIT(1) /* 1=see below 0=software */ +#define DMM32AT_INTCLK_CLKSEL BIT(0) /* 1=OUT2 0=EXTCLK */ #define DMM32AT_CTRDIO_CFG_REG 0x0a -#define DMM32AT_CTRDIO_CFG_FREQ12 (1 << 7) /* CLK12 1=100KHz 0=10MHz */ -#define DMM32AT_CTRDIO_CFG_FREQ0 (1 << 6) /* CLK0 1=10KHz
[PATCH 3/5] Staging: comedi: das800: fix comment issue
This fixes up a WARNING: 'Block comments use a trailing */ on a separate line'found by the checkpatch.pl tool Signed-off-by: Ravishankar Karkala Mallikarjunayya <ravishankark...@gmail.com> --- drivers/staging/comedi/drivers/das800.c | 102 1 file changed, 51 insertions(+), 51 deletions(-) diff --git a/drivers/staging/comedi/drivers/das800.c b/drivers/staging/comedi/drivers/das800.c index b02f122..0680d87 100644 --- a/drivers/staging/comedi/drivers/das800.c +++ b/drivers/staging/comedi/drivers/das800.c @@ -1,56 +1,56 @@ /* -comedi/drivers/das800.c -Driver for Keitley das800 series boards and compatibles -Copyright (C) 2000 Frank Mori Hess <fmh...@users.sourceforge.net> - -COMEDI - Linux Control and Measurement Device Interface -Copyright (C) 2000 David A. Schleef <d...@schleef.org> - -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. -*/ + * comedi/drivers/das800.c + * Driver for Keitley das800 series boards and compatibles + * Copyright (C) 2000 Frank Mori Hess <fmh...@users.sourceforge.net> + * + * COMEDI - Linux Control and Measurement Device Interface + * Copyright (C) 2000 David A. Schleef <d...@schleef.org> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ /* -Driver: das800 -Description: Keithley Metrabyte DAS800 (& compatibles) -Author: Frank Mori Hess <fmh...@users.sourceforge.net> -Devices: [Keithley Metrabyte] DAS-800 (das-800), DAS-801 (das-801), - DAS-802 (das-802), - [Measurement Computing] CIO-DAS800 (cio-das800), - CIO-DAS801 (cio-das801), CIO-DAS802 (cio-das802), - CIO-DAS802/16 (cio-das802/16) -Status: works, cio-das802/16 untested - email me if you have tested it - -Configuration options: - [0] - I/O port base address - [1] - IRQ (optional, required for timed or externally triggered conversions) - -Notes: - IRQ can be omitted, although the cmd interface will not work without it. - - All entries in the channel/gain list must use the same gain and be - consecutive channels counting upwards in channel number (these are - hardware limitations.) - - I've never tested the gain setting stuff since I only have a - DAS-800 board with fixed gain. - - The cio-das802/16 does not have a fifo-empty status bit! Therefore - only fifo-half-full transfers are possible with this card. - -cmd triggers supported: - start_src: TRIG_NOW | TRIG_EXT - scan_begin_src: TRIG_FOLLOW - scan_end_src: TRIG_COUNT - convert_src:TRIG_TIMER | TRIG_EXT - stop_src: TRIG_NONE | TRIG_COUNT -*/ + * Driver: das800 + * Description: Keithley Metrabyte DAS800 (& compatibles) + * Author: Frank Mori Hess <fmh...@users.sourceforge.net> + * Devices: [Keithley Metrabyte] DAS-800 (das-800), DAS-801 (das-801), + * DAS-802 (das-802), + * [Measurement Computing] CIO-DAS800 (cio-das800), + * CIO-DAS801 (cio-das801), CIO-DAS802 (cio-das802), + * CIO-DAS802/16 (cio-das802/16) + * Status: works, cio-das802/16 untested - email me if you have tested it + * + * Configuration options: + * [0] - I/O port base address + * [1] - IRQ (optional, required for timed or externally triggered conversions) + * + * Notes: + * IRQ can be omitted, although the cmd interface will not work without it. + * + * All entries in the channel/gain list must use the same gain and be + * consecutive channels counting upwards in channel number (these are + * hardware limitations.) + * + * I've never tested the gain setting stuff since I only have a + * DAS-800 board with fixed gain. + * + * The cio-das802/16 does not have a fifo-empty status bit! Therefore + * only fifo-half-full transfers are possible with this card. + * + * cmd triggers supported: + * start_src: TRIG_NOW | TRIG_EXT + * scan_begin_src: TRIG_FOLLOW + * scan_end_src: TRIG_COUNT + * convert_src:TRIG_TIMER | TRIG_EXT + * stop_src: TRIG_NONE | TRIG_COUNT + */ #include #include -- 1.9.1
[PATCH 3/5] Staging: comedi: das800: fix comment issue
This fixes up a WARNING: 'Block comments use a trailing */ on a separate line'found by the checkpatch.pl tool Signed-off-by: Ravishankar Karkala Mallikarjunayya --- drivers/staging/comedi/drivers/das800.c | 102 1 file changed, 51 insertions(+), 51 deletions(-) diff --git a/drivers/staging/comedi/drivers/das800.c b/drivers/staging/comedi/drivers/das800.c index b02f122..0680d87 100644 --- a/drivers/staging/comedi/drivers/das800.c +++ b/drivers/staging/comedi/drivers/das800.c @@ -1,56 +1,56 @@ /* -comedi/drivers/das800.c -Driver for Keitley das800 series boards and compatibles -Copyright (C) 2000 Frank Mori Hess - -COMEDI - Linux Control and Measurement Device Interface -Copyright (C) 2000 David A. Schleef - -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. -*/ + * comedi/drivers/das800.c + * Driver for Keitley das800 series boards and compatibles + * Copyright (C) 2000 Frank Mori Hess + * + * COMEDI - Linux Control and Measurement Device Interface + * Copyright (C) 2000 David A. Schleef + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ /* -Driver: das800 -Description: Keithley Metrabyte DAS800 (& compatibles) -Author: Frank Mori Hess -Devices: [Keithley Metrabyte] DAS-800 (das-800), DAS-801 (das-801), - DAS-802 (das-802), - [Measurement Computing] CIO-DAS800 (cio-das800), - CIO-DAS801 (cio-das801), CIO-DAS802 (cio-das802), - CIO-DAS802/16 (cio-das802/16) -Status: works, cio-das802/16 untested - email me if you have tested it - -Configuration options: - [0] - I/O port base address - [1] - IRQ (optional, required for timed or externally triggered conversions) - -Notes: - IRQ can be omitted, although the cmd interface will not work without it. - - All entries in the channel/gain list must use the same gain and be - consecutive channels counting upwards in channel number (these are - hardware limitations.) - - I've never tested the gain setting stuff since I only have a - DAS-800 board with fixed gain. - - The cio-das802/16 does not have a fifo-empty status bit! Therefore - only fifo-half-full transfers are possible with this card. - -cmd triggers supported: - start_src: TRIG_NOW | TRIG_EXT - scan_begin_src: TRIG_FOLLOW - scan_end_src: TRIG_COUNT - convert_src:TRIG_TIMER | TRIG_EXT - stop_src: TRIG_NONE | TRIG_COUNT -*/ + * Driver: das800 + * Description: Keithley Metrabyte DAS800 (& compatibles) + * Author: Frank Mori Hess + * Devices: [Keithley Metrabyte] DAS-800 (das-800), DAS-801 (das-801), + * DAS-802 (das-802), + * [Measurement Computing] CIO-DAS800 (cio-das800), + * CIO-DAS801 (cio-das801), CIO-DAS802 (cio-das802), + * CIO-DAS802/16 (cio-das802/16) + * Status: works, cio-das802/16 untested - email me if you have tested it + * + * Configuration options: + * [0] - I/O port base address + * [1] - IRQ (optional, required for timed or externally triggered conversions) + * + * Notes: + * IRQ can be omitted, although the cmd interface will not work without it. + * + * All entries in the channel/gain list must use the same gain and be + * consecutive channels counting upwards in channel number (these are + * hardware limitations.) + * + * I've never tested the gain setting stuff since I only have a + * DAS-800 board with fixed gain. + * + * The cio-das802/16 does not have a fifo-empty status bit! Therefore + * only fifo-half-full transfers are possible with this card. + * + * cmd triggers supported: + * start_src: TRIG_NOW | TRIG_EXT + * scan_begin_src: TRIG_FOLLOW + * scan_end_src: TRIG_COUNT + * convert_src:TRIG_TIMER | TRIG_EXT + * stop_src: TRIG_NONE | TRIG_COUNT + */ #include #include -- 1.9.1
[PATCH 1/5] Staging: comedi: das16: fix blank line
This fixes up a blank line after function/struct/union/enum check found by the checkpatch.pl tool Signed-off-by: Ravishankar Karkala Mallikarjunayya <ravishankark...@gmail.com> --- drivers/staging/comedi/drivers/das16.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/staging/comedi/drivers/das16.c b/drivers/staging/comedi/drivers/das16.c index fd8e0b7..4d6e581 100644 --- a/drivers/staging/comedi/drivers/das16.c +++ b/drivers/staging/comedi/drivers/das16.c @@ -198,6 +198,7 @@ enum { das16_pg_1601, das16_pg_1602, }; + static const int *const das16_gainlists[] = { NULL, das16jr_gainlist, -- 1.9.1
[PATCH 1/5] Staging: comedi: das16: fix blank line
This fixes up a blank line after function/struct/union/enum check found by the checkpatch.pl tool Signed-off-by: Ravishankar Karkala Mallikarjunayya --- drivers/staging/comedi/drivers/das16.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/staging/comedi/drivers/das16.c b/drivers/staging/comedi/drivers/das16.c index fd8e0b7..4d6e581 100644 --- a/drivers/staging/comedi/drivers/das16.c +++ b/drivers/staging/comedi/drivers/das16.c @@ -198,6 +198,7 @@ enum { das16_pg_1601, das16_pg_1602, }; + static const int *const das16_gainlists[] = { NULL, das16jr_gainlist, -- 1.9.1
[PATCH 2/5] Staging: comedi: das16: fix Block comment
This fixes up a WARNING: 'Block comments use a trailing */ on a separate line'found by the checkpatch.pl tool. Signed-off-by: Ravishankar Karkala Mallikarjunayya <ravishankark...@gmail.com> --- drivers/staging/comedi/drivers/das16.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/staging/comedi/drivers/das16.c b/drivers/staging/comedi/drivers/das16.c index 4d6e581..ef345dc 100644 --- a/drivers/staging/comedi/drivers/das16.c +++ b/drivers/staging/comedi/drivers/das16.c @@ -429,8 +429,10 @@ static const struct das16_board das16_boards[] = { }, }; -/* Period for timer interrupt in jiffies. It's a function - * to deal with possibility of dynamic HZ patches */ +/* + * Period for timer interrupt in jiffies. It's a function + * to deal with possibility of dynamic HZ patches + */ static inline int timer_period(void) { return HZ / 20; -- 1.9.1
[PATCH 4/5] Staging: comedi: das800: Prefer unsigned int instead of unsigned
This fixes up a WARNING: Prefer 'unsigned int' to bare use of 'unsigned' found by the checkpatch.pl tool. Signed-off-by: Ravishankar Karkala Mallikarjunayya <ravishankark...@gmail.com> --- drivers/staging/comedi/drivers/das800.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/comedi/drivers/das800.c b/drivers/staging/comedi/drivers/das800.c index 0680d87..ef48c48 100644 --- a/drivers/staging/comedi/drivers/das800.c +++ b/drivers/staging/comedi/drivers/das800.c @@ -218,7 +218,7 @@ struct das800_private { }; static void das800_ind_write(struct comedi_device *dev, -unsigned val, unsigned reg) +unsigned int val, unsigned int reg) { /* * Select dev->iobase + 2 to be desired register @@ -228,7 +228,7 @@ static void das800_ind_write(struct comedi_device *dev, outb(val, dev->iobase + 2); } -static unsigned das800_ind_read(struct comedi_device *dev, unsigned reg) +static unsigned int das800_ind_read(struct comedi_device *dev, unsigned int reg) { /* * Select dev->iobase + 7 to be desired register -- 1.9.1
[PATCH 2/5] Staging: comedi: das16: fix Block comment
This fixes up a WARNING: 'Block comments use a trailing */ on a separate line'found by the checkpatch.pl tool. Signed-off-by: Ravishankar Karkala Mallikarjunayya --- drivers/staging/comedi/drivers/das16.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/staging/comedi/drivers/das16.c b/drivers/staging/comedi/drivers/das16.c index 4d6e581..ef345dc 100644 --- a/drivers/staging/comedi/drivers/das16.c +++ b/drivers/staging/comedi/drivers/das16.c @@ -429,8 +429,10 @@ static const struct das16_board das16_boards[] = { }, }; -/* Period for timer interrupt in jiffies. It's a function - * to deal with possibility of dynamic HZ patches */ +/* + * Period for timer interrupt in jiffies. It's a function + * to deal with possibility of dynamic HZ patches + */ static inline int timer_period(void) { return HZ / 20; -- 1.9.1
[PATCH 4/5] Staging: comedi: das800: Prefer unsigned int instead of unsigned
This fixes up a WARNING: Prefer 'unsigned int' to bare use of 'unsigned' found by the checkpatch.pl tool. Signed-off-by: Ravishankar Karkala Mallikarjunayya --- drivers/staging/comedi/drivers/das800.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/comedi/drivers/das800.c b/drivers/staging/comedi/drivers/das800.c index 0680d87..ef48c48 100644 --- a/drivers/staging/comedi/drivers/das800.c +++ b/drivers/staging/comedi/drivers/das800.c @@ -218,7 +218,7 @@ struct das800_private { }; static void das800_ind_write(struct comedi_device *dev, -unsigned val, unsigned reg) +unsigned int val, unsigned int reg) { /* * Select dev->iobase + 2 to be desired register @@ -228,7 +228,7 @@ static void das800_ind_write(struct comedi_device *dev, outb(val, dev->iobase + 2); } -static unsigned das800_ind_read(struct comedi_device *dev, unsigned reg) +static unsigned int das800_ind_read(struct comedi_device *dev, unsigned int reg) { /* * Select dev->iobase + 7 to be desired register -- 1.9.1
[PATCH 5/5] Staging: comedi: Prefer using the BIT macro issue in dmm32at.c
This patch Replace all occurences of (1<<x) by BIT(x) in the file das16.c to get rid of checkpatch.pl "CHECK" output "Prefer using the BIT macro" Signed-off-by: Ravishankar Karkala Mallikarjunayya <ravishankark...@gmail.com> --- drivers/staging/comedi/drivers/dmm32at.c | 86 1 file changed, 43 insertions(+), 43 deletions(-) diff --git a/drivers/staging/comedi/drivers/dmm32at.c b/drivers/staging/comedi/drivers/dmm32at.c index 958c0d4..3c4722a 100644 --- a/drivers/staging/comedi/drivers/dmm32at.c +++ b/drivers/staging/comedi/drivers/dmm32at.c @@ -46,73 +46,73 @@ #define DMM32AT_AI_START_CONV_REG 0x00 #define DMM32AT_AI_LSB_REG 0x00 #define DMM32AT_AUX_DOUT_REG 0x01 -#define DMM32AT_AUX_DOUT2 (1 << 2) /* J3.42 - OUT2 (OUT2EN) */ -#define DMM32AT_AUX_DOUT1 (1 << 1) /* J3.43 */ -#define DMM32AT_AUX_DOUT0 (1 << 0) /* J3.44 - OUT0 (OUT0EN) */ +#define DMM32AT_AUX_DOUT2 BIT(2) /* J3.42 - OUT2 (OUT2EN) */ +#define DMM32AT_AUX_DOUT1 BIT(1) /* J3.43 */ +#define DMM32AT_AUX_DOUT0 BIT(0) /* J3.44 - OUT0 (OUT0EN) */ #define DMM32AT_AI_MSB_REG 0x01 #define DMM32AT_AI_LO_CHAN_REG 0x02 #define DMM32AT_AI_HI_CHAN_REG 0x03 #define DMM32AT_AUX_DI_REG 0x04 -#define DMM32AT_AUX_DI_DACBUSY (1 << 7) -#define DMM32AT_AUX_DI_CALBUSY (1 << 6) -#define DMM32AT_AUX_DI3(1 << 3) /* J3.45 - ADCLK (CLKSEL) */ -#define DMM32AT_AUX_DI2(1 << 2) /* J3.46 - GATE12 (GT12EN) */ -#define DMM32AT_AUX_DI1(1 << 1) /* J3.47 - GATE0 (GT0EN) */ -#define DMM32AT_AUX_DI0(1 << 0) /* J3.48 - CLK0 (SRC0) */ +#define DMM32AT_AUX_DI_DACBUSY BIT(7) +#define DMM32AT_AUX_DI_CALBUSY BIT(6) +#define DMM32AT_AUX_DI3BIT(3) /* J3.45 - ADCLK (CLKSEL) */ +#define DMM32AT_AUX_DI2BTI(2) /* J3.46 - GATE12 (GT12EN) */ +#define DMM32AT_AUX_DI1BIT(1) /* J3.47 - GATE0 (GT0EN) */ +#define DMM32AT_AUX_DI0BIT(0) /* J3.48 - CLK0 (SRC0) */ #define DMM32AT_AO_LSB_REG 0x04 #define DMM32AT_AO_MSB_REG 0x05 #define DMM32AT_AO_MSB_DACH(x) ((x) << 6) #define DMM32AT_FIFO_DEPTH_REG 0x06 #define DMM32AT_FIFO_CTRL_REG 0x07 -#define DMM32AT_FIFO_CTRL_FIFOEN (1 << 3) -#define DMM32AT_FIFO_CTRL_SCANEN (1 << 2) -#define DMM32AT_FIFO_CTRL_FIFORST (1 << 1) +#define DMM32AT_FIFO_CTRL_FIFOEN BIT(3) +#define DMM32AT_FIFO_CTRL_SCANEN BIT(2) +#define DMM32AT_FIFO_CTRL_FIFORST BIT(1) #define DMM32AT_FIFO_STATUS_REG0x07 -#define DMM32AT_FIFO_STATUS_EF (1 << 7) -#define DMM32AT_FIFO_STATUS_HF (1 << 6) -#define DMM32AT_FIFO_STATUS_FF (1 << 5) -#define DMM32AT_FIFO_STATUS_OVF(1 << 4) -#define DMM32AT_FIFO_STATUS_FIFOEN (1 << 3) -#define DMM32AT_FIFO_STATUS_SCANEN (1 << 2) +#define DMM32AT_FIFO_STATUS_EF BIT(7) +#define DMM32AT_FIFO_STATUS_HF BIT(6) +#define DMM32AT_FIFO_STATUS_FF BIT(5) +#define DMM32AT_FIFO_STATUS_OVFBIT(4) +#define DMM32AT_FIFO_STATUS_FIFOEN BIT(3) +#define DMM32AT_FIFO_STATUS_SCANEN BIT(2) #define DMM32AT_FIFO_STATUS_PAGE_MASK (3 << 0) #define DMM32AT_CTRL_REG 0x08 -#define DMM32AT_CTRL_RESETA(1 << 5) -#define DMM32AT_CTRL_RESETD(1 << 4) -#define DMM32AT_CTRL_INTRST(1 << 3) +#define DMM32AT_CTRL_RESETABIT(5) +#define DMM32AT_CTRL_RESETDBIT(4) +#define DMM32AT_CTRL_INTRSTBIT(3) #define DMM32AT_CTRL_PAGE_8254 (0 << 0) -#define DMM32AT_CTRL_PAGE_8255 (1 << 0) +#define DMM32AT_CTRL_PAGE_8255 BIT(0) #define DMM32AT_CTRL_PAGE_CALIB(3 << 0) #define DMM32AT_AI_STATUS_REG 0x08 -#define DMM32AT_AI_STATUS_STS (1 << 7) -#define DMM32AT_AI_STATUS_SD1 (1 << 6) -#define DMM32AT_AI_STATUS_SD0 (1 << 5) +#define DMM32AT_AI_STATUS_STS BIT(7) +#define DMM32AT_AI_STATUS_SD1 BIT(6) +#define DMM32AT_AI_STATUS_SD0 BIT(5) #define DMM32AT_AI_STATUS_ADCH_MASK(0x1f << 0) #define DMM32AT_INTCLK_REG 0x09 -#define DMM32AT_INTCLK_ADINT (1 << 7) -#define DMM32AT_INTCLK_DINT(1 << 6) -#define DMM32AT_INTCLK_TINT(1 << 5) -#define DMM32AT_INTCLK_CLKEN (1 << 1) /* 1=see below 0=software */ -#define DMM32AT_INTCLK_CLKSEL (1 << 0) /* 1=OUT2 0=EXTCLK */ +#define DMM32AT_INTCLK_ADINT BIT(
[PATCH 5/5] Staging: comedi: Prefer using the BIT macro issue in dmm32at.c
This patch Replace all occurences of (1< --- drivers/staging/comedi/drivers/dmm32at.c | 86 1 file changed, 43 insertions(+), 43 deletions(-) diff --git a/drivers/staging/comedi/drivers/dmm32at.c b/drivers/staging/comedi/drivers/dmm32at.c index 958c0d4..3c4722a 100644 --- a/drivers/staging/comedi/drivers/dmm32at.c +++ b/drivers/staging/comedi/drivers/dmm32at.c @@ -46,73 +46,73 @@ #define DMM32AT_AI_START_CONV_REG 0x00 #define DMM32AT_AI_LSB_REG 0x00 #define DMM32AT_AUX_DOUT_REG 0x01 -#define DMM32AT_AUX_DOUT2 (1 << 2) /* J3.42 - OUT2 (OUT2EN) */ -#define DMM32AT_AUX_DOUT1 (1 << 1) /* J3.43 */ -#define DMM32AT_AUX_DOUT0 (1 << 0) /* J3.44 - OUT0 (OUT0EN) */ +#define DMM32AT_AUX_DOUT2 BIT(2) /* J3.42 - OUT2 (OUT2EN) */ +#define DMM32AT_AUX_DOUT1 BIT(1) /* J3.43 */ +#define DMM32AT_AUX_DOUT0 BIT(0) /* J3.44 - OUT0 (OUT0EN) */ #define DMM32AT_AI_MSB_REG 0x01 #define DMM32AT_AI_LO_CHAN_REG 0x02 #define DMM32AT_AI_HI_CHAN_REG 0x03 #define DMM32AT_AUX_DI_REG 0x04 -#define DMM32AT_AUX_DI_DACBUSY (1 << 7) -#define DMM32AT_AUX_DI_CALBUSY (1 << 6) -#define DMM32AT_AUX_DI3(1 << 3) /* J3.45 - ADCLK (CLKSEL) */ -#define DMM32AT_AUX_DI2(1 << 2) /* J3.46 - GATE12 (GT12EN) */ -#define DMM32AT_AUX_DI1(1 << 1) /* J3.47 - GATE0 (GT0EN) */ -#define DMM32AT_AUX_DI0(1 << 0) /* J3.48 - CLK0 (SRC0) */ +#define DMM32AT_AUX_DI_DACBUSY BIT(7) +#define DMM32AT_AUX_DI_CALBUSY BIT(6) +#define DMM32AT_AUX_DI3BIT(3) /* J3.45 - ADCLK (CLKSEL) */ +#define DMM32AT_AUX_DI2BTI(2) /* J3.46 - GATE12 (GT12EN) */ +#define DMM32AT_AUX_DI1BIT(1) /* J3.47 - GATE0 (GT0EN) */ +#define DMM32AT_AUX_DI0BIT(0) /* J3.48 - CLK0 (SRC0) */ #define DMM32AT_AO_LSB_REG 0x04 #define DMM32AT_AO_MSB_REG 0x05 #define DMM32AT_AO_MSB_DACH(x) ((x) << 6) #define DMM32AT_FIFO_DEPTH_REG 0x06 #define DMM32AT_FIFO_CTRL_REG 0x07 -#define DMM32AT_FIFO_CTRL_FIFOEN (1 << 3) -#define DMM32AT_FIFO_CTRL_SCANEN (1 << 2) -#define DMM32AT_FIFO_CTRL_FIFORST (1 << 1) +#define DMM32AT_FIFO_CTRL_FIFOEN BIT(3) +#define DMM32AT_FIFO_CTRL_SCANEN BIT(2) +#define DMM32AT_FIFO_CTRL_FIFORST BIT(1) #define DMM32AT_FIFO_STATUS_REG0x07 -#define DMM32AT_FIFO_STATUS_EF (1 << 7) -#define DMM32AT_FIFO_STATUS_HF (1 << 6) -#define DMM32AT_FIFO_STATUS_FF (1 << 5) -#define DMM32AT_FIFO_STATUS_OVF(1 << 4) -#define DMM32AT_FIFO_STATUS_FIFOEN (1 << 3) -#define DMM32AT_FIFO_STATUS_SCANEN (1 << 2) +#define DMM32AT_FIFO_STATUS_EF BIT(7) +#define DMM32AT_FIFO_STATUS_HF BIT(6) +#define DMM32AT_FIFO_STATUS_FF BIT(5) +#define DMM32AT_FIFO_STATUS_OVFBIT(4) +#define DMM32AT_FIFO_STATUS_FIFOEN BIT(3) +#define DMM32AT_FIFO_STATUS_SCANEN BIT(2) #define DMM32AT_FIFO_STATUS_PAGE_MASK (3 << 0) #define DMM32AT_CTRL_REG 0x08 -#define DMM32AT_CTRL_RESETA(1 << 5) -#define DMM32AT_CTRL_RESETD(1 << 4) -#define DMM32AT_CTRL_INTRST(1 << 3) +#define DMM32AT_CTRL_RESETABIT(5) +#define DMM32AT_CTRL_RESETDBIT(4) +#define DMM32AT_CTRL_INTRSTBIT(3) #define DMM32AT_CTRL_PAGE_8254 (0 << 0) -#define DMM32AT_CTRL_PAGE_8255 (1 << 0) +#define DMM32AT_CTRL_PAGE_8255 BIT(0) #define DMM32AT_CTRL_PAGE_CALIB(3 << 0) #define DMM32AT_AI_STATUS_REG 0x08 -#define DMM32AT_AI_STATUS_STS (1 << 7) -#define DMM32AT_AI_STATUS_SD1 (1 << 6) -#define DMM32AT_AI_STATUS_SD0 (1 << 5) +#define DMM32AT_AI_STATUS_STS BIT(7) +#define DMM32AT_AI_STATUS_SD1 BIT(6) +#define DMM32AT_AI_STATUS_SD0 BIT(5) #define DMM32AT_AI_STATUS_ADCH_MASK(0x1f << 0) #define DMM32AT_INTCLK_REG 0x09 -#define DMM32AT_INTCLK_ADINT (1 << 7) -#define DMM32AT_INTCLK_DINT(1 << 6) -#define DMM32AT_INTCLK_TINT(1 << 5) -#define DMM32AT_INTCLK_CLKEN (1 << 1) /* 1=see below 0=software */ -#define DMM32AT_INTCLK_CLKSEL (1 << 0) /* 1=OUT2 0=EXTCLK */ +#define DMM32AT_INTCLK_ADINT BIT(7) +#define DMM32AT_INTCLK_DINTBIT(6) +#define DMM32AT_INTCLK_TINTBIT(5) +#define DMM32AT_INTCLK_CLKEN BIT(1) /* 1=see below 0=software */ +#define DMM32AT_INTCLK_CLKSEL BIT(0) /* 1=OUT2 0=EXTCLK */ #define DMM32AT_CTRDIO_CFG_REG 0x0a -#define DMM32AT_CTRDIO_CFG_FREQ12 (1 << 7) /* CLK12 1=100KHz 0=10MHz */ -#define DMM32AT_CTRDIO_CFG_FREQ0 (1 << 6) /* CLK0
[PATCH 2/4] Staging: comedi: Block comment issue fixed for das16.c
This is a patch to the das16.c file that fixes up a WARNING: 'Block comments use a trailing */ on a separate line' found by the checkpatch.pl tool. Signed-off-by: Ravishankar Karkala Mallikarjunayya <ravishankark...@gmail.com> --- drivers/staging/comedi/drivers/das16.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/staging/comedi/drivers/das16.c b/drivers/staging/comedi/drivers/das16.c index 4d6e581..ef345dc 100644 --- a/drivers/staging/comedi/drivers/das16.c +++ b/drivers/staging/comedi/drivers/das16.c @@ -429,8 +429,10 @@ static const struct das16_board das16_boards[] = { }, }; -/* Period for timer interrupt in jiffies. It's a function - * to deal with possibility of dynamic HZ patches */ +/* + * Period for timer interrupt in jiffies. It's a function + * to deal with possibility of dynamic HZ patches + */ static inline int timer_period(void) { return HZ / 20; -- 1.9.1
[PATCH 2/4] Staging: comedi: Block comment issue fixed for das16.c
This is a patch to the das16.c file that fixes up a WARNING: 'Block comments use a trailing */ on a separate line' found by the checkpatch.pl tool. Signed-off-by: Ravishankar Karkala Mallikarjunayya --- drivers/staging/comedi/drivers/das16.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/staging/comedi/drivers/das16.c b/drivers/staging/comedi/drivers/das16.c index 4d6e581..ef345dc 100644 --- a/drivers/staging/comedi/drivers/das16.c +++ b/drivers/staging/comedi/drivers/das16.c @@ -429,8 +429,10 @@ static const struct das16_board das16_boards[] = { }, }; -/* Period for timer interrupt in jiffies. It's a function - * to deal with possibility of dynamic HZ patches */ +/* + * Period for timer interrupt in jiffies. It's a function + * to deal with possibility of dynamic HZ patches + */ static inline int timer_period(void) { return HZ / 20; -- 1.9.1
[PATCH 1/4] Staging: comedi: fix blank line issue in das16.c
This is a patch to the das16.c file that fixes up a blank line after function/struct/union/enum check found by the checkpatch.pl tool Signed-off-by: Ravishankar Karkala Mallikarjunayya <ravishankark...@gmail.com> --- drivers/staging/comedi/drivers/das16.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/staging/comedi/drivers/das16.c b/drivers/staging/comedi/drivers/das16.c index fd8e0b7..4d6e581 100644 --- a/drivers/staging/comedi/drivers/das16.c +++ b/drivers/staging/comedi/drivers/das16.c @@ -198,6 +198,7 @@ enum { das16_pg_1601, das16_pg_1602, }; + static const int *const das16_gainlists[] = { NULL, das16jr_gainlist, -- 1.9.1
[PATCH 1/4] Staging: comedi: fix blank line issue in das16.c
This is a patch to the das16.c file that fixes up a blank line after function/struct/union/enum check found by the checkpatch.pl tool Signed-off-by: Ravishankar Karkala Mallikarjunayya --- drivers/staging/comedi/drivers/das16.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/staging/comedi/drivers/das16.c b/drivers/staging/comedi/drivers/das16.c index fd8e0b7..4d6e581 100644 --- a/drivers/staging/comedi/drivers/das16.c +++ b/drivers/staging/comedi/drivers/das16.c @@ -198,6 +198,7 @@ enum { das16_pg_1601, das16_pg_1602, }; + static const int *const das16_gainlists[] = { NULL, das16jr_gainlist, -- 1.9.1
[PATCH 3/4] Staging: comedi: fix comment issue fixed for das800.c
This is a patch to the das800.c file that fixes up a WARNING: 'Block comments use a trailing */ on a separate line' found by the checkpatch.pl tool Signed-off-by: Ravishankar Karkala Mallikarjunayya <ravishankark...@gmail.com> --- drivers/staging/comedi/drivers/das800.c | 102 1 file changed, 51 insertions(+), 51 deletions(-) diff --git a/drivers/staging/comedi/drivers/das800.c b/drivers/staging/comedi/drivers/das800.c index b02f122..1f1b7ad 100644 --- a/drivers/staging/comedi/drivers/das800.c +++ b/drivers/staging/comedi/drivers/das800.c @@ -1,56 +1,56 @@ /* -comedi/drivers/das800.c -Driver for Keitley das800 series boards and compatibles -Copyright (C) 2000 Frank Mori Hess <fmh...@users.sourceforge.net> - -COMEDI - Linux Control and Measurement Device Interface -Copyright (C) 2000 David A. Schleef <d...@schleef.org> - -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. -*/ + * comedi/drivers/das800.c + * Driver for Keitley das800 series boards and compatibles + * Copyright (C) 2000 Frank Mori Hess <fmh...@users.sourceforge.net> + * + * COMEDI - Linux Control and Measurement Device Interface + * Copyright (C) 2000 David A. Schleef <d...@schleef.org> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ /* -Driver: das800 -Description: Keithley Metrabyte DAS800 (& compatibles) -Author: Frank Mori Hess <fmh...@users.sourceforge.net> -Devices: [Keithley Metrabyte] DAS-800 (das-800), DAS-801 (das-801), - DAS-802 (das-802), - [Measurement Computing] CIO-DAS800 (cio-das800), - CIO-DAS801 (cio-das801), CIO-DAS802 (cio-das802), - CIO-DAS802/16 (cio-das802/16) -Status: works, cio-das802/16 untested - email me if you have tested it - -Configuration options: - [0] - I/O port base address - [1] - IRQ (optional, required for timed or externally triggered conversions) - -Notes: - IRQ can be omitted, although the cmd interface will not work without it. - - All entries in the channel/gain list must use the same gain and be - consecutive channels counting upwards in channel number (these are - hardware limitations.) - - I've never tested the gain setting stuff since I only have a - DAS-800 board with fixed gain. - - The cio-das802/16 does not have a fifo-empty status bit! Therefore - only fifo-half-full transfers are possible with this card. - -cmd triggers supported: - start_src: TRIG_NOW | TRIG_EXT - scan_begin_src: TRIG_FOLLOW - scan_end_src: TRIG_COUNT - convert_src:TRIG_TIMER | TRIG_EXT - stop_src: TRIG_NONE | TRIG_COUNT -*/ + * Driver: das800 + * Description: Keithley Metrabyte DAS800 (& compatibles) + * Author: Frank Mori Hess <fmh...@users.sourceforge.net> + * Devices: [Keithley Metrabyte] DAS-800 (das-800), DAS-801 (das-801), + * DAS-802 (das-802), + * [Measurement Computing] CIO-DAS800 (cio-das800), + * CIO-DAS801 (cio-das801), CIO-DAS802 (cio-das802), + * CIO-DAS802/16 (cio-das802/16) + * Status: works, cio-das802/16 untested - email me if you have tested it + * + * Configuration options: + * [0] - I/O port base address + * [1] - IRQ (optional, required for timed or externally triggered conversions) + * + * Notes: + * IRQ can be omitted, although the cmd interface will not work without it. + * + * All entries in the channel/gain list must use the same gain and be + * consecutive channels counting upwards in channel number (these are + * hardware limitations.) + * + * I've never tested the gain setting stuff since I only have a + * DAS-800 board with fixed gain. + * + * The cio-das802/16 does not have a fifo-empty status bit! Therefore + * only fifo-half-full transfers are possible with this card. + * + * cmd triggers supported: + * start_src: TRIG_NOW | TRIG_EXT + * scan_begin_src: TRIG_FOLLOW + * scan_end_src: TRIG_COUNT + * convert_src:TRIG_TIMER | TRIG_EXT + * stop_src: TRIG_NONE | TRIG_COUNT + */ #include #include -- 1.9.1
[PATCH 4/4] Staging: comedi: Prefer unsigned int instead of unsigned in das800.c
This is a patch to the das800.c file that fixes up a WARNING: Prefer 'unsigned int' to bare use of 'unsigned' found by the checkpatch.pl tool. Signed-off-by: Ravishankar Karkala Mallikarjunayya <ravishankark...@gmail.com> --- drivers/staging/comedi/drivers/das800.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/comedi/drivers/das800.c b/drivers/staging/comedi/drivers/das800.c index 1f1b7ad..fd4cb49 100644 --- a/drivers/staging/comedi/drivers/das800.c +++ b/drivers/staging/comedi/drivers/das800.c @@ -218,7 +218,7 @@ struct das800_private { }; static void das800_ind_write(struct comedi_device *dev, -unsigned val, unsigned reg) +unsigned int val, unsigned int reg) { /* * Select dev->iobase + 2 to be desired register @@ -228,7 +228,7 @@ static void das800_ind_write(struct comedi_device *dev, outb(val, dev->iobase + 2); } -static unsigned das800_ind_read(struct comedi_device *dev, unsigned reg) +static unsigned int das800_ind_read(struct comedi_device *dev, unsigned int reg) { /* * Select dev->iobase + 7 to be desired register -- 1.9.1
[PATCH 3/4] Staging: comedi: fix comment issue fixed for das800.c
This is a patch to the das800.c file that fixes up a WARNING: 'Block comments use a trailing */ on a separate line' found by the checkpatch.pl tool Signed-off-by: Ravishankar Karkala Mallikarjunayya --- drivers/staging/comedi/drivers/das800.c | 102 1 file changed, 51 insertions(+), 51 deletions(-) diff --git a/drivers/staging/comedi/drivers/das800.c b/drivers/staging/comedi/drivers/das800.c index b02f122..1f1b7ad 100644 --- a/drivers/staging/comedi/drivers/das800.c +++ b/drivers/staging/comedi/drivers/das800.c @@ -1,56 +1,56 @@ /* -comedi/drivers/das800.c -Driver for Keitley das800 series boards and compatibles -Copyright (C) 2000 Frank Mori Hess - -COMEDI - Linux Control and Measurement Device Interface -Copyright (C) 2000 David A. Schleef - -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. -*/ + * comedi/drivers/das800.c + * Driver for Keitley das800 series boards and compatibles + * Copyright (C) 2000 Frank Mori Hess + * + * COMEDI - Linux Control and Measurement Device Interface + * Copyright (C) 2000 David A. Schleef + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ /* -Driver: das800 -Description: Keithley Metrabyte DAS800 (& compatibles) -Author: Frank Mori Hess -Devices: [Keithley Metrabyte] DAS-800 (das-800), DAS-801 (das-801), - DAS-802 (das-802), - [Measurement Computing] CIO-DAS800 (cio-das800), - CIO-DAS801 (cio-das801), CIO-DAS802 (cio-das802), - CIO-DAS802/16 (cio-das802/16) -Status: works, cio-das802/16 untested - email me if you have tested it - -Configuration options: - [0] - I/O port base address - [1] - IRQ (optional, required for timed or externally triggered conversions) - -Notes: - IRQ can be omitted, although the cmd interface will not work without it. - - All entries in the channel/gain list must use the same gain and be - consecutive channels counting upwards in channel number (these are - hardware limitations.) - - I've never tested the gain setting stuff since I only have a - DAS-800 board with fixed gain. - - The cio-das802/16 does not have a fifo-empty status bit! Therefore - only fifo-half-full transfers are possible with this card. - -cmd triggers supported: - start_src: TRIG_NOW | TRIG_EXT - scan_begin_src: TRIG_FOLLOW - scan_end_src: TRIG_COUNT - convert_src:TRIG_TIMER | TRIG_EXT - stop_src: TRIG_NONE | TRIG_COUNT -*/ + * Driver: das800 + * Description: Keithley Metrabyte DAS800 (& compatibles) + * Author: Frank Mori Hess + * Devices: [Keithley Metrabyte] DAS-800 (das-800), DAS-801 (das-801), + * DAS-802 (das-802), + * [Measurement Computing] CIO-DAS800 (cio-das800), + * CIO-DAS801 (cio-das801), CIO-DAS802 (cio-das802), + * CIO-DAS802/16 (cio-das802/16) + * Status: works, cio-das802/16 untested - email me if you have tested it + * + * Configuration options: + * [0] - I/O port base address + * [1] - IRQ (optional, required for timed or externally triggered conversions) + * + * Notes: + * IRQ can be omitted, although the cmd interface will not work without it. + * + * All entries in the channel/gain list must use the same gain and be + * consecutive channels counting upwards in channel number (these are + * hardware limitations.) + * + * I've never tested the gain setting stuff since I only have a + * DAS-800 board with fixed gain. + * + * The cio-das802/16 does not have a fifo-empty status bit! Therefore + * only fifo-half-full transfers are possible with this card. + * + * cmd triggers supported: + * start_src: TRIG_NOW | TRIG_EXT + * scan_begin_src: TRIG_FOLLOW + * scan_end_src: TRIG_COUNT + * convert_src:TRIG_TIMER | TRIG_EXT + * stop_src: TRIG_NONE | TRIG_COUNT + */ #include #include -- 1.9.1
[PATCH 4/4] Staging: comedi: Prefer unsigned int instead of unsigned in das800.c
This is a patch to the das800.c file that fixes up a WARNING: Prefer 'unsigned int' to bare use of 'unsigned' found by the checkpatch.pl tool. Signed-off-by: Ravishankar Karkala Mallikarjunayya --- drivers/staging/comedi/drivers/das800.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/comedi/drivers/das800.c b/drivers/staging/comedi/drivers/das800.c index 1f1b7ad..fd4cb49 100644 --- a/drivers/staging/comedi/drivers/das800.c +++ b/drivers/staging/comedi/drivers/das800.c @@ -218,7 +218,7 @@ struct das800_private { }; static void das800_ind_write(struct comedi_device *dev, -unsigned val, unsigned reg) +unsigned int val, unsigned int reg) { /* * Select dev->iobase + 2 to be desired register @@ -228,7 +228,7 @@ static void das800_ind_write(struct comedi_device *dev, outb(val, dev->iobase + 2); } -static unsigned das800_ind_read(struct comedi_device *dev, unsigned reg) +static unsigned int das800_ind_read(struct comedi_device *dev, unsigned int reg) { /* * Select dev->iobase + 7 to be desired register -- 1.9.1
[PATCH v1 02/10] Staging: comedi: fix bare use of unsigned issue in ni_65xx.c
This is a patch to the ni_65xx.c file that fixes up a WARNING: Prefer 'unsigned int' to bare use of 'unsigned' found by the checkpatch.pl tool Signed-off-by: Ravishankar Karkala Mallikarjunayya <ravishankark...@gmail.com> --- drivers/staging/comedi/drivers/ni_65xx.c | 18 +- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/staging/comedi/drivers/ni_65xx.c b/drivers/staging/comedi/drivers/ni_65xx.c index 251117b..07f38e3 100644 --- a/drivers/staging/comedi/drivers/ni_65xx.c +++ b/drivers/staging/comedi/drivers/ni_65xx.c @@ -151,10 +151,10 @@ enum ni_65xx_boardid { struct ni_65xx_board { const char *name; - unsigned num_dio_ports; - unsigned num_di_ports; - unsigned num_do_ports; - unsigned legacy_invert:1; + unsigned int num_dio_ports; + unsigned int num_di_ports; + unsigned int num_do_ports; + unsigned int legacy_invert:1; }; static const struct ni_65xx_board ni_65xx_boards[] = { @@ -360,7 +360,7 @@ static int ni_65xx_dio_insn_config(struct comedi_device *dev, unsigned long base_port = (unsigned long)s->private; unsigned int chan = CR_CHAN(insn->chanspec); unsigned int chan_mask = NI_65XX_CHAN_TO_MASK(chan); - unsigned port = base_port + NI_65XX_CHAN_TO_PORT(chan); + unsigned int port = base_port + NI_65XX_CHAN_TO_PORT(chan); unsigned int interval; unsigned int val; @@ -428,14 +428,14 @@ static int ni_65xx_dio_insn_bits(struct comedi_device *dev, unsigned long base_port = (unsigned long)s->private; unsigned int base_chan = CR_CHAN(insn->chanspec); int last_port_offset = NI_65XX_CHAN_TO_PORT(s->n_chan - 1); - unsigned read_bits = 0; + unsigned int read_bits = 0; int port_offset; for (port_offset = NI_65XX_CHAN_TO_PORT(base_chan); port_offset <= last_port_offset; port_offset++) { - unsigned port = base_port + port_offset; + unsigned int port = base_port + port_offset; int base_port_channel = NI_65XX_PORT_TO_CHAN(port_offset); - unsigned port_mask, port_data, bits; + unsigned int port_mask, port_data, bits; int bitshift = base_port_channel - base_chan; if (bitshift >= 32) @@ -640,7 +640,7 @@ static int ni_65xx_auto_attach(struct comedi_device *dev, struct pci_dev *pcidev = comedi_to_pci_dev(dev); const struct ni_65xx_board *board = NULL; struct comedi_subdevice *s; - unsigned i; + unsigned int i; int ret; if (context < ARRAY_SIZE(ni_65xx_boards)) -- 1.9.1
[PATCH v1 02/10] Staging: comedi: fix bare use of unsigned issue in ni_65xx.c
This is a patch to the ni_65xx.c file that fixes up a WARNING: Prefer 'unsigned int' to bare use of 'unsigned' found by the checkpatch.pl tool Signed-off-by: Ravishankar Karkala Mallikarjunayya --- drivers/staging/comedi/drivers/ni_65xx.c | 18 +- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/staging/comedi/drivers/ni_65xx.c b/drivers/staging/comedi/drivers/ni_65xx.c index 251117b..07f38e3 100644 --- a/drivers/staging/comedi/drivers/ni_65xx.c +++ b/drivers/staging/comedi/drivers/ni_65xx.c @@ -151,10 +151,10 @@ enum ni_65xx_boardid { struct ni_65xx_board { const char *name; - unsigned num_dio_ports; - unsigned num_di_ports; - unsigned num_do_ports; - unsigned legacy_invert:1; + unsigned int num_dio_ports; + unsigned int num_di_ports; + unsigned int num_do_ports; + unsigned int legacy_invert:1; }; static const struct ni_65xx_board ni_65xx_boards[] = { @@ -360,7 +360,7 @@ static int ni_65xx_dio_insn_config(struct comedi_device *dev, unsigned long base_port = (unsigned long)s->private; unsigned int chan = CR_CHAN(insn->chanspec); unsigned int chan_mask = NI_65XX_CHAN_TO_MASK(chan); - unsigned port = base_port + NI_65XX_CHAN_TO_PORT(chan); + unsigned int port = base_port + NI_65XX_CHAN_TO_PORT(chan); unsigned int interval; unsigned int val; @@ -428,14 +428,14 @@ static int ni_65xx_dio_insn_bits(struct comedi_device *dev, unsigned long base_port = (unsigned long)s->private; unsigned int base_chan = CR_CHAN(insn->chanspec); int last_port_offset = NI_65XX_CHAN_TO_PORT(s->n_chan - 1); - unsigned read_bits = 0; + unsigned int read_bits = 0; int port_offset; for (port_offset = NI_65XX_CHAN_TO_PORT(base_chan); port_offset <= last_port_offset; port_offset++) { - unsigned port = base_port + port_offset; + unsigned int port = base_port + port_offset; int base_port_channel = NI_65XX_PORT_TO_CHAN(port_offset); - unsigned port_mask, port_data, bits; + unsigned int port_mask, port_data, bits; int bitshift = base_port_channel - base_chan; if (bitshift >= 32) @@ -640,7 +640,7 @@ static int ni_65xx_auto_attach(struct comedi_device *dev, struct pci_dev *pcidev = comedi_to_pci_dev(dev); const struct ni_65xx_board *board = NULL; struct comedi_subdevice *s; - unsigned i; + unsigned int i; int ret; if (context < ARRAY_SIZE(ni_65xx_boards)) -- 1.9.1
[PATCH v1 03/10] Staging: comedi: Indentation issue in mpc624.c
This is a patch to the mpc624.c file that fixes up a WARNING: 'Statements should start on a tabstop' found by the checkpatch.pl tool. Signed-off-by: Ravishankar Karkala Mallikarjunayya <ravishankark...@gmail.com> --- drivers/staging/comedi/drivers/mpc624.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/comedi/drivers/mpc624.c b/drivers/staging/comedi/drivers/mpc624.c index 826e439..9bda761 100644 --- a/drivers/staging/comedi/drivers/mpc624.c +++ b/drivers/staging/comedi/drivers/mpc624.c @@ -103,7 +103,7 @@ static const struct comedi_lrange range_mpc624_bipolar1 = { /* BIP_RANGE(1.01) this is correct, */ /* but my MPC-624 actually seems to have a range of 2.02 */ BIP_RANGE(2.02) -} + } }; static const struct comedi_lrange range_mpc624_bipolar10 = { @@ -112,7 +112,7 @@ static const struct comedi_lrange range_mpc624_bipolar10 = { /* BIP_RANGE(10.1) this is correct, */ /* but my MPC-624 actually seems to have a range of 20.2 */ BIP_RANGE(20.2) -} + } }; static unsigned int mpc624_ai_get_sample(struct comedi_device *dev, -- 1.9.1
[PATCH v1 03/10] Staging: comedi: Indentation issue in mpc624.c
This is a patch to the mpc624.c file that fixes up a WARNING: 'Statements should start on a tabstop' found by the checkpatch.pl tool. Signed-off-by: Ravishankar Karkala Mallikarjunayya --- drivers/staging/comedi/drivers/mpc624.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/comedi/drivers/mpc624.c b/drivers/staging/comedi/drivers/mpc624.c index 826e439..9bda761 100644 --- a/drivers/staging/comedi/drivers/mpc624.c +++ b/drivers/staging/comedi/drivers/mpc624.c @@ -103,7 +103,7 @@ static const struct comedi_lrange range_mpc624_bipolar1 = { /* BIP_RANGE(1.01) this is correct, */ /* but my MPC-624 actually seems to have a range of 2.02 */ BIP_RANGE(2.02) -} + } }; static const struct comedi_lrange range_mpc624_bipolar10 = { @@ -112,7 +112,7 @@ static const struct comedi_lrange range_mpc624_bipolar10 = { /* BIP_RANGE(10.1) this is correct, */ /* but my MPC-624 actually seems to have a range of 20.2 */ BIP_RANGE(20.2) -} + } }; static unsigned int mpc624_ai_get_sample(struct comedi_device *dev, -- 1.9.1
[PATCH v1 05/10] Staging: comedi: Fix comment issues in jr3_pci.c
This is a patch to the jr3_pci.c file that fixes up a WARNING: 'Block comments use a trailing */ on a separate line' found by the checkpatch.pl tool. Signed-off-by: Ravishankar Karkala Mallikarjunayya <ravishankark...@gmail.com> --- drivers/staging/comedi/drivers/jr3_pci.c | 32 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/drivers/staging/comedi/drivers/jr3_pci.c b/drivers/staging/comedi/drivers/jr3_pci.c index b87192e..fa0d4b1 100644 --- a/drivers/staging/comedi/drivers/jr3_pci.c +++ b/drivers/staging/comedi/drivers/jr3_pci.c @@ -1,20 +1,20 @@ /* - comedi/drivers/jr3_pci.c - hardware driver for JR3/PCI force sensor board - - COMEDI - Linux Control and Measurement Device Interface - Copyright (C) 2007 Anders Blomdell <anders.blomd...@control.lth.se> - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. -*/ + * comedi/drivers/jr3_pci.c + * hardware driver for JR3/PCI force sensor board + * + * COMEDI - Linux Control and Measurement Device Interface + * Copyright (C) 2007 Anders Blomdell <anders.blomd...@control.lth.se> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ /* * Driver: jr3_pci * Description: JR3/PCI force sensor board -- 1.9.1
[PATCH v1 05/10] Staging: comedi: Fix comment issues in jr3_pci.c
This is a patch to the jr3_pci.c file that fixes up a WARNING: 'Block comments use a trailing */ on a separate line' found by the checkpatch.pl tool. Signed-off-by: Ravishankar Karkala Mallikarjunayya --- drivers/staging/comedi/drivers/jr3_pci.c | 32 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/drivers/staging/comedi/drivers/jr3_pci.c b/drivers/staging/comedi/drivers/jr3_pci.c index b87192e..fa0d4b1 100644 --- a/drivers/staging/comedi/drivers/jr3_pci.c +++ b/drivers/staging/comedi/drivers/jr3_pci.c @@ -1,20 +1,20 @@ /* - comedi/drivers/jr3_pci.c - hardware driver for JR3/PCI force sensor board - - COMEDI - Linux Control and Measurement Device Interface - Copyright (C) 2007 Anders Blomdell - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. -*/ + * comedi/drivers/jr3_pci.c + * hardware driver for JR3/PCI force sensor board + * + * COMEDI - Linux Control and Measurement Device Interface + * Copyright (C) 2007 Anders Blomdell + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ /* * Driver: jr3_pci * Description: JR3/PCI force sensor board -- 1.9.1
[PATCH v1 09/10] Staging: comedi: Block comment issue fixed for das16m1.c
This is a patch to the das16m1.c file that fixes up a WARNING: 'Block comments use a trailing */ on a separate line' found by the checkpatch.pl tool. Signed-off-by: Ravishankar Karkala Mallikarjunayya <ravishankark...@gmail.com> --- drivers/staging/comedi/drivers/das16m1.c | 168 --- 1 file changed, 89 insertions(+), 79 deletions(-) diff --git a/drivers/staging/comedi/drivers/das16m1.c b/drivers/staging/comedi/drivers/das16m1.c index 3a37373..212125f 100644 --- a/drivers/staging/comedi/drivers/das16m1.c +++ b/drivers/staging/comedi/drivers/das16m1.c @@ -1,56 +1,56 @@ /* -comedi/drivers/das16m1.c -CIO-DAS16/M1 driver -Author: Frank Mori Hess, based on code from the das16 - driver. -Copyright (C) 2001 Frank Mori Hess <fmh...@users.sourceforge.net> - -COMEDI - Linux Control and Measurement Device Interface -Copyright (C) 2000 David A. Schleef <d...@schleef.org> - -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. -*/ + * comedi/drivers/das16m1.c + * CIO-DAS16/M1 driver + * Author: Frank Mori Hess, based on code from the das16 + * driver. + * Copyright (C) 2001 Frank Mori Hess <fmh...@users.sourceforge.net> + * + * COMEDI - Linux Control and Measurement Device Interface + * Copyright (C) 2000 David A. Schleef <d...@schleef.org> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ /* -Driver: das16m1 -Description: CIO-DAS16/M1 -Author: Frank Mori Hess <fmh...@users.sourceforge.net> -Devices: [Measurement Computing] CIO-DAS16/M1 (das16m1) -Status: works - -This driver supports a single board - the CIO-DAS16/M1. -As far as I know, there are no other boards that have -the same register layout. Even the CIO-DAS16/M1/16 is -significantly different. - -I was _barely_ able to reach the full 1 MHz capability -of this board, using a hard real-time interrupt -(set the TRIG_RT flag in your struct comedi_cmd and use -rtlinux or RTAI). The board can't do dma, so the bottleneck is -pulling the data across the ISA bus. I timed the interrupt -handler, and it took my computer ~470 microseconds to pull 512 -samples from the board. So at 1 Mhz sampling rate, -expect your CPU to be spending almost all of its -time in the interrupt handler. - -This board has some unusual restrictions for its channel/gain list. If the -list has 2 or more channels in it, then two conditions must be satisfied: -(1) - even/odd channels must appear at even/odd indices in the list -(2) - the list must have an even number of entries. - -Options: - [0] - base io address - [1] - irq (optional, but you probably want it) - -irq can be omitted, although the cmd interface will not work without it. -*/ + * Driver: das16m1 + * Description: CIO-DAS16/M1 + * Author: Frank Mori Hess <fmh...@users.sourceforge.net> + * Devices: [Measurement Computing] CIO-DAS16/M1 (das16m1) + * Status: works + * + * This driver supports a single board - the CIO-DAS16/M1. + * As far as I know, there are no other boards that have + * the same register layout. Even the CIO-DAS16/M1/16 is + * significantly different. + * + * I was _barely_ able to reach the full 1 MHz capability + * of this board, using a hard real-time interrupt + * (set the TRIG_RT flag in your struct comedi_cmd and use + * rtlinux or RTAI). The board can't do dma, so the bottleneck is + * pulling the data across the ISA bus. I timed the interrupt + * handler, and it took my computer ~470 microseconds to pull 512 + * samples from the board. So at 1 Mhz sampling rate, + * expect your CPU to be spending almost all of its + * time in the interrupt handler. + * + * This board has some unusual restrictions for its channel/gain list. If the + * list has 2 or more channels in it, then two conditions must be satisfied: + * (1) - even/odd channels must appear at even/odd indices in the list + * (2) - the list must have an even number of entries. + * + * Options: + * [0] - base io address + * [1] - irq (optional, but you probably want it) + * + * irq can be omitted, althou
[PATCH v1 10/10] Staging: comedi: Used unsigned int instead of unsigned issue in jr3_pci.c
This is a patch to the jr3_pci.c file that fixes up a WARNING: Prefer 'unsigned int' to bare use of 'unsigned' found by the checkpatch.pl tool. Signed-off-by: Ravishankar Karkala Mallikarjunayya <ravishankark...@gmail.com> --- drivers/staging/comedi/drivers/jr3_pci.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/comedi/drivers/jr3_pci.c b/drivers/staging/comedi/drivers/jr3_pci.c index fa0d4b1..6c4ff02 100644 --- a/drivers/staging/comedi/drivers/jr3_pci.c +++ b/drivers/staging/comedi/drivers/jr3_pci.c @@ -231,7 +231,7 @@ static unsigned int jr3_pci_ai_read_chan(struct comedi_device *dev, if (chan < 56) { unsigned int axis = chan % 8; - unsigned filter = chan / 8; + unsigned int filter = chan / 8; switch (axis) { case 0: @@ -690,7 +690,7 @@ static int jr3_pci_auto_attach(struct comedi_device *dev, if (sizeof(struct jr3_channel) != 0xc00) { dev_err(dev->class_dev, "sizeof(struct jr3_channel) = %x [expected %x]\n", - (unsigned)sizeof(struct jr3_channel), 0xc00); + (unsigned int)sizeof(struct jr3_channel), 0xc00); return -EINVAL; } -- 1.9.1
[PATCH v1 09/10] Staging: comedi: Block comment issue fixed for das16m1.c
This is a patch to the das16m1.c file that fixes up a WARNING: 'Block comments use a trailing */ on a separate line' found by the checkpatch.pl tool. Signed-off-by: Ravishankar Karkala Mallikarjunayya --- drivers/staging/comedi/drivers/das16m1.c | 168 --- 1 file changed, 89 insertions(+), 79 deletions(-) diff --git a/drivers/staging/comedi/drivers/das16m1.c b/drivers/staging/comedi/drivers/das16m1.c index 3a37373..212125f 100644 --- a/drivers/staging/comedi/drivers/das16m1.c +++ b/drivers/staging/comedi/drivers/das16m1.c @@ -1,56 +1,56 @@ /* -comedi/drivers/das16m1.c -CIO-DAS16/M1 driver -Author: Frank Mori Hess, based on code from the das16 - driver. -Copyright (C) 2001 Frank Mori Hess - -COMEDI - Linux Control and Measurement Device Interface -Copyright (C) 2000 David A. Schleef - -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. -*/ + * comedi/drivers/das16m1.c + * CIO-DAS16/M1 driver + * Author: Frank Mori Hess, based on code from the das16 + * driver. + * Copyright (C) 2001 Frank Mori Hess + * + * COMEDI - Linux Control and Measurement Device Interface + * Copyright (C) 2000 David A. Schleef + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ /* -Driver: das16m1 -Description: CIO-DAS16/M1 -Author: Frank Mori Hess -Devices: [Measurement Computing] CIO-DAS16/M1 (das16m1) -Status: works - -This driver supports a single board - the CIO-DAS16/M1. -As far as I know, there are no other boards that have -the same register layout. Even the CIO-DAS16/M1/16 is -significantly different. - -I was _barely_ able to reach the full 1 MHz capability -of this board, using a hard real-time interrupt -(set the TRIG_RT flag in your struct comedi_cmd and use -rtlinux or RTAI). The board can't do dma, so the bottleneck is -pulling the data across the ISA bus. I timed the interrupt -handler, and it took my computer ~470 microseconds to pull 512 -samples from the board. So at 1 Mhz sampling rate, -expect your CPU to be spending almost all of its -time in the interrupt handler. - -This board has some unusual restrictions for its channel/gain list. If the -list has 2 or more channels in it, then two conditions must be satisfied: -(1) - even/odd channels must appear at even/odd indices in the list -(2) - the list must have an even number of entries. - -Options: - [0] - base io address - [1] - irq (optional, but you probably want it) - -irq can be omitted, although the cmd interface will not work without it. -*/ + * Driver: das16m1 + * Description: CIO-DAS16/M1 + * Author: Frank Mori Hess + * Devices: [Measurement Computing] CIO-DAS16/M1 (das16m1) + * Status: works + * + * This driver supports a single board - the CIO-DAS16/M1. + * As far as I know, there are no other boards that have + * the same register layout. Even the CIO-DAS16/M1/16 is + * significantly different. + * + * I was _barely_ able to reach the full 1 MHz capability + * of this board, using a hard real-time interrupt + * (set the TRIG_RT flag in your struct comedi_cmd and use + * rtlinux or RTAI). The board can't do dma, so the bottleneck is + * pulling the data across the ISA bus. I timed the interrupt + * handler, and it took my computer ~470 microseconds to pull 512 + * samples from the board. So at 1 Mhz sampling rate, + * expect your CPU to be spending almost all of its + * time in the interrupt handler. + * + * This board has some unusual restrictions for its channel/gain list. If the + * list has 2 or more channels in it, then two conditions must be satisfied: + * (1) - even/odd channels must appear at even/odd indices in the list + * (2) - the list must have an even number of entries. + * + * Options: + * [0] - base io address + * [1] - irq (optional, but you probably want it) + * + * irq can be omitted, although the cmd interface will not work without it. + */ #include #include @@ -65,24 +65,24 @@ irq can be omitted, although the cmd interface will not work without it. #define FIFO_SIZE 1024 /* 1024 sample fifo
[PATCH v1 10/10] Staging: comedi: Used unsigned int instead of unsigned issue in jr3_pci.c
This is a patch to the jr3_pci.c file that fixes up a WARNING: Prefer 'unsigned int' to bare use of 'unsigned' found by the checkpatch.pl tool. Signed-off-by: Ravishankar Karkala Mallikarjunayya --- drivers/staging/comedi/drivers/jr3_pci.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/comedi/drivers/jr3_pci.c b/drivers/staging/comedi/drivers/jr3_pci.c index fa0d4b1..6c4ff02 100644 --- a/drivers/staging/comedi/drivers/jr3_pci.c +++ b/drivers/staging/comedi/drivers/jr3_pci.c @@ -231,7 +231,7 @@ static unsigned int jr3_pci_ai_read_chan(struct comedi_device *dev, if (chan < 56) { unsigned int axis = chan % 8; - unsigned filter = chan / 8; + unsigned int filter = chan / 8; switch (axis) { case 0: @@ -690,7 +690,7 @@ static int jr3_pci_auto_attach(struct comedi_device *dev, if (sizeof(struct jr3_channel) != 0xc00) { dev_err(dev->class_dev, "sizeof(struct jr3_channel) = %x [expected %x]\n", - (unsigned)sizeof(struct jr3_channel), 0xc00); + (unsigned int)sizeof(struct jr3_channel), 0xc00); return -EINVAL; } -- 1.9.1
[PATCH v1 07/10] Staging: comedi: fix BIT macro issue in das6402.c
This patch Replace all occurences of (1<<x) by BIT(x) and DAS6402_CTRL_TRIG(x), DAS6402_MODE_RANGE(x), DAS6402_MODE_DMA(x) macros in the file das6402.c to get rid of checkpatch.pl "CHECK" output "Prefer using the BIT macro" Signed-off-by: Ravishankar Karkala Mallikarjunayya <ravishankark...@gmail.com> --- drivers/staging/comedi/drivers/das6402.c | 74 1 file changed, 38 insertions(+), 36 deletions(-) diff --git a/drivers/staging/comedi/drivers/das6402.c b/drivers/staging/comedi/drivers/das6402.c index 1701294..0fdf5e0 100644 --- a/drivers/staging/comedi/drivers/das6402.c +++ b/drivers/staging/comedi/drivers/das6402.c @@ -50,48 +50,50 @@ #define DAS6402_AO_LSB_REG(x) (0x04 + ((x) * 2)) #define DAS6402_AO_MSB_REG(x) (0x05 + ((x) * 2)) #define DAS6402_STATUS_REG 0x08 -#define DAS6402_STATUS_FFNE(1 << 0) -#define DAS6402_STATUS_FHALF (1 << 1) -#define DAS6402_STATUS_FFULL (1 << 2) -#define DAS6402_STATUS_XINT(1 << 3) -#define DAS6402_STATUS_INT (1 << 4) -#define DAS6402_STATUS_XTRIG (1 << 5) -#define DAS6402_STATUS_INDGT (1 << 6) -#define DAS6402_STATUS_10MHZ (1 << 7) -#define DAS6402_STATUS_W_CLRINT(1 << 0) -#define DAS6402_STATUS_W_CLRXTR(1 << 1) -#define DAS6402_STATUS_W_CLRXIN(1 << 2) -#define DAS6402_STATUS_W_EXTEND(1 << 4) -#define DAS6402_STATUS_W_ARMED (1 << 5) -#define DAS6402_STATUS_W_POSTMODE (1 << 6) -#define DAS6402_STATUS_W_10MHZ (1 << 7) +#define DAS6402_STATUS_FFNEBIT(0) +#define DAS6402_STATUS_FHALF BIT(1) +#define DAS6402_STATUS_FFULL BIT(2) +#define DAS6402_STATUS_XINTBIT(3) +#define DAS6402_STATUS_INT BIT(4) +#define DAS6402_STATUS_XTRIG BIT(5) +#define DAS6402_STATUS_INDGT BIT(6) +#define DAS6402_STATUS_10MHZ BIT(7) +#define DAS6402_STATUS_W_CLRINTBIT(0) +#define DAS6402_STATUS_W_CLRXTRBIT(1) +#define DAS6402_STATUS_W_CLRXINBIT(2) +#define DAS6402_STATUS_W_EXTENDBIT(4) +#define DAS6402_STATUS_W_ARMED BIT(5) +#define DAS6402_STATUS_W_POSTMODE BIT(6) +#define DAS6402_STATUS_W_10MHZ BIT(7) #define DAS6402_CTRL_REG 0x09 -#define DAS6402_CTRL_SOFT_TRIG (0 << 0) -#define DAS6402_CTRL_EXT_FALL_TRIG (1 << 0) -#define DAS6402_CTRL_EXT_RISE_TRIG (2 << 0) -#define DAS6402_CTRL_PACER_TRIG(3 << 0) -#define DAS6402_CTRL_BURSTEN (1 << 2) -#define DAS6402_CTRL_XINTE (1 << 3) +#define DAS6402_CTRL_TRIG(x) ((x) << 0) +#define DAS6402_CTRL_SOFT_TRIG DAS6402_CTRL_TRIG(0) +#define DAS6402_CTRL_EXT_FALL_TRIG DAS6402_CTRL_TRIG(1) +#define DAS6402_CTRL_EXT_RISE_TRIG DAS6402_CTRL_TRIG(2) +#define DAS6402_CTRL_PACER_TRIGDAS6402_CTRL_TRIG(3) +#define DAS6402_CTRL_BURSTEN BIT(2) +#define DAS6402_CTRL_XINTE BIT(3) #define DAS6402_CTRL_IRQ(x)((x) << 4) -#define DAS6402_CTRL_INTE (1 << 7) +#define DAS6402_CTRL_INTE BIT(7) #define DAS6402_TRIG_REG 0x0a -#define DAS6402_TRIG_TGEN (1 << 0) -#define DAS6402_TRIG_TGSEL (1 << 1) -#define DAS6402_TRIG_TGPOL (1 << 2) -#define DAS6402_TRIG_PRETRIG (1 << 3) +#define DAS6402_TRIG_TGEN BIT(0) +#define DAS6402_TRIG_TGSEL BIT(1) +#define DAS6402_TRIG_TGPOL BIT(2) +#define DAS6402_TRIG_PRETRIG BIT(3) #define DAS6402_AO_RANGE(_chan, _range)((_range) << ((_chan) ? 6 : 4)) #define DAS6402_AO_RANGE_MASK(_chan) (3 << ((_chan) ? 6 : 4)) #define DAS6402_MODE_REG 0x0b -#define DAS6402_MODE_RANGE(x) ((x) << 0) -#define DAS6402_MODE_POLLED(0 << 2) -#define DAS6402_MODE_FIFONEPTY (1 << 2) -#define DAS6402_MODE_FIFOHFULL (2 << 2) -#define DAS6402_MODE_EOB (3 << 2) -#define DAS6402_MODE_ENHANCED (1 << 4) -#define DAS6402_MODE_SE(1 << 5) -#define DAS6402_MODE_UNI (1 << 6) -#define DAS6402_MODE_DMA1 (0 << 7) -#define DAS6402_MODE_DMA3 (1 << 7) +#define DAS6402_MODE_RANGE(x) ((x) << 2) +#define DAS6402_MODE_POLLEDDAS6402_MODE_RANGE(0) +#define DAS6402_MODE_FIFONEPTY DAS6402_MODE_RANGE(1) +#define DAS6402_MODE_FIFOHFULL DAS6402_MODE_RANGE(2) +#define DAS6402_MODE_EOB DAS6402_MODE_RANGE(3) +#define DAS6402_MODE_ENHANCED BIT(4) +#d
[PATCH v1 08/10] Staging: comedi: Prefer unsigned int instead of unsigned in comedi_bond.c
This is a patch to the comedi_bond.c file that fixes up a WARNING: Prefer 'unsigned int' to bare use of 'unsigned' found by the checkpatch.pl tool. Signed-off-by: Ravishankar Karkala Mallikarjunayya <ravishankark...@gmail.com> --- drivers/staging/comedi/drivers/comedi_bond.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/staging/comedi/drivers/comedi_bond.c b/drivers/staging/comedi/drivers/comedi_bond.c index 50b76ec..64a5ea3 100644 --- a/drivers/staging/comedi/drivers/comedi_bond.c +++ b/drivers/staging/comedi/drivers/comedi_bond.c @@ -55,16 +55,16 @@ struct bonded_device { struct comedi_device *dev; - unsigned minor; - unsigned subdev; - unsigned nchans; + unsigned int minor; + unsigned int subdev; + unsigned int nchans; }; struct comedi_bond_private { char name[256]; struct bonded_device **devs; - unsigned ndevs; - unsigned nchans; + unsigned int ndevs; + unsigned int nchans; }; static int bonding_dio_insn_bits(struct comedi_device *dev, -- 1.9.1
[PATCH v1 07/10] Staging: comedi: fix BIT macro issue in das6402.c
This patch Replace all occurences of (1< --- drivers/staging/comedi/drivers/das6402.c | 74 1 file changed, 38 insertions(+), 36 deletions(-) diff --git a/drivers/staging/comedi/drivers/das6402.c b/drivers/staging/comedi/drivers/das6402.c index 1701294..0fdf5e0 100644 --- a/drivers/staging/comedi/drivers/das6402.c +++ b/drivers/staging/comedi/drivers/das6402.c @@ -50,48 +50,50 @@ #define DAS6402_AO_LSB_REG(x) (0x04 + ((x) * 2)) #define DAS6402_AO_MSB_REG(x) (0x05 + ((x) * 2)) #define DAS6402_STATUS_REG 0x08 -#define DAS6402_STATUS_FFNE(1 << 0) -#define DAS6402_STATUS_FHALF (1 << 1) -#define DAS6402_STATUS_FFULL (1 << 2) -#define DAS6402_STATUS_XINT(1 << 3) -#define DAS6402_STATUS_INT (1 << 4) -#define DAS6402_STATUS_XTRIG (1 << 5) -#define DAS6402_STATUS_INDGT (1 << 6) -#define DAS6402_STATUS_10MHZ (1 << 7) -#define DAS6402_STATUS_W_CLRINT(1 << 0) -#define DAS6402_STATUS_W_CLRXTR(1 << 1) -#define DAS6402_STATUS_W_CLRXIN(1 << 2) -#define DAS6402_STATUS_W_EXTEND(1 << 4) -#define DAS6402_STATUS_W_ARMED (1 << 5) -#define DAS6402_STATUS_W_POSTMODE (1 << 6) -#define DAS6402_STATUS_W_10MHZ (1 << 7) +#define DAS6402_STATUS_FFNEBIT(0) +#define DAS6402_STATUS_FHALF BIT(1) +#define DAS6402_STATUS_FFULL BIT(2) +#define DAS6402_STATUS_XINTBIT(3) +#define DAS6402_STATUS_INT BIT(4) +#define DAS6402_STATUS_XTRIG BIT(5) +#define DAS6402_STATUS_INDGT BIT(6) +#define DAS6402_STATUS_10MHZ BIT(7) +#define DAS6402_STATUS_W_CLRINTBIT(0) +#define DAS6402_STATUS_W_CLRXTRBIT(1) +#define DAS6402_STATUS_W_CLRXINBIT(2) +#define DAS6402_STATUS_W_EXTENDBIT(4) +#define DAS6402_STATUS_W_ARMED BIT(5) +#define DAS6402_STATUS_W_POSTMODE BIT(6) +#define DAS6402_STATUS_W_10MHZ BIT(7) #define DAS6402_CTRL_REG 0x09 -#define DAS6402_CTRL_SOFT_TRIG (0 << 0) -#define DAS6402_CTRL_EXT_FALL_TRIG (1 << 0) -#define DAS6402_CTRL_EXT_RISE_TRIG (2 << 0) -#define DAS6402_CTRL_PACER_TRIG(3 << 0) -#define DAS6402_CTRL_BURSTEN (1 << 2) -#define DAS6402_CTRL_XINTE (1 << 3) +#define DAS6402_CTRL_TRIG(x) ((x) << 0) +#define DAS6402_CTRL_SOFT_TRIG DAS6402_CTRL_TRIG(0) +#define DAS6402_CTRL_EXT_FALL_TRIG DAS6402_CTRL_TRIG(1) +#define DAS6402_CTRL_EXT_RISE_TRIG DAS6402_CTRL_TRIG(2) +#define DAS6402_CTRL_PACER_TRIGDAS6402_CTRL_TRIG(3) +#define DAS6402_CTRL_BURSTEN BIT(2) +#define DAS6402_CTRL_XINTE BIT(3) #define DAS6402_CTRL_IRQ(x)((x) << 4) -#define DAS6402_CTRL_INTE (1 << 7) +#define DAS6402_CTRL_INTE BIT(7) #define DAS6402_TRIG_REG 0x0a -#define DAS6402_TRIG_TGEN (1 << 0) -#define DAS6402_TRIG_TGSEL (1 << 1) -#define DAS6402_TRIG_TGPOL (1 << 2) -#define DAS6402_TRIG_PRETRIG (1 << 3) +#define DAS6402_TRIG_TGEN BIT(0) +#define DAS6402_TRIG_TGSEL BIT(1) +#define DAS6402_TRIG_TGPOL BIT(2) +#define DAS6402_TRIG_PRETRIG BIT(3) #define DAS6402_AO_RANGE(_chan, _range)((_range) << ((_chan) ? 6 : 4)) #define DAS6402_AO_RANGE_MASK(_chan) (3 << ((_chan) ? 6 : 4)) #define DAS6402_MODE_REG 0x0b -#define DAS6402_MODE_RANGE(x) ((x) << 0) -#define DAS6402_MODE_POLLED(0 << 2) -#define DAS6402_MODE_FIFONEPTY (1 << 2) -#define DAS6402_MODE_FIFOHFULL (2 << 2) -#define DAS6402_MODE_EOB (3 << 2) -#define DAS6402_MODE_ENHANCED (1 << 4) -#define DAS6402_MODE_SE(1 << 5) -#define DAS6402_MODE_UNI (1 << 6) -#define DAS6402_MODE_DMA1 (0 << 7) -#define DAS6402_MODE_DMA3 (1 << 7) +#define DAS6402_MODE_RANGE(x) ((x) << 2) +#define DAS6402_MODE_POLLEDDAS6402_MODE_RANGE(0) +#define DAS6402_MODE_FIFONEPTY DAS6402_MODE_RANGE(1) +#define DAS6402_MODE_FIFOHFULL DAS6402_MODE_RANGE(2) +#define DAS6402_MODE_EOB DAS6402_MODE_RANGE(3) +#define DAS6402_MODE_ENHANCED BIT(4) +#define DAS6402_MODE_SEBIT(5) +#define DAS6402_MODE_UNI BIT(6) +#define DAS6402_MODE_DMA(x)((x) << 7) +#define DAS6402_MODE_DMA1 DAS6402_MODE_DMA(0) +#define DAS6402_MODE_DMA3 DAS6402_MODE_DMA(1) #define DAS6402_TIMER_BASE 0x0c static const struct comedi_lrange das6402_ai_ranges = { -- 1.9.1
[PATCH v1 08/10] Staging: comedi: Prefer unsigned int instead of unsigned in comedi_bond.c
This is a patch to the comedi_bond.c file that fixes up a WARNING: Prefer 'unsigned int' to bare use of 'unsigned' found by the checkpatch.pl tool. Signed-off-by: Ravishankar Karkala Mallikarjunayya --- drivers/staging/comedi/drivers/comedi_bond.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/staging/comedi/drivers/comedi_bond.c b/drivers/staging/comedi/drivers/comedi_bond.c index 50b76ec..64a5ea3 100644 --- a/drivers/staging/comedi/drivers/comedi_bond.c +++ b/drivers/staging/comedi/drivers/comedi_bond.c @@ -55,16 +55,16 @@ struct bonded_device { struct comedi_device *dev; - unsigned minor; - unsigned subdev; - unsigned nchans; + unsigned int minor; + unsigned int subdev; + unsigned int nchans; }; struct comedi_bond_private { char name[256]; struct bonded_device **devs; - unsigned ndevs; - unsigned nchans; + unsigned int ndevs; + unsigned int nchans; }; static int bonding_dio_insn_bits(struct comedi_device *dev, -- 1.9.1
[PATCH v1 04/10] Staging: comedi:Fix a warning issues in me_daq.c
This is a patch to the me_daq.c file that fixes up a WARNING: Prefer 'unsigned int' to bare use of 'unsigned' found by the checkpatch.pl tool. Signed-off-by: Ravishankar Karkala Mallikarjunayya <ravishankark...@gmail.com> --- drivers/staging/comedi/drivers/me_daq.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/comedi/drivers/me_daq.c b/drivers/staging/comedi/drivers/me_daq.c index 3bf0caa..c0b7a30 100644 --- a/drivers/staging/comedi/drivers/me_daq.c +++ b/drivers/staging/comedi/drivers/me_daq.c @@ -150,7 +150,7 @@ struct me_private_data { unsigned short dac_ctrl;/* Mirror of the DAC_CONTROL register */ }; -static inline void sleep(unsigned sec) +static inline void sleep(unsigned int sec) { schedule_timeout_interruptible(sec * HZ); } -- 1.9.1
[PATCH v1 06/10] Staging: comedi: Prefer using the BIT macro issue in das16.c
This patch Replace all occurences of (1<<x) by BIT(x) in the file das16.c to get rid of checkpatch.pl "CHECK" output "Prefer using the BIT macro" Signed-off-by: Ravishankar Karkala Mallikarjunayya <ravishankark...@gmail.com> --- drivers/staging/comedi/drivers/das16.c | 32 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/drivers/staging/comedi/drivers/das16.c b/drivers/staging/comedi/drivers/das16.c index fd8e0b7..69133e3 100644 --- a/drivers/staging/comedi/drivers/das16.c +++ b/drivers/staging/comedi/drivers/das16.c @@ -92,37 +92,37 @@ #define DAS16_AO_LSB_REG(x)((x) ? 0x06 : 0x04) #define DAS16_AO_MSB_REG(x)((x) ? 0x07 : 0x05) #define DAS16_STATUS_REG 0x08 -#define DAS16_STATUS_BUSY (1 << 7) -#define DAS16_STATUS_UNIPOLAR (1 << 6) -#define DAS16_STATUS_MUXBIT(1 << 5) -#define DAS16_STATUS_INT (1 << 4) +#define DAS16_STATUS_BUSY BIT(7) +#define DAS16_STATUS_UNIPOLAR BIT(6) +#define DAS16_STATUS_MUXBITBIT(5) +#define DAS16_STATUS_INT BIT(4) #define DAS16_CTRL_REG 0x09 -#define DAS16_CTRL_INTE(1 << 7) +#define DAS16_CTRL_INTEBIT(7) #define DAS16_CTRL_IRQ(x) (((x) & 0x7) << 4) -#define DAS16_CTRL_DMAE(1 << 2) +#define DAS16_CTRL_DMAEBIT(2) #define DAS16_CTRL_PACING_MASK (3 << 0) #define DAS16_CTRL_INT_PACER (3 << 0) #define DAS16_CTRL_EXT_PACER (2 << 0) #define DAS16_CTRL_SOFT_PACER (0 << 0) #define DAS16_PACER_REG0x0a #define DAS16_PACER_BURST_LEN(x) (((x) & 0xf) << 4) -#define DAS16_PACER_CTR0 (1 << 1) -#define DAS16_PACER_TRIG0 (1 << 0) +#define DAS16_PACER_CTR0 BIT(1) +#define DAS16_PACER_TRIG0 BIT(0) #define DAS16_GAIN_REG 0x0b #define DAS16_TIMER_BASE_REG 0x0c/* to 0x0f */ #define DAS1600_CONV_REG 0x404 -#define DAS1600_CONV_DISABLE (1 << 6) +#define DAS1600_CONV_DISABLE BIT(6) #define DAS1600_BURST_REG 0x405 -#define DAS1600_BURST_VAL (1 << 6) +#define DAS1600_BURST_VAL BIT(6) #define DAS1600_ENABLE_REG 0x406 -#define DAS1600_ENABLE_VAL (1 << 6) +#define DAS1600_ENABLE_VAL BIT(6) #define DAS1600_STATUS_REG 0x407 -#define DAS1600_STATUS_BME (1 << 6) -#define DAS1600_STATUS_ME (1 << 5) -#define DAS1600_STATUS_CD (1 << 4) -#define DAS1600_STATUS_WS (1 << 1) -#define DAS1600_STATUS_CLK_10MHZ (1 << 0) +#define DAS1600_STATUS_BME BIT(6) +#define DAS1600_STATUS_ME BIT(5) +#define DAS1600_STATUS_CD BIT(4) +#define DAS1600_STATUS_WS BIT(1) +#define DAS1600_STATUS_CLK_10MHZ BIT(0) static const struct comedi_lrange range_das1x01_bip = { 4, { -- 1.9.1
[PATCH v1 01/10] Staging: comedi: Use unsigned int instead of unsigned issue in pcmuio.c
This is a patch to the pcmuio.c file that fixes up a WARNING: Prefer 'unsigned int' to bare use of 'unsigned' found by the checkpatch.pl tool. Signed-off-by: Ravishankar Karkala Mallikarjunayya <ravishankark...@gmail.com> --- drivers/staging/comedi/drivers/pcmuio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/comedi/drivers/pcmuio.c b/drivers/staging/comedi/drivers/pcmuio.c index 7ea8130..8ad64f2 100644 --- a/drivers/staging/comedi/drivers/pcmuio.c +++ b/drivers/staging/comedi/drivers/pcmuio.c @@ -307,7 +307,7 @@ static void pcmuio_stop_intr(struct comedi_device *dev, static void pcmuio_handle_intr_subdev(struct comedi_device *dev, struct comedi_subdevice *s, - unsigned triggered) + unsigned int triggered) { struct pcmuio_private *devpriv = dev->private; int asic = pcmuio_subdevice_to_asic(s); -- 1.9.1
[PATCH v1 04/10] Staging: comedi:Fix a warning issues in me_daq.c
This is a patch to the me_daq.c file that fixes up a WARNING: Prefer 'unsigned int' to bare use of 'unsigned' found by the checkpatch.pl tool. Signed-off-by: Ravishankar Karkala Mallikarjunayya --- drivers/staging/comedi/drivers/me_daq.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/comedi/drivers/me_daq.c b/drivers/staging/comedi/drivers/me_daq.c index 3bf0caa..c0b7a30 100644 --- a/drivers/staging/comedi/drivers/me_daq.c +++ b/drivers/staging/comedi/drivers/me_daq.c @@ -150,7 +150,7 @@ struct me_private_data { unsigned short dac_ctrl;/* Mirror of the DAC_CONTROL register */ }; -static inline void sleep(unsigned sec) +static inline void sleep(unsigned int sec) { schedule_timeout_interruptible(sec * HZ); } -- 1.9.1
[PATCH v1 06/10] Staging: comedi: Prefer using the BIT macro issue in das16.c
This patch Replace all occurences of (1< --- drivers/staging/comedi/drivers/das16.c | 32 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/drivers/staging/comedi/drivers/das16.c b/drivers/staging/comedi/drivers/das16.c index fd8e0b7..69133e3 100644 --- a/drivers/staging/comedi/drivers/das16.c +++ b/drivers/staging/comedi/drivers/das16.c @@ -92,37 +92,37 @@ #define DAS16_AO_LSB_REG(x)((x) ? 0x06 : 0x04) #define DAS16_AO_MSB_REG(x)((x) ? 0x07 : 0x05) #define DAS16_STATUS_REG 0x08 -#define DAS16_STATUS_BUSY (1 << 7) -#define DAS16_STATUS_UNIPOLAR (1 << 6) -#define DAS16_STATUS_MUXBIT(1 << 5) -#define DAS16_STATUS_INT (1 << 4) +#define DAS16_STATUS_BUSY BIT(7) +#define DAS16_STATUS_UNIPOLAR BIT(6) +#define DAS16_STATUS_MUXBITBIT(5) +#define DAS16_STATUS_INT BIT(4) #define DAS16_CTRL_REG 0x09 -#define DAS16_CTRL_INTE(1 << 7) +#define DAS16_CTRL_INTEBIT(7) #define DAS16_CTRL_IRQ(x) (((x) & 0x7) << 4) -#define DAS16_CTRL_DMAE(1 << 2) +#define DAS16_CTRL_DMAEBIT(2) #define DAS16_CTRL_PACING_MASK (3 << 0) #define DAS16_CTRL_INT_PACER (3 << 0) #define DAS16_CTRL_EXT_PACER (2 << 0) #define DAS16_CTRL_SOFT_PACER (0 << 0) #define DAS16_PACER_REG0x0a #define DAS16_PACER_BURST_LEN(x) (((x) & 0xf) << 4) -#define DAS16_PACER_CTR0 (1 << 1) -#define DAS16_PACER_TRIG0 (1 << 0) +#define DAS16_PACER_CTR0 BIT(1) +#define DAS16_PACER_TRIG0 BIT(0) #define DAS16_GAIN_REG 0x0b #define DAS16_TIMER_BASE_REG 0x0c/* to 0x0f */ #define DAS1600_CONV_REG 0x404 -#define DAS1600_CONV_DISABLE (1 << 6) +#define DAS1600_CONV_DISABLE BIT(6) #define DAS1600_BURST_REG 0x405 -#define DAS1600_BURST_VAL (1 << 6) +#define DAS1600_BURST_VAL BIT(6) #define DAS1600_ENABLE_REG 0x406 -#define DAS1600_ENABLE_VAL (1 << 6) +#define DAS1600_ENABLE_VAL BIT(6) #define DAS1600_STATUS_REG 0x407 -#define DAS1600_STATUS_BME (1 << 6) -#define DAS1600_STATUS_ME (1 << 5) -#define DAS1600_STATUS_CD (1 << 4) -#define DAS1600_STATUS_WS (1 << 1) -#define DAS1600_STATUS_CLK_10MHZ (1 << 0) +#define DAS1600_STATUS_BME BIT(6) +#define DAS1600_STATUS_ME BIT(5) +#define DAS1600_STATUS_CD BIT(4) +#define DAS1600_STATUS_WS BIT(1) +#define DAS1600_STATUS_CLK_10MHZ BIT(0) static const struct comedi_lrange range_das1x01_bip = { 4, { -- 1.9.1
[PATCH v1 01/10] Staging: comedi: Use unsigned int instead of unsigned issue in pcmuio.c
This is a patch to the pcmuio.c file that fixes up a WARNING: Prefer 'unsigned int' to bare use of 'unsigned' found by the checkpatch.pl tool. Signed-off-by: Ravishankar Karkala Mallikarjunayya --- drivers/staging/comedi/drivers/pcmuio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/comedi/drivers/pcmuio.c b/drivers/staging/comedi/drivers/pcmuio.c index 7ea8130..8ad64f2 100644 --- a/drivers/staging/comedi/drivers/pcmuio.c +++ b/drivers/staging/comedi/drivers/pcmuio.c @@ -307,7 +307,7 @@ static void pcmuio_stop_intr(struct comedi_device *dev, static void pcmuio_handle_intr_subdev(struct comedi_device *dev, struct comedi_subdevice *s, - unsigned triggered) + unsigned int triggered) { struct pcmuio_private *devpriv = dev->private; int asic = pcmuio_subdevice_to_asic(s); -- 1.9.1
[PATCH v1 06/10] Staging: comedi: Prefer using the BIT macro issue in das16.c
This patch Replace all occurences of (1<<x) by BIT(x) in the file das16.c to get rid of checkpatch.pl "CHECK" output "Prefer using the BIT macro" Signed-off-by: Ravishankar Karkala Mallikarjunayya <ravishankark...@gmail.com> --- drivers/staging/comedi/drivers/das16.c | 32 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/drivers/staging/comedi/drivers/das16.c b/drivers/staging/comedi/drivers/das16.c index fd8e0b7..69133e3 100644 --- a/drivers/staging/comedi/drivers/das16.c +++ b/drivers/staging/comedi/drivers/das16.c @@ -92,37 +92,37 @@ #define DAS16_AO_LSB_REG(x)((x) ? 0x06 : 0x04) #define DAS16_AO_MSB_REG(x)((x) ? 0x07 : 0x05) #define DAS16_STATUS_REG 0x08 -#define DAS16_STATUS_BUSY (1 << 7) -#define DAS16_STATUS_UNIPOLAR (1 << 6) -#define DAS16_STATUS_MUXBIT(1 << 5) -#define DAS16_STATUS_INT (1 << 4) +#define DAS16_STATUS_BUSY BIT(7) +#define DAS16_STATUS_UNIPOLAR BIT(6) +#define DAS16_STATUS_MUXBITBIT(5) +#define DAS16_STATUS_INT BIT(4) #define DAS16_CTRL_REG 0x09 -#define DAS16_CTRL_INTE(1 << 7) +#define DAS16_CTRL_INTEBIT(7) #define DAS16_CTRL_IRQ(x) (((x) & 0x7) << 4) -#define DAS16_CTRL_DMAE(1 << 2) +#define DAS16_CTRL_DMAEBIT(2) #define DAS16_CTRL_PACING_MASK (3 << 0) #define DAS16_CTRL_INT_PACER (3 << 0) #define DAS16_CTRL_EXT_PACER (2 << 0) #define DAS16_CTRL_SOFT_PACER (0 << 0) #define DAS16_PACER_REG0x0a #define DAS16_PACER_BURST_LEN(x) (((x) & 0xf) << 4) -#define DAS16_PACER_CTR0 (1 << 1) -#define DAS16_PACER_TRIG0 (1 << 0) +#define DAS16_PACER_CTR0 BIT(1) +#define DAS16_PACER_TRIG0 BIT(0) #define DAS16_GAIN_REG 0x0b #define DAS16_TIMER_BASE_REG 0x0c/* to 0x0f */ #define DAS1600_CONV_REG 0x404 -#define DAS1600_CONV_DISABLE (1 << 6) +#define DAS1600_CONV_DISABLE BIT(6) #define DAS1600_BURST_REG 0x405 -#define DAS1600_BURST_VAL (1 << 6) +#define DAS1600_BURST_VAL BIT(6) #define DAS1600_ENABLE_REG 0x406 -#define DAS1600_ENABLE_VAL (1 << 6) +#define DAS1600_ENABLE_VAL BIT(6) #define DAS1600_STATUS_REG 0x407 -#define DAS1600_STATUS_BME (1 << 6) -#define DAS1600_STATUS_ME (1 << 5) -#define DAS1600_STATUS_CD (1 << 4) -#define DAS1600_STATUS_WS (1 << 1) -#define DAS1600_STATUS_CLK_10MHZ (1 << 0) +#define DAS1600_STATUS_BME BIT(6) +#define DAS1600_STATUS_ME BIT(5) +#define DAS1600_STATUS_CD BIT(4) +#define DAS1600_STATUS_WS BIT(1) +#define DAS1600_STATUS_CLK_10MHZ BIT(0) static const struct comedi_lrange range_das1x01_bip = { 4, { -- 1.9.1
[PATCH v1 06/10] Staging: comedi: Prefer using the BIT macro issue in das16.c
This patch Replace all occurences of (1< --- drivers/staging/comedi/drivers/das16.c | 32 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/drivers/staging/comedi/drivers/das16.c b/drivers/staging/comedi/drivers/das16.c index fd8e0b7..69133e3 100644 --- a/drivers/staging/comedi/drivers/das16.c +++ b/drivers/staging/comedi/drivers/das16.c @@ -92,37 +92,37 @@ #define DAS16_AO_LSB_REG(x)((x) ? 0x06 : 0x04) #define DAS16_AO_MSB_REG(x)((x) ? 0x07 : 0x05) #define DAS16_STATUS_REG 0x08 -#define DAS16_STATUS_BUSY (1 << 7) -#define DAS16_STATUS_UNIPOLAR (1 << 6) -#define DAS16_STATUS_MUXBIT(1 << 5) -#define DAS16_STATUS_INT (1 << 4) +#define DAS16_STATUS_BUSY BIT(7) +#define DAS16_STATUS_UNIPOLAR BIT(6) +#define DAS16_STATUS_MUXBITBIT(5) +#define DAS16_STATUS_INT BIT(4) #define DAS16_CTRL_REG 0x09 -#define DAS16_CTRL_INTE(1 << 7) +#define DAS16_CTRL_INTEBIT(7) #define DAS16_CTRL_IRQ(x) (((x) & 0x7) << 4) -#define DAS16_CTRL_DMAE(1 << 2) +#define DAS16_CTRL_DMAEBIT(2) #define DAS16_CTRL_PACING_MASK (3 << 0) #define DAS16_CTRL_INT_PACER (3 << 0) #define DAS16_CTRL_EXT_PACER (2 << 0) #define DAS16_CTRL_SOFT_PACER (0 << 0) #define DAS16_PACER_REG0x0a #define DAS16_PACER_BURST_LEN(x) (((x) & 0xf) << 4) -#define DAS16_PACER_CTR0 (1 << 1) -#define DAS16_PACER_TRIG0 (1 << 0) +#define DAS16_PACER_CTR0 BIT(1) +#define DAS16_PACER_TRIG0 BIT(0) #define DAS16_GAIN_REG 0x0b #define DAS16_TIMER_BASE_REG 0x0c/* to 0x0f */ #define DAS1600_CONV_REG 0x404 -#define DAS1600_CONV_DISABLE (1 << 6) +#define DAS1600_CONV_DISABLE BIT(6) #define DAS1600_BURST_REG 0x405 -#define DAS1600_BURST_VAL (1 << 6) +#define DAS1600_BURST_VAL BIT(6) #define DAS1600_ENABLE_REG 0x406 -#define DAS1600_ENABLE_VAL (1 << 6) +#define DAS1600_ENABLE_VAL BIT(6) #define DAS1600_STATUS_REG 0x407 -#define DAS1600_STATUS_BME (1 << 6) -#define DAS1600_STATUS_ME (1 << 5) -#define DAS1600_STATUS_CD (1 << 4) -#define DAS1600_STATUS_WS (1 << 1) -#define DAS1600_STATUS_CLK_10MHZ (1 << 0) +#define DAS1600_STATUS_BME BIT(6) +#define DAS1600_STATUS_ME BIT(5) +#define DAS1600_STATUS_CD BIT(4) +#define DAS1600_STATUS_WS BIT(1) +#define DAS1600_STATUS_CLK_10MHZ BIT(0) static const struct comedi_lrange range_das1x01_bip = { 4, { -- 1.9.1
[PATCH 04/10] Staging: comedi:Fix a warning issues in me_daq.c
This is a patch to the me_daq.c file that fixes up a WARNING: Prefer 'unsigned int' to bare use of 'unsigned' found by the checkpatch.pl tool. Signed-off-by: Ravishankar Karkala Mallikarjunayya <ravishankark...@gmail.com> --- drivers/staging/comedi/drivers/me_daq.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/comedi/drivers/me_daq.c b/drivers/staging/comedi/drivers/me_daq.c index 3bf0caa..c0b7a30 100644 --- a/drivers/staging/comedi/drivers/me_daq.c +++ b/drivers/staging/comedi/drivers/me_daq.c @@ -150,7 +150,7 @@ struct me_private_data { unsigned short dac_ctrl;/* Mirror of the DAC_CONTROL register */ }; -static inline void sleep(unsigned sec) +static inline void sleep(unsigned int sec) { schedule_timeout_interruptible(sec * HZ); } -- 1.9.1
[PATCH 02/10] Staging: comedi: fix bare use of unsigned issue in ni_65xx.c
This is a patch to the ni_65xx.c file that fixes up a WARNING: Prefer 'unsigned int' to bare use of 'unsigned' found by the checkpatch.pl tool Signed-off-by: Ravishankar Karkala Mallikarjunayya <ravishankark...@gmail.com> --- drivers/staging/comedi/drivers/ni_65xx.c | 18 +- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/staging/comedi/drivers/ni_65xx.c b/drivers/staging/comedi/drivers/ni_65xx.c index 251117b..07f38e3 100644 --- a/drivers/staging/comedi/drivers/ni_65xx.c +++ b/drivers/staging/comedi/drivers/ni_65xx.c @@ -151,10 +151,10 @@ enum ni_65xx_boardid { struct ni_65xx_board { const char *name; - unsigned num_dio_ports; - unsigned num_di_ports; - unsigned num_do_ports; - unsigned legacy_invert:1; + unsigned int num_dio_ports; + unsigned int num_di_ports; + unsigned int num_do_ports; + unsigned int legacy_invert:1; }; static const struct ni_65xx_board ni_65xx_boards[] = { @@ -360,7 +360,7 @@ static int ni_65xx_dio_insn_config(struct comedi_device *dev, unsigned long base_port = (unsigned long)s->private; unsigned int chan = CR_CHAN(insn->chanspec); unsigned int chan_mask = NI_65XX_CHAN_TO_MASK(chan); - unsigned port = base_port + NI_65XX_CHAN_TO_PORT(chan); + unsigned int port = base_port + NI_65XX_CHAN_TO_PORT(chan); unsigned int interval; unsigned int val; @@ -428,14 +428,14 @@ static int ni_65xx_dio_insn_bits(struct comedi_device *dev, unsigned long base_port = (unsigned long)s->private; unsigned int base_chan = CR_CHAN(insn->chanspec); int last_port_offset = NI_65XX_CHAN_TO_PORT(s->n_chan - 1); - unsigned read_bits = 0; + unsigned int read_bits = 0; int port_offset; for (port_offset = NI_65XX_CHAN_TO_PORT(base_chan); port_offset <= last_port_offset; port_offset++) { - unsigned port = base_port + port_offset; + unsigned int port = base_port + port_offset; int base_port_channel = NI_65XX_PORT_TO_CHAN(port_offset); - unsigned port_mask, port_data, bits; + unsigned int port_mask, port_data, bits; int bitshift = base_port_channel - base_chan; if (bitshift >= 32) @@ -640,7 +640,7 @@ static int ni_65xx_auto_attach(struct comedi_device *dev, struct pci_dev *pcidev = comedi_to_pci_dev(dev); const struct ni_65xx_board *board = NULL; struct comedi_subdevice *s; - unsigned i; + unsigned int i; int ret; if (context < ARRAY_SIZE(ni_65xx_boards)) -- 1.9.1
[PATCH 06/10] Staging: comedi: Prefer using the BIT macro issue in das16.c
This patch Replace all occurences of (1<<x) by BIT(x) in the file das16.c to get rid of checkpatch.pl "CHECK" output "Prefer using the BIT macro" Signed-off-by: Ravishankar Karkala Mallikarjunayya <ravishankark...@gmail.com> --- drivers/staging/comedi/drivers/das16.c | 32 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/drivers/staging/comedi/drivers/das16.c b/drivers/staging/comedi/drivers/das16.c index fd8e0b7..69133e3 100644 --- a/drivers/staging/comedi/drivers/das16.c +++ b/drivers/staging/comedi/drivers/das16.c @@ -92,37 +92,37 @@ #define DAS16_AO_LSB_REG(x)((x) ? 0x06 : 0x04) #define DAS16_AO_MSB_REG(x)((x) ? 0x07 : 0x05) #define DAS16_STATUS_REG 0x08 -#define DAS16_STATUS_BUSY (1 << 7) -#define DAS16_STATUS_UNIPOLAR (1 << 6) -#define DAS16_STATUS_MUXBIT(1 << 5) -#define DAS16_STATUS_INT (1 << 4) +#define DAS16_STATUS_BUSY BIT(7) +#define DAS16_STATUS_UNIPOLAR BIT(6) +#define DAS16_STATUS_MUXBITBIT(5) +#define DAS16_STATUS_INT BIT(4) #define DAS16_CTRL_REG 0x09 -#define DAS16_CTRL_INTE(1 << 7) +#define DAS16_CTRL_INTEBIT(7) #define DAS16_CTRL_IRQ(x) (((x) & 0x7) << 4) -#define DAS16_CTRL_DMAE(1 << 2) +#define DAS16_CTRL_DMAEBIT(2) #define DAS16_CTRL_PACING_MASK (3 << 0) #define DAS16_CTRL_INT_PACER (3 << 0) #define DAS16_CTRL_EXT_PACER (2 << 0) #define DAS16_CTRL_SOFT_PACER (0 << 0) #define DAS16_PACER_REG0x0a #define DAS16_PACER_BURST_LEN(x) (((x) & 0xf) << 4) -#define DAS16_PACER_CTR0 (1 << 1) -#define DAS16_PACER_TRIG0 (1 << 0) +#define DAS16_PACER_CTR0 BIT(1) +#define DAS16_PACER_TRIG0 BIT(0) #define DAS16_GAIN_REG 0x0b #define DAS16_TIMER_BASE_REG 0x0c/* to 0x0f */ #define DAS1600_CONV_REG 0x404 -#define DAS1600_CONV_DISABLE (1 << 6) +#define DAS1600_CONV_DISABLE BIT(6) #define DAS1600_BURST_REG 0x405 -#define DAS1600_BURST_VAL (1 << 6) +#define DAS1600_BURST_VAL BIT(6) #define DAS1600_ENABLE_REG 0x406 -#define DAS1600_ENABLE_VAL (1 << 6) +#define DAS1600_ENABLE_VAL BIT(6) #define DAS1600_STATUS_REG 0x407 -#define DAS1600_STATUS_BME (1 << 6) -#define DAS1600_STATUS_ME (1 << 5) -#define DAS1600_STATUS_CD (1 << 4) -#define DAS1600_STATUS_WS (1 << 1) -#define DAS1600_STATUS_CLK_10MHZ (1 << 0) +#define DAS1600_STATUS_BME BIT(6) +#define DAS1600_STATUS_ME BIT(5) +#define DAS1600_STATUS_CD BIT(4) +#define DAS1600_STATUS_WS BIT(1) +#define DAS1600_STATUS_CLK_10MHZ BIT(0) static const struct comedi_lrange range_das1x01_bip = { 4, { -- 1.9.1
[PATCH 04/10] Staging: comedi:Fix a warning issues in me_daq.c
This is a patch to the me_daq.c file that fixes up a WARNING: Prefer 'unsigned int' to bare use of 'unsigned' found by the checkpatch.pl tool. Signed-off-by: Ravishankar Karkala Mallikarjunayya --- drivers/staging/comedi/drivers/me_daq.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/comedi/drivers/me_daq.c b/drivers/staging/comedi/drivers/me_daq.c index 3bf0caa..c0b7a30 100644 --- a/drivers/staging/comedi/drivers/me_daq.c +++ b/drivers/staging/comedi/drivers/me_daq.c @@ -150,7 +150,7 @@ struct me_private_data { unsigned short dac_ctrl;/* Mirror of the DAC_CONTROL register */ }; -static inline void sleep(unsigned sec) +static inline void sleep(unsigned int sec) { schedule_timeout_interruptible(sec * HZ); } -- 1.9.1
[PATCH 02/10] Staging: comedi: fix bare use of unsigned issue in ni_65xx.c
This is a patch to the ni_65xx.c file that fixes up a WARNING: Prefer 'unsigned int' to bare use of 'unsigned' found by the checkpatch.pl tool Signed-off-by: Ravishankar Karkala Mallikarjunayya --- drivers/staging/comedi/drivers/ni_65xx.c | 18 +- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/staging/comedi/drivers/ni_65xx.c b/drivers/staging/comedi/drivers/ni_65xx.c index 251117b..07f38e3 100644 --- a/drivers/staging/comedi/drivers/ni_65xx.c +++ b/drivers/staging/comedi/drivers/ni_65xx.c @@ -151,10 +151,10 @@ enum ni_65xx_boardid { struct ni_65xx_board { const char *name; - unsigned num_dio_ports; - unsigned num_di_ports; - unsigned num_do_ports; - unsigned legacy_invert:1; + unsigned int num_dio_ports; + unsigned int num_di_ports; + unsigned int num_do_ports; + unsigned int legacy_invert:1; }; static const struct ni_65xx_board ni_65xx_boards[] = { @@ -360,7 +360,7 @@ static int ni_65xx_dio_insn_config(struct comedi_device *dev, unsigned long base_port = (unsigned long)s->private; unsigned int chan = CR_CHAN(insn->chanspec); unsigned int chan_mask = NI_65XX_CHAN_TO_MASK(chan); - unsigned port = base_port + NI_65XX_CHAN_TO_PORT(chan); + unsigned int port = base_port + NI_65XX_CHAN_TO_PORT(chan); unsigned int interval; unsigned int val; @@ -428,14 +428,14 @@ static int ni_65xx_dio_insn_bits(struct comedi_device *dev, unsigned long base_port = (unsigned long)s->private; unsigned int base_chan = CR_CHAN(insn->chanspec); int last_port_offset = NI_65XX_CHAN_TO_PORT(s->n_chan - 1); - unsigned read_bits = 0; + unsigned int read_bits = 0; int port_offset; for (port_offset = NI_65XX_CHAN_TO_PORT(base_chan); port_offset <= last_port_offset; port_offset++) { - unsigned port = base_port + port_offset; + unsigned int port = base_port + port_offset; int base_port_channel = NI_65XX_PORT_TO_CHAN(port_offset); - unsigned port_mask, port_data, bits; + unsigned int port_mask, port_data, bits; int bitshift = base_port_channel - base_chan; if (bitshift >= 32) @@ -640,7 +640,7 @@ static int ni_65xx_auto_attach(struct comedi_device *dev, struct pci_dev *pcidev = comedi_to_pci_dev(dev); const struct ni_65xx_board *board = NULL; struct comedi_subdevice *s; - unsigned i; + unsigned int i; int ret; if (context < ARRAY_SIZE(ni_65xx_boards)) -- 1.9.1
[PATCH 06/10] Staging: comedi: Prefer using the BIT macro issue in das16.c
This patch Replace all occurences of (1< --- drivers/staging/comedi/drivers/das16.c | 32 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/drivers/staging/comedi/drivers/das16.c b/drivers/staging/comedi/drivers/das16.c index fd8e0b7..69133e3 100644 --- a/drivers/staging/comedi/drivers/das16.c +++ b/drivers/staging/comedi/drivers/das16.c @@ -92,37 +92,37 @@ #define DAS16_AO_LSB_REG(x)((x) ? 0x06 : 0x04) #define DAS16_AO_MSB_REG(x)((x) ? 0x07 : 0x05) #define DAS16_STATUS_REG 0x08 -#define DAS16_STATUS_BUSY (1 << 7) -#define DAS16_STATUS_UNIPOLAR (1 << 6) -#define DAS16_STATUS_MUXBIT(1 << 5) -#define DAS16_STATUS_INT (1 << 4) +#define DAS16_STATUS_BUSY BIT(7) +#define DAS16_STATUS_UNIPOLAR BIT(6) +#define DAS16_STATUS_MUXBITBIT(5) +#define DAS16_STATUS_INT BIT(4) #define DAS16_CTRL_REG 0x09 -#define DAS16_CTRL_INTE(1 << 7) +#define DAS16_CTRL_INTEBIT(7) #define DAS16_CTRL_IRQ(x) (((x) & 0x7) << 4) -#define DAS16_CTRL_DMAE(1 << 2) +#define DAS16_CTRL_DMAEBIT(2) #define DAS16_CTRL_PACING_MASK (3 << 0) #define DAS16_CTRL_INT_PACER (3 << 0) #define DAS16_CTRL_EXT_PACER (2 << 0) #define DAS16_CTRL_SOFT_PACER (0 << 0) #define DAS16_PACER_REG0x0a #define DAS16_PACER_BURST_LEN(x) (((x) & 0xf) << 4) -#define DAS16_PACER_CTR0 (1 << 1) -#define DAS16_PACER_TRIG0 (1 << 0) +#define DAS16_PACER_CTR0 BIT(1) +#define DAS16_PACER_TRIG0 BIT(0) #define DAS16_GAIN_REG 0x0b #define DAS16_TIMER_BASE_REG 0x0c/* to 0x0f */ #define DAS1600_CONV_REG 0x404 -#define DAS1600_CONV_DISABLE (1 << 6) +#define DAS1600_CONV_DISABLE BIT(6) #define DAS1600_BURST_REG 0x405 -#define DAS1600_BURST_VAL (1 << 6) +#define DAS1600_BURST_VAL BIT(6) #define DAS1600_ENABLE_REG 0x406 -#define DAS1600_ENABLE_VAL (1 << 6) +#define DAS1600_ENABLE_VAL BIT(6) #define DAS1600_STATUS_REG 0x407 -#define DAS1600_STATUS_BME (1 << 6) -#define DAS1600_STATUS_ME (1 << 5) -#define DAS1600_STATUS_CD (1 << 4) -#define DAS1600_STATUS_WS (1 << 1) -#define DAS1600_STATUS_CLK_10MHZ (1 << 0) +#define DAS1600_STATUS_BME BIT(6) +#define DAS1600_STATUS_ME BIT(5) +#define DAS1600_STATUS_CD BIT(4) +#define DAS1600_STATUS_WS BIT(1) +#define DAS1600_STATUS_CLK_10MHZ BIT(0) static const struct comedi_lrange range_das1x01_bip = { 4, { -- 1.9.1
[PATCH 07/10] Staging: comedi: fix BIT macro issue in das6402.c
This patch Replace all occurences of (1<<x) by BIT(x) in the file das6402.c to get rid of checkpatch.pl "CHECK" output "Prefer using the BIT macro" Signed-off-by: Ravishankar Karkala Mallikarjunayya <ravishankark...@gmail.com> --- drivers/staging/comedi/drivers/das6402.c | 56 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/drivers/staging/comedi/drivers/das6402.c b/drivers/staging/comedi/drivers/das6402.c index 1701294..f6319b3 100644 --- a/drivers/staging/comedi/drivers/das6402.c +++ b/drivers/staging/comedi/drivers/das6402.c @@ -50,48 +50,48 @@ #define DAS6402_AO_LSB_REG(x) (0x04 + ((x) * 2)) #define DAS6402_AO_MSB_REG(x) (0x05 + ((x) * 2)) #define DAS6402_STATUS_REG 0x08 -#define DAS6402_STATUS_FFNE(1 << 0) -#define DAS6402_STATUS_FHALF (1 << 1) -#define DAS6402_STATUS_FFULL (1 << 2) -#define DAS6402_STATUS_XINT(1 << 3) -#define DAS6402_STATUS_INT (1 << 4) -#define DAS6402_STATUS_XTRIG (1 << 5) -#define DAS6402_STATUS_INDGT (1 << 6) -#define DAS6402_STATUS_10MHZ (1 << 7) -#define DAS6402_STATUS_W_CLRINT(1 << 0) -#define DAS6402_STATUS_W_CLRXTR(1 << 1) -#define DAS6402_STATUS_W_CLRXIN(1 << 2) -#define DAS6402_STATUS_W_EXTEND(1 << 4) -#define DAS6402_STATUS_W_ARMED (1 << 5) -#define DAS6402_STATUS_W_POSTMODE (1 << 6) -#define DAS6402_STATUS_W_10MHZ (1 << 7) +#define DAS6402_STATUS_FFNEBIT(0) +#define DAS6402_STATUS_FHALF BIT(1) +#define DAS6402_STATUS_FFULL BIT(2) +#define DAS6402_STATUS_XINTBIT(3) +#define DAS6402_STATUS_INT BIT(4) +#define DAS6402_STATUS_XTRIG BIT(5) +#define DAS6402_STATUS_INDGT BIT(6) +#define DAS6402_STATUS_10MHZ BIT(7) +#define DAS6402_STATUS_W_CLRINTBIT(0) +#define DAS6402_STATUS_W_CLRXTRBIT(1) +#define DAS6402_STATUS_W_CLRXINBIT(2) +#define DAS6402_STATUS_W_EXTENDBIT(4) +#define DAS6402_STATUS_W_ARMED BIT(5) +#define DAS6402_STATUS_W_POSTMODE BIT(6) +#define DAS6402_STATUS_W_10MHZ BIT(7) #define DAS6402_CTRL_REG 0x09 #define DAS6402_CTRL_SOFT_TRIG (0 << 0) -#define DAS6402_CTRL_EXT_FALL_TRIG (1 << 0) +#define DAS6402_CTRL_EXT_FALL_TRIG BIT(0) #define DAS6402_CTRL_EXT_RISE_TRIG (2 << 0) #define DAS6402_CTRL_PACER_TRIG(3 << 0) -#define DAS6402_CTRL_BURSTEN (1 << 2) -#define DAS6402_CTRL_XINTE (1 << 3) +#define DAS6402_CTRL_BURSTEN BIT(2) +#define DAS6402_CTRL_XINTE BIT(3) #define DAS6402_CTRL_IRQ(x)((x) << 4) -#define DAS6402_CTRL_INTE (1 << 7) +#define DAS6402_CTRL_INTE BIT(7) #define DAS6402_TRIG_REG 0x0a -#define DAS6402_TRIG_TGEN (1 << 0) -#define DAS6402_TRIG_TGSEL (1 << 1) -#define DAS6402_TRIG_TGPOL (1 << 2) -#define DAS6402_TRIG_PRETRIG (1 << 3) +#define DAS6402_TRIG_TGEN BIT(0) +#define DAS6402_TRIG_TGSEL BIT(1) +#define DAS6402_TRIG_TGPOL BIT(2) +#define DAS6402_TRIG_PRETRIG BIT(3) #define DAS6402_AO_RANGE(_chan, _range)((_range) << ((_chan) ? 6 : 4)) #define DAS6402_AO_RANGE_MASK(_chan) (3 << ((_chan) ? 6 : 4)) #define DAS6402_MODE_REG 0x0b #define DAS6402_MODE_RANGE(x) ((x) << 0) #define DAS6402_MODE_POLLED(0 << 2) -#define DAS6402_MODE_FIFONEPTY (1 << 2) +#define DAS6402_MODE_FIFONEPTY BIT(2) #define DAS6402_MODE_FIFOHFULL (2 << 2) #define DAS6402_MODE_EOB (3 << 2) -#define DAS6402_MODE_ENHANCED (1 << 4) -#define DAS6402_MODE_SE(1 << 5) -#define DAS6402_MODE_UNI (1 << 6) +#define DAS6402_MODE_ENHANCED BIT(4) +#define DAS6402_MODE_SEBIT(5) +#define DAS6402_MODE_UNI BIT(6) #define DAS6402_MODE_DMA1 (0 << 7) -#define DAS6402_MODE_DMA3 (1 << 7) +#define DAS6402_MODE_DMA3 BIT(7) #define DAS6402_TIMER_BASE 0x0c static const struct comedi_lrange das6402_ai_ranges = { -- 1.9.1
[PATCH 07/10] Staging: comedi: fix BIT macro issue in das6402.c
This patch Replace all occurences of (1< --- drivers/staging/comedi/drivers/das6402.c | 56 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/drivers/staging/comedi/drivers/das6402.c b/drivers/staging/comedi/drivers/das6402.c index 1701294..f6319b3 100644 --- a/drivers/staging/comedi/drivers/das6402.c +++ b/drivers/staging/comedi/drivers/das6402.c @@ -50,48 +50,48 @@ #define DAS6402_AO_LSB_REG(x) (0x04 + ((x) * 2)) #define DAS6402_AO_MSB_REG(x) (0x05 + ((x) * 2)) #define DAS6402_STATUS_REG 0x08 -#define DAS6402_STATUS_FFNE(1 << 0) -#define DAS6402_STATUS_FHALF (1 << 1) -#define DAS6402_STATUS_FFULL (1 << 2) -#define DAS6402_STATUS_XINT(1 << 3) -#define DAS6402_STATUS_INT (1 << 4) -#define DAS6402_STATUS_XTRIG (1 << 5) -#define DAS6402_STATUS_INDGT (1 << 6) -#define DAS6402_STATUS_10MHZ (1 << 7) -#define DAS6402_STATUS_W_CLRINT(1 << 0) -#define DAS6402_STATUS_W_CLRXTR(1 << 1) -#define DAS6402_STATUS_W_CLRXIN(1 << 2) -#define DAS6402_STATUS_W_EXTEND(1 << 4) -#define DAS6402_STATUS_W_ARMED (1 << 5) -#define DAS6402_STATUS_W_POSTMODE (1 << 6) -#define DAS6402_STATUS_W_10MHZ (1 << 7) +#define DAS6402_STATUS_FFNEBIT(0) +#define DAS6402_STATUS_FHALF BIT(1) +#define DAS6402_STATUS_FFULL BIT(2) +#define DAS6402_STATUS_XINTBIT(3) +#define DAS6402_STATUS_INT BIT(4) +#define DAS6402_STATUS_XTRIG BIT(5) +#define DAS6402_STATUS_INDGT BIT(6) +#define DAS6402_STATUS_10MHZ BIT(7) +#define DAS6402_STATUS_W_CLRINTBIT(0) +#define DAS6402_STATUS_W_CLRXTRBIT(1) +#define DAS6402_STATUS_W_CLRXINBIT(2) +#define DAS6402_STATUS_W_EXTENDBIT(4) +#define DAS6402_STATUS_W_ARMED BIT(5) +#define DAS6402_STATUS_W_POSTMODE BIT(6) +#define DAS6402_STATUS_W_10MHZ BIT(7) #define DAS6402_CTRL_REG 0x09 #define DAS6402_CTRL_SOFT_TRIG (0 << 0) -#define DAS6402_CTRL_EXT_FALL_TRIG (1 << 0) +#define DAS6402_CTRL_EXT_FALL_TRIG BIT(0) #define DAS6402_CTRL_EXT_RISE_TRIG (2 << 0) #define DAS6402_CTRL_PACER_TRIG(3 << 0) -#define DAS6402_CTRL_BURSTEN (1 << 2) -#define DAS6402_CTRL_XINTE (1 << 3) +#define DAS6402_CTRL_BURSTEN BIT(2) +#define DAS6402_CTRL_XINTE BIT(3) #define DAS6402_CTRL_IRQ(x)((x) << 4) -#define DAS6402_CTRL_INTE (1 << 7) +#define DAS6402_CTRL_INTE BIT(7) #define DAS6402_TRIG_REG 0x0a -#define DAS6402_TRIG_TGEN (1 << 0) -#define DAS6402_TRIG_TGSEL (1 << 1) -#define DAS6402_TRIG_TGPOL (1 << 2) -#define DAS6402_TRIG_PRETRIG (1 << 3) +#define DAS6402_TRIG_TGEN BIT(0) +#define DAS6402_TRIG_TGSEL BIT(1) +#define DAS6402_TRIG_TGPOL BIT(2) +#define DAS6402_TRIG_PRETRIG BIT(3) #define DAS6402_AO_RANGE(_chan, _range)((_range) << ((_chan) ? 6 : 4)) #define DAS6402_AO_RANGE_MASK(_chan) (3 << ((_chan) ? 6 : 4)) #define DAS6402_MODE_REG 0x0b #define DAS6402_MODE_RANGE(x) ((x) << 0) #define DAS6402_MODE_POLLED(0 << 2) -#define DAS6402_MODE_FIFONEPTY (1 << 2) +#define DAS6402_MODE_FIFONEPTY BIT(2) #define DAS6402_MODE_FIFOHFULL (2 << 2) #define DAS6402_MODE_EOB (3 << 2) -#define DAS6402_MODE_ENHANCED (1 << 4) -#define DAS6402_MODE_SE(1 << 5) -#define DAS6402_MODE_UNI (1 << 6) +#define DAS6402_MODE_ENHANCED BIT(4) +#define DAS6402_MODE_SEBIT(5) +#define DAS6402_MODE_UNI BIT(6) #define DAS6402_MODE_DMA1 (0 << 7) -#define DAS6402_MODE_DMA3 (1 << 7) +#define DAS6402_MODE_DMA3 BIT(7) #define DAS6402_TIMER_BASE 0x0c static const struct comedi_lrange das6402_ai_ranges = { -- 1.9.1
[PATCH 10/10] Staging: comedi: Preferd unsigned int instead of unsigned in comedi_bond.c
This is a patch to the comedi_bond.c file that fixes up a WARNING: Prefer 'unsigned int' to bare use of 'unsigned' found by the checkpatch.pl tool. Signed-off-by: Ravishankar Karkala Mallikarjunayya <ravishankark...@gmail.com> --- drivers/staging/comedi/drivers/comedi_bond.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/staging/comedi/drivers/comedi_bond.c b/drivers/staging/comedi/drivers/comedi_bond.c index 50b76ec..64a5ea3 100644 --- a/drivers/staging/comedi/drivers/comedi_bond.c +++ b/drivers/staging/comedi/drivers/comedi_bond.c @@ -55,16 +55,16 @@ struct bonded_device { struct comedi_device *dev; - unsigned minor; - unsigned subdev; - unsigned nchans; + unsigned int minor; + unsigned int subdev; + unsigned int nchans; }; struct comedi_bond_private { char name[256]; struct bonded_device **devs; - unsigned ndevs; - unsigned nchans; + unsigned int ndevs; + unsigned int nchans; }; static int bonding_dio_insn_bits(struct comedi_device *dev, -- 1.9.1
[PATCH 09/10] Staging: comedi: Block comment issue fixed for das16m1.c
This is a patch to the das16m1.c file that fixes up a WARNING: 'Block comments use a trailing */ on a separate line' found by the checkpatch.pl tool. Signed-off-by: Ravishankar Karkala Mallikarjunayya <ravishankark...@gmail.com> --- drivers/staging/comedi/drivers/das16m1.c | 168 --- 1 file changed, 89 insertions(+), 79 deletions(-) diff --git a/drivers/staging/comedi/drivers/das16m1.c b/drivers/staging/comedi/drivers/das16m1.c index 3a37373..c71a7e0 100644 --- a/drivers/staging/comedi/drivers/das16m1.c +++ b/drivers/staging/comedi/drivers/das16m1.c @@ -1,56 +1,56 @@ /* -comedi/drivers/das16m1.c -CIO-DAS16/M1 driver -Author: Frank Mori Hess, based on code from the das16 - driver. -Copyright (C) 2001 Frank Mori Hess <fmh...@users.sourceforge.net> - -COMEDI - Linux Control and Measurement Device Interface -Copyright (C) 2000 David A. Schleef <d...@schleef.org> - -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. -*/ + * comedi/drivers/das16m1.c + * CIO-DAS16/M1 driver + * Author: Frank Mori Hess, based on code from the das16 + * driver. + * Copyright (C) 2001 Frank Mori Hess <fmh...@users.sourceforge.net> + * + * COMEDI - Linux Control and Measurement Device Interface + * Copyright (C) 2000 David A. Schleef <d...@schleef.org> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ /* -Driver: das16m1 -Description: CIO-DAS16/M1 -Author: Frank Mori Hess <fmh...@users.sourceforge.net> -Devices: [Measurement Computing] CIO-DAS16/M1 (das16m1) -Status: works - -This driver supports a single board - the CIO-DAS16/M1. -As far as I know, there are no other boards that have -the same register layout. Even the CIO-DAS16/M1/16 is -significantly different. - -I was _barely_ able to reach the full 1 MHz capability -of this board, using a hard real-time interrupt -(set the TRIG_RT flag in your struct comedi_cmd and use -rtlinux or RTAI). The board can't do dma, so the bottleneck is -pulling the data across the ISA bus. I timed the interrupt -handler, and it took my computer ~470 microseconds to pull 512 -samples from the board. So at 1 Mhz sampling rate, -expect your CPU to be spending almost all of its -time in the interrupt handler. - -This board has some unusual restrictions for its channel/gain list. If the -list has 2 or more channels in it, then two conditions must be satisfied: -(1) - even/odd channels must appear at even/odd indices in the list -(2) - the list must have an even number of entries. - -Options: - [0] - base io address - [1] - irq (optional, but you probably want it) - -irq can be omitted, although the cmd interface will not work without it. -*/ + * Driver: das16m1 + * Description: CIO-DAS16/M1 + * Author: Frank Mori Hess <fmh...@users.sourceforge.net> + * Devices: [Measurement Computing] CIO-DAS16/M1 (das16m1) + * Status: works + * + * This driver supports a single board - the CIO-DAS16/M1. + * As far as I know, there are no other boards that have + * the same register layout. Even the CIO-DAS16/M1/16 is + * significantly different. + * + * I was _barely_ able to reach the full 1 MHz capability + * of this board, using a hard real-time interrupt + * (set the TRIG_RT flag in your struct comedi_cmd and use + * rtlinux or RTAI). The board can't do dma, so the bottleneck is + * pulling the data across the ISA bus. I timed the interrupt + * handler, and it took my computer ~470 microseconds to pull 512 + * samples from the board. So at 1 Mhz sampling rate, + * expect your CPU to be spending almost all of its + * time in the interrupt handler. + * + * This board has some unusual restrictions for its channel/gain list. If the + * list has 2 or more channels in it, then two conditions must be satisfied: + * (1) - even/odd channels must appear at even/odd indices in the list + * (2) - the list must have an even number of entries. + * + * Options: + * [0] - base io address + * [1] - irq (optional, but you probably want it) + * + * irq can be omitted, althou
[PATCH 08/10] Staging: comedi: Used unsigned int instead of unsigned issue in jr3_pci.c
This is a patch to the jr3_pci.c file that fixes up a WARNING: Prefer 'unsigned int' to bare use of 'unsigned' found by the checkpatch.pl tool. Signed-off-by: Ravishankar Karkala Mallikarjunayya <ravishankark...@gmail.com> --- drivers/staging/comedi/drivers/jr3_pci.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/comedi/drivers/jr3_pci.c b/drivers/staging/comedi/drivers/jr3_pci.c index fa0d4b1..6c4ff02 100644 --- a/drivers/staging/comedi/drivers/jr3_pci.c +++ b/drivers/staging/comedi/drivers/jr3_pci.c @@ -231,7 +231,7 @@ static unsigned int jr3_pci_ai_read_chan(struct comedi_device *dev, if (chan < 56) { unsigned int axis = chan % 8; - unsigned filter = chan / 8; + unsigned int filter = chan / 8; switch (axis) { case 0: @@ -690,7 +690,7 @@ static int jr3_pci_auto_attach(struct comedi_device *dev, if (sizeof(struct jr3_channel) != 0xc00) { dev_err(dev->class_dev, "sizeof(struct jr3_channel) = %x [expected %x]\n", - (unsigned)sizeof(struct jr3_channel), 0xc00); + (unsigned int)sizeof(struct jr3_channel), 0xc00); return -EINVAL; } -- 1.9.1
[PATCH 09/10] Staging: comedi: Block comment issue fixed for das16m1.c
This is a patch to the das16m1.c file that fixes up a WARNING: 'Block comments use a trailing */ on a separate line' found by the checkpatch.pl tool. Signed-off-by: Ravishankar Karkala Mallikarjunayya --- drivers/staging/comedi/drivers/das16m1.c | 168 --- 1 file changed, 89 insertions(+), 79 deletions(-) diff --git a/drivers/staging/comedi/drivers/das16m1.c b/drivers/staging/comedi/drivers/das16m1.c index 3a37373..c71a7e0 100644 --- a/drivers/staging/comedi/drivers/das16m1.c +++ b/drivers/staging/comedi/drivers/das16m1.c @@ -1,56 +1,56 @@ /* -comedi/drivers/das16m1.c -CIO-DAS16/M1 driver -Author: Frank Mori Hess, based on code from the das16 - driver. -Copyright (C) 2001 Frank Mori Hess - -COMEDI - Linux Control and Measurement Device Interface -Copyright (C) 2000 David A. Schleef - -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. -*/ + * comedi/drivers/das16m1.c + * CIO-DAS16/M1 driver + * Author: Frank Mori Hess, based on code from the das16 + * driver. + * Copyright (C) 2001 Frank Mori Hess + * + * COMEDI - Linux Control and Measurement Device Interface + * Copyright (C) 2000 David A. Schleef + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ /* -Driver: das16m1 -Description: CIO-DAS16/M1 -Author: Frank Mori Hess -Devices: [Measurement Computing] CIO-DAS16/M1 (das16m1) -Status: works - -This driver supports a single board - the CIO-DAS16/M1. -As far as I know, there are no other boards that have -the same register layout. Even the CIO-DAS16/M1/16 is -significantly different. - -I was _barely_ able to reach the full 1 MHz capability -of this board, using a hard real-time interrupt -(set the TRIG_RT flag in your struct comedi_cmd and use -rtlinux or RTAI). The board can't do dma, so the bottleneck is -pulling the data across the ISA bus. I timed the interrupt -handler, and it took my computer ~470 microseconds to pull 512 -samples from the board. So at 1 Mhz sampling rate, -expect your CPU to be spending almost all of its -time in the interrupt handler. - -This board has some unusual restrictions for its channel/gain list. If the -list has 2 or more channels in it, then two conditions must be satisfied: -(1) - even/odd channels must appear at even/odd indices in the list -(2) - the list must have an even number of entries. - -Options: - [0] - base io address - [1] - irq (optional, but you probably want it) - -irq can be omitted, although the cmd interface will not work without it. -*/ + * Driver: das16m1 + * Description: CIO-DAS16/M1 + * Author: Frank Mori Hess + * Devices: [Measurement Computing] CIO-DAS16/M1 (das16m1) + * Status: works + * + * This driver supports a single board - the CIO-DAS16/M1. + * As far as I know, there are no other boards that have + * the same register layout. Even the CIO-DAS16/M1/16 is + * significantly different. + * + * I was _barely_ able to reach the full 1 MHz capability + * of this board, using a hard real-time interrupt + * (set the TRIG_RT flag in your struct comedi_cmd and use + * rtlinux or RTAI). The board can't do dma, so the bottleneck is + * pulling the data across the ISA bus. I timed the interrupt + * handler, and it took my computer ~470 microseconds to pull 512 + * samples from the board. So at 1 Mhz sampling rate, + * expect your CPU to be spending almost all of its + * time in the interrupt handler. + * + * This board has some unusual restrictions for its channel/gain list. If the + * list has 2 or more channels in it, then two conditions must be satisfied: + * (1) - even/odd channels must appear at even/odd indices in the list + * (2) - the list must have an even number of entries. + * + * Options: + * [0] - base io address + * [1] - irq (optional, but you probably want it) + * + * irq can be omitted, although the cmd interface will not work without it. + */ #include #include @@ -65,24 +65,24 @@ irq can be omitted, although the cmd interface will not work without it. #define FIFO_SIZE 1024 /* 1024 sample fifo
[PATCH 08/10] Staging: comedi: Used unsigned int instead of unsigned issue in jr3_pci.c
This is a patch to the jr3_pci.c file that fixes up a WARNING: Prefer 'unsigned int' to bare use of 'unsigned' found by the checkpatch.pl tool. Signed-off-by: Ravishankar Karkala Mallikarjunayya --- drivers/staging/comedi/drivers/jr3_pci.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/comedi/drivers/jr3_pci.c b/drivers/staging/comedi/drivers/jr3_pci.c index fa0d4b1..6c4ff02 100644 --- a/drivers/staging/comedi/drivers/jr3_pci.c +++ b/drivers/staging/comedi/drivers/jr3_pci.c @@ -231,7 +231,7 @@ static unsigned int jr3_pci_ai_read_chan(struct comedi_device *dev, if (chan < 56) { unsigned int axis = chan % 8; - unsigned filter = chan / 8; + unsigned int filter = chan / 8; switch (axis) { case 0: @@ -690,7 +690,7 @@ static int jr3_pci_auto_attach(struct comedi_device *dev, if (sizeof(struct jr3_channel) != 0xc00) { dev_err(dev->class_dev, "sizeof(struct jr3_channel) = %x [expected %x]\n", - (unsigned)sizeof(struct jr3_channel), 0xc00); + (unsigned int)sizeof(struct jr3_channel), 0xc00); return -EINVAL; } -- 1.9.1
[PATCH 10/10] Staging: comedi: Preferd unsigned int instead of unsigned in comedi_bond.c
This is a patch to the comedi_bond.c file that fixes up a WARNING: Prefer 'unsigned int' to bare use of 'unsigned' found by the checkpatch.pl tool. Signed-off-by: Ravishankar Karkala Mallikarjunayya --- drivers/staging/comedi/drivers/comedi_bond.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/staging/comedi/drivers/comedi_bond.c b/drivers/staging/comedi/drivers/comedi_bond.c index 50b76ec..64a5ea3 100644 --- a/drivers/staging/comedi/drivers/comedi_bond.c +++ b/drivers/staging/comedi/drivers/comedi_bond.c @@ -55,16 +55,16 @@ struct bonded_device { struct comedi_device *dev; - unsigned minor; - unsigned subdev; - unsigned nchans; + unsigned int minor; + unsigned int subdev; + unsigned int nchans; }; struct comedi_bond_private { char name[256]; struct bonded_device **devs; - unsigned ndevs; - unsigned nchans; + unsigned int ndevs; + unsigned int nchans; }; static int bonding_dio_insn_bits(struct comedi_device *dev, -- 1.9.1
[PATCH 05/10] Staging: comedi: Fix comment issues in jr3_pci.c
This is a patch to the jr3_pci.c file that fixes up a WARNING: 'Block comments use a trailing */ on a separate line' found by the checkpatch.pl tool. Signed-off-by: Ravishankar Karkala Mallikarjunayya <ravishankark...@gmail.com> --- drivers/staging/comedi/drivers/jr3_pci.c | 32 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/drivers/staging/comedi/drivers/jr3_pci.c b/drivers/staging/comedi/drivers/jr3_pci.c index b87192e..fa0d4b1 100644 --- a/drivers/staging/comedi/drivers/jr3_pci.c +++ b/drivers/staging/comedi/drivers/jr3_pci.c @@ -1,20 +1,20 @@ /* - comedi/drivers/jr3_pci.c - hardware driver for JR3/PCI force sensor board - - COMEDI - Linux Control and Measurement Device Interface - Copyright (C) 2007 Anders Blomdell <anders.blomd...@control.lth.se> - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. -*/ + * comedi/drivers/jr3_pci.c + * hardware driver for JR3/PCI force sensor board + * + * COMEDI - Linux Control and Measurement Device Interface + * Copyright (C) 2007 Anders Blomdell <anders.blomd...@control.lth.se> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ /* * Driver: jr3_pci * Description: JR3/PCI force sensor board -- 1.9.1
[PATCH 05/10] Staging: comedi: Fix comment issues in jr3_pci.c
This is a patch to the jr3_pci.c file that fixes up a WARNING: 'Block comments use a trailing */ on a separate line' found by the checkpatch.pl tool. Signed-off-by: Ravishankar Karkala Mallikarjunayya --- drivers/staging/comedi/drivers/jr3_pci.c | 32 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/drivers/staging/comedi/drivers/jr3_pci.c b/drivers/staging/comedi/drivers/jr3_pci.c index b87192e..fa0d4b1 100644 --- a/drivers/staging/comedi/drivers/jr3_pci.c +++ b/drivers/staging/comedi/drivers/jr3_pci.c @@ -1,20 +1,20 @@ /* - comedi/drivers/jr3_pci.c - hardware driver for JR3/PCI force sensor board - - COMEDI - Linux Control and Measurement Device Interface - Copyright (C) 2007 Anders Blomdell - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. -*/ + * comedi/drivers/jr3_pci.c + * hardware driver for JR3/PCI force sensor board + * + * COMEDI - Linux Control and Measurement Device Interface + * Copyright (C) 2007 Anders Blomdell + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ /* * Driver: jr3_pci * Description: JR3/PCI force sensor board -- 1.9.1
[PATCH 03/10] Staging: comedi: Indentation issue in mpc624.c
This is a patch to the mpc624.c file that fixes up a WARNING: 'Statements should start on a tabstop' found by the checkpatch.pl tool. Signed-off-by: Ravishankar Karkala Mallikarjunayya <ravishankark...@gmail.com> --- drivers/staging/comedi/drivers/mpc624.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/comedi/drivers/mpc624.c b/drivers/staging/comedi/drivers/mpc624.c index 826e439..9bda761 100644 --- a/drivers/staging/comedi/drivers/mpc624.c +++ b/drivers/staging/comedi/drivers/mpc624.c @@ -103,7 +103,7 @@ static const struct comedi_lrange range_mpc624_bipolar1 = { /* BIP_RANGE(1.01) this is correct, */ /* but my MPC-624 actually seems to have a range of 2.02 */ BIP_RANGE(2.02) -} + } }; static const struct comedi_lrange range_mpc624_bipolar10 = { @@ -112,7 +112,7 @@ static const struct comedi_lrange range_mpc624_bipolar10 = { /* BIP_RANGE(10.1) this is correct, */ /* but my MPC-624 actually seems to have a range of 20.2 */ BIP_RANGE(20.2) -} + } }; static unsigned int mpc624_ai_get_sample(struct comedi_device *dev, -- 1.9.1
[PATCH 01/10] Staging: comedi: Use unsigned int instead of unsigned issue in pcmuio.c
This is a patch to the pcmuio.c file that fixes up a WARNING: Prefer 'unsigned int' to bare use of 'unsigned' found by the checkpatch.pl tool. Signed-off-by: Ravishankar Karkala Mallikarjunayya <ravishankark...@gmail.com> --- drivers/staging/comedi/drivers/pcmuio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/comedi/drivers/pcmuio.c b/drivers/staging/comedi/drivers/pcmuio.c index 7ea8130..8ad64f2 100644 --- a/drivers/staging/comedi/drivers/pcmuio.c +++ b/drivers/staging/comedi/drivers/pcmuio.c @@ -307,7 +307,7 @@ static void pcmuio_stop_intr(struct comedi_device *dev, static void pcmuio_handle_intr_subdev(struct comedi_device *dev, struct comedi_subdevice *s, - unsigned triggered) + unsigned int triggered) { struct pcmuio_private *devpriv = dev->private; int asic = pcmuio_subdevice_to_asic(s); -- 1.9.1
[PATCH 03/10] Staging: comedi: Indentation issue in mpc624.c
This is a patch to the mpc624.c file that fixes up a WARNING: 'Statements should start on a tabstop' found by the checkpatch.pl tool. Signed-off-by: Ravishankar Karkala Mallikarjunayya --- drivers/staging/comedi/drivers/mpc624.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/comedi/drivers/mpc624.c b/drivers/staging/comedi/drivers/mpc624.c index 826e439..9bda761 100644 --- a/drivers/staging/comedi/drivers/mpc624.c +++ b/drivers/staging/comedi/drivers/mpc624.c @@ -103,7 +103,7 @@ static const struct comedi_lrange range_mpc624_bipolar1 = { /* BIP_RANGE(1.01) this is correct, */ /* but my MPC-624 actually seems to have a range of 2.02 */ BIP_RANGE(2.02) -} + } }; static const struct comedi_lrange range_mpc624_bipolar10 = { @@ -112,7 +112,7 @@ static const struct comedi_lrange range_mpc624_bipolar10 = { /* BIP_RANGE(10.1) this is correct, */ /* but my MPC-624 actually seems to have a range of 20.2 */ BIP_RANGE(20.2) -} + } }; static unsigned int mpc624_ai_get_sample(struct comedi_device *dev, -- 1.9.1
[PATCH 01/10] Staging: comedi: Use unsigned int instead of unsigned issue in pcmuio.c
This is a patch to the pcmuio.c file that fixes up a WARNING: Prefer 'unsigned int' to bare use of 'unsigned' found by the checkpatch.pl tool. Signed-off-by: Ravishankar Karkala Mallikarjunayya --- drivers/staging/comedi/drivers/pcmuio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/comedi/drivers/pcmuio.c b/drivers/staging/comedi/drivers/pcmuio.c index 7ea8130..8ad64f2 100644 --- a/drivers/staging/comedi/drivers/pcmuio.c +++ b/drivers/staging/comedi/drivers/pcmuio.c @@ -307,7 +307,7 @@ static void pcmuio_stop_intr(struct comedi_device *dev, static void pcmuio_handle_intr_subdev(struct comedi_device *dev, struct comedi_subdevice *s, - unsigned triggered) + unsigned int triggered) { struct pcmuio_private *devpriv = dev->private; int asic = pcmuio_subdevice_to_asic(s); -- 1.9.1
[PATCH v2 1/4] staging : comedi : fix type issues in s626.c
This is a patch to the s626.c file that fixes up a type issues like i.e Prefer kernel type 'u8' over 'uint8_t' Prefer kernel type 'u16' over 'uint16_t' Prefer kernel type 'u32' over 'uint32_t' Prefer kernel type 's16' over 'int16_t' Prefer kernel type 's32' over 'int32_t' found by the checkpatch.pl tool. Signed-off-by: Ravishankar Karkala Mallikarjunayya <ravishankark...@gmail.com> --- changes since v1: Rework --- drivers/staging/comedi/drivers/s626.c | 212 +- 1 file changed, 106 insertions(+), 106 deletions(-) diff --git a/drivers/staging/comedi/drivers/s626.c b/drivers/staging/comedi/drivers/s626.c index c5e0863..a399d7b 100644 --- a/drivers/staging/comedi/drivers/s626.c +++ b/drivers/staging/comedi/drivers/s626.c @@ -75,24 +75,24 @@ struct s626_buffer_dma { }; struct s626_private { - uint8_t ai_cmd_running; /* ai_cmd is running */ + u8 ai_cmd_running; /* ai_cmd is running */ unsigned int ai_sample_timer; /* time between samples in * units of the timer */ int ai_convert_count; /* conversion counter */ unsigned int ai_convert_timer; /* time between conversion in * units of the timer */ - uint16_t counter_int_enabs; /* counter interrupt enable mask + u16 counter_int_enabs; /* counter interrupt enable mask * for MISC2 register */ - uint8_t adc_items; /* number of items in ADC poll list */ + u8 adc_items; /* number of items in ADC poll list */ struct s626_buffer_dma rps_buf; /* DMA buffer used to hold ADC (RPS1) * program */ struct s626_buffer_dma ana_buf; /* DMA buffer used to receive ADC data * and hold DAC data */ - uint32_t *dac_wbuf; /* pointer to logical adrs of DMA buffer + u32 *dac_wbuf; /* pointer to logical adrs of DMA buffer * used to hold DAC data */ - 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 + u16 dacpol; /* image of DAC polarity register */ + u8 trim_setpoint[12]; /* images of TrimDAC setpoints */ + u32 i2c_adrs; /* I2C device address for onboard EEPROM * (board rev dependent) */ }; @@ -304,10 +304,10 @@ static uint8_t s626_i2c_read(struct comedi_device *dev, uint8_t addr) /* *** DAC FUNCTIONS *** */ /* TrimDac LogicalChan-to-PhysicalChan mapping table. */ -static const uint8_t s626_trimchan[] = { 10, 9, 8, 3, 2, 7, 6, 1, 0, 5, 4 }; +static const u8 s626_trimchan[] = { 10, 9, 8, 3, 2, 7, 6, 1, 0, 5, 4 }; /* TrimDac LogicalChan-to-EepromAdrs mapping table. */ -static const uint8_t s626_trimadrs[] = { +static const u8 s626_trimadrs[] = { 0x40, 0x41, 0x42, 0x50, 0x51, 0x52, 0x53, 0x60, 0x61, 0x62, 0x63 }; @@ -516,12 +516,12 @@ static int s626_send_dac(struct comedi_device *dev, uint32_t val) * Private helper function: Write setpoint to an application DAC channel. */ static int s626_set_dac(struct comedi_device *dev, - uint16_t chan, int16_t dacdata) + u16 chan, s16 dacdata) { struct s626_private *devpriv = dev->private; - uint16_t signmask; - uint32_t ws_image; - uint32_t val; + u16 signmask; + u32 ws_image; + u32 val; /* * Adjust DAC data polarity and set up Polarity Control Register image. @@ -535,7 +535,7 @@ static int s626_set_dac(struct comedi_device *dev, } /* Limit DAC setpoint value to valid range. */ - if ((uint16_t)dacdata > 0x1FFF) + if ((u16)dacdata > 0x1FFF) dacdata = 0x1FFF; /* @@ -575,23 +575,23 @@ static int s626_set_dac(struct comedi_device *dev, * (write to non-existent trimdac). */ val |= 0x4000; /* Address the two main dual-DAC devices * (TSL's chip select enables target device). */ - val |= ((uint32_t)(chan & 1) << 15);/* Address the DAC channel + val |= ((u32)(chan & 1) << 15); /* Address the DAC channel * within the device. */ - val |= (uint32_t)dacdata; /* Include DAC setpoint data. */ + val |= (u32)dacdata;/* Include DAC setpoint data. */ return s626_send_dac(dev, val); } static int s626_write_trim_dac(struct comedi_device *dev, - uin
[PATCH v2 1/4] staging : comedi : fix type issues in s626.c
This is a patch to the s626.c file that fixes up a type issues like i.e Prefer kernel type 'u8' over 'uint8_t' Prefer kernel type 'u16' over 'uint16_t' Prefer kernel type 'u32' over 'uint32_t' Prefer kernel type 's16' over 'int16_t' Prefer kernel type 's32' over 'int32_t' found by the checkpatch.pl tool. Signed-off-by: Ravishankar Karkala Mallikarjunayya --- changes since v1: Rework --- drivers/staging/comedi/drivers/s626.c | 212 +- 1 file changed, 106 insertions(+), 106 deletions(-) diff --git a/drivers/staging/comedi/drivers/s626.c b/drivers/staging/comedi/drivers/s626.c index c5e0863..a399d7b 100644 --- a/drivers/staging/comedi/drivers/s626.c +++ b/drivers/staging/comedi/drivers/s626.c @@ -75,24 +75,24 @@ struct s626_buffer_dma { }; struct s626_private { - uint8_t ai_cmd_running; /* ai_cmd is running */ + u8 ai_cmd_running; /* ai_cmd is running */ unsigned int ai_sample_timer; /* time between samples in * units of the timer */ int ai_convert_count; /* conversion counter */ unsigned int ai_convert_timer; /* time between conversion in * units of the timer */ - uint16_t counter_int_enabs; /* counter interrupt enable mask + u16 counter_int_enabs; /* counter interrupt enable mask * for MISC2 register */ - uint8_t adc_items; /* number of items in ADC poll list */ + u8 adc_items; /* number of items in ADC poll list */ struct s626_buffer_dma rps_buf; /* DMA buffer used to hold ADC (RPS1) * program */ struct s626_buffer_dma ana_buf; /* DMA buffer used to receive ADC data * and hold DAC data */ - uint32_t *dac_wbuf; /* pointer to logical adrs of DMA buffer + u32 *dac_wbuf; /* pointer to logical adrs of DMA buffer * used to hold DAC data */ - 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 + u16 dacpol; /* image of DAC polarity register */ + u8 trim_setpoint[12]; /* images of TrimDAC setpoints */ + u32 i2c_adrs; /* I2C device address for onboard EEPROM * (board rev dependent) */ }; @@ -304,10 +304,10 @@ static uint8_t s626_i2c_read(struct comedi_device *dev, uint8_t addr) /* *** DAC FUNCTIONS *** */ /* TrimDac LogicalChan-to-PhysicalChan mapping table. */ -static const uint8_t s626_trimchan[] = { 10, 9, 8, 3, 2, 7, 6, 1, 0, 5, 4 }; +static const u8 s626_trimchan[] = { 10, 9, 8, 3, 2, 7, 6, 1, 0, 5, 4 }; /* TrimDac LogicalChan-to-EepromAdrs mapping table. */ -static const uint8_t s626_trimadrs[] = { +static const u8 s626_trimadrs[] = { 0x40, 0x41, 0x42, 0x50, 0x51, 0x52, 0x53, 0x60, 0x61, 0x62, 0x63 }; @@ -516,12 +516,12 @@ static int s626_send_dac(struct comedi_device *dev, uint32_t val) * Private helper function: Write setpoint to an application DAC channel. */ static int s626_set_dac(struct comedi_device *dev, - uint16_t chan, int16_t dacdata) + u16 chan, s16 dacdata) { struct s626_private *devpriv = dev->private; - uint16_t signmask; - uint32_t ws_image; - uint32_t val; + u16 signmask; + u32 ws_image; + u32 val; /* * Adjust DAC data polarity and set up Polarity Control Register image. @@ -535,7 +535,7 @@ static int s626_set_dac(struct comedi_device *dev, } /* Limit DAC setpoint value to valid range. */ - if ((uint16_t)dacdata > 0x1FFF) + if ((u16)dacdata > 0x1FFF) dacdata = 0x1FFF; /* @@ -575,23 +575,23 @@ static int s626_set_dac(struct comedi_device *dev, * (write to non-existent trimdac). */ val |= 0x4000; /* Address the two main dual-DAC devices * (TSL's chip select enables target device). */ - val |= ((uint32_t)(chan & 1) << 15);/* Address the DAC channel + val |= ((u32)(chan & 1) << 15); /* Address the DAC channel * within the device. */ - val |= (uint32_t)dacdata; /* Include DAC setpoint data. */ + val |= (u32)dacdata;/* Include DAC setpoint data. */ return s626_send_dac(dev, val); } static int s626_write_trim_dac(struct comedi_device *dev, - uint8_t logical_chan, uint8_t dac_data) +
[PATCH v2 3/4] Staging: comedi:Fix unsigned int to bare use of unsigned issue in s626.c
This is a patch to the s626.c file that fixes up a WARNING: Prefer 'unsigned int' to bare use of 'unsigned' found by the checkpatch.pl tool Signed-off-by: Ravishankar Karkala Mallikarjunayya <ravishankark...@gmail.com> --- changes since v1: No change --- drivers/staging/comedi/drivers/s626.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/staging/comedi/drivers/s626.c b/drivers/staging/comedi/drivers/s626.c index edcd466..790ca41 100644 --- a/drivers/staging/comedi/drivers/s626.c +++ b/drivers/staging/comedi/drivers/s626.c @@ -728,7 +728,7 @@ static u16 s626_get_mode_a(struct comedi_device *dev, u16 cra; u16 crb; u16 setup; - unsigned cntsrc, clkmult, clkpol, encmode; + unsigned int cntsrc, clkmult, clkpol, encmode; /* Fetch CRA and CRB register images. */ cra = s626_debi_read(dev, S626_LP_CRA(chan)); @@ -783,7 +783,7 @@ static u16 s626_get_mode_b(struct comedi_device *dev, u16 cra; u16 crb; u16 setup; - unsigned cntsrc, clkmult, clkpol, encmode; + unsigned int cntsrc, clkmult, clkpol, encmode; /* Fetch CRA and CRB register images. */ cra = s626_debi_read(dev, S626_LP_CRA(chan)); @@ -858,7 +858,7 @@ static void s626_set_mode_a(struct comedi_device *dev, struct s626_private *devpriv = dev->private; u16 cra; u16 crb; - unsigned cntsrc, clkmult, clkpol; + unsigned int cntsrc, clkmult, clkpol; /* Initialize CRA and CRB images. */ /* Preload trigger is passed through. */ @@ -936,7 +936,7 @@ static void s626_set_mode_b(struct comedi_device *dev, struct s626_private *devpriv = dev->private; u16 cra; u16 crb; - unsigned cntsrc, clkmult, clkpol; + unsigned int cntsrc, clkmult, clkpol; /* Initialize CRA and CRB images. */ /* IndexSrc is passed through. */ -- 1.9.1
[PATCH v2 2/4] Staging: comedi: Fix WARNING issue in s626.c
This is a patch to the s626.c file that fixes up a Block comments issues found by the checkpatch.pl tool. i.e. Block comments use a trailing */ on a separate line Signed-off-by: Ravishankar Karkala Mallikarjunayya <ravishankark...@gmail.com> --- changes since v1: No change --- drivers/staging/comedi/drivers/s626.c | 60 +++ 1 file changed, 40 insertions(+), 20 deletions(-) diff --git a/drivers/staging/comedi/drivers/s626.c b/drivers/staging/comedi/drivers/s626.c index a399d7b..edcd466 100644 --- a/drivers/staging/comedi/drivers/s626.c +++ b/drivers/staging/comedi/drivers/s626.c @@ -76,24 +76,38 @@ struct s626_buffer_dma { struct s626_private { u8 ai_cmd_running; /* ai_cmd is running */ - unsigned int ai_sample_timer; /* time between samples in -* units of the timer */ + unsigned int ai_sample_timer; /* +* time between samples in +* units of the timer +*/ int ai_convert_count; /* conversion counter */ - unsigned int ai_convert_timer; /* time between conversion in -* units of the timer */ - u16 counter_int_enabs; /* counter interrupt enable mask -* for MISC2 register */ + unsigned int ai_convert_timer; /* +* time between conversion in +* units of the timer +*/ + u16 counter_int_enabs; /* +* counter interrupt enable mask +* for MISC2 register +*/ u8 adc_items; /* number of items in ADC poll list */ - struct s626_buffer_dma rps_buf; /* DMA buffer used to hold ADC (RPS1) -* program */ - struct s626_buffer_dma ana_buf; /* DMA buffer used to receive ADC data -* and hold DAC data */ - u32 *dac_wbuf; /* pointer to logical adrs of DMA buffer -* used to hold DAC data */ + struct s626_buffer_dma rps_buf; /* +* DMA buffer used to hold ADC (RPS1) +* program +*/ + struct s626_buffer_dma ana_buf; /* +* DMA buffer used to receive ADC data +* and hold DAC data +*/ + u32 *dac_wbuf; /* +* pointer to logical adrs of DMA buffer +* used to hold DAC data +*/ u16 dacpol; /* image of DAC polarity register */ u8 trim_setpoint[12]; /* images of TrimDAC setpoints */ - u32 i2c_adrs; /* I2C device address for onboard EEPROM -* (board rev dependent) */ + u32 i2c_adrs; /* +* I2C device address for onboard EEPROM +* (board rev dependent) +*/ }; /* Counter overflow/index event flag masks for RDMISC2. */ @@ -571,12 +585,18 @@ static int s626_set_dac(struct comedi_device *dev, * to a non-existent TrimDac channel) that serves to keep the clock * running after the packet has been sent to the target DAC. */ - val = 0x0F00; /* Continue clock after target DAC data -* (write to non-existent trimdac). */ - val |= 0x4000; /* Address the two main dual-DAC devices -* (TSL's chip select enables target device). */ - val |= ((u32)(chan & 1) << 15); /* Address the DAC channel -* within the device. */ + val = 0x0F00; /* +* Continue clock after target DAC data +* (write to non-existent trimdac). +*/ + val |= 0x4000; /* +* Address the two main dual-DAC devices +* (TSL's chip select enables target device). +*/ + val |= ((u32)(chan & 1) << 15); /* +* Address the DAC channel +* within the device. +
[PATCH v2 4/4] Staging: comedi: fix line over 80 characters issue in s626.c
This is a patch to the s626.c file that fixes up a line over 80 characters issues found by the checkpatch.pl tool. Signed-off-by: Ravishankar Karkala Mallikarjunayya <ravishankark...@gmail.com> --- changes since v1: No change --- drivers/staging/comedi/drivers/s626.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/staging/comedi/drivers/s626.c b/drivers/staging/comedi/drivers/s626.c index 790ca41..b5cd946 100644 --- a/drivers/staging/comedi/drivers/s626.c +++ b/drivers/staging/comedi/drivers/s626.c @@ -2520,7 +2520,8 @@ static int s626_initialize(struct comedi_device *dev) for (i = 0; i < 2; i++) { writel(S626_I2C_CLKSEL, dev->mmio + S626_P_I2CSTAT); s626_mc_enable(dev, S626_MC2_UPLD_IIC, S626_P_MC2); - ret = comedi_timeout(dev, NULL, NULL, s626_i2c_handshake_eoc, 0); + ret = comedi_timeout(dev, NULL, NULL, s626_i2c_handshake_eoc, +0); if (ret) return ret; } -- 1.9.1
[PATCH v2 3/4] Staging: comedi:Fix unsigned int to bare use of unsigned issue in s626.c
This is a patch to the s626.c file that fixes up a WARNING: Prefer 'unsigned int' to bare use of 'unsigned' found by the checkpatch.pl tool Signed-off-by: Ravishankar Karkala Mallikarjunayya --- changes since v1: No change --- drivers/staging/comedi/drivers/s626.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/staging/comedi/drivers/s626.c b/drivers/staging/comedi/drivers/s626.c index edcd466..790ca41 100644 --- a/drivers/staging/comedi/drivers/s626.c +++ b/drivers/staging/comedi/drivers/s626.c @@ -728,7 +728,7 @@ static u16 s626_get_mode_a(struct comedi_device *dev, u16 cra; u16 crb; u16 setup; - unsigned cntsrc, clkmult, clkpol, encmode; + unsigned int cntsrc, clkmult, clkpol, encmode; /* Fetch CRA and CRB register images. */ cra = s626_debi_read(dev, S626_LP_CRA(chan)); @@ -783,7 +783,7 @@ static u16 s626_get_mode_b(struct comedi_device *dev, u16 cra; u16 crb; u16 setup; - unsigned cntsrc, clkmult, clkpol, encmode; + unsigned int cntsrc, clkmult, clkpol, encmode; /* Fetch CRA and CRB register images. */ cra = s626_debi_read(dev, S626_LP_CRA(chan)); @@ -858,7 +858,7 @@ static void s626_set_mode_a(struct comedi_device *dev, struct s626_private *devpriv = dev->private; u16 cra; u16 crb; - unsigned cntsrc, clkmult, clkpol; + unsigned int cntsrc, clkmult, clkpol; /* Initialize CRA and CRB images. */ /* Preload trigger is passed through. */ @@ -936,7 +936,7 @@ static void s626_set_mode_b(struct comedi_device *dev, struct s626_private *devpriv = dev->private; u16 cra; u16 crb; - unsigned cntsrc, clkmult, clkpol; + unsigned int cntsrc, clkmult, clkpol; /* Initialize CRA and CRB images. */ /* IndexSrc is passed through. */ -- 1.9.1
[PATCH v2 2/4] Staging: comedi: Fix WARNING issue in s626.c
This is a patch to the s626.c file that fixes up a Block comments issues found by the checkpatch.pl tool. i.e. Block comments use a trailing */ on a separate line Signed-off-by: Ravishankar Karkala Mallikarjunayya --- changes since v1: No change --- drivers/staging/comedi/drivers/s626.c | 60 +++ 1 file changed, 40 insertions(+), 20 deletions(-) diff --git a/drivers/staging/comedi/drivers/s626.c b/drivers/staging/comedi/drivers/s626.c index a399d7b..edcd466 100644 --- a/drivers/staging/comedi/drivers/s626.c +++ b/drivers/staging/comedi/drivers/s626.c @@ -76,24 +76,38 @@ struct s626_buffer_dma { struct s626_private { u8 ai_cmd_running; /* ai_cmd is running */ - unsigned int ai_sample_timer; /* time between samples in -* units of the timer */ + unsigned int ai_sample_timer; /* +* time between samples in +* units of the timer +*/ int ai_convert_count; /* conversion counter */ - unsigned int ai_convert_timer; /* time between conversion in -* units of the timer */ - u16 counter_int_enabs; /* counter interrupt enable mask -* for MISC2 register */ + unsigned int ai_convert_timer; /* +* time between conversion in +* units of the timer +*/ + u16 counter_int_enabs; /* +* counter interrupt enable mask +* for MISC2 register +*/ u8 adc_items; /* number of items in ADC poll list */ - struct s626_buffer_dma rps_buf; /* DMA buffer used to hold ADC (RPS1) -* program */ - struct s626_buffer_dma ana_buf; /* DMA buffer used to receive ADC data -* and hold DAC data */ - u32 *dac_wbuf; /* pointer to logical adrs of DMA buffer -* used to hold DAC data */ + struct s626_buffer_dma rps_buf; /* +* DMA buffer used to hold ADC (RPS1) +* program +*/ + struct s626_buffer_dma ana_buf; /* +* DMA buffer used to receive ADC data +* and hold DAC data +*/ + u32 *dac_wbuf; /* +* pointer to logical adrs of DMA buffer +* used to hold DAC data +*/ u16 dacpol; /* image of DAC polarity register */ u8 trim_setpoint[12]; /* images of TrimDAC setpoints */ - u32 i2c_adrs; /* I2C device address for onboard EEPROM -* (board rev dependent) */ + u32 i2c_adrs; /* +* I2C device address for onboard EEPROM +* (board rev dependent) +*/ }; /* Counter overflow/index event flag masks for RDMISC2. */ @@ -571,12 +585,18 @@ static int s626_set_dac(struct comedi_device *dev, * to a non-existent TrimDac channel) that serves to keep the clock * running after the packet has been sent to the target DAC. */ - val = 0x0F00; /* Continue clock after target DAC data -* (write to non-existent trimdac). */ - val |= 0x4000; /* Address the two main dual-DAC devices -* (TSL's chip select enables target device). */ - val |= ((u32)(chan & 1) << 15); /* Address the DAC channel -* within the device. */ + val = 0x0F00; /* +* Continue clock after target DAC data +* (write to non-existent trimdac). +*/ + val |= 0x4000; /* +* Address the two main dual-DAC devices +* (TSL's chip select enables target device). +*/ + val |= ((u32)(chan & 1) << 15); /* +* Address the DAC channel +* within the device. +*/ val |= (u32)dacdat
[PATCH v2 4/4] Staging: comedi: fix line over 80 characters issue in s626.c
This is a patch to the s626.c file that fixes up a line over 80 characters issues found by the checkpatch.pl tool. Signed-off-by: Ravishankar Karkala Mallikarjunayya --- changes since v1: No change --- drivers/staging/comedi/drivers/s626.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/staging/comedi/drivers/s626.c b/drivers/staging/comedi/drivers/s626.c index 790ca41..b5cd946 100644 --- a/drivers/staging/comedi/drivers/s626.c +++ b/drivers/staging/comedi/drivers/s626.c @@ -2520,7 +2520,8 @@ static int s626_initialize(struct comedi_device *dev) for (i = 0; i < 2; i++) { writel(S626_I2C_CLKSEL, dev->mmio + S626_P_I2CSTAT); s626_mc_enable(dev, S626_MC2_UPLD_IIC, S626_P_MC2); - ret = comedi_timeout(dev, NULL, NULL, s626_i2c_handshake_eoc, 0); + ret = comedi_timeout(dev, NULL, NULL, s626_i2c_handshake_eoc, +0); if (ret) return ret; } -- 1.9.1
[PATCH v2 4/4] Staging: comedi: fix line over 80 characters issue in s626.c
This is a patch to the s626.c file that fixes up a line over 80 characters issues found by the checkpatch.pl tool. Signed-off-by: Ravishankar Karkala Mallikarjunayya <ravishankark...@gmail.com> --- Changes since V1: - No change --- drivers/staging/comedi/drivers/s626.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/staging/comedi/drivers/s626.c b/drivers/staging/comedi/drivers/s626.c index 1d663a0..b37ba87 100644 --- a/drivers/staging/comedi/drivers/s626.c +++ b/drivers/staging/comedi/drivers/s626.c @@ -2520,7 +2520,8 @@ static int s626_initialize(struct comedi_device *dev) for (i = 0; i < 2; i++) { writel(S626_I2C_CLKSEL, dev->mmio + S626_P_I2CSTAT); s626_mc_enable(dev, S626_MC2_UPLD_IIC, S626_P_MC2); - ret = comedi_timeout(dev, NULL, NULL, s626_i2c_handshake_eoc, 0); + ret = comedi_timeout(dev, NULL, NULL, s626_i2c_handshake_eoc, +0); if (ret) return ret; } -- 1.9.1
[PATCH v2 4/4] Staging: comedi: fix line over 80 characters issue in s626.c
This is a patch to the s626.c file that fixes up a line over 80 characters issues found by the checkpatch.pl tool. Signed-off-by: Ravishankar Karkala Mallikarjunayya --- Changes since V1: - No change --- drivers/staging/comedi/drivers/s626.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/staging/comedi/drivers/s626.c b/drivers/staging/comedi/drivers/s626.c index 1d663a0..b37ba87 100644 --- a/drivers/staging/comedi/drivers/s626.c +++ b/drivers/staging/comedi/drivers/s626.c @@ -2520,7 +2520,8 @@ static int s626_initialize(struct comedi_device *dev) for (i = 0; i < 2; i++) { writel(S626_I2C_CLKSEL, dev->mmio + S626_P_I2CSTAT); s626_mc_enable(dev, S626_MC2_UPLD_IIC, S626_P_MC2); - ret = comedi_timeout(dev, NULL, NULL, s626_i2c_handshake_eoc, 0); + ret = comedi_timeout(dev, NULL, NULL, s626_i2c_handshake_eoc, +0); if (ret) return ret; } -- 1.9.1
[PATCH v2 2/4] Staging: comedi: Fix WARNING issue in s626.c
This is a patch to the s626.c file that fixes up a Block comments issues found by the checkpatch.pl tool. i.e. Block comments use a trailing */ on a separate line Signed-off-by: Ravishankar Karkala Mallikarjunayya <ravishankark...@gmail.com> --- Changes since V1: - No change --- drivers/staging/comedi/drivers/s626.c | 60 +++ 1 file changed, 40 insertions(+), 20 deletions(-) diff --git a/drivers/staging/comedi/drivers/s626.c b/drivers/staging/comedi/drivers/s626.c index 6961550e..723504b 100644 --- a/drivers/staging/comedi/drivers/s626.c +++ b/drivers/staging/comedi/drivers/s626.c @@ -76,24 +76,38 @@ struct s626_buffer_dma { struct s626_private { u8 ai_cmd_running; /* ai_cmd is running */ - unsigned int ai_sample_timer; /* time between samples in -* units of the timer */ + unsigned int ai_sample_timer; /* +* time between samples in +* units of the timer +*/ int ai_convert_count; /* conversion counter */ - unsigned int ai_convert_timer; /* time between conversion in -* units of the timer */ - u16 counter_int_enabs; /* counter interrupt enable mask -* for MISC2 register */ + unsigned int ai_convert_timer; /* +* time between conversion in +* units of the timer +*/ + u16 counter_int_enabs; /* +* counter interrupt enable mask +* for MISC2 register +*/ u8 adc_items; /* number of items in ADC poll list */ - struct s626_buffer_dma rps_buf; /* DMA buffer used to hold ADC (RPS1) -* program */ - struct s626_buffer_dma ana_buf; /* DMA buffer used to receive ADC data -* and hold DAC data */ - u32 *dac_wbuf; /* pointer to logical adrs of DMA buffer -* used to hold DAC data */ + struct s626_buffer_dma rps_buf; /* +* DMA buffer used to hold ADC (RPS1) +* program +*/ + struct s626_buffer_dma ana_buf; /* +* DMA buffer used to receive ADC data +* and hold DAC data +*/ + u32 *dac_wbuf; /* +* pointer to logical adrs of DMA buffer +* used to hold DAC data +*/ u16 dacpol; /* image of DAC polarity register */ u8 trim_setpoint[12]; /* images of TrimDAC setpoints */ - u32 i2c_adrs; /* I2C device address for onboard EEPROM -* (board rev dependent) */ + u32 i2c_adrs; /* +* I2C device address for onboard EEPROM +* (board rev dependent) +*/ }; /* Counter overflow/index event flag masks for RDMISC2. */ @@ -571,12 +585,18 @@ static int s626_set_dac(struct comedi_device *dev, * to a non-existent TrimDac channel) that serves to keep the clock * running after the packet has been sent to the target DAC. */ - val = 0x0F00; /* Continue clock after target DAC data -* (write to non-existent trimdac). */ - val |= 0x4000; /* Address the two main dual-DAC devices -* (TSL's chip select enables target device). */ - val |= ((uint32_t)(chan & 1) << 15);/* Address the DAC channel -* within the device. */ + val = 0x0F00; /* +* Continue clock after target DAC data +* (write to non-existent trimdac). +*/ + val |= 0x4000; /* +* Address the two main dual-DAC devices +* (TSL's chip select enables target device). +*/ + val |= ((uint32_t)(chan & 1) << 15);/* +* Address the DAC channel +
[PATCH v2 2/4] Staging: comedi: Fix WARNING issue in s626.c
This is a patch to the s626.c file that fixes up a Block comments issues found by the checkpatch.pl tool. i.e. Block comments use a trailing */ on a separate line Signed-off-by: Ravishankar Karkala Mallikarjunayya --- Changes since V1: - No change --- drivers/staging/comedi/drivers/s626.c | 60 +++ 1 file changed, 40 insertions(+), 20 deletions(-) diff --git a/drivers/staging/comedi/drivers/s626.c b/drivers/staging/comedi/drivers/s626.c index 6961550e..723504b 100644 --- a/drivers/staging/comedi/drivers/s626.c +++ b/drivers/staging/comedi/drivers/s626.c @@ -76,24 +76,38 @@ struct s626_buffer_dma { struct s626_private { u8 ai_cmd_running; /* ai_cmd is running */ - unsigned int ai_sample_timer; /* time between samples in -* units of the timer */ + unsigned int ai_sample_timer; /* +* time between samples in +* units of the timer +*/ int ai_convert_count; /* conversion counter */ - unsigned int ai_convert_timer; /* time between conversion in -* units of the timer */ - u16 counter_int_enabs; /* counter interrupt enable mask -* for MISC2 register */ + unsigned int ai_convert_timer; /* +* time between conversion in +* units of the timer +*/ + u16 counter_int_enabs; /* +* counter interrupt enable mask +* for MISC2 register +*/ u8 adc_items; /* number of items in ADC poll list */ - struct s626_buffer_dma rps_buf; /* DMA buffer used to hold ADC (RPS1) -* program */ - struct s626_buffer_dma ana_buf; /* DMA buffer used to receive ADC data -* and hold DAC data */ - u32 *dac_wbuf; /* pointer to logical adrs of DMA buffer -* used to hold DAC data */ + struct s626_buffer_dma rps_buf; /* +* DMA buffer used to hold ADC (RPS1) +* program +*/ + struct s626_buffer_dma ana_buf; /* +* DMA buffer used to receive ADC data +* and hold DAC data +*/ + u32 *dac_wbuf; /* +* pointer to logical adrs of DMA buffer +* used to hold DAC data +*/ u16 dacpol; /* image of DAC polarity register */ u8 trim_setpoint[12]; /* images of TrimDAC setpoints */ - u32 i2c_adrs; /* I2C device address for onboard EEPROM -* (board rev dependent) */ + u32 i2c_adrs; /* +* I2C device address for onboard EEPROM +* (board rev dependent) +*/ }; /* Counter overflow/index event flag masks for RDMISC2. */ @@ -571,12 +585,18 @@ static int s626_set_dac(struct comedi_device *dev, * to a non-existent TrimDac channel) that serves to keep the clock * running after the packet has been sent to the target DAC. */ - val = 0x0F00; /* Continue clock after target DAC data -* (write to non-existent trimdac). */ - val |= 0x4000; /* Address the two main dual-DAC devices -* (TSL's chip select enables target device). */ - val |= ((uint32_t)(chan & 1) << 15);/* Address the DAC channel -* within the device. */ + val = 0x0F00; /* +* Continue clock after target DAC data +* (write to non-existent trimdac). +*/ + val |= 0x4000; /* +* Address the two main dual-DAC devices +* (TSL's chip select enables target device). +*/ + val |= ((uint32_t)(chan & 1) << 15);/* +* Address the DAC channel +
[PATCH v2 3/4] Staging: comedi:Fix unsigned int to bare use of unsigned issue in s626.c
This is a patch to the s626.c file that fixes up a WARNING: Prefer 'unsigned int' to bare use of 'unsigned' found by the checkpatch.pl tool Signed-off-by: Ravishankar Karkala Mallikarjunayya <ravishankark...@gmail.com> --- Changes since V1: - No change --- drivers/staging/comedi/drivers/s626.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/staging/comedi/drivers/s626.c b/drivers/staging/comedi/drivers/s626.c index 723504b..1d663a0 100644 --- a/drivers/staging/comedi/drivers/s626.c +++ b/drivers/staging/comedi/drivers/s626.c @@ -728,7 +728,7 @@ static uint16_t s626_get_mode_a(struct comedi_device *dev, u16 cra; u16 crb; u16 setup; - unsigned cntsrc, clkmult, clkpol, encmode; + unsigned int cntsrc, clkmult, clkpol, encmode; /* Fetch CRA and CRB register images. */ cra = s626_debi_read(dev, S626_LP_CRA(chan)); @@ -783,7 +783,7 @@ static uint16_t s626_get_mode_b(struct comedi_device *dev, u16 cra; u16 crb; u16 setup; - unsigned cntsrc, clkmult, clkpol, encmode; + unsigned int cntsrc, clkmult, clkpol, encmode; /* Fetch CRA and CRB register images. */ cra = s626_debi_read(dev, S626_LP_CRA(chan)); @@ -858,7 +858,7 @@ static void s626_set_mode_a(struct comedi_device *dev, struct s626_private *devpriv = dev->private; u16 cra; u16 crb; - unsigned cntsrc, clkmult, clkpol; + unsigned int cntsrc, clkmult, clkpol; /* Initialize CRA and CRB images. */ /* Preload trigger is passed through. */ @@ -936,7 +936,7 @@ static void s626_set_mode_b(struct comedi_device *dev, struct s626_private *devpriv = dev->private; u16 cra; u16 crb; - unsigned cntsrc, clkmult, clkpol; + unsigned int cntsrc, clkmult, clkpol; /* Initialize CRA and CRB images. */ /* IndexSrc is passed through. */ -- 1.9.1
[PATCH v2 3/4] Staging: comedi:Fix unsigned int to bare use of unsigned issue in s626.c
This is a patch to the s626.c file that fixes up a WARNING: Prefer 'unsigned int' to bare use of 'unsigned' found by the checkpatch.pl tool Signed-off-by: Ravishankar Karkala Mallikarjunayya --- Changes since V1: - No change --- drivers/staging/comedi/drivers/s626.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/staging/comedi/drivers/s626.c b/drivers/staging/comedi/drivers/s626.c index 723504b..1d663a0 100644 --- a/drivers/staging/comedi/drivers/s626.c +++ b/drivers/staging/comedi/drivers/s626.c @@ -728,7 +728,7 @@ static uint16_t s626_get_mode_a(struct comedi_device *dev, u16 cra; u16 crb; u16 setup; - unsigned cntsrc, clkmult, clkpol, encmode; + unsigned int cntsrc, clkmult, clkpol, encmode; /* Fetch CRA and CRB register images. */ cra = s626_debi_read(dev, S626_LP_CRA(chan)); @@ -783,7 +783,7 @@ static uint16_t s626_get_mode_b(struct comedi_device *dev, u16 cra; u16 crb; u16 setup; - unsigned cntsrc, clkmult, clkpol, encmode; + unsigned int cntsrc, clkmult, clkpol, encmode; /* Fetch CRA and CRB register images. */ cra = s626_debi_read(dev, S626_LP_CRA(chan)); @@ -858,7 +858,7 @@ static void s626_set_mode_a(struct comedi_device *dev, struct s626_private *devpriv = dev->private; u16 cra; u16 crb; - unsigned cntsrc, clkmult, clkpol; + unsigned int cntsrc, clkmult, clkpol; /* Initialize CRA and CRB images. */ /* Preload trigger is passed through. */ @@ -936,7 +936,7 @@ static void s626_set_mode_b(struct comedi_device *dev, struct s626_private *devpriv = dev->private; u16 cra; u16 crb; - unsigned cntsrc, clkmult, clkpol; + unsigned int cntsrc, clkmult, clkpol; /* Initialize CRA and CRB images. */ /* IndexSrc is passed through. */ -- 1.9.1