Assist

2016-05-19 Thread Sgt Anthony Victor
Dear Sir/Madam,

I am Sgt Anthony Victor, I have a good business proposal for you.
There are no risks involved and it is easy. Please reply for briefs
and procedures.

Best regards,

Sgt Anthony Victor

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: Asociación de Empresas

2016-05-19 Thread Sr. Raymond Khumalo



--
¡Saludos!

¿Está bien para discutir posibles negocios en este correo electrónico? 
Hágamelo saber lo antes posible para que yo pueda proporcionarle los 
detalles. Ponte en contacto conmigo en mi correo electrónico 
(raymond_khum...@outlook.com) para más detalles de este negocio


Un cordial saludo,
Raymond Khumalo
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v3 06/14] staging: comedi: daqboard2000: rename register offset macros

2016-05-19 Thread Ian Abbott
Rename the macros defining register offsets to avoid CamelCase, and to
use namespace associated with the driver.

Signed-off-by: Ian Abbott 
Reviewed-by: H Hartley Sweeten 
---
Other CamelCase issues in this patch will be dealt with by later
patches in the series.

v2: Shortened prefix from `DAQBOARD2000_` to `DB2K_`.
v3: Removed a space before tab that slipped in in v2.
---
 drivers/staging/comedi/drivers/daqboard2000.c | 112 ++
 1 file changed, 61 insertions(+), 51 deletions(-)

diff --git a/drivers/staging/comedi/drivers/daqboard2000.c 
b/drivers/staging/comedi/drivers/daqboard2000.c
index ceb910d..7c6a2450 100644
--- a/drivers/staging/comedi/drivers/daqboard2000.c
+++ b/drivers/staging/comedi/drivers/daqboard2000.c
@@ -151,35 +151,35 @@ static const struct comedi_lrange range_daqboard2000_ai = 
{
 /*
  * Register Memory Map
  */
-#define acqControl 0x00/* u16 */
-#define acqScanListFIFO0x02/* u16 */
-#define acqPacerClockDivLow0x04/* u32 */
-#define acqScanCounter 0x08/* u16 */
-#define acqPacerClockDivHigh   0x0a/* u16 */
-#define acqTriggerCount0x0c/* u16 */
-#define acqResultsFIFO 0x10/* u16 */
-#define acqResultsShadow   0x14/* u16 */
-#define acqAdcResult   0x18/* u16 */
-#define dacScanCounter 0x1c/* u16 */
-#define dacControl 0x20/* u16 */
-#define dacFIFO0x24/* s16 */
-#define dacPacerClockDiv   0x2a/* u16 */
-#define refDacs0x2c/* u16 */
-#define dioControl 0x30/* u16 */
-#define dioP3hsioData  0x32/* s16 */
-#define dioP3Control   0x34/* u16 */
-#define calEepromControl   0x36/* u16 */
-#define dacSetting(x)  (0x38 + (x) * 2) /* s16 */
-#define dioP2ExpansionIO8Bit   0x40/* s16 */
-#define ctrTmrControl  0x80/* u16 */
-#define ctrInput(x)(0x88 + (x) * 2) /* s16 */
-#define timerDivisor(x)(0xa0 + (x) * 2) /* u16 */
-#define dmaControl 0xb0/* u16 */
-#define trigControl0xb2/* u16 */
-#define calEeprom  0xb8/* u16 */
-#define acqDigitalMark 0xba/* u16 */
-#define trigDacs   0xbc/* u16 */
-#define dioP2ExpansionIO16Bit(x)   (0xc0 + (x) * 2) /* s16 */
+#define DB2K_REG_ACQ_CONTROL   0x00/* u16 */
+#define DB2K_REG_ACQ_SCAN_LIST_FIFO0x02/* u16 */
+#define DB2K_REG_ACQ_PACER_CLOCK_DIV_LOW   0x04/* u32 */
+#define DB2K_REG_ACQ_SCAN_COUNTER  0x08/* u16 */
+#define DB2K_REG_ACQ_PACER_CLOCK_DIV_HIGH  0x0a/* u16 */
+#define DB2K_REG_ACQ_TRIGGER_COUNT 0x0c/* u16 */
+#define DB2K_REG_ACQ_RESULTS_FIFO  0x10/* u16 */
+#define DB2K_REG_ACQ_RESULTS_SHADOW0x14/* u16 */
+#define DB2K_REG_ACQ_ADC_RESULT0x18/* u16 
*/
+#define DB2K_REG_DAC_SCAN_COUNTER  0x1c/* u16 */
+#define DB2K_REG_DAC_CONTROL   0x20/* u16 */
+#define DB2K_REG_DAC_FIFO  0x24/* s16 */
+#define DB2K_REG_DAC_PACER_CLOCK_DIV   0x2a/* u16 */
+#define DB2K_REG_REF_DACS  0x2c/* u16 */
+#define DB2K_REG_DIO_CONTROL   0x30/* u16 */
+#define DB2K_REG_P3_HSIO_DATA  0x32/* s16 */
+#define DB2K_REG_P3_CONTROL0x34/* u16 */
+#define DB2K_REG_CAL_EEPROM_CONTROL0x36/* u16 */
+#define DB2K_REG_DAC_SETTING(x)(0x38 + (x) * 2) /* s16 
*/
+#define DB2K_REG_DIO_P2_EXP_IO_8_BIT   0x40/* s16 */
+#define DB2K_REG_COUNTER_TIMER_CONTROL 0x80/* u16 */
+#define DB2K_REG_COUNTER_INPUT(x)  (0x88 + (x) * 2) /* s16 */
+#define DB2K_REG_TIMER_DIV(x)  (0xa0 + (x) * 2) /* u16 */
+#define DB2K_REG_DMA_CONTROL   0xb0/* u16 */
+#define DB2K_REG_TRIG_CONTROL  0xb2/* u16 */
+#define DB2K_REG_CAL_EEPROM0xb8/* u16 */
+#define DB2K_REG_ACQ_DIGITAL_MARK  0xba/* u16 */
+#define DB2K_REG_TRIG_DACS 0xbc/* u16 */
+#define DB2K_REG_DIO_P2_EXP_IO_16_BIT(x)   (0xc0 + (x) * 2) /* s16 */
 
 /

[PATCH v3 12/14] staging: comedi: daqboard2000: rename reference DACs register macros

2016-05-19 Thread Ian Abbott
Rename the macros that define values for the reference DACs register to
avoid CamelCase, and to make it clearer which register they are
associated with.  Add a macro `DAQBOARD2000_REF_DACS_SET` for the value
`0x0080` that triggers setting one of the references.

Signed-off-by: Ian Abbott 
Reviewed-by: H Hartley Sweeten 
---
v2: Shortened prefix from `DAQBOARD2000_` to `DB2K_`.
v3: Corrected typo in commit:  0x80 --> 0x0080.
---
 drivers/staging/comedi/drivers/daqboard2000.c | 9 +
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/comedi/drivers/daqboard2000.c 
b/drivers/staging/comedi/drivers/daqboard2000.c
index e9efdbc..15f2b8a5 100644
--- a/drivers/staging/comedi/drivers/daqboard2000.c
+++ b/drivers/staging/comedi/drivers/daqboard2000.c
@@ -244,8 +244,9 @@ static const struct comedi_lrange range_daqboard2000_ai = {
 #define DB2K_TRIG_CONTROL_DISABLE  0x
 
 /* Reference Dac Selection */
-#define DAQBOARD2000_PosRefDacSelect 0x0100
-#define DAQBOARD2000_NegRefDacSelect 0x
+#define DB2K_REF_DACS_SET  0x0080
+#define DB2K_REF_DACS_SELECT_POS_REF   0x0100
+#define DB2K_REF_DACS_SELECT_NEG_REF   0x
 
 struct daq200_boardtype {
const char *name;
@@ -569,7 +570,7 @@ static void daqboard2000_activateReferenceDacs(struct 
comedi_device *dev)
int timeout;
 
/*  Set the + reference dac value in the FPGA */
-   writew(0x80 | DAQBOARD2000_PosRefDacSelect,
+   writew(DB2K_REF_DACS_SET | DB2K_REF_DACS_SELECT_POS_REF,
   dev->mmio + DB2K_REG_REF_DACS);
for (timeout = 0; timeout < 20; timeout++) {
val = readw(dev->mmio + DB2K_REG_DAC_STATUS);
@@ -579,7 +580,7 @@ static void daqboard2000_activateReferenceDacs(struct 
comedi_device *dev)
}
 
/*  Set the - reference dac value in the FPGA */
-   writew(0x80 | DAQBOARD2000_NegRefDacSelect,
+   writew(DB2K_REF_DACS_SET | DB2K_REF_DACS_SELECT_NEG_REF,
   dev->mmio + DB2K_REG_REF_DACS);
for (timeout = 0; timeout < 20; timeout++) {
val = readw(dev->mmio + DB2K_REG_DAC_STATUS);
-- 
2.8.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH v2 00/14] staging: comedi: daqboard2000: checkpatch clean-ups

2016-05-19 Thread Ian Abbott

On 18/05/16 13:36, Ian Abbott wrote:

Patches 03 and 06 have checkpatch warnings themselves about CamelCase
issues, but they are not "new" issues, and are resolved by the later
patches in the series.

01) staging: comedi: daqboard2000: remove commented out code
02) staging: comedi: daqboard2000: use usual block comment style
03) staging: comedi: daqboard2000: CHECK: spaces preferred around that
 '*'
04) staging: comedi: daqboard2000: add blank line after struct
 declaration
05) staging: comedi: daqboard2000: rename serial EEPROM register macros
06) staging: comedi: daqboard2000: rename register offset macros
07) staging: comedi: daqboard2000: rename acquisition control register
 macros
08) staging: comedi: daqboard2000: rename acq status register macros
09) staging: comedi: daqboard2000: redo DAC control register macros
10) staging: comedi: daqboard2000: redo DAC status macros and fix busy
11) staging: comedi: daqboard2000: rename trigger control register
 macros
12) staging: comedi: daqboard2000: rename reference DACs register macros
13) staging: comedi: daqboard2000: rename CamelCase functions
14) staging: comedi: daqboard2000: prefer usleep_range()

v2: Incorporate suggestions by H Hartley Sweeten, adding a couple of
comments in patch 01, changing a prefix from `DAQBOARD2000_` to `DB2K_`
in patches 05 onwards, and changing a `udelay(10)` to `usleep_range(10,
20)` in patch 14.

  drivers/staging/comedi/drivers/daqboard2000.c | 380 +-
  1 file changed, 189 insertions(+), 191 deletions(-)



I posted a v3 of patches 06 and 12, following Hartley's comments:

[PATCH v3 06/14] staging: comedi: daqboard2000: rename register offset 
macros
[PATCH v3 12/14] staging: comedi: daqboard2000: rename reference DACs 
register macros


I can repost it as a full series if necessary.

--
-=( Ian Abbott @ MEV Ltd.E-mail:  )=-
-=(  Web: http://www.mev.co.uk/  )=-
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH v3 12/14] staging: comedi: daqboard2000: rename reference DACs register macros

2016-05-19 Thread Ian Abbott

On 19/05/16 10:58, Ian Abbott wrote:

Rename the macros that define values for the reference DACs register to
avoid CamelCase, and to make it clearer which register they are
associated with.  Add a macro `DAQBOARD2000_REF_DACS_SET` for the value
`0x0080` that triggers setting one of the references.

Signed-off-by: Ian Abbott 
Reviewed-by: H Hartley Sweeten 
---
v2: Shortened prefix from `DAQBOARD2000_` to `DB2K_`.
v3: Corrected typo in commit:  0x80 --> 0x0080.
---
  drivers/staging/comedi/drivers/daqboard2000.c | 9 +
  1 file changed, 5 insertions(+), 4 deletions(-)


Dammit!  I missed the other, glaring typo in the commit. 
`DAQBOARD2000_REF_DACS_SET` should be `DB2K_REQ_DACS_SET`.  I'll post a 
v4 of this patch.  Sorry for the bother.


--
-=( Ian Abbott @ MEV Ltd.E-mail:  )=-
-=(  Web: http://www.mev.co.uk/  )=-
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v4 12/14] staging: comedi: daqboard2000: rename reference DACs register macros

2016-05-19 Thread Ian Abbott
Rename the macros that define values for the reference DACs register to
avoid CamelCase, and to make it clearer which register they are
associated with.  Add a macro `DB2K_REG_DACS_SET` for the value `0x0080`
that triggers setting one of the references.

Signed-off-by: Ian Abbott 
Reviewed-by: H Hartley Sweeten 
---
v2: Shortened prefix from `DAQBOARD2000_` to `DB2K_`.
v3: Corrected typo in commit:  0x80 --> 0x0080.
v4: Corrected typo in commit: DAQBOARD2000_REF_DACS_SET -->
DB2K_REG_DACS_SET
---
 drivers/staging/comedi/drivers/daqboard2000.c | 9 +
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/comedi/drivers/daqboard2000.c 
b/drivers/staging/comedi/drivers/daqboard2000.c
index e9efdbc..15f2b8a5 100644
--- a/drivers/staging/comedi/drivers/daqboard2000.c
+++ b/drivers/staging/comedi/drivers/daqboard2000.c
@@ -244,8 +244,9 @@ static const struct comedi_lrange range_daqboard2000_ai = {
 #define DB2K_TRIG_CONTROL_DISABLE  0x
 
 /* Reference Dac Selection */
-#define DAQBOARD2000_PosRefDacSelect 0x0100
-#define DAQBOARD2000_NegRefDacSelect 0x
+#define DB2K_REF_DACS_SET  0x0080
+#define DB2K_REF_DACS_SELECT_POS_REF   0x0100
+#define DB2K_REF_DACS_SELECT_NEG_REF   0x
 
 struct daq200_boardtype {
const char *name;
@@ -569,7 +570,7 @@ static void daqboard2000_activateReferenceDacs(struct 
comedi_device *dev)
int timeout;
 
/*  Set the + reference dac value in the FPGA */
-   writew(0x80 | DAQBOARD2000_PosRefDacSelect,
+   writew(DB2K_REF_DACS_SET | DB2K_REF_DACS_SELECT_POS_REF,
   dev->mmio + DB2K_REG_REF_DACS);
for (timeout = 0; timeout < 20; timeout++) {
val = readw(dev->mmio + DB2K_REG_DAC_STATUS);
@@ -579,7 +580,7 @@ static void daqboard2000_activateReferenceDacs(struct 
comedi_device *dev)
}
 
/*  Set the - reference dac value in the FPGA */
-   writew(0x80 | DAQBOARD2000_NegRefDacSelect,
+   writew(DB2K_REF_DACS_SET | DB2K_REF_DACS_SELECT_NEG_REF,
   dev->mmio + DB2K_REG_REF_DACS);
for (timeout = 0; timeout < 20; timeout++) {
val = readw(dev->mmio + DB2K_REG_DAC_STATUS);
-- 
2.8.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH v2 00/14] staging: comedi: daqboard2000: checkpatch clean-ups

2016-05-19 Thread Ian Abbott

On 19/05/16 11:02, Ian Abbott wrote:

On 18/05/16 13:36, Ian Abbott wrote:

Patches 03 and 06 have checkpatch warnings themselves about CamelCase
issues, but they are not "new" issues, and are resolved by the later
patches in the series.

01) staging: comedi: daqboard2000: remove commented out code
02) staging: comedi: daqboard2000: use usual block comment style
03) staging: comedi: daqboard2000: CHECK: spaces preferred around that
 '*'
04) staging: comedi: daqboard2000: add blank line after struct
 declaration
05) staging: comedi: daqboard2000: rename serial EEPROM register macros
06) staging: comedi: daqboard2000: rename register offset macros
07) staging: comedi: daqboard2000: rename acquisition control register
 macros
08) staging: comedi: daqboard2000: rename acq status register macros
09) staging: comedi: daqboard2000: redo DAC control register macros
10) staging: comedi: daqboard2000: redo DAC status macros and fix busy
11) staging: comedi: daqboard2000: rename trigger control register
 macros
12) staging: comedi: daqboard2000: rename reference DACs register macros
13) staging: comedi: daqboard2000: rename CamelCase functions
14) staging: comedi: daqboard2000: prefer usleep_range()

v2: Incorporate suggestions by H Hartley Sweeten, adding a couple of
comments in patch 01, changing a prefix from `DAQBOARD2000_` to `DB2K_`
in patches 05 onwards, and changing a `udelay(10)` to `usleep_range(10,
20)` in patch 14.

  drivers/staging/comedi/drivers/daqboard2000.c | 380
+-
  1 file changed, 189 insertions(+), 191 deletions(-)



I posted a v3 of patches 06 and 12, following Hartley's comments:

[PATCH v3 06/14] staging: comedi: daqboard2000: rename register offset
macros
[PATCH v3 12/14] staging: comedi: daqboard2000: rename reference DACs
register macros


And then I posted a v4 of patch 12, correcting a typo I missed in v3:

[PATCH v4 12/14] staging: comedi: daqboard2000: rename reference DACs 
register macros


So patch 06/14 is at v3, patch 12/14 is at v4, and all the others are 
v2.  If that's too much hassle to deal with, let me know, and I'll 
repost the whole series as v4.  And sorry for the hassle.


--
-=( Ian Abbott @ MEV Ltd.E-mail:  )=-
-=(  Web: http://www.mev.co.uk/  )=-
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: Asociación de Empresas

2016-05-19 Thread Sr. Raymond Khumalo



--
¡Saludos!

¿Está bien para discutir posibles negocios en este correo electrónico? 
Hágamelo saber lo antes posible para que yo pueda proporcionarle los 
detalles. Ponte en contacto conmigo en mi correo electrónico 
(raymond_khum...@outlook.com) para más detalles de este negocio


Un cordial saludo,
Raymond Khumalo
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


RE: new driver for drivers/virt/?

2016-05-19 Thread Sell, Timothy C
> -Original Message-
> From: Sell, Timothy C
> Sent: Wednesday, May 18, 2016 6:25 PM
> To: 'Thomas Gleixner'
> Cc: mi...@kernel.org; dave.han...@linux.intel.com;
> ti...@freescale.com; ga...@kernel.crashing.org; Kershner, David A;
> cor...@lwn.net; mi...@redhat.com; h...@zytor.com; Arfvidson, Erik;
> hof...@osadl.org; dzic...@redhat.com; Curtin, Alexander Paul;
> janani.rvchn...@gmail.com; sudipm.mukher...@gmail.com;
> pra...@redhat.com; Binder, David Anthony; nhor...@redhat.com;
> dan.j.willi...@intel.com; linux-ker...@vger.kernel.org; linux-
> d...@vger.kernel.org; driverdev-devel@linuxdriverproject.org; *S-Par-
> Maintainer; Greg KH; Jes Sorensen
> Subject: RE: new driver for drivers/virt/?
> 
> > -Original Message-
> > From: Thomas Gleixner [mailto:t...@linutronix.de]
> > Sent: Wednesday, May 18, 2016 6:12 PM
> > To: Sell, Timothy C
> > Cc: mi...@kernel.org; dave.han...@linux.intel.com;
> > ti...@freescale.com; ga...@kernel.crashing.org; Kershner, David A;
> > cor...@lwn.net; mi...@redhat.com; h...@zytor.com; Arfvidson, Erik;
> > hof...@osadl.org; dzic...@redhat.com; Curtin, Alexander Paul;
> > janani.rvchn...@gmail.com; sudipm.mukher...@gmail.com;
> > pra...@redhat.com; Binder, David Anthony; nhor...@redhat.com;
> > dan.j.willi...@intel.com; linux-ker...@vger.kernel.org; linux-
> > d...@vger.kernel.org; driverdev-devel@linuxdriverproject.org; *S-Par-
> > Maintainer; Greg KH; Jes Sorensen
> > Subject: Re: new driver for drivers/virt/?
> >
> > On Wed, 18 May 2016, Sell, Timothy C wrote:
> > > We have a bus driver currently in drivers/staging/unisys/visorbus/ that
> > > we are trying to get out of staging and into the kernel proper.  Since
> > > "visorbus" is a driver to host a virtual bus presented to a Linux guest
> > > in a hypervisor environment (refer to
> > > drivers/staging/unisys/Documentation/overview.txt for more details),
> > > Greg KH and Jes Sorensen have suggested the possibility that
> drivers/virt/
> > > might be a good place for visorbus.  But right now, we see that the only
> > > driver under drivers/virt/ is the Freescale hypervisor environment,
> which
> > > made us wonder whether this was really the correct place.
> > >
> > > Would you have any guidance for us?
> > > Our intent is to push our visorbus out of staging immediately following
> > > the current merge window.
> >
> > What's the problem with Gregs and Jes suggestion? I don't see any.
> >
> 
> That's good; glad you agree with them.  We just wanted to double-check
> with those of you listed as maintainers of drivers/virt/.  Thanks.
> 
> > There is bigger fish to fry than the final place of this driver. I had just 
> > a
> > peek at the staging code and there is enough stuff which wants to be
> > cleaned
> > up before moving anywhere. I don't have time to do a proper review now,
> > but
> > here are a few hints upfront:
> >
> > 1) Locking:
> >
> >visordriver_callback_lock:
> >
> >   That should be a mutex, not a semaphore
> >
> >periodic_work->lock:
> >
> >   Why is this a rw_lock if it's only locked with write_lock? And what's
> >   the purpose of this lock at all?
> >
> > 2) Memory barriers:
> >
> >Completely undocumented wmb()s without corresponding rmb()s to do
> > obscure
> >protection of that periodic work stuff.
> >

tglx:

Re wmb/rmb: I believe you must have been looking at an older
version of our code in Linus' tree, rather than the latest version in
Greg's staging-next tree.  Reason is, Linus' tree only contains our
source code thru 3/11 (i.e., see
(http://git.kernel.org/cgit/linux/kernel/git/stable/linux-stable.git/log/drivers/staging/unisys),
and wmb() was removed in Greg's staging-next tree on 3/30 with
commit 64938182e7836650feeb9b2b9dadd510ed4b0dad
(https://git.kernel.org/cgit/linux/kernel/git/gregkh/staging.git/commit/drivers/staging?h=staging-next&id=64938182e7836650feeb9b2b9dadd510ed4b0dad).

We've made a LOT of changes in Greg's staging-next since 3/11.
However, the other issues you bring up still look to be valid in our
latest source code (in Greg's staging-next).

Tim Sell

> > 3) periodic_work:
> >
> >That set of functions is obscure. Especially visor_periodic_work_stop()
> >makes me shudder. See also #2.
> >
> >That work->lock does not inspire my confidence further.
> >
> > 4) Exports:
> >
> >A gazillion of exports which are just wrappers around another set of
> >exports
> >
> > 5) Function comments:
> >
> >Try to mimic kerneldoc comments, i.e. start with: /**
> >but do not implement any of the kerneldoc requirements.
> >
> 
> We'll take a look at these.  Thanks.
> 
> Tim Sell
> 
> > I'll try do find a time slot for a proper review of that thing, but don't
> > expect that to happen in the next days.
> >
> > Thanks,
> >
> > tglx
> >

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH net-next] tools: hv: Add a script for bonding synthetic and VF NICs

2016-05-19 Thread Haiyang Zhang
This example script creates bonding network devices based on synthetic NIC
(the virtual network adapter usually provided by Hyper-V) and the matching
VF NIC (SRIOV virtual function). So the synthetic NIC and VF NIC can
function as one network device, and fail over to the synthetic NIC if VF is
down.

Signed-off-by: Haiyang Zhang 
Reviewed-by: K. Y. Srinivasan 
---
 tools/hv/bondvf.sh |  132 
 1 files changed, 132 insertions(+), 0 deletions(-)
 create mode 100755 tools/hv/bondvf.sh

diff --git a/tools/hv/bondvf.sh b/tools/hv/bondvf.sh
new file mode 100755
index 000..2758d60
--- /dev/null
+++ b/tools/hv/bondvf.sh
@@ -0,0 +1,132 @@
+#!/bin/bash
+
+# This example script creates bonding network devices based on synthetic NIC
+# (the virtual network adapter usually provided by Hyper-V) and the matching
+# VF NIC (SRIOV virtual function). So the synthetic NIC and VF NIC can
+# function as one network device, and fail over to the synthetic NIC if VF is
+# down.
+#
+# Usage:
+# - After configured vSwitch and vNIC with SRIOV, start Linux virtual
+#   machine (VM)
+# - Run this scripts on the VM. It will create configuration files in
+#   /etc/sysconfig/network-scripts/
+# - Reboot the VM, so that the bonding config are enabled.
+#
+# The config files are DHCP by default. You may edit them if you need to change
+# to Static IP or change other settings. The file name is, for example:
+#   /etc/sysconfig/network-scripts/ifcfg-bond0
+#
+# Each Distro is expected to implement this script in a distro specific
+# fashion.
+#
+# This example script is based on a RHEL environment.
+#
+# Here is an example of the bonding configuration file:
+#   DEVICE=bond0
+#   TYPE=Bond
+#   BOOTPROTO=dhcp
+#   ONBOOT=yes
+#   NM_CONTROLLED=no
+#   PEERDNS=yes
+#   IPV6INIT=yes
+#   BONDING_MASTER=yes
+#   BONDING_OPTS="mode=active-backup miimon=100 primary=eth1"
+#
+
+sysdir=/sys/class/net
+cfgdir=/etc/sysconfig/network-scripts
+netvsc_cls={f8615163-df3e-46c5-913f-f2d2f965ed0e}
+bondcnt=0
+
+# Get a list of ethernet names
+list_eth=(`cd $sysdir && ls -d */ | cut -d/ -f1 | grep -v bond`)
+eth_cnt=${#list_eth[@]}
+
+echo List of net devices:
+
+# Get the MAC addresses
+for (( i=0; i < $eth_cnt; i++ ))
+do
+   list_mac[$i]=`cat $sysdir/${list_eth[$i]}/address`
+   echo ${list_eth[$i]}, ${list_mac[$i]}
+done
+
+# Find NIC with matching MAC
+for (( i=0; i < $eth_cnt-1; i++ ))
+do
+   for (( j=i+1; j < $eth_cnt; j++ ))
+   do
+   if [ "${list_mac[$i]}" = "${list_mac[$j]}" ]
+   then
+   list_match[$i]=${list_eth[$j]}
+   break
+   fi
+   done
+done
+
+function create_eth_cfg {
+   local fn=$cfgdir/ifcfg-$1
+
+   echo creating: $fn for $2
+
+   rm -f $fn
+   echo DEVICE=$1 >>$fn
+   echo TYPE=Ethernet >>$fn
+   echo BOOTPROTO=none >>$fn
+   echo ONBOOT=yes >>$fn
+   echo NM_CONTROLLED=no >>$fn
+   echo PEERDNS=yes >>$fn
+   echo IPV6INIT=yes >>$fn
+   echo MASTER=$2 >>$fn
+   echo SLAVE=yes >>$fn
+}
+
+function create_bond_cfg {
+   local fn=$cfgdir/ifcfg-$1
+
+   echo $'\nBond name:' $1
+   echo creating: $fn with primary slave: $2
+
+   rm -f $fn
+   echo DEVICE=$1 >>$fn
+   echo TYPE=Bond >>$fn
+   echo BOOTPROTO=dhcp >>$fn
+   echo ONBOOT=yes >>$fn
+   echo NM_CONTROLLED=no >>$fn
+   echo PEERDNS=yes >>$fn
+   echo IPV6INIT=yes >>$fn
+   echo BONDING_MASTER=yes >>$fn
+   echo BONDING_OPTS=\"mode=active-backup miimon=100 primary=$2\" >>$fn
+}
+
+function create_bond {
+   local bondname=bond$bondcnt
+
+   local class_id1=`cat $sysdir/$1/device/class_id 2>/dev/null`
+   local class_id2=`cat $sysdir/$2/device/class_id 2>/dev/null`
+
+   if [ "$class_id1" = "$netvsc_cls" ]
+   then
+   create_bond_cfg $bondname $2
+   elif [ "$class_id2" = "$netvsc_cls" ]
+   then
+   create_bond_cfg $bondname $1
+   else
+   return 0
+   fi
+
+   create_eth_cfg $1 $bondname
+   create_eth_cfg $2 $bondname
+
+   let bondcnt=bondcnt+1
+}
+
+for (( i=0; i < $eth_cnt-1; i++ ))
+do
+if [ -n "${list_match[$i]}" ]
+then
+   create_bond ${list_eth[$i]} ${list_match[$i]}
+fi
+done
+
-- 
1.7.4.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


RE: [PATCH v3 06/14] staging: comedi: daqboard2000: rename register offset macros

2016-05-19 Thread Hartley Sweeten
On Thursday, May 19, 2016 2:56 AM, Ian Abbott wrote:
> Rename the macros defining register offsets to avoid CamelCase, and to
> use namespace associated with the driver.
>
> Signed-off-by: Ian Abbott 
> Reviewed-by: H Hartley Sweeten 
> ---
> Other CamelCase issues in this patch will be dealt with by later
> patches in the series.
>
> v2: Shortened prefix from `DAQBOARD2000_` to `DB2K_`.
> v3: Removed a space before tab that slipped in in v2.

Ian,

Your [PATCH v2 07/14: ...] does not apply after this one.

It's probably better if Greg drops the previous patches and you
post a full series.

Regards,
Hartley

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH v3 06/14] staging: comedi: daqboard2000: rename register offset macros

2016-05-19 Thread Ian Abbott

On 19/05/16 17:49, Hartley Sweeten wrote:

On Thursday, May 19, 2016 2:56 AM, Ian Abbott wrote:

Rename the macros defining register offsets to avoid CamelCase, and to
use namespace associated with the driver.

Signed-off-by: Ian Abbott 
Reviewed-by: H Hartley Sweeten 
---
Other CamelCase issues in this patch will be dealt with by later
patches in the series.

v2: Shortened prefix from `DAQBOARD2000_` to `DB2K_`.
v3: Removed a space before tab that slipped in in v2.


Ian,

Your [PATCH v2 07/14: ...] does not apply after this one.

It's probably better if Greg drops the previous patches and you
post a full series.


I must be having a bad day!

I'll repost it all as v4.


--
-=( Ian Abbott @ MEV Ltd.E-mail:  )=-
-=(  Web: http://www.mev.co.uk/  )=-
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH v2 00/14] staging: comedi: daqboard2000: checkpatch clean-ups

2016-05-19 Thread Ian Abbott

On 19/05/16 11:16, Ian Abbott wrote:

On 19/05/16 11:02, Ian Abbott wrote:

On 18/05/16 13:36, Ian Abbott wrote:

Patches 03 and 06 have checkpatch warnings themselves about CamelCase
issues, but they are not "new" issues, and are resolved by the later
patches in the series.

01) staging: comedi: daqboard2000: remove commented out code
02) staging: comedi: daqboard2000: use usual block comment style
03) staging: comedi: daqboard2000: CHECK: spaces preferred around that
 '*'
04) staging: comedi: daqboard2000: add blank line after struct
 declaration
05) staging: comedi: daqboard2000: rename serial EEPROM register macros
06) staging: comedi: daqboard2000: rename register offset macros
07) staging: comedi: daqboard2000: rename acquisition control register
 macros
08) staging: comedi: daqboard2000: rename acq status register macros
09) staging: comedi: daqboard2000: redo DAC control register macros
10) staging: comedi: daqboard2000: redo DAC status macros and fix busy
11) staging: comedi: daqboard2000: rename trigger control register
 macros
12) staging: comedi: daqboard2000: rename reference DACs register macros
13) staging: comedi: daqboard2000: rename CamelCase functions
14) staging: comedi: daqboard2000: prefer usleep_range()

v2: Incorporate suggestions by H Hartley Sweeten, adding a couple of
comments in patch 01, changing a prefix from `DAQBOARD2000_` to `DB2K_`
in patches 05 onwards, and changing a `udelay(10)` to `usleep_range(10,
20)` in patch 14.

  drivers/staging/comedi/drivers/daqboard2000.c | 380
+-
  1 file changed, 189 insertions(+), 191 deletions(-)



I posted a v3 of patches 06 and 12, following Hartley's comments:

[PATCH v3 06/14] staging: comedi: daqboard2000: rename register offset
macros
[PATCH v3 12/14] staging: comedi: daqboard2000: rename reference DACs
register macros


And then I posted a v4 of patch 12, correcting a typo I missed in v3:

[PATCH v4 12/14] staging: comedi: daqboard2000: rename reference DACs
register macros

So patch 06/14 is at v3, patch 12/14 is at v4, and all the others are
v2.  If that's too much hassle to deal with, let me know, and I'll
repost the whole series as v4.  And sorry for the hassle.



Scratch all that, I'm posting a full v4 series.

--
-=( Ian Abbott @ MEV Ltd.E-mail:  )=-
-=(  Web: http://www.mev.co.uk/  )=-
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v4 02/14] staging: comedi: daqboard2000: use usual block comment style

2016-05-19 Thread Ian Abbott
Reformat one of the block comments to conform to the usual style (it's
the only one that doesn't).

Signed-off-by: Ian Abbott 
Reviewed-by: H Hartley Sweeten 
---
v2, v3, v4: No change.
---
 drivers/staging/comedi/drivers/daqboard2000.c | 6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/comedi/drivers/daqboard2000.c 
b/drivers/staging/comedi/drivers/daqboard2000.c
index 63d68fd..905b005 100644
--- a/drivers/staging/comedi/drivers/daqboard2000.c
+++ b/drivers/staging/comedi/drivers/daqboard2000.c
@@ -359,10 +359,12 @@ static int daqboard2000_ai_insn_read(struct comedi_device 
*dev,
gain = CR_RANGE(insn->chanspec);
chan = CR_CHAN(insn->chanspec);
 
-   /* This doesn't look efficient.  I decided to take the conservative
+   /*
+* This doesn't look efficient.  I decided to take the conservative
 * approach when I did the insn conversion.  Perhaps it would be
 * better to have broken it completely, then someone would have been
-* forced to fix it.  --ds */
+* forced to fix it.  --ds
+*/
for (i = 0; i < insn->n; i++) {
setup_sampling(dev, chan, gain);
/* Enable reading from the scanlist FIFO */
-- 
2.8.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v4 05/14] staging: comedi: daqboard2000: rename serial EEPROM register macros

2016-05-19 Thread Ian Abbott
Rename the macros defining values for the Serial EEPROM Control Register
to avoid CamelCase.

Signed-off-by: Ian Abbott 
Reviewed-by: H Hartley Sweeten 
---
v2: Shortened prefix from `DAQBOARD2000_` to `DB2K_`.
v3, v4: No change.
---
 drivers/staging/comedi/drivers/daqboard2000.c | 26 +-
 1 file changed, 13 insertions(+), 13 deletions(-)

diff --git a/drivers/staging/comedi/drivers/daqboard2000.c 
b/drivers/staging/comedi/drivers/daqboard2000.c
index cbbeb50..ceb910d 100644
--- a/drivers/staging/comedi/drivers/daqboard2000.c
+++ b/drivers/staging/comedi/drivers/daqboard2000.c
@@ -116,12 +116,12 @@
 #define DAQBOARD2000_SUBSYSTEM_IDS40x0004  /* Daqboard/2000 - 4 Dacs */
 
 /* Initialization bits for the Serial EEPROM Control Register */
-#define DAQBOARD2000_SECRProgPinHi  0x8001767e
-#define DAQBOARD2000_SECRProgPinLo  0x8000767e
-#define DAQBOARD2000_SECRLocalBusHi 0xc000767e
-#define DAQBOARD2000_SECRLocalBusLo 0x8000767e
-#define DAQBOARD2000_SECRReloadHi   0xa000767e
-#define DAQBOARD2000_SECRReloadLo   0x8000767e
+#define DB2K_SECR_PROG_PIN_HI  0x8001767e
+#define DB2K_SECR_PROG_PIN_LO  0x8000767e
+#define DB2K_SECR_LOCAL_BUS_HI 0xc000767e
+#define DB2K_SECR_LOCAL_BUS_LO 0x8000767e
+#define DB2K_SECR_RELOAD_HI0xa000767e
+#define DB2K_SECR_RELOAD_LO0x8000767e
 
 /* SECR status bits */
 #define DAQBOARD2000_EEPROM_PRESENT 0x1000
@@ -438,9 +438,9 @@ static void daqboard2000_resetLocalBus(struct comedi_device 
*dev)
 {
struct daqboard2000_private *devpriv = dev->private;
 
-   writel(DAQBOARD2000_SECRLocalBusHi, devpriv->plx + 0x6c);
+   writel(DB2K_SECR_LOCAL_BUS_HI, devpriv->plx + 0x6c);
mdelay(10);
-   writel(DAQBOARD2000_SECRLocalBusLo, devpriv->plx + 0x6c);
+   writel(DB2K_SECR_LOCAL_BUS_LO, devpriv->plx + 0x6c);
mdelay(10);
 }
 
@@ -448,11 +448,11 @@ static void daqboard2000_reloadPLX(struct comedi_device 
*dev)
 {
struct daqboard2000_private *devpriv = dev->private;
 
-   writel(DAQBOARD2000_SECRReloadLo, devpriv->plx + 0x6c);
+   writel(DB2K_SECR_RELOAD_LO, devpriv->plx + 0x6c);
mdelay(10);
-   writel(DAQBOARD2000_SECRReloadHi, devpriv->plx + 0x6c);
+   writel(DB2K_SECR_RELOAD_HI, devpriv->plx + 0x6c);
mdelay(10);
-   writel(DAQBOARD2000_SECRReloadLo, devpriv->plx + 0x6c);
+   writel(DB2K_SECR_RELOAD_LO, devpriv->plx + 0x6c);
mdelay(10);
 }
 
@@ -460,9 +460,9 @@ static void daqboard2000_pulseProgPin(struct comedi_device 
*dev)
 {
struct daqboard2000_private *devpriv = dev->private;
 
-   writel(DAQBOARD2000_SECRProgPinHi, devpriv->plx + 0x6c);
+   writel(DB2K_SECR_PROG_PIN_HI, devpriv->plx + 0x6c);
mdelay(10);
-   writel(DAQBOARD2000_SECRProgPinLo, devpriv->plx + 0x6c);
+   writel(DB2K_SECR_PROG_PIN_LO, devpriv->plx + 0x6c);
mdelay(10); /* Not in the original code, but I like symmetry... */
 }
 
-- 
2.8.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v4 01/14] staging: comedi: daqboard2000: remove commented out code

2016-05-19 Thread Ian Abbott
Remove some commented out code.  Some of it uses constructs that don't
exist in the driver, and probably come from the source code for the MS
Windows driver.

Signed-off-by: Ian Abbott 
Reviewed-by: H Hartley Sweeten 
---
v2: Added comments to offset and gain values that should be read from
EEPROM, as suggested by Hartley.
v3, v4: No change.
---
 drivers/staging/comedi/drivers/daqboard2000.c | 10 ++
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/drivers/staging/comedi/drivers/daqboard2000.c 
b/drivers/staging/comedi/drivers/daqboard2000.c
index 57ab668..63d68fd 100644
--- a/drivers/staging/comedi/drivers/daqboard2000.c
+++ b/drivers/staging/comedi/drivers/daqboard2000.c
@@ -278,9 +278,7 @@ struct daqboard2000_private {
 
 static void writeAcqScanListEntry(struct comedi_device *dev, u16 entry)
 {
-   /* udelay(4); */
writew(entry & 0x00ff, dev->mmio + acqScanListFIFO);
-   /* udelay(4); */
writew((entry >> 8) & 0x00ff, dev->mmio + acqScanListFIFO);
 }
 
@@ -315,13 +313,9 @@ static void setup_sampling(struct comedi_device *dev, int 
chan, int gain)
word3 = 0;
break;
}
-/*
-  dev->eeprom.correctionDACSE[i][j][k].offset = 0x800;
-  dev->eeprom.correctionDACSE[i][j][k].gain = 0xc00;
-*/
/* These should be read from EEPROM */
-   word2 |= 0x0800;
-   word3 |= 0xc000;
+   word2 |= 0x0800;/* offset */
+   word3 |= 0xc000;/* gain */
writeAcqScanListEntry(dev, word0);
writeAcqScanListEntry(dev, word1);
writeAcqScanListEntry(dev, word2);
-- 
2.8.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v4 07/14] staging: comedi: daqboard2000: rename acquisition control register macros

2016-05-19 Thread Ian Abbott
Rename the macros defining values for the acquisition control register
to avoid CamelCase, and to make it clearer which register they are
associated with.

Signed-off-by: Ian Abbott 
Reviewed-by: H Hartley Sweeten 
---
v2: Shortened prefix from `DAQBOARD2000_` to `DB2K_`.
v3: Rebased due to v3 change in previous patches.
v4: No change.
---
 drivers/staging/comedi/drivers/daqboard2000.c | 50 ---
 1 file changed, 23 insertions(+), 27 deletions(-)

diff --git a/drivers/staging/comedi/drivers/daqboard2000.c 
b/drivers/staging/comedi/drivers/daqboard2000.c
index 7c6a2450..4d3e3c6 100644
--- a/drivers/staging/comedi/drivers/daqboard2000.c
+++ b/drivers/staging/comedi/drivers/daqboard2000.c
@@ -182,13 +182,13 @@ static const struct comedi_lrange range_daqboard2000_ai = 
{
 #define DB2K_REG_DIO_P2_EXP_IO_16_BIT(x)   (0xc0 + (x) * 2) /* s16 */
 
 /* Scan Sequencer programming */
-#define DAQBOARD2000_SeqStartScanList0x0011
-#define DAQBOARD2000_SeqStopScanList 0x0010
+#define DB2K_ACQ_CONTROL_SEQ_START_SCAN_LIST   0x0011
+#define DB2K_ACQ_CONTROL_SEQ_STOP_SCAN_LIST0x0010
 
 /* Prepare for acquisition */
-#define DAQBOARD2000_AcqResetScanListFifo0x0004
-#define DAQBOARD2000_AcqResetResultsFifo 0x0002
-#define DAQBOARD2000_AcqResetConfigPipe  0x0001
+#define DB2K_ACQ_CONTROL_RESET_SCAN_LIST_FIFO  0x0004
+#define DB2K_ACQ_CONTROL_RESET_RESULTS_FIFO0x0002
+#define DB2K_ACQ_CONTROL_RESET_CONFIG_PIPE 0x0001
 
 /* Acqusition status bits */
 #define DAQBOARD2000_AcqResultsFIFOMore1Sample   0x0001
@@ -203,20 +203,16 @@ static const struct comedi_lrange range_daqboard2000_ai = 
{
 #define DAQBOARD2000_DacPacerOverrun 0x0200
 #define DAQBOARD2000_AcqHardwareError0x01c0
 
-/* Scan Sequencer programming */
-#define DAQBOARD2000_SeqStartScanList0x0011
-#define DAQBOARD2000_SeqStopScanList 0x0010
-
 /* Pacer Clock Control */
-#define DAQBOARD2000_AdcPacerInternal0x0030
-#define DAQBOARD2000_AdcPacerExternal0x0032
-#define DAQBOARD2000_AdcPacerEnable  0x0031
-#define DAQBOARD2000_AdcPacerEnableDacPacer  0x0034
-#define DAQBOARD2000_AdcPacerDisable 0x0030
-#define DAQBOARD2000_AdcPacerNormalMode  0x0060
-#define DAQBOARD2000_AdcPacerCompatibilityMode   0x0061
-#define DAQBOARD2000_AdcPacerInternalOutEnable   0x0008
-#define DAQBOARD2000_AdcPacerExternalRising  0x0100
+#define DB2K_ACQ_CONTROL_ADC_PACER_INTERNAL0x0030
+#define DB2K_ACQ_CONTROL_ADC_PACER_EXTERNAL0x0032
+#define DB2K_ACQ_CONTROL_ADC_PACER_ENABLE  0x0031
+#define DB2K_ACQ_CONTROL_ADC_PACER_ENABLE_DAC_PACER0x0034
+#define DB2K_ACQ_CONTROL_ADC_PACER_DISABLE 0x0030
+#define DB2K_ACQ_CONTROL_ADC_PACER_NORMAL_MODE 0x0060
+#define DB2K_ACQ_CONTROL_ADC_PACER_COMPATIBILITY_MODE  0x0061
+#define DB2K_ACQ_CONTROL_ADC_PACER_INTERNAL_OUT_ENABLE 0x0008
+#define DB2K_ACQ_CONTROL_ADC_PACER_EXTERNAL_RISING 0x0100
 
 /* DAC status */
 #define DAQBOARD2000_DacFull 0x0001
@@ -346,9 +342,9 @@ static int daqboard2000_ai_insn_read(struct comedi_device 
*dev,
int ret;
int i;
 
-   writew(DAQBOARD2000_AcqResetScanListFifo |
-  DAQBOARD2000_AcqResetResultsFifo |
-  DAQBOARD2000_AcqResetConfigPipe,
+   writew(DB2K_ACQ_CONTROL_RESET_SCAN_LIST_FIFO |
+  DB2K_ACQ_CONTROL_RESET_RESULTS_FIFO |
+  DB2K_ACQ_CONTROL_RESET_CONFIG_PIPE,
   dev->mmio + DB2K_REG_ACQ_CONTROL);
 
/*
@@ -371,7 +367,7 @@ static int daqboard2000_ai_insn_read(struct comedi_device 
*dev,
for (i = 0; i < insn->n; i++) {
setup_sampling(dev, chan, gain);
/* Enable reading from the scanlist FIFO */
-   writew(DAQBOARD2000_SeqStartScanList,
+   writew(DB2K_ACQ_CONTROL_SEQ_START_SCAN_LIST,
   dev->mmio + DB2K_REG_ACQ_CONTROL);
 
ret = comedi_timeout(dev, s, insn, daqboard2000_ai_status,
@@ -379,7 +375,7 @@ static int daqboard2000_ai_insn_read(struct comedi_device 
*dev,
if (ret)
return ret;
 
-   writew(DAQBOARD2000_AdcPacerEnable,
+   writew(DB2K_ACQ_CONTROL_ADC_PACER_ENABLE,
   dev->mmio + DB2K_REG_ACQ_CONTROL);
 
ret = comedi_timeout(dev, s, insn, daqboard2000_ai_status,
@@ -393,9 +389,9 @@ static int daqboard2000_ai_insn_read(struct comedi_device 
*dev,
return ret;
 
data[i] = readw(dev->mmio + DB2K_REG_ACQ_RESULTS_FIFO);
-   writew(DAQBOARD2000_AdcPacerDisable,
+   writew(DB2K_ACQ_CONTROL_ADC_PACER_DISABLE,
   dev->mmio + DB2K_REG_ACQ_CONTROL);
-   writew(DAQBOARD2000_SeqStopScanList,
+   writew(DB2K_ACQ_CONTROL_SEQ_STOP

[PATCH v4 00/14] staging: comedi: daqboard2000: checkpatch clean-ups

2016-05-19 Thread Ian Abbott
s series of patches to the daqboard2000 driver is mostly to fix the
checkpatch.pl warnings.  There is one warning remaining about one of the
`udelay` calls with a parameter of 10 microseconds, but I decided to
leave it alone, as converting it to `usleep_range` could increase
firmware loading time.

Patches 03 and 06 have checkpatch warnings themselves about CamelCase
issues, but they are not "new" issues, and are resolved by the later
patches in the series.

01) staging: comedi: daqboard2000: remove commented out code
02) staging: comedi: daqboard2000: use usual block comment style
03) staging: comedi: daqboard2000: CHECK: spaces preferred around that
'*'
04) staging: comedi: daqboard2000: add blank line after struct
declaration
05) staging: comedi: daqboard2000: rename serial EEPROM register macros
06) staging: comedi: daqboard2000: rename register offset macros
07) staging: comedi: daqboard2000: rename acquisition control register
macros
08) staging: comedi: daqboard2000: rename acq status register macros
09) staging: comedi: daqboard2000: redo DAC control register macros
10) staging: comedi: daqboard2000: redo DAC status macros and fix busy
11) staging: comedi: daqboard2000: rename trigger control register
macros
12) staging: comedi: daqboard2000: rename reference DACs register macros
13) staging: comedi: daqboard2000: rename CamelCase functions
14) staging: comedi: daqboard2000: prefer usleep_range()

v2: Incorporate suggestions by H Hartley Sweeten, adding a couple of
comments in patch 01, changing a prefix from `DAQBOARD2000_` to `DB2K_`
in patches 05 onwards, and changing a `udelay(10)` to `usleep_range(10,
20)` in patch 14.

v3: Fix a space before tab formatting error that crept in to patch 06v2,
and a typo in the commit message for patch 12.

v4: Fix two more typos in the commit message for patch 12 and 12v2.

 drivers/staging/comedi/drivers/daqboard2000.c | 380 +-
 1 file changed, 189 insertions(+), 191 deletions(-)
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v4 09/14] staging: comedi: daqboard2000: redo DAC control register macros

2016-05-19 Thread Ian Abbott
Rename the macros used to define values for the DAC control register to
avoid CamelCase and to make it clearer which register they are
associated with.  Refactor the macros used to define values to enable or
disable DAC channels to use the channel number as a parameter.  None of
these macros are currently used by the driver.

Signed-off-by: Ian Abbott 
Reviewed-by: H Hartley Sweeten 
---
v2: Shortened prefix from `DAQBOARD2000_` to `DB2K_`.
v3, v4: No change.
---
 drivers/staging/comedi/drivers/daqboard2000.c | 21 +++--
 1 file changed, 7 insertions(+), 14 deletions(-)

diff --git a/drivers/staging/comedi/drivers/daqboard2000.c 
b/drivers/staging/comedi/drivers/daqboard2000.c
index 08d4809..d8a3345 100644
--- a/drivers/staging/comedi/drivers/daqboard2000.c
+++ b/drivers/staging/comedi/drivers/daqboard2000.c
@@ -225,20 +225,13 @@ static const struct comedi_lrange range_daqboard2000_ai = 
{
 #define DAQBOARD2000_Dac3Busy0x0080
 
 /* DAC control */
-#define DAQBOARD2000_Dac0Enable  0x0021
-#define DAQBOARD2000_Dac1Enable  0x0031
-#define DAQBOARD2000_Dac2Enable  0x0041
-#define DAQBOARD2000_Dac3Enable  0x0051
-#define DAQBOARD2000_DacEnableBit0x0001
-#define DAQBOARD2000_Dac0Disable 0x0020
-#define DAQBOARD2000_Dac1Disable 0x0030
-#define DAQBOARD2000_Dac2Disable 0x0040
-#define DAQBOARD2000_Dac3Disable 0x0050
-#define DAQBOARD2000_DacResetFifo0x0004
-#define DAQBOARD2000_DacPatternDisable   0x0060
-#define DAQBOARD2000_DacPatternEnable0x0061
-#define DAQBOARD2000_DacSelectSignedData 0x0002
-#define DAQBOARD2000_DacSelectUnsignedData   0x
+#define DB2K_DAC_CONTROL_ENABLE_BIT0x0001
+#define DB2K_DAC_CONTROL_DATA_IS_SIGNED0x0002
+#define DB2K_DAC_CONTROL_RESET_FIFO0x0004
+#define DB2K_DAC_CONTROL_DAC_DISABLE(x)(0x0020 + ((x) 
<< 4))
+#define DB2K_DAC_CONTROL_DAC_ENABLE(x) (0x0021 + ((x) << 4))
+#define DB2K_DAC_CONTROL_PATTERN_DISABLE   0x0060
+#define DB2K_DAC_CONTROL_PATTERN_ENABLE0x0061
 
 /* Trigger Control */
 #define DAQBOARD2000_TrigAnalog  0x
-- 
2.8.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v4 04/14] staging: comedi: daqboard2000: add blank line after struct declaration

2016-05-19 Thread Ian Abbott
Fix checkpatch issue: "CHECK: Please use a blank line after
function/struct/union/enum declarations".

Signed-off-by: Ian Abbott 
Reviewed-by: H Hartley Sweeten 
---
v2: Fixed typo in patch description: `black line` --> `blank line`.
v3, v4: No change.
---
 drivers/staging/comedi/drivers/daqboard2000.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/staging/comedi/drivers/daqboard2000.c 
b/drivers/staging/comedi/drivers/daqboard2000.c
index 904de95..cbbeb50 100644
--- a/drivers/staging/comedi/drivers/daqboard2000.c
+++ b/drivers/staging/comedi/drivers/daqboard2000.c
@@ -264,6 +264,7 @@ struct daq200_boardtype {
const char *name;
int id;
 };
+
 static const struct daq200_boardtype boardtypes[] = {
{"ids2", DAQBOARD2000_SUBSYSTEM_IDS2},
{"ids4", DAQBOARD2000_SUBSYSTEM_IDS4},
-- 
2.8.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v4 03/14] staging: comedi: daqboard2000: CHECK: spaces preferred around that '*'

2016-05-19 Thread Ian Abbott
Fix checkpatch issues of the form "CHECK: spaces preferred around that
'*' (ctx:VxV)".

Signed-off-by: Ian Abbott 
Reviewed-by: H Hartley Sweeten 
---
CamelCase issues in this patch will be dealt with by later patches.

v2, v3, v4: No change.
---
 drivers/staging/comedi/drivers/daqboard2000.c | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/comedi/drivers/daqboard2000.c 
b/drivers/staging/comedi/drivers/daqboard2000.c
index 905b005..904de95 100644
--- a/drivers/staging/comedi/drivers/daqboard2000.c
+++ b/drivers/staging/comedi/drivers/daqboard2000.c
@@ -169,17 +169,17 @@ static const struct comedi_lrange range_daqboard2000_ai = 
{
 #define dioP3hsioData  0x32/* s16 */
 #define dioP3Control   0x34/* u16 */
 #define calEepromControl   0x36/* u16 */
-#define dacSetting(x)  (0x38 + (x)*2)  /* s16 */
+#define dacSetting(x)  (0x38 + (x) * 2) /* s16 */
 #define dioP2ExpansionIO8Bit   0x40/* s16 */
 #define ctrTmrControl  0x80/* u16 */
-#define ctrInput(x)(0x88 + (x)*2)  /* s16 */
-#define timerDivisor(x)(0xa0 + (x)*2)  /* u16 */
+#define ctrInput(x)(0x88 + (x) * 2) /* s16 */
+#define timerDivisor(x)(0xa0 + (x) * 2) /* u16 */
 #define dmaControl 0xb0/* u16 */
 #define trigControl0xb2/* u16 */
 #define calEeprom  0xb8/* u16 */
 #define acqDigitalMark 0xba/* u16 */
 #define trigDacs   0xbc/* u16 */
-#define dioP2ExpansionIO16Bit(x)   (0xc0 + (x)*2)  /* s16 */
+#define dioP2ExpansionIO16Bit(x)   (0xc0 + (x) * 2) /* s16 */
 
 /* Scan Sequencer programming */
 #define DAQBOARD2000_SeqStartScanList0x0011
-- 
2.8.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v4 12/14] staging: comedi: daqboard2000: rename reference DACs register macros

2016-05-19 Thread Ian Abbott
Rename the macros that define values for the reference DACs register to
avoid CamelCase, and to make it clearer which register they are
associated with.  Add a macro `DB2K_REG_DACS_SET` for the value `0x0080`
that triggers setting one of the references.

Signed-off-by: Ian Abbott 
Reviewed-by: H Hartley Sweeten 
---
v2: Shortened prefix from `DAQBOARD2000_` to `DB2K_`.
v3: Corrected typo in commit:  0x80 --> 0x0080.
v4: Corrected typo in commit: DAQBOARD2000_REF_DACS_SET -->
DB2K_REG_DACS_SET
---
 drivers/staging/comedi/drivers/daqboard2000.c | 9 +
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/comedi/drivers/daqboard2000.c 
b/drivers/staging/comedi/drivers/daqboard2000.c
index e9efdbc..15f2b8a5 100644
--- a/drivers/staging/comedi/drivers/daqboard2000.c
+++ b/drivers/staging/comedi/drivers/daqboard2000.c
@@ -244,8 +244,9 @@ static const struct comedi_lrange range_daqboard2000_ai = {
 #define DB2K_TRIG_CONTROL_DISABLE  0x
 
 /* Reference Dac Selection */
-#define DAQBOARD2000_PosRefDacSelect 0x0100
-#define DAQBOARD2000_NegRefDacSelect 0x
+#define DB2K_REF_DACS_SET  0x0080
+#define DB2K_REF_DACS_SELECT_POS_REF   0x0100
+#define DB2K_REF_DACS_SELECT_NEG_REF   0x
 
 struct daq200_boardtype {
const char *name;
@@ -569,7 +570,7 @@ static void daqboard2000_activateReferenceDacs(struct 
comedi_device *dev)
int timeout;
 
/*  Set the + reference dac value in the FPGA */
-   writew(0x80 | DAQBOARD2000_PosRefDacSelect,
+   writew(DB2K_REF_DACS_SET | DB2K_REF_DACS_SELECT_POS_REF,
   dev->mmio + DB2K_REG_REF_DACS);
for (timeout = 0; timeout < 20; timeout++) {
val = readw(dev->mmio + DB2K_REG_DAC_STATUS);
@@ -579,7 +580,7 @@ static void daqboard2000_activateReferenceDacs(struct 
comedi_device *dev)
}
 
/*  Set the - reference dac value in the FPGA */
-   writew(0x80 | DAQBOARD2000_NegRefDacSelect,
+   writew(DB2K_REF_DACS_SET | DB2K_REF_DACS_SELECT_NEG_REF,
   dev->mmio + DB2K_REG_REF_DACS);
for (timeout = 0; timeout < 20; timeout++) {
val = readw(dev->mmio + DB2K_REG_DAC_STATUS);
-- 
2.8.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v4 13/14] staging: comedi: daqboard2000: rename CamelCase functions

2016-05-19 Thread Ian Abbott
Rename functions to avoid CamelCase warnings from checkpatch, and to use
namespace associated with the driver.

Signed-off-by: Ian Abbott 
Reviewed-by: H Hartley Sweeten 
---
v2: Rebased due to v2 changes in previous patches.
v3, v4: No change.
---
 drivers/staging/comedi/drivers/daqboard2000.c | 80 ++-
 1 file changed, 41 insertions(+), 39 deletions(-)

diff --git a/drivers/staging/comedi/drivers/daqboard2000.c 
b/drivers/staging/comedi/drivers/daqboard2000.c
index 15f2b8a5..fd9fb21 100644
--- a/drivers/staging/comedi/drivers/daqboard2000.c
+++ b/drivers/staging/comedi/drivers/daqboard2000.c
@@ -265,14 +265,16 @@ struct daqboard2000_private {
void __iomem *plx;
 };
 
-static void writeAcqScanListEntry(struct comedi_device *dev, u16 entry)
+static void daqboard2000_write_acq_scan_list_entry(struct comedi_device *dev,
+  u16 entry)
 {
writew(entry & 0x00ff, dev->mmio + DB2K_REG_ACQ_SCAN_LIST_FIFO);
writew((entry >> 8) & 0x00ff,
   dev->mmio + DB2K_REG_ACQ_SCAN_LIST_FIFO);
 }
 
-static void setup_sampling(struct comedi_device *dev, int chan, int gain)
+static void daqboard2000_setup_sampling(struct comedi_device *dev, int chan,
+   int gain)
 {
u16 word0, word1, word2, word3;
 
@@ -306,10 +308,10 @@ static void setup_sampling(struct comedi_device *dev, int 
chan, int gain)
/* These should be read from EEPROM */
word2 |= 0x0800;/* offset */
word3 |= 0xc000;/* gain */
-   writeAcqScanListEntry(dev, word0);
-   writeAcqScanListEntry(dev, word1);
-   writeAcqScanListEntry(dev, word2);
-   writeAcqScanListEntry(dev, word3);
+   daqboard2000_write_acq_scan_list_entry(dev, word0);
+   daqboard2000_write_acq_scan_list_entry(dev, word1);
+   daqboard2000_write_acq_scan_list_entry(dev, word2);
+   daqboard2000_write_acq_scan_list_entry(dev, word3);
 }
 
 static int daqboard2000_ai_status(struct comedi_device *dev,
@@ -357,7 +359,7 @@ static int daqboard2000_ai_insn_read(struct comedi_device 
*dev,
 * forced to fix it.  --ds
 */
for (i = 0; i < insn->n; i++) {
-   setup_sampling(dev, chan, gain);
+   daqboard2000_setup_sampling(dev, chan, gain);
/* Enable reading from the scanlist FIFO */
writew(DB2K_ACQ_CONTROL_SEQ_START_SCAN_LIST,
   dev->mmio + DB2K_REG_ACQ_CONTROL);
@@ -429,7 +431,7 @@ static int daqboard2000_ao_insn_write(struct comedi_device 
*dev,
return insn->n;
 }
 
-static void daqboard2000_resetLocalBus(struct comedi_device *dev)
+static void daqboard2000_reset_local_bus(struct comedi_device *dev)
 {
struct daqboard2000_private *devpriv = dev->private;
 
@@ -439,7 +441,7 @@ static void daqboard2000_resetLocalBus(struct comedi_device 
*dev)
mdelay(10);
 }
 
-static void daqboard2000_reloadPLX(struct comedi_device *dev)
+static void daqboard2000_reload_plx(struct comedi_device *dev)
 {
struct daqboard2000_private *devpriv = dev->private;
 
@@ -451,7 +453,7 @@ static void daqboard2000_reloadPLX(struct comedi_device 
*dev)
mdelay(10);
 }
 
-static void daqboard2000_pulseProgPin(struct comedi_device *dev)
+static void daqboard2000_pulse_prog_pin(struct comedi_device *dev)
 {
struct daqboard2000_private *devpriv = dev->private;
 
@@ -461,7 +463,7 @@ static void daqboard2000_pulseProgPin(struct comedi_device 
*dev)
mdelay(10); /* Not in the original code, but I like symmetry... */
 }
 
-static int daqboard2000_pollCPLD(struct comedi_device *dev, int mask)
+static int daqboard2000_poll_cpld(struct comedi_device *dev, int mask)
 {
int result = 0;
int i;
@@ -480,7 +482,7 @@ static int daqboard2000_pollCPLD(struct comedi_device *dev, 
int mask)
return result;
 }
 
-static int daqboard2000_writeCPLD(struct comedi_device *dev, int data)
+static int daqboard2000_write_cpld(struct comedi_device *dev, int data)
 {
int result = 0;
 
@@ -493,9 +495,9 @@ static int daqboard2000_writeCPLD(struct comedi_device 
*dev, int data)
return result;
 }
 
-static int initialize_daqboard2000(struct comedi_device *dev,
-  const u8 *cpld_array, size_t len,
-  unsigned long context)
+static int daqboard2000_load_firmware(struct comedi_device *dev,
+ const u8 *cpld_array, size_t len,
+ unsigned long context)
 {
struct daqboard2000_private *devpriv = dev->private;
int result = -EIO;
@@ -510,10 +512,10 @@ static int initialize_daqboard2000(struct comedi_device 
*dev,
return -EIO;
 
for (retry = 0; retry < 3; retry++) {
-   daqboard2000_resetLocalBus(dev);
-   daqboard2000_reloadPLX(dev);
-   daqboard2000_pulseProgPin(dev

[PATCH v4 10/14] staging: comedi: daqboard2000: redo DAC status macros and fix busy

2016-05-19 Thread Ian Abbott
Rename the macros defining values for the DAC status register to avoid
CamelCase, and to make it clear which register they are associated with.
Refactor the macros defining the regular DAC channel "busy" bits into a
single macro that takes the DAC channel number as a parameter.

Add a macro to define the offset of the read-only DAC status register.
It is the same offset as the DAC control register, which is write-only.

The code in `daqboard2000_ao_eoc()` that checks the status for
completion of the DAC conversion looks wrong.  The register has a "busy"
bit for each channel, but the existing code only works for channels 0
and 1.  The driver only supports two DAC channels at the moment, so the
bug is currently harmless, but fix it so we can support four DAC
channels on some board models.

Signed-off-by: Ian Abbott 
Reviewed-by: H Hartley Sweeten 
---
v2: Shortened prefix from `DAQBOARD2000_` to `DB2K_`.
v3, v4: No change.

squash! staging: comedi: daqboard2000: redo DAC status macros and fix busy
---
 drivers/staging/comedi/drivers/daqboard2000.c | 28 +--
 1 file changed, 13 insertions(+), 15 deletions(-)

diff --git a/drivers/staging/comedi/drivers/daqboard2000.c 
b/drivers/staging/comedi/drivers/daqboard2000.c
index d8a3345..d56bf20 100644
--- a/drivers/staging/comedi/drivers/daqboard2000.c
+++ b/drivers/staging/comedi/drivers/daqboard2000.c
@@ -162,7 +162,8 @@ static const struct comedi_lrange range_daqboard2000_ai = {
 #define DB2K_REG_ACQ_RESULTS_SHADOW0x14/* u16 */
 #define DB2K_REG_ACQ_ADC_RESULT0x18/* u16 
*/
 #define DB2K_REG_DAC_SCAN_COUNTER  0x1c/* u16 */
-#define DB2K_REG_DAC_CONTROL   0x20/* u16 */
+#define DB2K_REG_DAC_CONTROL   0x20/* u16 (w) */
+#define DB2K_REG_DAC_STATUS0x20/* u16 (r) */
 #define DB2K_REG_DAC_FIFO  0x24/* s16 */
 #define DB2K_REG_DAC_PACER_CLOCK_DIV   0x2a/* u16 */
 #define DB2K_REG_REF_DACS  0x2c/* u16 */
@@ -215,14 +216,11 @@ static const struct comedi_lrange range_daqboard2000_ai = 
{
 #define DB2K_ACQ_STATUS_DAC_PACER_OVERRUN  0x0200
 
 /* DAC status */
-#define DAQBOARD2000_DacFull 0x0001
-#define DAQBOARD2000_RefBusy 0x0002
-#define DAQBOARD2000_TrgBusy 0x0004
-#define DAQBOARD2000_CalBusy 0x0008
-#define DAQBOARD2000_Dac0Busy0x0010
-#define DAQBOARD2000_Dac1Busy0x0020
-#define DAQBOARD2000_Dac2Busy0x0040
-#define DAQBOARD2000_Dac3Busy0x0080
+#define DB2K_DAC_STATUS_DAC_FULL   0x0001
+#define DB2K_DAC_STATUS_REF_BUSY   0x0002
+#define DB2K_DAC_STATUS_TRIG_BUSY  0x0004
+#define DB2K_DAC_STATUS_CAL_BUSY   0x0008
+#define DB2K_DAC_STATUS_DAC_BUSY(x)(0x0010 << (x))
 
 /* DAC control */
 #define DB2K_DAC_CONTROL_ENABLE_BIT0x0001
@@ -400,8 +398,8 @@ static int daqboard2000_ao_eoc(struct comedi_device *dev,
unsigned int chan = CR_CHAN(insn->chanspec);
unsigned int status;
 
-   status = readw(dev->mmio + DB2K_REG_DAC_CONTROL);
-   if ((status & ((chan + 1) * 0x0010)) == 0)
+   status = readw(dev->mmio + DB2K_REG_DAC_STATUS);
+   if ((status & DB2K_DAC_STATUS_DAC_BUSY(chan)) == 0)
return 0;
return -EBUSY;
 }
@@ -574,8 +572,8 @@ static void daqboard2000_activateReferenceDacs(struct 
comedi_device *dev)
writew(0x80 | DAQBOARD2000_PosRefDacSelect,
   dev->mmio + DB2K_REG_REF_DACS);
for (timeout = 0; timeout < 20; timeout++) {
-   val = readw(dev->mmio + DB2K_REG_DAC_CONTROL);
-   if ((val & DAQBOARD2000_RefBusy) == 0)
+   val = readw(dev->mmio + DB2K_REG_DAC_STATUS);
+   if ((val & DB2K_DAC_STATUS_REF_BUSY) == 0)
break;
udelay(2);
}
@@ -584,8 +582,8 @@ static void daqboard2000_activateReferenceDacs(struct 
comedi_device *dev)
writew(0x80 | DAQBOARD2000_NegRefDacSelect,
   dev->mmio + DB2K_REG_REF_DACS);
for (timeout = 0; timeout < 20; timeout++) {
-   val = readw(dev->mmio + DB2K_REG_DAC_CONTROL);
-   if ((val & DAQBOARD2000_RefBusy) == 0)
+   val = readw(dev->mmio + DB2K_REG_DAC_STATUS);
+   if ((val & DB2K_DAC_STATUS_REF_BUSY) == 0)
break;
udelay(2);
}
-- 
2.8.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v4 08/14] staging: comedi: daqboard2000: rename acq status register macros

2016-05-19 Thread Ian Abbott
Rename the macros associated with the acquisition status register to
avoid CamelCase and to make it clear which register they are associated
with.

Add a macro to define the offset of the read-only acquisition status
register.  It's the same offset as the acquisition control register,
which is write-only.

Signed-off-by: Ian Abbott 
Reviewed-by: H Hartley Sweeten 
---
v2: Shortened prefix from `DAQBOARD2000_` to `DB2K_`.
v3, v4: No change.
---
 drivers/staging/comedi/drivers/daqboard2000.c | 39 ++-
 1 file changed, 20 insertions(+), 19 deletions(-)

diff --git a/drivers/staging/comedi/drivers/daqboard2000.c 
b/drivers/staging/comedi/drivers/daqboard2000.c
index 4d3e3c6..08d4809 100644
--- a/drivers/staging/comedi/drivers/daqboard2000.c
+++ b/drivers/staging/comedi/drivers/daqboard2000.c
@@ -151,7 +151,8 @@ static const struct comedi_lrange range_daqboard2000_ai = {
 /*
  * Register Memory Map
  */
-#define DB2K_REG_ACQ_CONTROL   0x00/* u16 */
+#define DB2K_REG_ACQ_CONTROL   0x00/* u16 (w) */
+#define DB2K_REG_ACQ_STATUS0x00/* u16 (r) */
 #define DB2K_REG_ACQ_SCAN_LIST_FIFO0x02/* u16 */
 #define DB2K_REG_ACQ_PACER_CLOCK_DIV_LOW   0x04/* u32 */
 #define DB2K_REG_ACQ_SCAN_COUNTER  0x08/* u16 */
@@ -190,19 +191,6 @@ static const struct comedi_lrange range_daqboard2000_ai = {
 #define DB2K_ACQ_CONTROL_RESET_RESULTS_FIFO0x0002
 #define DB2K_ACQ_CONTROL_RESET_CONFIG_PIPE 0x0001
 
-/* Acqusition status bits */
-#define DAQBOARD2000_AcqResultsFIFOMore1Sample   0x0001
-#define DAQBOARD2000_AcqResultsFIFOHasValidData  0x0002
-#define DAQBOARD2000_AcqResultsFIFOOverrun   0x0004
-#define DAQBOARD2000_AcqLogicScanning0x0008
-#define DAQBOARD2000_AcqConfigPipeFull   0x0010
-#define DAQBOARD2000_AcqScanListFIFOEmpty0x0020
-#define DAQBOARD2000_AcqAdcNotReady  0x0040
-#define DAQBOARD2000_ArbitrationFailure  0x0080
-#define DAQBOARD2000_AcqPacerOverrun 0x0100
-#define DAQBOARD2000_DacPacerOverrun 0x0200
-#define DAQBOARD2000_AcqHardwareError0x01c0
-
 /* Pacer Clock Control */
 #define DB2K_ACQ_CONTROL_ADC_PACER_INTERNAL0x0030
 #define DB2K_ACQ_CONTROL_ADC_PACER_EXTERNAL0x0032
@@ -214,6 +202,18 @@ static const struct comedi_lrange range_daqboard2000_ai = {
 #define DB2K_ACQ_CONTROL_ADC_PACER_INTERNAL_OUT_ENABLE 0x0008
 #define DB2K_ACQ_CONTROL_ADC_PACER_EXTERNAL_RISING 0x0100
 
+/* Acquisition status bits */
+#define DB2K_ACQ_STATUS_RESULTS_FIFO_MORE_1_SAMPLE 0x0001
+#define DB2K_ACQ_STATUS_RESULTS_FIFO_HAS_DATA  0x0002
+#define DB2K_ACQ_STATUS_RESULTS_FIFO_OVERRUN   0x0004
+#define DB2K_ACQ_STATUS_LOGIC_SCANNING 0x0008
+#define DB2K_ACQ_STATUS_CONFIG_PIPE_FULL   0x0010
+#define DB2K_ACQ_STATUS_SCAN_LIST_FIFO_EMPTY   0x0020
+#define DB2K_ACQ_STATUS_ADC_NOT_READY  0x0040
+#define DB2K_ACQ_STATUS_ARBITRATION_FAILURE0x0080
+#define DB2K_ACQ_STATUS_ADC_PACER_OVERRUN  0x0100
+#define DB2K_ACQ_STATUS_DAC_PACER_OVERRUN  0x0200
+
 /* DAC status */
 #define DAQBOARD2000_DacFull 0x0001
 #define DAQBOARD2000_RefBusy 0x0002
@@ -327,7 +327,7 @@ static int daqboard2000_ai_status(struct comedi_device *dev,
 {
unsigned int status;
 
-   status = readw(dev->mmio + DB2K_REG_ACQ_CONTROL);
+   status = readw(dev->mmio + DB2K_REG_ACQ_STATUS);
if (status & context)
return 0;
return -EBUSY;
@@ -371,7 +371,7 @@ static int daqboard2000_ai_insn_read(struct comedi_device 
*dev,
   dev->mmio + DB2K_REG_ACQ_CONTROL);
 
ret = comedi_timeout(dev, s, insn, daqboard2000_ai_status,
-DAQBOARD2000_AcqConfigPipeFull);
+DB2K_ACQ_STATUS_CONFIG_PIPE_FULL);
if (ret)
return ret;
 
@@ -379,12 +379,13 @@ static int daqboard2000_ai_insn_read(struct comedi_device 
*dev,
   dev->mmio + DB2K_REG_ACQ_CONTROL);
 
ret = comedi_timeout(dev, s, insn, daqboard2000_ai_status,
-DAQBOARD2000_AcqLogicScanning);
+DB2K_ACQ_STATUS_LOGIC_SCANNING);
if (ret)
return ret;
 
-   ret = comedi_timeout(dev, s, insn, daqboard2000_ai_status,
-DAQBOARD2000_AcqResultsFIFOHasValidData);
+   ret =
+   comedi_timeout(dev, s, insn, daqboard2000_ai_status,
+  DB2K_ACQ_STATUS_RESULTS_FIFO_HAS_DATA);
if (ret)
return ret;
 
-- 
2.8.1

___

[PATCH v4 11/14] staging: comedi: daqboard2000: rename trigger control register macros

2016-05-19 Thread Ian Abbott
Rename the macros that define values for the trigger control register to
avoid CamelCase, and to make it clearer which register they are
associated with.

Signed-off-by: Ian Abbott 
Reviewed-by: H Hartley Sweeten 
---
v2: Shortened prefix from `DAQBOARD2000_` to `DB2K_`.
v3, v4: No change.
---
 drivers/staging/comedi/drivers/daqboard2000.c | 24 
 1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/drivers/staging/comedi/drivers/daqboard2000.c 
b/drivers/staging/comedi/drivers/daqboard2000.c
index d56bf20..e9efdbc 100644
--- a/drivers/staging/comedi/drivers/daqboard2000.c
+++ b/drivers/staging/comedi/drivers/daqboard2000.c
@@ -232,16 +232,16 @@ static const struct comedi_lrange range_daqboard2000_ai = 
{
 #define DB2K_DAC_CONTROL_PATTERN_ENABLE0x0061
 
 /* Trigger Control */
-#define DAQBOARD2000_TrigAnalog  0x
-#define DAQBOARD2000_TrigTTL 0x0010
-#define DAQBOARD2000_TrigTransHiLo   0x0004
-#define DAQBOARD2000_TrigTransLoHi   0x
-#define DAQBOARD2000_TrigAbove   0x
-#define DAQBOARD2000_TrigBelow   0x0004
-#define DAQBOARD2000_TrigLevelSense  0x0002
-#define DAQBOARD2000_TrigEdgeSense   0x
-#define DAQBOARD2000_TrigEnable  0x0001
-#define DAQBOARD2000_TrigDisable 0x
+#define DB2K_TRIG_CONTROL_TYPE_ANALOG  0x
+#define DB2K_TRIG_CONTROL_TYPE_TTL 0x0010
+#define DB2K_TRIG_CONTROL_EDGE_HI_LO   0x0004
+#define DB2K_TRIG_CONTROL_EDGE_LO_HI   0x
+#define DB2K_TRIG_CONTROL_LEVEL_ABOVE  0x
+#define DB2K_TRIG_CONTROL_LEVEL_BELOW  0x0004
+#define DB2K_TRIG_CONTROL_SENSE_LEVEL  0x0002
+#define DB2K_TRIG_CONTROL_SENSE_EDGE   0x
+#define DB2K_TRIG_CONTROL_ENABLE   0x0001
+#define DB2K_TRIG_CONTROL_DISABLE  0x
 
 /* Reference Dac Selection */
 #define DAQBOARD2000_PosRefDacSelect 0x0100
@@ -543,10 +543,10 @@ static void daqboard2000_adcDisarm(struct comedi_device 
*dev)
 {
/* Disable hardware triggers */
udelay(2);
-   writew(DAQBOARD2000_TrigAnalog | DAQBOARD2000_TrigDisable,
+   writew(DB2K_TRIG_CONTROL_TYPE_ANALOG | DB2K_TRIG_CONTROL_DISABLE,
   dev->mmio + DB2K_REG_TRIG_CONTROL);
udelay(2);
-   writew(DAQBOARD2000_TrigTTL | DAQBOARD2000_TrigDisable,
+   writew(DB2K_TRIG_CONTROL_TYPE_TTL | DB2K_TRIG_CONTROL_DISABLE,
   dev->mmio + DB2K_REG_TRIG_CONTROL);
 
/* Stop the scan list FIFO from loading the configuration pipe */
-- 
2.8.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v4 14/14] staging: comedi: daqboard2000: prefer usleep_range()

2016-05-19 Thread Ian Abbott
The checkpatch.pl warns about two `udelay(x)` calls, one of 100
microseconds, and one of 10 microseconds.  The 100 microseconds one is
used when waiting for FPGA to become ready to accept firmware, and is
not that critical, so replace it with a call to `usleep_range(100,
1000)`.  The 10 microseconds one is called as each 16-bit word of
firmware data is written.  Replace it with a fairly tight
`usleep_range(10, 20)` to avoid slowing down firmware loading too much.
The firmware is fairly short, so this would only slow it down firmware
loading by about 20 milliseconds or so.

Signed-off-by: Ian Abbott 
Reviewed-by: H Hartley Sweeten 
---
v2: Replaced the 10 microsecond udelay with a fairly tight usleep_range,
as suggested by Hartley.
v3, v4: No change.
---
 drivers/staging/comedi/drivers/daqboard2000.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/comedi/drivers/daqboard2000.c 
b/drivers/staging/comedi/drivers/daqboard2000.c
index fd9fb21..b259d41 100644
--- a/drivers/staging/comedi/drivers/daqboard2000.c
+++ b/drivers/staging/comedi/drivers/daqboard2000.c
@@ -476,7 +476,7 @@ static int daqboard2000_poll_cpld(struct comedi_device 
*dev, int mask)
result = 1;
break;
}
-   udelay(100);
+   usleep_range(100, 1000);
}
udelay(5);
return result;
@@ -486,7 +486,7 @@ static int daqboard2000_write_cpld(struct comedi_device 
*dev, int data)
 {
int result = 0;
 
-   udelay(10);
+   usleep_range(10, 20);
writew(data, dev->mmio + 0x1000);
if ((readw(dev->mmio + 0x1000) & DAQBOARD2000_CPLD_INIT) ==
DAQBOARD2000_CPLD_INIT) {
-- 
2.8.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v4 06/14] staging: comedi: daqboard2000: rename register offset macros

2016-05-19 Thread Ian Abbott
Rename the macros defining register offsets to avoid CamelCase, and to
use namespace associated with the driver.

Signed-off-by: Ian Abbott 
Reviewed-by: H Hartley Sweeten 
---
Other CamelCase issues in this patch will be dealt with by later
patches in the series.

v2: Shortened prefix from `DAQBOARD2000_` to `DB2K_`.
v3: Removed a space before tab that slipped in in v2.
v4: No change.
---
 drivers/staging/comedi/drivers/daqboard2000.c | 112 ++
 1 file changed, 61 insertions(+), 51 deletions(-)

diff --git a/drivers/staging/comedi/drivers/daqboard2000.c 
b/drivers/staging/comedi/drivers/daqboard2000.c
index ceb910d..7c6a2450 100644
--- a/drivers/staging/comedi/drivers/daqboard2000.c
+++ b/drivers/staging/comedi/drivers/daqboard2000.c
@@ -151,35 +151,35 @@ static const struct comedi_lrange range_daqboard2000_ai = 
{
 /*
  * Register Memory Map
  */
-#define acqControl 0x00/* u16 */
-#define acqScanListFIFO0x02/* u16 */
-#define acqPacerClockDivLow0x04/* u32 */
-#define acqScanCounter 0x08/* u16 */
-#define acqPacerClockDivHigh   0x0a/* u16 */
-#define acqTriggerCount0x0c/* u16 */
-#define acqResultsFIFO 0x10/* u16 */
-#define acqResultsShadow   0x14/* u16 */
-#define acqAdcResult   0x18/* u16 */
-#define dacScanCounter 0x1c/* u16 */
-#define dacControl 0x20/* u16 */
-#define dacFIFO0x24/* s16 */
-#define dacPacerClockDiv   0x2a/* u16 */
-#define refDacs0x2c/* u16 */
-#define dioControl 0x30/* u16 */
-#define dioP3hsioData  0x32/* s16 */
-#define dioP3Control   0x34/* u16 */
-#define calEepromControl   0x36/* u16 */
-#define dacSetting(x)  (0x38 + (x) * 2) /* s16 */
-#define dioP2ExpansionIO8Bit   0x40/* s16 */
-#define ctrTmrControl  0x80/* u16 */
-#define ctrInput(x)(0x88 + (x) * 2) /* s16 */
-#define timerDivisor(x)(0xa0 + (x) * 2) /* u16 */
-#define dmaControl 0xb0/* u16 */
-#define trigControl0xb2/* u16 */
-#define calEeprom  0xb8/* u16 */
-#define acqDigitalMark 0xba/* u16 */
-#define trigDacs   0xbc/* u16 */
-#define dioP2ExpansionIO16Bit(x)   (0xc0 + (x) * 2) /* s16 */
+#define DB2K_REG_ACQ_CONTROL   0x00/* u16 */
+#define DB2K_REG_ACQ_SCAN_LIST_FIFO0x02/* u16 */
+#define DB2K_REG_ACQ_PACER_CLOCK_DIV_LOW   0x04/* u32 */
+#define DB2K_REG_ACQ_SCAN_COUNTER  0x08/* u16 */
+#define DB2K_REG_ACQ_PACER_CLOCK_DIV_HIGH  0x0a/* u16 */
+#define DB2K_REG_ACQ_TRIGGER_COUNT 0x0c/* u16 */
+#define DB2K_REG_ACQ_RESULTS_FIFO  0x10/* u16 */
+#define DB2K_REG_ACQ_RESULTS_SHADOW0x14/* u16 */
+#define DB2K_REG_ACQ_ADC_RESULT0x18/* u16 
*/
+#define DB2K_REG_DAC_SCAN_COUNTER  0x1c/* u16 */
+#define DB2K_REG_DAC_CONTROL   0x20/* u16 */
+#define DB2K_REG_DAC_FIFO  0x24/* s16 */
+#define DB2K_REG_DAC_PACER_CLOCK_DIV   0x2a/* u16 */
+#define DB2K_REG_REF_DACS  0x2c/* u16 */
+#define DB2K_REG_DIO_CONTROL   0x30/* u16 */
+#define DB2K_REG_P3_HSIO_DATA  0x32/* s16 */
+#define DB2K_REG_P3_CONTROL0x34/* u16 */
+#define DB2K_REG_CAL_EEPROM_CONTROL0x36/* u16 */
+#define DB2K_REG_DAC_SETTING(x)(0x38 + (x) * 2) /* s16 
*/
+#define DB2K_REG_DIO_P2_EXP_IO_8_BIT   0x40/* s16 */
+#define DB2K_REG_COUNTER_TIMER_CONTROL 0x80/* u16 */
+#define DB2K_REG_COUNTER_INPUT(x)  (0x88 + (x) * 2) /* s16 */
+#define DB2K_REG_TIMER_DIV(x)  (0xa0 + (x) * 2) /* u16 */
+#define DB2K_REG_DMA_CONTROL   0xb0/* u16 */
+#define DB2K_REG_TRIG_CONTROL  0xb2/* u16 */
+#define DB2K_REG_CAL_EEPROM0xb8/* u16 */
+#define DB2K_REG_ACQ_DIGITAL_MARK  0xba/* u16 */
+#define DB2K_REG_TRIG_DACS 0xbc/* u16 */
+#define DB2K_REG_DIO_P2_EXP_IO_16_BIT(x)   (0xc0 + (x) * 2)

[PATCH v2 1/4] Staging: comedi: fix type issue in s626.c

2016-05-19 Thread Ravishankar Karkala Mallikarjunayya
This is a patch to the s626.c file that fixes up a type issues
found by the checkpatch.pl tool.

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'

Signed-off-by: Ravishankar Karkala Mallikarjunayya 
---
Changes since V1:
- Rework
---
 drivers/staging/comedi/drivers/s626.c | 152 +-
 1 file changed, 76 insertions(+), 76 deletions(-)

diff --git a/drivers/staging/comedi/drivers/s626.c 
b/drivers/staging/comedi/drivers/s626.c
index c5e0863..6961550e 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, int16_t 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 comedi_device *dev,

[PATCH v2 3/4] Staging: comedi:Fix unsigned int to bare use of unsigned issue in s626.c

2016-05-19 Thread Ravishankar Karkala Mallikarjunayya
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

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v2 2/4] Staging: comedi: Fix WARNING issue in s626.c

2016-05-19 Thread Ravishankar Karkala Mallikarjunayya
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
+* within the device.
+*/
 

[PATCH v2 4/4] Staging: comedi: fix line over 80 characters issue in s626.c

2016-05-19 Thread Ravishankar Karkala Mallikarjunayya
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

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH 00/27] staging: add driver for KS7010 based SDIO cards

2016-05-19 Thread Wolfram Sang
Hi Greg,

> An add-on patch is probably easiest for everyone involved here.

Any chance for the new-driver-rule for this one?

Thanks,

   Wolfram



signature.asc
Description: PGP signature
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel