Re: [PATCH 1/1] Drivers: scsi: storvsc: Get rid of warning messages

2014-09-05 Thread Sitsofe Wheeler
On Thu, Sep 04, 2014 at 10:40:14PM -0700, Christoph Hellwig wrote:
> Looks good to me.
> 
> Olaf, Hannes - can I get another review for this (and the older hyperv
> scanning patch set)?

I agree this looks useful because on a
59753a805499f1ffbca4ac0a24b3dff67bf1 3.17rc2 kernel with

92578ea Drivers: net: hyperv: Cleanup select queue
7e1ea8c Add documentation for HV_STATUS_INVALID_ALIGNMENT.
cecd44d BUG: unable to handle kernel paging request at 8801f5bc7cbb
(netvsc_select_queue)
9c6196f Drivers: hv: vmbus: Properly protect calls to smp_processor_id()
2590142 Drivers: hv: vmbus: Cleanup hv_post_message()
cd97ae9 Drivers: hv: vmbus: Cleanup vmbus_close_internal()
ff08f61 Drivers: hv: vmbus: Fix a bug in vmbus_open()
2f8915e Drivers: hv: vmbus: Cleanup vmbus_establish_gpadl()
6940bd6 Drivers: hv: vmbus: Cleanup vmbus_teardown_gpadl()
b022b1b Drivers: hv: vmbus: Cleanup vmbus_post_msg()

but without this particular patch applied it is possible for a lot of
hv_storvsc vmbus_0_5 messages to be produced while running a command
like
fio --filename /dev/sdg --ioengine=libaio --iodepth=8 --name=go --rw=randwrite 
--bs=4k --runtime=10m --time_based=1  --direct=1
and repeatedly removing/re-adding/changing the VHDX backing /dev/sdg
from the Linux Hyper-V guest:

Sep 05 07:09:57 a kernel: scsi 1:0:1:0: scsi scan: INQUIRY result too short 
(5), using 36
Sep 05 07:09:57 a kernel: scsi 1:0:1:1: scsi scan: INQUIRY result too short 
(5), using 36
Sep 05 07:09:57 a kernel: sd 1:0:0:0: [sdf] Synchronizing SCSI cache
Sep 05 07:09:57 a kernel: hv_storvsc vmbus_0_5: cmd 0x35 scsi status 0x0 srb 
status 0x20
Sep 05 07:09:58 a kernel: scsi 1:0:0:0: Direct-Access Msft Virtual Disk 
1.0  PQ: 0 ANSI: 4
Sep 05 07:09:58 a kernel: sd 1:0:0:0: [sdf] 2097152 512-byte logical blocks: 
(1.07 GB/1.00 GiB)
Sep 05 07:09:58 a kernel: sd 1:0:0:0: Attached scsi generic sg5 type 0
Sep 05 07:09:58 a kernel: scsi 1:0:1:0: scsi scan: INQUIRY result too short 
(5), using 36
Sep 05 07:09:58 a kernel: sd 1:0:0:0: [sdf] Write Protect is off
Sep 05 07:09:58 a kernel: sd 1:0:0:0: [sdf] Mode Sense: 0f 00 00 00
Sep 05 07:09:58 a kernel: sd 1:0:0:0: [sdf] Write cache: enabled, read cache: 
enabled, doesn't support DPO or FUA
Sep 05 07:09:58 a kernel:  sdf: unknown partition table
Sep 05 07:09:58 a kernel: scsi 1:0:1:1: scsi scan: INQUIRY result too short 
(5), using 36
Sep 05 07:09:58 a kernel: sd 1:0:0:0: [sdf] Attached SCSI disk
Sep 05 07:09:58 a kernel: md: bind
Sep 05 07:09:58 a kernel: md126: detected capacity change from 0 to 1069547520
Sep 05 07:09:58 a kernel:  md126: unknown partition table
Sep 05 07:09:58 a systemd[1]: Starting LVM2 PV scan on device 9:126...
Sep 05 07:09:58 a pvscan[788]: 0 logical volume(s) in volume group "PoolDelete" 
now active
Sep 05 07:09:58 a systemd[1]: Started LVM2 PV scan on device 9:126.
Sep 05 07:10:01 a systemd[1]: Starting Session 2 of user root.
Sep 05 07:10:01 a systemd[1]: Started Session 2 of user root.
Sep 05 07:10:01 a CROND[793]: (root) CMD (/usr/lib64/sa/sa1 1 1)
Sep 05 07:10:02 a systemd[673]: Time has been changed
Sep 05 07:10:02 a systemd[1]: Time has been changed
Sep 05 07:10:07 a systemd[1]: Time has been changed
Sep 05 07:10:07 a systemd[673]: Time has been changed
Sep 05 07:10:12 a systemd[673]: Time has been changed
Sep 05 07:10:12 a systemd[1]: Time has been changed
Sep 05 07:10:16 a kernel: scsi 1:0:1:0: scsi scan: INQUIRY result too short 
(5), using 36
Sep 05 07:10:16 a kernel: scsi 1:0:1:1: scsi scan: INQUIRY result too short 
(5), using 36
Sep 05 07:10:17 a kernel: scsi 1:0:1:0: scsi scan: INQUIRY result too short 
(5), using 36
Sep 05 07:10:17 a kernel: scsi 1:0:1:1: scsi scan: INQUIRY result too short 
(5), using 36
Sep 05 07:10:17 a systemd[1]: Time has been changed
Sep 05 07:10:17 a systemd[673]: Time has been changed
Sep 05 07:10:22 a systemd[673]: Time has been changed
Sep 05 07:10:22 a systemd[1]: Time has been changed
Sep 05 07:10:27 a systemd[1]: Time has been changed
Sep 05 07:10:27 a systemd[673]: Time has been changed
Sep 05 07:10:32 a systemd[673]: Time has been changed
Sep 05 07:10:32 a systemd[1]: Time has been changed
Sep 05 07:10:37 a systemd[1]: Time has been changed
Sep 05 07:10:37 a systemd[673]: Time has been changed
Sep 05 07:10:42 a systemd[673]: Time has been changed
Sep 05 07:10:42 a systemd[1]: Time has been changed
Sep 05 07:10:47 a systemd[1]: Time has been changed
Sep 05 07:10:47 a systemd[673]: Time has been changed
Sep 05 07:10:51 a kernel: scsi 1:0:1:0: scsi scan: INQUIRY result too short 
(5), using 36
Sep 05 07:10:53 a kernel: hv_storvsc vmbus_0_5: cmd 0x2a scsi status 0x0 srb 
status 0x20
Sep 05 07:10:53 a kernel: hv_storvsc vmbus_0_5: cmd 0x2a scsi status 0x0 srb 
status 0x20
Sep 05 07:10:53 a kernel: hv_storvsc vmbus_0_5: cmd 0x2a scsi status 0x0 srb 
status 0x20
[Message is repeated]
Sep 05 07:10:54 a kernel: hv_storvsc vmbus_0_5: cmd 0x2a scsi status 0x0 srb 
status 0x20
Sep 05 07:10:54 a kernel: hv_storvsc vmbus_0_5: cmd 0x2a scsi status 

[PATCH] staging: unisys: uislib: uislib.c: sparse warning of context imbalance

2014-09-05 Thread Sudip Mukherjee
fixed sparse warning : context imbalance in 'pause_device' 
unexpected unlock
this patch will generate warning from checkpatch for 
lines over 80 character , but since those are user-visible strings
so it was not modified.

Signed-off-by: Sudip Mukherjee 
---

hi , can you please review the patch and see if the approach is correct.
The functiion is still doing the same what it was doing , only the logic
is changed. if the approach is ok, then i can send a patch to fix the
other two similar warning in the file.

 drivers/staging/unisys/uislib/uislib.c | 82 --
 1 file changed, 39 insertions(+), 43 deletions(-)

diff --git a/drivers/staging/unisys/uislib/uislib.c 
b/drivers/staging/unisys/uislib/uislib.c
index 8b89fe3..3a92d9f 100644
--- a/drivers/staging/unisys/uislib/uislib.c
+++ b/drivers/staging/unisys/uislib/uislib.c
@@ -548,6 +548,7 @@ pause_device(CONTROLVM_MESSAGE *msg)
struct bus_info *bus;
struct device_info *dev;
struct guest_msgs cmd;
+   int retval = CONTROLVM_RESP_SUCCESS;
 
busNo = msg->cmd.deviceChangeState.busNo;
devNo = msg->cmd.deviceChangeState.devNo;
@@ -559,58 +560,53 @@ pause_device(CONTROLVM_MESSAGE *msg)
if (devNo >= bus->deviceCount) {
LOGERR("CONTROLVM_DEVICE_CHANGESTATE:pause 
Failed: device(%d) >= deviceCount(%d).",
 devNo, bus->deviceCount);
-   read_unlock(&BusListLock);
-   return CONTROLVM_RESP_ERROR_DEVICE_INVALID;
-   }
-   /* make sure this device exists */
-   dev = bus->device[devNo];
-   if (!dev) {
-   LOGERR("CONTROLVM_DEVICE_CHANGESTATE:pause 
Failed: device %d does not exist.",
-devNo);
-   read_unlock(&BusListLock);
-   return CONTROLVM_RESP_ERROR_ALREADY_DONE;
-   }
-   read_unlock(&BusListLock);
-   /* the msg is bound for virtpci; send
-* guest_msgs struct to callback
-*/
-   if (!uuid_le_cmp(dev->channelTypeGuid,
-   UltraVhbaChannelProtocolGuid)) {
-   cmd.msgtype = GUEST_PAUSE_VHBA;
-   cmd.pause_vhba.chanptr = dev->chanptr;
-   } else
-   if (!uuid_le_cmp(dev->channelTypeGuid,
-   UltraVnicChannelProtocolGuid)) {
-   cmd.msgtype = GUEST_PAUSE_VNIC;
-   cmd.pause_vnic.chanptr = dev->chanptr;
+   retval = CONTROLVM_RESP_ERROR_DEVICE_INVALID;
} else {
-   LOGERR("CONTROLVM_DEVICE_CHANGESTATE:pause 
Failed: unknown channelTypeGuid.\n");
-   return
-   CONTROLVM_RESP_ERROR_CHANNEL_TYPE_UNKNOWN;
-   }
-
-   if (!VirtControlChanFunc) {
-   LOGERR("CONTROLVM_DEVICE_CHANGESTATE Failed: 
virtpci callback not registered.");
-   return
-   CONTROLVM_RESP_ERROR_VIRTPCI_DRIVER_FAILURE;
-   }
-
-   if (!VirtControlChanFunc(&cmd)) {
-   LOGERR("CONTROLVM_DEVICE_CHANGESTATE:pause 
Failed: virtpci GUEST_PAUSE_[VHBA||VNIC] returned error.");
-   return 
CONTROLVM_RESP_ERROR_VIRTPCI_DRIVER_CALLBACK_ERROR;
+   /* make sure this device exists */
+   dev = bus->device[devNo];
+   if (!dev) {
+   
LOGERR("CONTROLVM_DEVICE_CHANGESTATE:pause Failed: device %d does not exist.",
+devNo);
+   retval =
+ CONTROLVM_RESP_ERROR_ALREADY_DONE;
+   }
}
break;
}
}
-
if (!bus) {
LOGERR("CONTROLVM_DEVICE_CHANGESTATE:pause Failed: bus %d does 
not exist",
 busNo);
-   read_unlock(&BusListLock);
-   return CONTROLVM_RESP_ERROR_BUS_INVALID;
+   retval = CONTROLVM_RESP_ERROR_BUS_INVALID;
}
-
-   return CONTROLVM_RESP_SUCCESS;
+   read_unlock(&BusListLock);
+   if (retval == CONTROLVM_RESP_SUCCESS) {
+   /* the msg is bound for virtpci; send
+* guest_msgs struct to callback
+*/

Re: [PATCH 00/21] staging: comedi: adl_pci9118: cleanup the boardinfo and attach

2014-09-05 Thread Ian Abbott

On 2014-09-04 18:39, H Hartley Sweeten wrote:

Remove all the unused information in the boardinfo and tidy it up.

Clenaup the attach of this driver a bit.

H Hartley Sweeten (21):
   staging: comedi: adl_pci9118: remove unused boardinfo
   staging: comedi: adl_pci9118: remove 'rangelist_ao' boardinfo
   staging: comedi: adl_pci9118: remove 'ao_maxdata' boardinfo
   staging: comedi: adl_pci9118: remove 'n_aochan' boardinfo
   staging: comedi: adl_pci9118: remove 'half_fifo_size' boardinfo
   staging: comedi: adl_pci9118: remove 'n_aichanlist' boardinfo
   staging: comedi: adl_pci9118: remove 'n_aichand' boardinfo
   staging: comedi: adl_pci9118: remove 'n_aichan' boardinfo
   staging: comedi: adl_pci9118: remove 'ai_ns_min' from boardinfo
   staging: comedi: adl_pci9118: remove 'ai_pacer_min' from boardinfo
   staging: comedi: adl_pci9118: refactor 'rangelist_ai' in boardinfo
   staging: comedi: adl_pci9118: refactor 'ai_maxdata' in boardinfo
   staging: comedi: adl_pci9118: use 'context' in (*auto_attach)
   staging: comedi: adl_pci9118: remove 'device_id' from boardinfo
   staging: comedi: adl_pci9118: remove unnecessary dev->board_name 
initialization
   staging: comedi: adl_pci9118: rename boardinfo struct
   staging: comedi: adl_pci9118: allocate private data in 
pci9118_common_attach()
   staging: comedi: adl_pci9118: tidy up digital output subdevice init
   staging: comedi: adl_pci9118: tidy up digital input subdevice init
   staging: comedi: adl_pci9118: tidy up analog output subdevice init
   staging: comedi: adl_pci9118: tidy up analog input subdevice init

  drivers/staging/comedi/drivers/adl_pci9118.c | 287 +++
  1 file changed, 114 insertions(+), 173 deletions(-)



Reviewed-by: Ian Abbott 

--
-=( Ian Abbott @ MEV Ltd.E-mail: )=-
-=( Tel: +44 (0)161 477 1898   FAX: +44 (0)161 718 3587 )=-
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH 14/18] staging: xillybus: Fix incorrect cast

2014-09-05 Thread Dan Carpenter
On Thu, Sep 04, 2014 at 05:47:53PM +0300, Eli Billauer wrote:
> Suggested-by: Dan Carpenter 
> Signed-off-by: Eli Billauer 
> ---
>  drivers/staging/xillybus/xillybus_core.c |2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/staging/xillybus/xillybus_core.c 
> b/drivers/staging/xillybus/xillybus_core.c
> index 04c60c6..5ed89ce 100644
> --- a/drivers/staging/xillybus/xillybus_core.c
> +++ b/drivers/staging/xillybus/xillybus_core.c
> @@ -664,7 +664,7 @@ static int xilly_obtain_idt(struct xilly_endpoint 
> *endpoint)
>   if (*version > 0x82) {
>   dev_err(endpoint->dev,
>   "No support for IDT version 0x%02x. Maybe the xillybus 
> driver needs an upgarde. Aborting.\n",
> -(int) *version);
> + (unsigned int) *version);

Let's drop this one.

Sorry, I was just wrong on here.  I misread the code and also my
review comments were too vague and must have puzzled you.  (Feel free
to call me out on this if I'm wrong next time.)

Looking at it now, before and after of this are basically the same.
Really, I don't think there is any casting needed.

It won't affect any of the other patches in the series so no need to
resend anything.

regards,
dan carpenter

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


Re: [PATCH 00/18] staging: xillybus: Coding style fixes

2014-09-05 Thread Dan Carpenter
Thanks for his!

Reviewed-by: Dan Carpenter 

regards,
dan carpenter

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


Re: [PATCH] staging: iio: adc: mxs-lradc.c: sparse warning of incorrect type

2014-09-05 Thread Dan Carpenter
On Thu, Sep 04, 2014 at 10:15:42PM +0530, Sudip Mukherjee wrote:
> fixed sparse warning : incorrect type in argument 1 
>  (different address spaces)
> 

The change log is not clear.  It's the IS_ERR() which is the problem?
This is a false positive which is fixed in a later version of Sparse.

regards,
dan carpenter


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


Re: [PATCH] staging: iio: adc: mxs-lradc.c: sparse warning of incorrect type

2014-09-05 Thread Sudip Mukherjee
On Fri, Sep 05, 2014 at 12:34:13PM +0300, Dan Carpenter wrote:
> On Thu, Sep 04, 2014 at 10:15:42PM +0530, Sudip Mukherjee wrote:
> > fixed sparse warning : incorrect type in argument 1 
> >(different address spaces)
> > 
> 
> The change log is not clear.  It's the IS_ERR() which is the problem?
> This is a false positive which is fixed in a later version of Sparse.
> 
> regards,
> dan carpenter
> 
> 
yes , problem with sparse. ubuntu repo was not having the latest version , 
and i did not check what is the latest . 
sorry for it.

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


[PATCH] staging: xillybus: Removed unnecessary cast

2014-09-05 Thread Eli Billauer
Suggested-by: Dan Carpenter 
Signed-off-by: Eli Billauer 
---
 drivers/staging/xillybus/xillybus_core.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/staging/xillybus/xillybus_core.c 
b/drivers/staging/xillybus/xillybus_core.c
index 30bb7ac..b827fa0 100644
--- a/drivers/staging/xillybus/xillybus_core.c
+++ b/drivers/staging/xillybus/xillybus_core.c
@@ -657,7 +657,7 @@ static int xilly_obtain_idt(struct xilly_endpoint *endpoint)
if (*version > 0x82) {
dev_err(endpoint->dev,
"No support for IDT version 0x%02x. Maybe the xillybus 
driver needs an upgarde. Aborting.\n",
-  (int) *version);
+   *version);
return -ENODEV;
}
 
-- 
1.7.2.3

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


Re: [PATCH 14/18] staging: xillybus: Fix incorrect cast

2014-09-05 Thread Eli Billauer

On 05/09/14 12:26, Dan Carpenter wrote:

Sorry, I was just wrong on here.  I misread the code and also my
review comments were too vague and must have puzzled you.  (Feel free
to call me out on this if I'm wrong next time.)
   
I beg to differ on this one: Your comments were crystal clear. The fact 
that I got it on 17 out of 18, proves my point. :)

Looking at it now, before and after of this are basically the same.
Really, I don't think there is any casting needed.
   
Indeed, no casting is needed there. I've submitted a new patch instead 
of this one.


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


Re: [PATCH 00/19] staging: comedi: adl_pci9118: tidy up register map

2014-09-05 Thread Ian Abbott

On 2014-09-04 20:14, H Hartley Sweeten wrote:

Rename the register map defines and remove all the CamelCase.

This series applies after:
[PATCH 00/21] staging: comedi: adl_pci9118: cleanup the boardinfo and attach

H Hartley Sweeten (19):
   staging: comedi: adl_pci9118: all registers are 32-bit
   staging: comedi: adl_pci9118: introduce pci9118_timer_write()
   staging: comedi: adl_pci9118: introduce pci9118_timer_set_mode()
   staging: comedi: adl_pci9118: tidy up analog input fifo register define
   staging: comedi: adl_pci9118: tidy up analog output register defines
   staging: comedi: adl_pci9118: rename PCI9118_ADSTAT define
   staging: comedi: adl_pci9118: tidy up the ai status register bit defines
   staging: comedi: adl_pci9118: rename PCI9118_ADCNTRL define
   staging: comedi: adl_pci9118: tidy up the ai control register bit defines
   staging: comedi: adl_pci9118: clarify the digital I/O register
   staging: comedi: adl_pci9118: introduce pci9118_ai_start_conv()
   staging: comedi: adl_pci9118: rename PCI9118_GAIN define
   staging: comedi: adl_pci9118: rename PCI9118_BURST define
   staging: comedi: adl_pci9118: rename PCI9118_SCANMOD define
   staging: comedi: adl_pci9118: rename PCI9118_ADFUNC define
   staging: comedi: adl_pci9118: tidy up the ai config register bit defines
   staging: comedi: adl_pci9118: introduce pci9118_ai_reset_fifo()
   staging: comedi: adl_pci9118: tidy up the interrupt control/status register
   staging: comedi: adl_pci9118: tidy up the interrupt control/status bit 
defines

  drivers/staging/comedi/drivers/adl_pci9118.c | 479 +--
  1 file changed, 236 insertions(+), 243 deletions(-)



Reviewed-by: Ian Abbott 

--
-=( Ian Abbott @ MEV Ltd.E-mail: )=-
-=( Tel: +44 (0)161 477 1898   FAX: +44 (0)161 718 3587 )=-
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] [next-20140904] staging: gs_fpgaboot: remove checks for CONFIG_B4860G100

2014-09-05 Thread Paul Bolle
There are two checks for CONFIG_B4860G100 in this driver. But there's no
Kconfig symbol B4860G100. These checks will always evaluate to false.
Remove them and the code they hide.

Signed-off-by: Paul Bolle 
---
Build tested only (by building just drivers/staging/gs_fpgaboot/io.o).

Perhaps this enables further cleanups. I didn't check.

 drivers/staging/gs_fpgaboot/io.c | 163 ---
 1 file changed, 163 deletions(-)

diff --git a/drivers/staging/gs_fpgaboot/io.c b/drivers/staging/gs_fpgaboot/io.c
index 23c12f47c8f1..d0168bec40b9 100644
--- a/drivers/staging/gs_fpgaboot/io.c
+++ b/drivers/staging/gs_fpgaboot/io.c
@@ -31,10 +31,6 @@
 
 #include "io.h"
 
-#ifdef CONFIG_B4860G100
-static struct gpiobus gbus;
-#endif /* CONFIG_B4860G100 */
-
 static inline void byte0_out(unsigned char data);
 static inline void byte1_out(unsigned char data);
 static inline void xl_cclk_b(int32_t i);
@@ -92,163 +88,6 @@ static inline unsigned char bitswap(unsigned char s)
return d;
 }
 
-#ifdef CONFIG_B4860G100
-/*
- * ==
- * board specific configuration
- */
-
-static inline void mpc85xx_gpio_set_dir(
-   int32_t port,
-   uint32_t mask,
-   uint32_t dir)
-{
-   dir |= (in_be32(gbus.r[port]+GPDIR) & ~mask);
-   out_be32(gbus.r[port]+GPDIR, dir);
-}
-
-static inline void mpc85xx_gpio_set(int32_t port, uint32_t mask, uint32_t val)
-{
-   /* First mask off the unwanted parts of "dir" and "val" */
-   val &= mask;
-
-   /* Now read in the values we're supposed to preserve */
-   val |= (in_be32(gbus.r[port]+GPDAT) & ~mask);
-
-   out_be32(gbus.r[port]+GPDAT, val);
-}
-
-static inline uint32_t mpc85xx_gpio_get(int32_t port, uint32_t mask)
-{
-   /* Read the requested values */
-   return in_be32(gbus.r[port]+GPDAT) & mask;
-}
-
-static inline void mpc85xx_gpio_set_low(int32_t port, uint32_t gpios)
-{
-   mpc85xx_gpio_set(port, gpios, 0x);
-}
-
-static inline void mpc85xx_gpio_set_high(int32_t port, uint32_t gpios)
-{
-   mpc85xx_gpio_set(port, gpios, 0x);
-}
-
-static inline void gpio_set_value(int32_t port, uint32_t gpio, uint32_t value)
-{
-   int32_t g;
-
-   g = 31 - gpio;
-   if (value)
-   mpc85xx_gpio_set_high(port, 1U << g);
-   else
-   mpc85xx_gpio_set_low(port, 1U << g);
-}
-
-static inline int gpio_get_value(int32_t port, uint32_t gpio)
-{
-   int32_t g;
-
-   g = 31 - gpio;
-   return !!mpc85xx_gpio_get(port, 1U << g);
-}
-
-static inline void xl_cclk_b(int32_t i)
-{
-   gpio_set_value(XL_CCLK_PORT, XL_CCLK_PIN, i);
-}
-
-void xl_program_b(int32_t i)
-{
-   gpio_set_value(XL_PROGN_PORT, XL_PROGN_PIN, i);
-}
-
-void xl_rdwr_b(int32_t i)
-{
-   gpio_set_value(XL_RDWRN_PORT, XL_RDWRN_PIN, i);
-}
-
-void xl_csi_b(int32_t i)
-{
-   gpio_set_value(XL_CSIN_PORT, XL_CSIN_PIN, i);
-}
-
-int xl_get_init_b(void)
-{
-   return gpio_get_value(XL_INITN_PORT, XL_INITN_PIN);
-}
-
-int xl_get_done_b(void)
-{
-   return gpio_get_value(XL_DONE_PORT, XL_DONE_PIN);
-}
-
-
-/* G100 specific bit swap and remmap (to gpio pins) for byte 0 */
-static inline uint32_t bit_remap_byte0(uint32_t s)
-{
-   uint32_t d;
-
-   d = (((s&0x80)>>7) | ((s&0x40)>>5) | ((s&0x20)>>3) | ((s&0x10)>>1) |
-   ((s&0x08)<<1) | ((s&0x04)<<3) | ((s&0x02)<<6) | ((s&0x01)<<9));
-   return d;
-}
-
-/*
- * G100 specific MSB, in this order [byte0 | byte1], out
- */
-static inline void byte0_out(unsigned char data)
-{
-   uint32_t swap32;
-
-   swap32 =  bit_remap_byte0((uint32_t) data) << 8;
-
-   mpc85xx_gpio_set(0, 0x0002BF00, (uint32_t) swap32);
-}
-
-/*
- * G100 specific LSB, in this order [byte0 | byte1], out
- */
-static inline void byte1_out(unsigned char data)
-{
-   mpc85xx_gpio_set(0, 0x00FF, (uint32_t) bitswap(data));
-}
-
-/*
- * configurable per device type for different I/O config
- */
-int xl_init_io(void)
-{
-   struct device_node *np;
-   const u32 *p_reg;
-   int reg, cnt;
-
-   cnt = 0;
-   memset(&gbus, 0, sizeof(struct gpiobus));
-   for_each_compatible_node(np, NULL, "fsl,qoriq-gpio") {
-   p_reg = of_get_property(np, "reg", NULL);
-   if (p_reg == NULL)
-   break;
-   reg = (int) *p_reg;
-   gbus.r[cnt] = of_iomap(np, 0);
-
-   if (!gbus.r[cnt]) {
-   pr_err("not findding gpio cell-index %d\n", cnt);
-   return -ENODEV;
-   }
-   cnt++;
-   }
-   mpc85xx_gpio_set_dir(0, 0x0002BFFF, 0x0002BFFF);
-   mpc85xx_gpio_set_dir(1, 0x00240060, 0x00240060);
-
-   gbus.ngpio = cnt;
-
-   return 0;
-}
-
-
-#else  /* placeholder for boards with different config */
-
 void xl_program_b(int32_t i)
 {
return;
@@ -296,5 +135,3 @@ int 

[PATCH] staging: xgifb: remove unnecessary else

2014-09-05 Thread Thomas Gummerer
Signed-off-by: Thomas Gummerer 
---
 drivers/staging/xgifb/XGI_main_26.c | 10 +++-
 drivers/staging/xgifb/vb_init.c | 50 -
 drivers/staging/xgifb/vb_setmode.c  |  3 +--
 3 files changed, 26 insertions(+), 37 deletions(-)

diff --git a/drivers/staging/xgifb/XGI_main_26.c 
b/drivers/staging/xgifb/XGI_main_26.c
index f82f057..be7778b 100644
--- a/drivers/staging/xgifb/XGI_main_26.c
+++ b/drivers/staging/xgifb/XGI_main_26.c
@@ -588,13 +588,11 @@ static u8 XGIfb_search_refresh_rate(struct 
xgifb_video_info *xgifb_info,
}
i++;
}
-   if (xgifb_info->rate_idx > 0) {
+   if (xgifb_info->rate_idx > 0)
return xgifb_info->rate_idx;
-   } else {
-   pr_info("Unsupported rate %d for %dx%d\n",
-  rate, xres, yres);
-   return 0;
-   }
+   pr_info("Unsupported rate %d for %dx%d\n",
+   rate, xres, yres);
+   return 0;
 }
 
 static void XGIfb_search_tvstd(const char *name)
diff --git a/drivers/staging/xgifb/vb_init.c b/drivers/staging/xgifb/vb_init.c
index ff210dd..2b233af 100644
--- a/drivers/staging/xgifb/vb_init.c
+++ b/drivers/staging/xgifb/vb_init.c
@@ -63,14 +63,13 @@ XGINew_GetXG20DRAMType(struct xgi_hw_device_info 
*HwDeviceExtension,
/* ~HOTPLUG_SUPPORT */
xgifb_reg_or(pVBInfo->P3d4, 0xB4, 0x02);
return data;
-   } else {
-   data = xgifb_reg_get(pVBInfo->P3d4, 0x97) & 0x01;
+   }
+   data = xgifb_reg_get(pVBInfo->P3d4, 0x97) & 0x01;
 
-   if (data == 1)
-   data++;
+   if (data == 1)
+   data++;
 
-   return data;
-   }
+   return data;
 }
 
 static void XGINew_DDR1x_MRS_340(unsigned long P3c4,
@@ -578,9 +577,8 @@ static unsigned char XGINew_CheckFrequence(struct 
vb_device_info *pVBInfo)
data = xgifb_reg_get(pVBInfo->P3c4, 0x39);
data = (data & 0x02) >> 1;
return data;
-   } else {
-   return data & 0x01;
}
+   return data & 0x01;
 }
 
 static void XGINew_CheckChannel(struct xgi_hw_device_info *HwDeviceExtension,
@@ -637,10 +635,9 @@ static void XGINew_CheckChannel(struct xgi_hw_device_info 
*HwDeviceExtension,
 
if (XGINew_ReadWriteRest(23, 22, pVBInfo) == 1)
return;
-   else
-   xgifb_reg_set(pVBInfo->P3c4,
- 0x13,
- 0x31);
+   xgifb_reg_set(pVBInfo->P3c4,
+ 0x13,
+ 0x31);
udelay(15);
}
 
@@ -687,10 +684,11 @@ static void XGINew_CheckChannel(struct xgi_hw_device_info 
*HwDeviceExtension,
 
if (XGINew_ReadWriteRest(22, 21, pVBInfo) == 1)
return;
-   else /* (0x31:12x8x2) 22bit + 1 rank */
-   xgifb_reg_set(pVBInfo->P3c4,
- 0x13,
- 0x31);
+
+   /* (0x31:12x8x2) 22bit + 1 rank */
+   xgifb_reg_set(pVBInfo->P3c4,
+ 0x13,
+ 0x31);
udelay(15);
}
}
@@ -729,10 +727,8 @@ static void XGINew_CheckChannel(struct xgi_hw_device_info 
*HwDeviceExtension,
 
if (XGINew_ReadWriteRest(23, 22, pVBInfo) == 1)
return;
-   else {
-   xgifb_reg_set(pVBInfo->P3c4, 0x13, 0x21);
-   xgifb_reg_set(pVBInfo->P3c4, 0x14, 0x30);
-   }
+   xgifb_reg_set(pVBInfo->P3c4, 0x13, 0x21);
+   xgifb_reg_set(pVBInfo->P3c4, 0x14, 0x30);
} else { /* DDR */
pVBInfo->ram_bus = 64; /* 64 bits */
pVBInfo->ram_channel = 1; /* 1 channels */
@@ -741,10 +737,8 @@ static void XGINew_CheckChannel(struct xgi_hw_device_info 
*HwDeviceExtension,
 
if (XGINew_ReadWriteRest(24, 23, pVBInfo) == 1)
return;
-   else {
-   xgifb_reg_set(pVBInfo->P3c4, 0x13, 0x21);
-   xgifb_reg_set(pVBInfo->P3c4, 0x14, 0x42);
-   }
+   xgifb_reg_set(pVBInfo->P3c4, 0x13, 0x21);
+   xgifb_reg_set(pVBInfo->P3c4, 0

[PATCH] staging: xgifb: remove unnecessary else

2014-09-05 Thread Thomas Gummerer
Signed-off-by: Thomas Gummerer 
---
 drivers/staging/xgifb/XGI_main_26.c | 10 +++-
 drivers/staging/xgifb/vb_init.c | 50 -
 drivers/staging/xgifb/vb_setmode.c  |  3 +--
 3 files changed, 26 insertions(+), 37 deletions(-)

diff --git a/drivers/staging/xgifb/XGI_main_26.c 
b/drivers/staging/xgifb/XGI_main_26.c
index f82f057..be7778b 100644
--- a/drivers/staging/xgifb/XGI_main_26.c
+++ b/drivers/staging/xgifb/XGI_main_26.c
@@ -588,13 +588,11 @@ static u8 XGIfb_search_refresh_rate(struct 
xgifb_video_info *xgifb_info,
}
i++;
}
-   if (xgifb_info->rate_idx > 0) {
+   if (xgifb_info->rate_idx > 0)
return xgifb_info->rate_idx;
-   } else {
-   pr_info("Unsupported rate %d for %dx%d\n",
-  rate, xres, yres);
-   return 0;
-   }
+   pr_info("Unsupported rate %d for %dx%d\n",
+   rate, xres, yres);
+   return 0;
 }
 
 static void XGIfb_search_tvstd(const char *name)
diff --git a/drivers/staging/xgifb/vb_init.c b/drivers/staging/xgifb/vb_init.c
index ff210dd..2b233af 100644
--- a/drivers/staging/xgifb/vb_init.c
+++ b/drivers/staging/xgifb/vb_init.c
@@ -63,14 +63,13 @@ XGINew_GetXG20DRAMType(struct xgi_hw_device_info 
*HwDeviceExtension,
/* ~HOTPLUG_SUPPORT */
xgifb_reg_or(pVBInfo->P3d4, 0xB4, 0x02);
return data;
-   } else {
-   data = xgifb_reg_get(pVBInfo->P3d4, 0x97) & 0x01;
+   }
+   data = xgifb_reg_get(pVBInfo->P3d4, 0x97) & 0x01;
 
-   if (data == 1)
-   data++;
+   if (data == 1)
+   data++;
 
-   return data;
-   }
+   return data;
 }
 
 static void XGINew_DDR1x_MRS_340(unsigned long P3c4,
@@ -578,9 +577,8 @@ static unsigned char XGINew_CheckFrequence(struct 
vb_device_info *pVBInfo)
data = xgifb_reg_get(pVBInfo->P3c4, 0x39);
data = (data & 0x02) >> 1;
return data;
-   } else {
-   return data & 0x01;
}
+   return data & 0x01;
 }
 
 static void XGINew_CheckChannel(struct xgi_hw_device_info *HwDeviceExtension,
@@ -637,10 +635,9 @@ static void XGINew_CheckChannel(struct xgi_hw_device_info 
*HwDeviceExtension,
 
if (XGINew_ReadWriteRest(23, 22, pVBInfo) == 1)
return;
-   else
-   xgifb_reg_set(pVBInfo->P3c4,
- 0x13,
- 0x31);
+   xgifb_reg_set(pVBInfo->P3c4,
+ 0x13,
+ 0x31);
udelay(15);
}
 
@@ -687,10 +684,11 @@ static void XGINew_CheckChannel(struct xgi_hw_device_info 
*HwDeviceExtension,
 
if (XGINew_ReadWriteRest(22, 21, pVBInfo) == 1)
return;
-   else /* (0x31:12x8x2) 22bit + 1 rank */
-   xgifb_reg_set(pVBInfo->P3c4,
- 0x13,
- 0x31);
+
+   /* (0x31:12x8x2) 22bit + 1 rank */
+   xgifb_reg_set(pVBInfo->P3c4,
+ 0x13,
+ 0x31);
udelay(15);
}
}
@@ -729,10 +727,8 @@ static void XGINew_CheckChannel(struct xgi_hw_device_info 
*HwDeviceExtension,
 
if (XGINew_ReadWriteRest(23, 22, pVBInfo) == 1)
return;
-   else {
-   xgifb_reg_set(pVBInfo->P3c4, 0x13, 0x21);
-   xgifb_reg_set(pVBInfo->P3c4, 0x14, 0x30);
-   }
+   xgifb_reg_set(pVBInfo->P3c4, 0x13, 0x21);
+   xgifb_reg_set(pVBInfo->P3c4, 0x14, 0x30);
} else { /* DDR */
pVBInfo->ram_bus = 64; /* 64 bits */
pVBInfo->ram_channel = 1; /* 1 channels */
@@ -741,10 +737,8 @@ static void XGINew_CheckChannel(struct xgi_hw_device_info 
*HwDeviceExtension,
 
if (XGINew_ReadWriteRest(24, 23, pVBInfo) == 1)
return;
-   else {
-   xgifb_reg_set(pVBInfo->P3c4, 0x13, 0x21);
-   xgifb_reg_set(pVBInfo->P3c4, 0x14, 0x42);
-   }
+   xgifb_reg_set(pVBInfo->P3c4, 0x13, 0x21);
+   xgifb_reg_set(pVBInfo->P3c4, 0

[PATCH 06/17] staging: comedi: adl_pci9118: cleanup and simplify pci9118_reset()

2014-09-05 Thread H Hartley Sweeten
Change the return type to void, this function always succeeds and the
callers never check the return value.

According to the The User Manual for the PCI-9118, the hardware does not
require any particular "reset" in order to function. Simplify the reset
so it justs gets the board info a known state with interrupts disabled.

There is no reason to initialize the private data members in this function.
They all default to '0' due to the kzalloc() of the private data and the
subdevice operations all initialize them as needed.

Signed-off-by: H Hartley Sweeten 
Cc: Ian Abbott 
Cc: Greg Kroah-Hartman 
---
 drivers/staging/comedi/drivers/adl_pci9118.c | 59 ++--
 1 file changed, 13 insertions(+), 46 deletions(-)

diff --git a/drivers/staging/comedi/drivers/adl_pci9118.c 
b/drivers/staging/comedi/drivers/adl_pci9118.c
index 4a956ccb..56458ac 100644
--- a/drivers/staging/comedi/drivers/adl_pci9118.c
+++ b/drivers/staging/comedi/drivers/adl_pci9118.c
@@ -1654,63 +1654,30 @@ static int pci9118_do_insn_bits(struct comedi_device 
*dev,
return insn->n;
 }
 
-static int pci9118_reset(struct comedi_device *dev)
+static void pci9118_reset(struct comedi_device *dev)
 {
-   struct pci9118_private *devpriv = dev->private;
+   /* reset analog input subsystem */
+   outl(0, dev->iobase + PCI9118_INT_CTRL_REG);
+   outl(0, dev->iobase + PCI9118_AI_CTRL_REG);
+   outl(0, dev->iobase + PCI9118_AI_CFG_REG);
+   pci9118_ai_reset_fifo(dev);
 
-   devpriv->IntControlReg = 0;
-   devpriv->exttrg_users = 0;
-   /* clear interrupts then disable all interrupt sources */
+   /* clear any pending interrupts and status */
inl(dev->iobase + PCI9118_INT_CTRL_REG);
-   outl(devpriv->IntControlReg, dev->iobase + PCI9118_INT_CTRL_REG);
+   inl(dev->iobase + PCI9118_AI_STATUS_REG);
+
+   /* reset and stop counters */
pci9118_timer_set_mode(dev, 0, I8254_MODE0);
-   pci9118_start_pacer(dev, 0);/* stop 8254 counters */
-   devpriv->AdControlReg = 0;
-   outl(devpriv->AdControlReg, dev->iobase + PCI9118_AI_CTRL_REG);
-   /*
-* bipolar, S.E., use 8254,
-* stop 8354, internal trigger,
-* soft trigger,
-* disable INT and DMA
-*/
+   pci9118_start_pacer(dev, 0);
+
+   /* reset DMA and scan queue */
outl(0, dev->iobase + PCI9118_AI_BURST_NUM_REG);
-   /* reset scan queue */
outl(1, dev->iobase + PCI9118_AI_AUTOSCAN_MODE_REG);
outl(2, dev->iobase + PCI9118_AI_AUTOSCAN_MODE_REG);
-   devpriv->AdFunctionReg = PCI9118_AI_CFG_PDTRG | PCI9118_AI_CFG_PETRG;
-   outl(devpriv->AdFunctionReg, dev->iobase + PCI9118_AI_CFG_REG);
-   /*
-* positive triggers, no S&H,
-* no burst, burst stop,
-* no post trigger,
-* no about trigger,
-* trigger stop
-*/
 
/* reset analog outputs to 0V */
outl(2047, dev->iobase + PCI9118_AO_REG(0));
outl(2047, dev->iobase + PCI9118_AO_REG(1));
-
-   udelay(10);
-   inl(dev->iobase + PCI9118_AI_FIFO_REG);
-   pci9118_ai_reset_fifo(dev);
-   /* disable all interrupt sources */
-   outl(0, dev->iobase + PCI9118_INT_CTRL_REG);
-   /* clear A/D and INT status registers */
-   inl(dev->iobase + PCI9118_AI_STATUS_REG);
-   inl(dev->iobase + PCI9118_INT_CTRL_REG);
-   devpriv->AdControlReg = 0;
-   outl(devpriv->AdControlReg, dev->iobase + PCI9118_AI_CTRL_REG);
-   /*
-* bipolar, S.E., use 8254,
-* stop 8354, internal trigger,
-* soft trigger,
-* disable INT and DMA
-*/
-
-   devpriv->exttrg_users = 0;
-
-   return 0;
 }
 
 static struct pci_dev *pci9118_find_pci(struct comedi_device *dev,
-- 
2.0.3

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


[PATCH 04/17] staging: comedi: adl_pci9118: use comedi_subdevice 'readback'

2014-09-05 Thread H Hartley Sweeten
Use the new comedi_subdevice 'readback' member and the core provided
(*insn_read) for the readback of the analog output subdevice channels.

The board is "reset" prior to the subdevice init. Part of this reset
sets all the analog output channels to 0V. Move the initialization of
the 'readback' values after the 'readback' member has been allocated.

Signed-off-by: H Hartley Sweeten 
Cc: Ian Abbott 
Cc: Greg Kroah-Hartman 
---
 drivers/staging/comedi/drivers/adl_pci9118.c | 47 
 1 file changed, 20 insertions(+), 27 deletions(-)

diff --git a/drivers/staging/comedi/drivers/adl_pci9118.c 
b/drivers/staging/comedi/drivers/adl_pci9118.c
index b89021f..bd4dee2 100644
--- a/drivers/staging/comedi/drivers/adl_pci9118.c
+++ b/drivers/staging/comedi/drivers/adl_pci9118.c
@@ -255,7 +255,6 @@ struct pci9118_private {
 * divisors for start of measure
 * on external start
 */
-   unsigned short ao_data[2];  /* data output buffer */
char dma_doublebuf; /* use double buffering */
unsigned int dma_actbuf;/* which buffer is used now */
unsigned short *dmabuf_virt[2]; /*
@@ -523,32 +522,20 @@ static int pci9118_insn_read_ai(struct comedi_device *dev,
 
 static int pci9118_insn_write_ao(struct comedi_device *dev,
 struct comedi_subdevice *s,
-struct comedi_insn *insn, unsigned int *data)
+struct comedi_insn *insn,
+unsigned int *data)
 {
-   struct pci9118_private *devpriv = dev->private;
unsigned int chan = CR_CHAN(insn->chanspec);
-   int n;
+   unsigned int val = s->readback[chan];
+   int i;
 
-   for (n = 0; n < insn->n; n++) {
-   outl(data[n], dev->iobase + PCI9118_AO_REG(chan));
-   devpriv->ao_data[chan] = data[n];
+   for (i = 0; i < insn->n; i++) {
+   val = data[i];
+   outl(val, dev->iobase + PCI9118_AO_REG(chan));
}
+   s->readback[chan] = val;
 
-   return n;
-}
-
-static int pci9118_insn_read_ao(struct comedi_device *dev,
-   struct comedi_subdevice *s,
-   struct comedi_insn *insn, unsigned int *data)
-{
-   struct pci9118_private *devpriv = dev->private;
-   int n, chan;
-
-   chan = CR_CHAN(insn->chanspec);
-   for (n = 0; n < insn->n; n++)
-   data[n] = devpriv->ao_data[chan];
-
-   return n;
+   return insn->n;
 }
 
 static void interrupt_pci9118_ai_mode4_switch(struct comedi_device *dev)
@@ -1701,10 +1688,8 @@ static int pci9118_reset(struct comedi_device *dev)
 */
 
/* reset analog outputs to 0V */
-   devpriv->ao_data[0] = 2047;
-   devpriv->ao_data[1] = 2047;
-   outl(devpriv->ao_data[0], dev->iobase + PCI9118_AO_REG(0));
-   outl(devpriv->ao_data[1], dev->iobase + PCI9118_AO_REG(1));
+   outl(2047, dev->iobase + PCI9118_AO_REG(0));
+   outl(2047, dev->iobase + PCI9118_AO_REG(1));
 
udelay(10);
inl(dev->iobase + PCI9118_AI_FIFO_REG);
@@ -1886,7 +1871,15 @@ static int pci9118_common_attach(struct comedi_device 
*dev, int disable_irq,
s->maxdata  = 0x0fff;
s->range_table  = &range_bipolar10;
s->insn_write   = pci9118_insn_write_ao;
-   s->insn_read= pci9118_insn_read_ao;
+   s->insn_read= comedi_readback_insn_read;
+
+   ret = comedi_alloc_subdev_readback(s);
+   if (ret)
+   return ret;
+
+   /* the analog outputs were reset to 0V, make the readback match */
+   for (i = 0; i < s->n_chan; i++)
+   s->readback[i] = 2047;
 
/* Digital Input subdevice */
s = &dev->subdevices[2];
-- 
2.0.3

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


[PATCH 14/17] staging: comedi: adl_pci9118: introduce pci9118_amcc_setup_dma()

2014-09-05 Thread H Hartley Sweeten
Introduce a helper function to program the AMCC master write address and
transfer count registers to setup a DMA transaction.

Signed-off-by: H Hartley Sweeten 
Cc: Ian Abbott 
Cc: Greg Kroah-Hartman 
---
 drivers/staging/comedi/drivers/adl_pci9118.c | 29 
 1 file changed, 17 insertions(+), 12 deletions(-)

diff --git a/drivers/staging/comedi/drivers/adl_pci9118.c 
b/drivers/staging/comedi/drivers/adl_pci9118.c
index 0526afe..c90afdf 100644
--- a/drivers/staging/comedi/drivers/adl_pci9118.c
+++ b/drivers/staging/comedi/drivers/adl_pci9118.c
@@ -294,6 +294,16 @@ struct pci9118_private {
unsigned int ai_ns_min;
 };
 
+static void pci9118_amcc_setup_dma(struct comedi_device *dev, unsigned int buf)
+{
+   struct pci9118_private *devpriv = dev->private;
+
+   /* set the master write address and transfer count */
+   outl(devpriv->dmabuf_hw[buf], devpriv->iobase_a + AMCC_OP_REG_MWAR);
+   outl(devpriv->dmabuf_use_size[buf],
+devpriv->iobase_a + AMCC_OP_REG_MWTC);
+}
+
 static void pci9118_amcc_dma_ena(struct comedi_device *dev, bool enable)
 {
struct pci9118_private *devpriv = dev->private;
@@ -880,10 +890,7 @@ static void interrupt_pci9118_ai_dma(struct comedi_device 
*dev,
 * double buffering
 */
next_dma_buf = 1 - devpriv->dma_actbuf;
-   outl(devpriv->dmabuf_hw[next_dma_buf],
-devpriv->iobase_a + AMCC_OP_REG_MWAR);
-   outl(devpriv->dmabuf_use_size[next_dma_buf],
-devpriv->iobase_a + AMCC_OP_REG_MWTC);
+   pci9118_amcc_setup_dma(dev, next_dma_buf);
devpriv->dmabuf_used_size[next_dma_buf] =
devpriv->dmabuf_use_size[next_dma_buf];
if (devpriv->ai_do == 4)
@@ -906,13 +913,12 @@ static void interrupt_pci9118_ai_dma(struct comedi_device 
*dev,
s->async->events |= COMEDI_CB_EOA;
}
 
-   if (devpriv->dma_doublebuf) {   /* switch dma buffers */
+   if (devpriv->dma_doublebuf) {
+   /* switch dma buffers */
devpriv->dma_actbuf = 1 - devpriv->dma_actbuf;
-   } else {/* restart DMA if is not used double buffering */
-   outl(devpriv->dmabuf_hw[0],
-devpriv->iobase_a + AMCC_OP_REG_MWAR);
-   outl(devpriv->dmabuf_use_size[0],
-devpriv->iobase_a + AMCC_OP_REG_MWTC);
+   } else {
+   /* restart DMA if is not used double buffering */
+   pci9118_amcc_setup_dma(dev, 0);
if (devpriv->ai_do == 4)
interrupt_pci9118_ai_mode4_switch(dev);
}
@@ -1288,8 +1294,7 @@ static int Compute_and_setup_dma(struct comedi_device 
*dev,
 #endif
 
pci9118_amcc_dma_ena(dev, false);
-   outl(devpriv->dmabuf_hw[0], devpriv->iobase_a + AMCC_OP_REG_MWAR);
-   outl(devpriv->dmabuf_use_size[0], devpriv->iobase_a + AMCC_OP_REG_MWTC);
+   pci9118_amcc_setup_dma(dev, 0);
/* init DMA transfer */
outl(0x | AINT_WRITE_COMPL,
 devpriv->iobase_a + AMCC_OP_REG_INTCSR);
-- 
2.0.3

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


[PATCH 17/17] staging: comedi: adl_pci9118: move analog input (*insn_read) function

2014-09-05 Thread H Hartley Sweeten
For aesthetics, move the analog input (*insn_read) function so it
is not located in the middle of the async command support functions.
Also, rename it for consistency.

Signed-off-by: H Hartley Sweeten 
Cc: Ian Abbott 
Cc: Greg Kroah-Hartman 
---
 drivers/staging/comedi/drivers/adl_pci9118.c | 123 ++-
 1 file changed, 62 insertions(+), 61 deletions(-)

diff --git a/drivers/staging/comedi/drivers/adl_pci9118.c 
b/drivers/staging/comedi/drivers/adl_pci9118.c
index 1fb6370..41fa615 100644
--- a/drivers/staging/comedi/drivers/adl_pci9118.c
+++ b/drivers/staging/comedi/drivers/adl_pci9118.c
@@ -489,66 +489,6 @@ static int setup_channel_list(struct comedi_device *dev,
return 1;   /* we can serve this with scan logic */
 }
 
-static int pci9118_ai_eoc(struct comedi_device *dev,
- struct comedi_subdevice *s,
- struct comedi_insn *insn,
- unsigned long context)
-{
-   unsigned int status;
-
-   status = inl(dev->iobase + PCI9118_AI_STATUS_REG);
-   if (status & PCI9118_AI_STATUS_ADRDY)
-   return 0;
-   return -EBUSY;
-}
-
-static void pci9118_ai_start_conv(struct comedi_device *dev)
-{
-   /* writing any value triggers an A/D conversion */
-   outl(0, dev->iobase + PCI9118_SOFTTRG_REG);
-}
-
-static int pci9118_insn_read_ai(struct comedi_device *dev,
-   struct comedi_subdevice *s,
-   struct comedi_insn *insn, unsigned int *data)
-{
-   struct pci9118_private *devpriv = dev->private;
-   unsigned int val;
-   int ret;
-   int n;
-
-   /*
-   * Configure analog input based on the chanspec.
-   * Acqusition is software controlled without interrupts.
-   */
-   pci9118_ai_set_range_aref(dev, s, insn->chanspec);
-
-   /* set default config (disable burst and triggers) */
-   devpriv->ai_cfg = PCI9118_AI_CFG_PDTRG | PCI9118_AI_CFG_PETRG;
-   outl(devpriv->ai_cfg, dev->iobase + PCI9118_AI_CFG_REG);
-
-   if (!setup_channel_list(dev, s, 1, &insn->chanspec, 0, 0, 0, 0))
-   return -EINVAL;
-
-   pci9118_ai_reset_fifo(dev);
-
-   for (n = 0; n < insn->n; n++) {
-   pci9118_ai_start_conv(dev);
-
-   ret = comedi_timeout(dev, s, insn, pci9118_ai_eoc, 0);
-   if (ret)
-   return ret;
-
-   val = inl(dev->iobase + PCI9118_AI_FIFO_REG);
-   if (s->maxdata == 0x)
-   data[n] = (val & 0x) ^ 0x8000;
-   else
-   data[n] = (val >> 4) & 0xfff;
-   }
-
-   return n;
-}
-
 static void interrupt_pci9118_ai_mode4_switch(struct comedi_device *dev)
 {
struct pci9118_private *devpriv = dev->private;
@@ -1600,6 +1540,67 @@ static int pci9118_ai_cmd(struct comedi_device *dev, 
struct comedi_subdevice *s)
return ret;
 }
 
+static int pci9118_ai_eoc(struct comedi_device *dev,
+ struct comedi_subdevice *s,
+ struct comedi_insn *insn,
+ unsigned long context)
+{
+   unsigned int status;
+
+   status = inl(dev->iobase + PCI9118_AI_STATUS_REG);
+   if (status & PCI9118_AI_STATUS_ADRDY)
+   return 0;
+   return -EBUSY;
+}
+
+static void pci9118_ai_start_conv(struct comedi_device *dev)
+{
+   /* writing any value triggers an A/D conversion */
+   outl(0, dev->iobase + PCI9118_SOFTTRG_REG);
+}
+
+static int pci9118_ai_insn_read(struct comedi_device *dev,
+   struct comedi_subdevice *s,
+   struct comedi_insn *insn,
+   unsigned int *data)
+{
+   struct pci9118_private *devpriv = dev->private;
+   unsigned int val;
+   int ret;
+   int i;
+
+   /*
+   * Configure analog input based on the chanspec.
+   * Acqusition is software controlled without interrupts.
+   */
+   pci9118_ai_set_range_aref(dev, s, insn->chanspec);
+
+   /* set default config (disable burst and triggers) */
+   devpriv->ai_cfg = PCI9118_AI_CFG_PDTRG | PCI9118_AI_CFG_PETRG;
+   outl(devpriv->ai_cfg, dev->iobase + PCI9118_AI_CFG_REG);
+
+   if (!setup_channel_list(dev, s, 1, &insn->chanspec, 0, 0, 0, 0))
+   return -EINVAL;
+
+   pci9118_ai_reset_fifo(dev);
+
+   for (i = 0; i < insn->n; i++) {
+   pci9118_ai_start_conv(dev);
+
+   ret = comedi_timeout(dev, s, insn, pci9118_ai_eoc, 0);
+   if (ret)
+   return ret;
+
+   val = inl(dev->iobase + PCI9118_AI_FIFO_REG);
+   if (s->maxdata == 0x)
+   data[i] = (val & 0x) ^ 0x8000;
+   else
+   data[i] = (val >> 4) & 0xfff;
+   }
+
+   return insn->n;
+}
+
 static int pci9118_ao_insn_write(struct com

[PATCH 05/17] staging: comedi: adl_pci9118: move analog output (*insn_write) function

2014-09-05 Thread H Hartley Sweeten
For aesthetics, move the analog output (*insn_write) function so it
is not located in the middle of the analog input functions. Also,
rename it for consistency.

Signed-off-by: H Hartley Sweeten 
Cc: Ian Abbott 
Cc: Greg Kroah-Hartman 
---
 drivers/staging/comedi/drivers/adl_pci9118.c | 38 ++--
 1 file changed, 19 insertions(+), 19 deletions(-)

diff --git a/drivers/staging/comedi/drivers/adl_pci9118.c 
b/drivers/staging/comedi/drivers/adl_pci9118.c
index bd4dee2..4a956ccb 100644
--- a/drivers/staging/comedi/drivers/adl_pci9118.c
+++ b/drivers/staging/comedi/drivers/adl_pci9118.c
@@ -520,24 +520,6 @@ static int pci9118_insn_read_ai(struct comedi_device *dev,
 
 }
 
-static int pci9118_insn_write_ao(struct comedi_device *dev,
-struct comedi_subdevice *s,
-struct comedi_insn *insn,
-unsigned int *data)
-{
-   unsigned int chan = CR_CHAN(insn->chanspec);
-   unsigned int val = s->readback[chan];
-   int i;
-
-   for (i = 0; i < insn->n; i++) {
-   val = data[i];
-   outl(val, dev->iobase + PCI9118_AO_REG(chan));
-   }
-   s->readback[chan] = val;
-
-   return insn->n;
-}
-
 static void interrupt_pci9118_ai_mode4_switch(struct comedi_device *dev)
 {
struct pci9118_private *devpriv = dev->private;
@@ -1620,6 +1602,24 @@ static int pci9118_ai_cmd(struct comedi_device *dev, 
struct comedi_subdevice *s)
return ret;
 }
 
+static int pci9118_ao_insn_write(struct comedi_device *dev,
+struct comedi_subdevice *s,
+struct comedi_insn *insn,
+unsigned int *data)
+{
+   unsigned int chan = CR_CHAN(insn->chanspec);
+   unsigned int val = s->readback[chan];
+   int i;
+
+   for (i = 0; i < insn->n; i++) {
+   val = data[i];
+   outl(val, dev->iobase + PCI9118_AO_REG(chan));
+   }
+   s->readback[chan] = val;
+
+   return insn->n;
+}
+
 static int pci9118_di_insn_bits(struct comedi_device *dev,
struct comedi_subdevice *s,
struct comedi_insn *insn,
@@ -1870,7 +1870,7 @@ static int pci9118_common_attach(struct comedi_device 
*dev, int disable_irq,
s->n_chan   = 2;
s->maxdata  = 0x0fff;
s->range_table  = &range_bipolar10;
-   s->insn_write   = pci9118_insn_write_ao;
+   s->insn_write   = pci9118_ao_insn_write;
s->insn_read= comedi_readback_insn_read;
 
ret = comedi_alloc_subdev_readback(s);
-- 
2.0.3

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


[PATCH 09/17] staging: comedi: adl_pci9118: rename 'AdFunctionReg'

2014-09-05 Thread H Hartley Sweeten
Rename this CamelCase member of the private data.

Signed-off-by: H Hartley Sweeten 
Cc: Ian Abbott 
Cc: Greg Kroah-Hartman 
---
 drivers/staging/comedi/drivers/adl_pci9118.c | 54 ++--
 1 file changed, 27 insertions(+), 27 deletions(-)

diff --git a/drivers/staging/comedi/drivers/adl_pci9118.c 
b/drivers/staging/comedi/drivers/adl_pci9118.c
index 398f6e1..349d960 100644
--- a/drivers/staging/comedi/drivers/adl_pci9118.c
+++ b/drivers/staging/comedi/drivers/adl_pci9118.c
@@ -229,7 +229,7 @@ struct pci9118_private {
 #endif
unsigned char AdControlReg; /* A/D control register */
unsigned char IntControlReg;/* Interrupt control register */
-   unsigned char AdFunctionReg;/* A/D function register */
+   unsigned char ai_cfg;
char ai_neverending;/* we do unlimited AI */
unsigned int ai_do; /* what do AI? 0=nothing, 1 to 4 mode */
unsigned int ai_act_scan;   /* how many scans we finished */
@@ -486,8 +486,8 @@ static int pci9118_insn_read_ai(struct comedi_device *dev,
*/
pci9118_ai_set_range_aref(dev, s, insn->chanspec);
 
-   devpriv->AdFunctionReg = PCI9118_AI_CFG_PDTRG | PCI9118_AI_CFG_PETRG;
-   outl(devpriv->AdFunctionReg, dev->iobase + PCI9118_AI_CFG_REG);
+   devpriv->ai_cfg = PCI9118_AI_CFG_PDTRG | PCI9118_AI_CFG_PETRG;
+   outl(devpriv->ai_cfg, dev->iobase + PCI9118_AI_CFG_REG);
/*
 * positive triggers, no S&H,
 * no burst, burst stop,
@@ -526,14 +526,14 @@ static void interrupt_pci9118_ai_mode4_switch(struct 
comedi_device *dev)
 {
struct pci9118_private *devpriv = dev->private;
 
-   devpriv->AdFunctionReg = PCI9118_AI_CFG_PDTRG | PCI9118_AI_CFG_PETRG |
-PCI9118_AI_CFG_AM;
-   outl(devpriv->AdFunctionReg, dev->iobase + PCI9118_AI_CFG_REG);
+   devpriv->ai_cfg = PCI9118_AI_CFG_PDTRG | PCI9118_AI_CFG_PETRG |
+ PCI9118_AI_CFG_AM;
+   outl(devpriv->ai_cfg, dev->iobase + PCI9118_AI_CFG_REG);
pci9118_timer_set_mode(dev, 0, I8254_MODE0);
pci9118_timer_write(dev, 0,
devpriv->dmabuf_hw[1 - devpriv->dma_actbuf] >> 1);
-   devpriv->AdFunctionReg |= PCI9118_AI_CFG_START;
-   outl(devpriv->AdFunctionReg, dev->iobase + PCI9118_AI_CFG_REG);
+   devpriv->ai_cfg |= PCI9118_AI_CFG_START;
+   outl(devpriv->ai_cfg, dev->iobase + PCI9118_AI_CFG_REG);
 }
 
 static unsigned int defragment_dma_buffer(struct comedi_device *dev,
@@ -689,8 +689,8 @@ static int pci9118_ai_cancel(struct comedi_device *dev,
devpriv->iobase_a + AMCC_OP_REG_MCSR);  /* stop DMA */
pci9118_exttrg_del(dev, EXTTRG_AI);
pci9118_start_pacer(dev, 0);/* stop 8254 counters */
-   devpriv->AdFunctionReg = PCI9118_AI_CFG_PDTRG | PCI9118_AI_CFG_PETRG;
-   outl(devpriv->AdFunctionReg, dev->iobase + PCI9118_AI_CFG_REG);
+   devpriv->ai_cfg = PCI9118_AI_CFG_PDTRG | PCI9118_AI_CFG_PETRG;
+   outl(devpriv->ai_cfg, dev->iobase + PCI9118_AI_CFG_REG);
/*
 * positive triggers, no S&H, no burst,
 * burst stop, no post trigger,
@@ -974,7 +974,7 @@ static int pci9118_ai_inttrig(struct comedi_device *dev,
s->async->inttrig = NULL;
 
outl(devpriv->IntControlReg, dev->iobase + PCI9118_INT_CTRL_REG);
-   outl(devpriv->AdFunctionReg, dev->iobase + PCI9118_AI_CFG_REG);
+   outl(devpriv->ai_cfg, dev->iobase + PCI9118_AI_CFG_REG);
if (devpriv->ai_do != 3) {
pci9118_start_pacer(dev, devpriv->ai_do);
devpriv->AdControlReg |= PCI9118_AI_CTRL_SOFTG;
@@ -1327,7 +1327,7 @@ static int pci9118_ai_docmd_sampl(struct comedi_device 
*dev,
if (!(devpriv->ai12_startstop & (START_AI_EXT | START_AI_INT))) {
outl(devpriv->IntControlReg,
 dev->iobase + PCI9118_INT_CTRL_REG);
-   outl(devpriv->AdFunctionReg, dev->iobase + PCI9118_AI_CFG_REG);
+   outl(devpriv->ai_cfg, dev->iobase + PCI9118_AI_CFG_REG);
if (devpriv->ai_do != 3) {
pci9118_start_pacer(dev, devpriv->ai_do);
devpriv->AdControlReg |= PCI9118_AI_CTRL_SOFTG;
@@ -1355,31 +1355,31 @@ static int pci9118_ai_docmd_dma(struct comedi_device 
*dev,
case 2:
devpriv->AdControlReg |= PCI9118_AI_CTRL_TMRTR |
 PCI9118_AI_CTRL_DMA;
-   devpriv->AdFunctionReg = PCI9118_AI_CFG_PDTRG |
-PCI9118_AI_CFG_PETRG |
-PCI9118_AI_CFG_BM |
-PCI9118_AI_CFG_BS;
+   devpriv->ai

[PATCH 00/17] staging: comedi: adl_pci9118: tidy up driver

2014-09-05 Thread H Hartley Sweeten
Cleans up all the non-async command support code.

This series applies after:
[PATCH 00/21] staging: comedi: adl_pci9118: cleanup the boardinfo and attach
[PATCH 00/19] staging: comedi: adl_pci9118: tidy up register map

H Hartley Sweeten (17):
  staging: comedi: adl_pci9118: move digitial output (*insn_bits) function
  staging: comedi: adl_pci9118: don't reset digital outputs
  staging: comedi: adl_pci9118: move digitial input (*insn_bits) function
  staging: comedi: adl_pci9118: use comedi_subdevice 'readback'
  staging: comedi: adl_pci9118: move analog output (*insn_write) function
  staging: comedi: adl_pci9118: cleanup and simplify pci9118_reset()
  staging: comedi: adl_pci9118: ai (*insn_read) does not use interrupts
  staging: comedi: adl_pci9118: fix ai range/aref programming
  staging: comedi: adl_pci9118: rename 'AdFunctionReg'
  staging: comedi: adl_pci9118: rename 'AdControlReg'
  staging: comedi: adl_pci9118: rename 'IntControlReg'
  staging: comedi: adl_pci9118: introduce pci9118_amcc_int_ena()
  staging: comedi: adl_pci9118: introduce pci9118_amcc_dma_ena()
  staging: comedi: adl_pci9118: introduce pci9118_amcc_setup_dma()
  staging: comedi: adl_pci9118: no need to reset ai FIFO after (*insn_read)
  staging: comedi: adl_pci9118: tidy up some wordy comments
  staging: comedi: adl_pci9118: move analog input (*insn_read) function

 drivers/staging/comedi/drivers/adl_pci9118.c | 605 +--
 1 file changed, 283 insertions(+), 322 deletions(-)

-- 
2.0.3

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


[PATCH 10/17] staging: comedi: adl_pci9118: rename 'AdControlReg'

2014-09-05 Thread H Hartley Sweeten
Rename this CamelCase member of the private data.

Signed-off-by: H Hartley Sweeten 
Cc: Ian Abbott 
Cc: Greg Kroah-Hartman 
---
 drivers/staging/comedi/drivers/adl_pci9118.c | 48 ++--
 1 file changed, 24 insertions(+), 24 deletions(-)

diff --git a/drivers/staging/comedi/drivers/adl_pci9118.c 
b/drivers/staging/comedi/drivers/adl_pci9118.c
index 349d960..1efa9ff 100644
--- a/drivers/staging/comedi/drivers/adl_pci9118.c
+++ b/drivers/staging/comedi/drivers/adl_pci9118.c
@@ -227,7 +227,7 @@ struct pci9118_private {
 */
unsigned char chanlistlen;  /* number of scanlist */
 #endif
-   unsigned char AdControlReg; /* A/D control register */
+   unsigned char ai_ctrl;
unsigned char IntControlReg;/* Interrupt control register */
unsigned char ai_cfg;
char ai_neverending;/* we do unlimited AI */
@@ -326,12 +326,12 @@ static void pci9118_ai_set_range_aref(struct 
comedi_device *dev,
unsigned int range = CR_RANGE(chanspec);
unsigned int aref = CR_AREF(chanspec);
 
-   devpriv->AdControlReg = 0;
+   devpriv->ai_ctrl = 0;
if (comedi_range_is_unipolar(s, range))
-   devpriv->AdControlReg |= PCI9118_AI_CTRL_UNIP;
+   devpriv->ai_ctrl |= PCI9118_AI_CTRL_UNIP;
if (aref == AREF_DIFF)
-   devpriv->AdControlReg |= PCI9118_AI_CTRL_DIFF;
-   outl(devpriv->AdControlReg, dev->iobase + PCI9118_AI_CTRL_REG);
+   devpriv->ai_ctrl |= PCI9118_AI_CTRL_DIFF;
+   outl(devpriv->ai_ctrl, dev->iobase + PCI9118_AI_CTRL_REG);
 }
 
 static int check_channel_list(struct comedi_device *dev,
@@ -696,8 +696,8 @@ static int pci9118_ai_cancel(struct comedi_device *dev,
 * burst stop, no post trigger,
 * no about trigger, trigger stop
 */
-   devpriv->AdControlReg = 0x00;
-   outl(devpriv->AdControlReg, dev->iobase + PCI9118_AI_CTRL_REG);
+   devpriv->ai_ctrl = 0;
+   outl(devpriv->ai_ctrl, dev->iobase + PCI9118_AI_CTRL_REG);
/*
 * bipolar, S.E., use 8254, stop 8354,
 * internal trigger, soft trigger,
@@ -939,7 +939,7 @@ static irqreturn_t pci9118_interrupt(int irq, void *d)
 
/* start pacer */
pci9118_start_pacer(dev, devpriv->ai_do);
-   outl(devpriv->AdControlReg,
+   outl(devpriv->ai_ctrl,
 dev->iobase + PCI9118_AI_CTRL_REG);
} else if (devpriv->ai12_startstop & STOP_AI_EXT) {
/* deactivate EXT trigger */
@@ -977,9 +977,9 @@ static int pci9118_ai_inttrig(struct comedi_device *dev,
outl(devpriv->ai_cfg, dev->iobase + PCI9118_AI_CFG_REG);
if (devpriv->ai_do != 3) {
pci9118_start_pacer(dev, devpriv->ai_do);
-   devpriv->AdControlReg |= PCI9118_AI_CTRL_SOFTG;
+   devpriv->ai_ctrl |= PCI9118_AI_CTRL_SOFTG;
}
-   outl(devpriv->AdControlReg, dev->iobase + PCI9118_AI_CTRL_REG);
+   outl(devpriv->ai_ctrl, dev->iobase + PCI9118_AI_CTRL_REG);
 
return 1;
 }
@@ -1295,13 +1295,13 @@ static int pci9118_ai_docmd_sampl(struct comedi_device 
*dev,
 
switch (devpriv->ai_do) {
case 1:
-   devpriv->AdControlReg |= PCI9118_AI_CTRL_TMRTR;
+   devpriv->ai_ctrl |= PCI9118_AI_CTRL_TMRTR;
break;
case 2:
dev_err(dev->class_dev, "%s mode 2 bug!\n", __func__);
return -EIO;
case 3:
-   devpriv->AdControlReg |= PCI9118_AI_CTRL_EXTM;
+   devpriv->ai_ctrl |= PCI9118_AI_CTRL_EXTM;
break;
case 4:
dev_err(dev->class_dev, "%s mode 4 bug!\n", __func__);
@@ -1318,7 +1318,7 @@ static int pci9118_ai_docmd_sampl(struct comedi_device 
*dev,
if ((devpriv->ai_do == 1) || (devpriv->ai_do == 2))
devpriv->IntControlReg |= PCI9118_INT_CTRL_TIMER;
 
-   devpriv->AdControlReg |= PCI9118_AI_CTRL_INT;
+   devpriv->ai_ctrl |= PCI9118_AI_CTRL_INT;
 
outl(inl(devpriv->iobase_a + AMCC_OP_REG_INTCSR) | 0x1f00,
devpriv->iobase_a + AMCC_OP_REG_INTCSR);
@@ -1330,7 +1330,7 @@ static int pci9118_ai_docmd_sampl(struct comedi_device 
*dev,
outl(devpriv->ai_cfg, dev->iobase + PCI9118_AI_CFG_REG);
if (devpriv->ai_do != 3) {
pci9118_start_pacer(dev, devpriv->ai_do);
-   devpriv->AdControlReg |= PCI9118_AI_CTRL_SOFTG;
+   devpriv->ai_ctrl |= PCI9118_AI_CTRL_SOFTG;
}
outl(devpriv->IntCont

[PATCH 16/17] staging: comedi: adl_pci9118: tidy up some wordy comments

2014-09-05 Thread H Hartley Sweeten
Signed-off-by: H Hartley Sweeten 
Cc: Ian Abbott 
Cc: Greg Kroah-Hartman 
---
 drivers/staging/comedi/drivers/adl_pci9118.c | 26 --
 1 file changed, 4 insertions(+), 22 deletions(-)

diff --git a/drivers/staging/comedi/drivers/adl_pci9118.c 
b/drivers/staging/comedi/drivers/adl_pci9118.c
index 5743960..1fb6370 100644
--- a/drivers/staging/comedi/drivers/adl_pci9118.c
+++ b/drivers/staging/comedi/drivers/adl_pci9118.c
@@ -523,15 +523,9 @@ static int pci9118_insn_read_ai(struct comedi_device *dev,
*/
pci9118_ai_set_range_aref(dev, s, insn->chanspec);
 
+   /* set default config (disable burst and triggers) */
devpriv->ai_cfg = PCI9118_AI_CFG_PDTRG | PCI9118_AI_CFG_PETRG;
outl(devpriv->ai_cfg, dev->iobase + PCI9118_AI_CFG_REG);
-   /*
-* positive triggers, no S&H,
-* no burst, burst stop,
-* no post trigger,
-* no about trigger,
-* trigger stop
-*/
 
if (!setup_channel_list(dev, s, 1, &insn->chanspec, 0, 0, 0, 0))
return -EINVAL;
@@ -714,20 +708,12 @@ static int pci9118_ai_cancel(struct comedi_device *dev,
pci9118_amcc_dma_ena(dev, false);
pci9118_exttrg_del(dev, EXTTRG_AI);
pci9118_start_pacer(dev, 0);/* stop 8254 counters */
+   /* set default config (disable burst and triggers) */
devpriv->ai_cfg = PCI9118_AI_CFG_PDTRG | PCI9118_AI_CFG_PETRG;
outl(devpriv->ai_cfg, dev->iobase + PCI9118_AI_CFG_REG);
-   /*
-* positive triggers, no S&H, no burst,
-* burst stop, no post trigger,
-* no about trigger, trigger stop
-*/
+   /* reset acqusition control */
devpriv->ai_ctrl = 0;
outl(devpriv->ai_ctrl, dev->iobase + PCI9118_AI_CTRL_REG);
-   /*
-* bipolar, S.E., use 8254, stop 8354,
-* internal trigger, soft trigger,
-* disable INT and DMA
-*/
outl(0, dev->iobase + PCI9118_AI_BURST_NUM_REG);
/* reset scan queue */
outl(1, dev->iobase + PCI9118_AI_AUTOSCAN_MODE_REG);
@@ -1592,12 +1578,8 @@ static int pci9118_ai_cmd(struct comedi_device *dev, 
struct comedi_subdevice *s)
 
pci9118_start_pacer(dev, -1);   /* stop pacer */
 
+   /* set default config (disable burst and triggers) */
devpriv->ai_cfg = PCI9118_AI_CFG_PDTRG | PCI9118_AI_CFG_PETRG;
-   /*
-* positive triggers, no S&H, no burst,
-* burst stop, no post trigger,
-* no about trigger, trigger stop
-*/
outl(devpriv->ai_cfg, dev->iobase + PCI9118_AI_CFG_REG);
udelay(1);
pci9118_ai_reset_fifo(dev);
-- 
2.0.3

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


[PATCH 15/17] staging: comedi: adl_pci9118: no need to reset ai FIFO after (*insn_read)

2014-09-05 Thread H Hartley Sweeten
The analog input FIFO is reset at the start of every (*insn_read) and (*do_cmd)
operation. It's also reset for the analog input (*cancel).

There's no reason to reset the FIFO if an (*insn_read) times out or after
all the samples have been acquired.

Signed-off-by: H Hartley Sweeten 
Cc: Ian Abbott 
Cc: Greg Kroah-Hartman 
---
 drivers/staging/comedi/drivers/adl_pci9118.c | 6 +-
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/drivers/staging/comedi/drivers/adl_pci9118.c 
b/drivers/staging/comedi/drivers/adl_pci9118.c
index c90afdf..5743960 100644
--- a/drivers/staging/comedi/drivers/adl_pci9118.c
+++ b/drivers/staging/comedi/drivers/adl_pci9118.c
@@ -542,10 +542,8 @@ static int pci9118_insn_read_ai(struct comedi_device *dev,
pci9118_ai_start_conv(dev);
 
ret = comedi_timeout(dev, s, insn, pci9118_ai_eoc, 0);
-   if (ret) {
-   pci9118_ai_reset_fifo(dev);
+   if (ret)
return ret;
-   }
 
val = inl(dev->iobase + PCI9118_AI_FIFO_REG);
if (s->maxdata == 0x)
@@ -554,9 +552,7 @@ static int pci9118_insn_read_ai(struct comedi_device *dev,
data[n] = (val >> 4) & 0xfff;
}
 
-   pci9118_ai_reset_fifo(dev);
return n;
-
 }
 
 static void interrupt_pci9118_ai_mode4_switch(struct comedi_device *dev)
-- 
2.0.3

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


[PATCH 13/17] staging: comedi: adl_pci9118: introduce pci9118_amcc_dma_ena()

2014-09-05 Thread H Hartley Sweeten
Introduce a helper function to program the AMCC master control/status
register to enable/disable dma.

Signed-off-by: H Hartley Sweeten 
Cc: Ian Abbott 
Cc: Greg Kroah-Hartman 
---
 drivers/staging/comedi/drivers/adl_pci9118.c | 25 -
 1 file changed, 16 insertions(+), 9 deletions(-)

diff --git a/drivers/staging/comedi/drivers/adl_pci9118.c 
b/drivers/staging/comedi/drivers/adl_pci9118.c
index 834f619..0526afe 100644
--- a/drivers/staging/comedi/drivers/adl_pci9118.c
+++ b/drivers/staging/comedi/drivers/adl_pci9118.c
@@ -294,6 +294,19 @@ struct pci9118_private {
unsigned int ai_ns_min;
 };
 
+static void pci9118_amcc_dma_ena(struct comedi_device *dev, bool enable)
+{
+   struct pci9118_private *devpriv = dev->private;
+   unsigned int mcsr;
+
+   mcsr = inl(devpriv->iobase_a + AMCC_OP_REG_MCSR);
+   if (enable)
+   mcsr |= RESET_A2P_FLAGS | A2P_HI_PRIORITY | EN_A2P_TRANSFERS;
+   else
+   mcsr &= ~EN_A2P_TRANSFERS;
+   outl(mcsr, devpriv->iobase_a + AMCC_OP_REG_MCSR);
+}
+
 static void pci9118_amcc_int_ena(struct comedi_device *dev, bool enable)
 {
struct pci9118_private *devpriv = dev->private;
@@ -692,9 +705,7 @@ static int pci9118_ai_cancel(struct comedi_device *dev,
struct pci9118_private *devpriv = dev->private;
 
if (devpriv->usedma)
-   outl(inl(devpriv->iobase_a + AMCC_OP_REG_MCSR) &
-   (~EN_A2P_TRANSFERS),
-   devpriv->iobase_a + AMCC_OP_REG_MCSR);  /* stop DMA */
+   pci9118_amcc_dma_ena(dev, false);
pci9118_exttrg_del(dev, EXTTRG_AI);
pci9118_start_pacer(dev, 0);/* stop 8254 counters */
devpriv->ai_cfg = PCI9118_AI_CFG_PDTRG | PCI9118_AI_CFG_PETRG;
@@ -1276,18 +1287,14 @@ static int Compute_and_setup_dma(struct comedi_device 
*dev,
}
 #endif
 
-   outl(inl(devpriv->iobase_a + AMCC_OP_REG_MCSR) & (~EN_A2P_TRANSFERS),
-   devpriv->iobase_a + AMCC_OP_REG_MCSR);  /* stop DMA */
+   pci9118_amcc_dma_ena(dev, false);
outl(devpriv->dmabuf_hw[0], devpriv->iobase_a + AMCC_OP_REG_MWAR);
outl(devpriv->dmabuf_use_size[0], devpriv->iobase_a + AMCC_OP_REG_MWTC);
/* init DMA transfer */
outl(0x | AINT_WRITE_COMPL,
 devpriv->iobase_a + AMCC_OP_REG_INTCSR);
 /* outl(0x0200|AINT_WRITE_COMPL, devpriv->iobase_a+AMCC_OP_REG_INTCSR); */
-
-   outl(inl(devpriv->iobase_a +
-AMCC_OP_REG_MCSR) | RESET_A2P_FLAGS | A2P_HI_PRIORITY |
-EN_A2P_TRANSFERS, devpriv->iobase_a + AMCC_OP_REG_MCSR);
+   pci9118_amcc_dma_ena(dev, true);
outl(inl(devpriv->iobase_a + AMCC_OP_REG_INTCSR) | EN_A2P_TRANSFERS,
devpriv->iobase_a + AMCC_OP_REG_INTCSR);
/* allow bus mastering */
-- 
2.0.3

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


[PATCH 01/17] staging: comedi: adl_pci9118: move digitial output (*insn_bits) function

2014-09-05 Thread H Hartley Sweeten
For aesthetics, move the digital outputs (*insn_bits) function so it
is not located in the middle of the analog input functions. Also,
rename it for consistency.

Signed-off-by: H Hartley Sweeten 
Cc: Ian Abbott 
Cc: Greg Kroah-Hartman 
---
 drivers/staging/comedi/drivers/adl_pci9118.c | 40 ++--
 1 file changed, 20 insertions(+), 20 deletions(-)

diff --git a/drivers/staging/comedi/drivers/adl_pci9118.c 
b/drivers/staging/comedi/drivers/adl_pci9118.c
index 03ca818..a9fd343 100644
--- a/drivers/staging/comedi/drivers/adl_pci9118.c
+++ b/drivers/staging/comedi/drivers/adl_pci9118.c
@@ -566,25 +566,6 @@ static int pci9118_insn_bits_di(struct comedi_device *dev,
return insn->n;
 }
 
-static int pci9118_insn_bits_do(struct comedi_device *dev,
-   struct comedi_subdevice *s,
-   struct comedi_insn *insn,
-   unsigned int *data)
-{
-   /*
-* The digital outputs are set with the same register that
-* the digital inputs and outputs are read from. But the
-* outputs are set with bits [3:0] so we can simply write
-* the s->state to set them.
-*/
-   if (comedi_dio_update_state(s, data))
-   outl(s->state, dev->iobase + PCI9118_DIO_REG);
-
-   data[1] = s->state;
-
-   return insn->n;
-}
-
 static void interrupt_pci9118_ai_mode4_switch(struct comedi_device *dev)
 {
struct pci9118_private *devpriv = dev->private;
@@ -1667,6 +1648,25 @@ static int pci9118_ai_cmd(struct comedi_device *dev, 
struct comedi_subdevice *s)
return ret;
 }
 
+static int pci9118_do_insn_bits(struct comedi_device *dev,
+   struct comedi_subdevice *s,
+   struct comedi_insn *insn,
+   unsigned int *data)
+{
+   /*
+* The digital outputs are set with the same register that
+* the digital inputs and outputs are read from. But the
+* outputs are set with bits [3:0] so we can simply write
+* the s->state to set them.
+*/
+   if (comedi_dio_update_state(s, data))
+   outl(s->state, dev->iobase + PCI9118_DIO_REG);
+
+   data[1] = s->state;
+
+   return insn->n;
+}
+
 static int pci9118_reset(struct comedi_device *dev)
 {
struct pci9118_private *devpriv = dev->private;
@@ -1905,7 +1905,7 @@ static int pci9118_common_attach(struct comedi_device 
*dev, int disable_irq,
s->n_chan   = 4;
s->maxdata  = 1;
s->range_table  = &range_digital;
-   s->insn_bits= pci9118_insn_bits_do;
+   s->insn_bits= pci9118_do_insn_bits;
 
devpriv->ai_maskharderr = 0x10a;
/* default measure crash condition */
-- 
2.0.3

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


[PATCH 12/17] staging: comedi: adl_pci9118: introduce pci9118_amcc_int_ena()

2014-09-05 Thread H Hartley Sweeten
Introduce a helper function to program the AMCC interrupt control/
status register to enable/disable interrupts.

Fix the analog input (*cancel). The analog input async command support
is the only interrupt generator. The (*cancel) should always disable
interrupts.

Signed-off-by: H Hartley Sweeten 
Cc: Ian Abbott 
Cc: Greg Kroah-Hartman 
---
 drivers/staging/comedi/drivers/adl_pci9118.c | 38 
 1 file changed, 22 insertions(+), 16 deletions(-)

diff --git a/drivers/staging/comedi/drivers/adl_pci9118.c 
b/drivers/staging/comedi/drivers/adl_pci9118.c
index 48287a5..834f619 100644
--- a/drivers/staging/comedi/drivers/adl_pci9118.c
+++ b/drivers/staging/comedi/drivers/adl_pci9118.c
@@ -294,6 +294,20 @@ struct pci9118_private {
unsigned int ai_ns_min;
 };
 
+static void pci9118_amcc_int_ena(struct comedi_device *dev, bool enable)
+{
+   struct pci9118_private *devpriv = dev->private;
+   unsigned int intcsr;
+
+   /* enable/disable interrupt for AMCC Incoming Mailbox 4 (32-bit) */
+   intcsr = inl(devpriv->iobase_a + AMCC_OP_REG_INTCSR);
+   if (enable)
+   intcsr |= 0x1f00;
+   else
+   intcsr &= ~0x1f00;
+   outl(intcsr, devpriv->iobase_a + AMCC_OP_REG_INTCSR);
+}
+
 static void pci9118_timer_write(struct comedi_device *dev,
unsigned int timer, unsigned int val)
 {
@@ -592,9 +606,7 @@ static int pci9118_exttrg_add(struct comedi_device *dev, 
unsigned char source)
devpriv->exttrg_users |= (1 << source);
devpriv->int_ctrl |= PCI9118_INT_CTRL_DTRG;
outl(devpriv->int_ctrl, dev->iobase + PCI9118_INT_CTRL_REG);
-   outl(inl(devpriv->iobase_a + AMCC_OP_REG_INTCSR) | 0x1f00,
-   devpriv->iobase_a + AMCC_OP_REG_INTCSR);
-   /* allow INT in AMCC */
+   pci9118_amcc_int_ena(dev, true);
return 0;
 }
 
@@ -607,11 +619,8 @@ static int pci9118_exttrg_del(struct comedi_device *dev, 
unsigned char source)
devpriv->exttrg_users &= ~(1 << source);
if (!devpriv->exttrg_users) {   /* shutdown ext trg intterrupts */
devpriv->int_ctrl &= ~PCI9118_INT_CTRL_DTRG;
-   if (!devpriv->int_ctrl) /* all IRQ disabled */
-   outl(inl(devpriv->iobase_a + AMCC_OP_REG_INTCSR) &
-   (~0x1f00),
-   devpriv->iobase_a + AMCC_OP_REG_INTCSR);
-   /* disable int in AMCC */
+   if (!devpriv->int_ctrl)
+   pci9118_amcc_int_ena(dev, false);
outl(devpriv->int_ctrl, dev->iobase + PCI9118_INT_CTRL_REG);
}
return 0;
@@ -708,6 +717,10 @@ static int pci9118_ai_cancel(struct comedi_device *dev,
outl(2, dev->iobase + PCI9118_AI_AUTOSCAN_MODE_REG);
pci9118_ai_reset_fifo(dev);
 
+   devpriv->int_ctrl = 0;
+   outl(devpriv->int_ctrl, dev->iobase + PCI9118_INT_CTRL_REG);
+   pci9118_amcc_int_ena(dev, false);
+
devpriv->ai_do = 0;
devpriv->usedma = 0;
 
@@ -718,11 +731,6 @@ static int pci9118_ai_cancel(struct comedi_device *dev,
devpriv->ai_neverending = 0;
devpriv->dma_actbuf = 0;
 
-   if (!devpriv->int_ctrl)
-   outl(inl(devpriv->iobase_a + AMCC_OP_REG_INTCSR) | 0x1f00,
-   devpriv->iobase_a + AMCC_OP_REG_INTCSR);
-   /* allow INT in AMCC */
-
return 0;
 }
 
@@ -1319,9 +1327,7 @@ static int pci9118_ai_docmd_sampl(struct comedi_device 
*dev,
 
devpriv->ai_ctrl |= PCI9118_AI_CTRL_INT;
 
-   outl(inl(devpriv->iobase_a + AMCC_OP_REG_INTCSR) | 0x1f00,
-   devpriv->iobase_a + AMCC_OP_REG_INTCSR);
-   /* allow INT in AMCC */
+   pci9118_amcc_int_ena(dev, true);
 
if (!(devpriv->ai12_startstop & (START_AI_EXT | START_AI_INT))) {
outl(devpriv->int_ctrl, dev->iobase + PCI9118_INT_CTRL_REG);
-- 
2.0.3

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


[PATCH 03/17] staging: comedi: adl_pci9118: move digitial input (*insn_bits) function

2014-09-05 Thread H Hartley Sweeten
For aesthetics, move the digital inputs (*insn_bits) function so it
is not located in the middle of the analog input functions. Also,
rename it for consistency.

Signed-off-by: H Hartley Sweeten 
Cc: Ian Abbott 
Cc: Greg Kroah-Hartman 
---
 drivers/staging/comedi/drivers/adl_pci9118.c | 32 ++--
 1 file changed, 16 insertions(+), 16 deletions(-)

diff --git a/drivers/staging/comedi/drivers/adl_pci9118.c 
b/drivers/staging/comedi/drivers/adl_pci9118.c
index c758a46..b89021f 100644
--- a/drivers/staging/comedi/drivers/adl_pci9118.c
+++ b/drivers/staging/comedi/drivers/adl_pci9118.c
@@ -551,21 +551,6 @@ static int pci9118_insn_read_ao(struct comedi_device *dev,
return n;
 }
 
-static int pci9118_insn_bits_di(struct comedi_device *dev,
-   struct comedi_subdevice *s,
-   struct comedi_insn *insn,
-   unsigned int *data)
-{
-   /*
-* The digital inputs and outputs share the read register.
-* bits [7:4] are the digital outputs
-* bits [3:0] are the digital inputs
-*/
-   data[1] = inl(dev->iobase + PCI9118_DIO_REG) & 0xf;
-
-   return insn->n;
-}
-
 static void interrupt_pci9118_ai_mode4_switch(struct comedi_device *dev)
 {
struct pci9118_private *devpriv = dev->private;
@@ -1648,6 +1633,21 @@ static int pci9118_ai_cmd(struct comedi_device *dev, 
struct comedi_subdevice *s)
return ret;
 }
 
+static int pci9118_di_insn_bits(struct comedi_device *dev,
+   struct comedi_subdevice *s,
+   struct comedi_insn *insn,
+   unsigned int *data)
+{
+   /*
+* The digital inputs and outputs share the read register.
+* bits [7:4] are the digital outputs
+* bits [3:0] are the digital inputs
+*/
+   data[1] = inl(dev->iobase + PCI9118_DIO_REG) & 0xf;
+
+   return insn->n;
+}
+
 static int pci9118_do_insn_bits(struct comedi_device *dev,
struct comedi_subdevice *s,
struct comedi_insn *insn,
@@ -1895,7 +1895,7 @@ static int pci9118_common_attach(struct comedi_device 
*dev, int disable_irq,
s->n_chan   = 4;
s->maxdata  = 1;
s->range_table  = &range_digital;
-   s->insn_bits= pci9118_insn_bits_di;
+   s->insn_bits= pci9118_di_insn_bits;
 
/* Digital Output subdevice */
s = &dev->subdevices[3];
-- 
2.0.3

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


[PATCH 07/17] staging: comedi: adl_pci9118: ai (*insn_read) does not use interrupts

2014-09-05 Thread H Hartley Sweeten
The analog input (*insn_read) in this driver is done as a software-triggered,
polled operation. The PCI9118_AI_CTRL_INT bit in the control register, which
is actually set in setup_channel_list(), should not be set.

Signed-off-by: H Hartley Sweeten 
Cc: Ian Abbott 
Cc: Greg Kroah-Hartman 
---
 drivers/staging/comedi/drivers/adl_pci9118.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/comedi/drivers/adl_pci9118.c 
b/drivers/staging/comedi/drivers/adl_pci9118.c
index 56458ac..e3e4052 100644
--- a/drivers/staging/comedi/drivers/adl_pci9118.c
+++ b/drivers/staging/comedi/drivers/adl_pci9118.c
@@ -483,7 +483,7 @@ static int pci9118_insn_read_ai(struct comedi_device *dev,
int ret;
int n;
 
-   devpriv->AdControlReg = PCI9118_AI_CTRL_INT;
+   devpriv->AdControlReg = 0;
devpriv->AdFunctionReg = PCI9118_AI_CFG_PDTRG | PCI9118_AI_CFG_PETRG;
outl(devpriv->AdFunctionReg, dev->iobase + PCI9118_AI_CFG_REG);
/*
-- 
2.0.3

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


[PATCH 11/17] staging: comedi: adl_pci9118: rename 'IntControlReg'

2014-09-05 Thread H Hartley Sweeten
Rename this CamelCase member of the private data.

Signed-off-by: H Hartley Sweeten 
Cc: Ian Abbott 
Cc: Greg Kroah-Hartman 
---
 drivers/staging/comedi/drivers/adl_pci9118.c | 28 
 1 file changed, 12 insertions(+), 16 deletions(-)

diff --git a/drivers/staging/comedi/drivers/adl_pci9118.c 
b/drivers/staging/comedi/drivers/adl_pci9118.c
index 1efa9ff..48287a5 100644
--- a/drivers/staging/comedi/drivers/adl_pci9118.c
+++ b/drivers/staging/comedi/drivers/adl_pci9118.c
@@ -228,7 +228,7 @@ struct pci9118_private {
unsigned char chanlistlen;  /* number of scanlist */
 #endif
unsigned char ai_ctrl;
-   unsigned char IntControlReg;/* Interrupt control register */
+   unsigned char int_ctrl;
unsigned char ai_cfg;
char ai_neverending;/* we do unlimited AI */
unsigned int ai_do; /* what do AI? 0=nothing, 1 to 4 mode */
@@ -590,8 +590,8 @@ static int pci9118_exttrg_add(struct comedi_device *dev, 
unsigned char source)
if (source > 3)
return -1;  /* incorrect source */
devpriv->exttrg_users |= (1 << source);
-   devpriv->IntControlReg |= PCI9118_INT_CTRL_DTRG;
-   outl(devpriv->IntControlReg, dev->iobase + PCI9118_INT_CTRL_REG);
+   devpriv->int_ctrl |= PCI9118_INT_CTRL_DTRG;
+   outl(devpriv->int_ctrl, dev->iobase + PCI9118_INT_CTRL_REG);
outl(inl(devpriv->iobase_a + AMCC_OP_REG_INTCSR) | 0x1f00,
devpriv->iobase_a + AMCC_OP_REG_INTCSR);
/* allow INT in AMCC */
@@ -606,14 +606,13 @@ static int pci9118_exttrg_del(struct comedi_device *dev, 
unsigned char source)
return -1;  /* incorrect source */
devpriv->exttrg_users &= ~(1 << source);
if (!devpriv->exttrg_users) {   /* shutdown ext trg intterrupts */
-   devpriv->IntControlReg &= ~PCI9118_INT_CTRL_DTRG;
-   if (!devpriv->IntControlReg)/* all IRQ disabled */
+   devpriv->int_ctrl &= ~PCI9118_INT_CTRL_DTRG;
+   if (!devpriv->int_ctrl) /* all IRQ disabled */
outl(inl(devpriv->iobase_a + AMCC_OP_REG_INTCSR) &
(~0x1f00),
devpriv->iobase_a + AMCC_OP_REG_INTCSR);
/* disable int in AMCC */
-   outl(devpriv->IntControlReg,
-dev->iobase + PCI9118_INT_CTRL_REG);
+   outl(devpriv->int_ctrl, dev->iobase + PCI9118_INT_CTRL_REG);
}
return 0;
 }
@@ -719,7 +718,7 @@ static int pci9118_ai_cancel(struct comedi_device *dev,
devpriv->ai_neverending = 0;
devpriv->dma_actbuf = 0;
 
-   if (!devpriv->IntControlReg)
+   if (!devpriv->int_ctrl)
outl(inl(devpriv->iobase_a + AMCC_OP_REG_INTCSR) | 0x1f00,
devpriv->iobase_a + AMCC_OP_REG_INTCSR);
/* allow INT in AMCC */
@@ -973,7 +972,7 @@ static int pci9118_ai_inttrig(struct comedi_device *dev,
devpriv->ai12_startstop &= ~START_AI_INT;
s->async->inttrig = NULL;
 
-   outl(devpriv->IntControlReg, dev->iobase + PCI9118_INT_CTRL_REG);
+   outl(devpriv->int_ctrl, dev->iobase + PCI9118_INT_CTRL_REG);
outl(devpriv->ai_cfg, dev->iobase + PCI9118_AI_CFG_REG);
if (devpriv->ai_do != 3) {
pci9118_start_pacer(dev, devpriv->ai_do);
@@ -1316,7 +1315,7 @@ static int pci9118_ai_docmd_sampl(struct comedi_device 
*dev,
/* activate EXT trigger */
 
if ((devpriv->ai_do == 1) || (devpriv->ai_do == 2))
-   devpriv->IntControlReg |= PCI9118_INT_CTRL_TIMER;
+   devpriv->int_ctrl |= PCI9118_INT_CTRL_TIMER;
 
devpriv->ai_ctrl |= PCI9118_AI_CTRL_INT;
 
@@ -1325,15 +1324,13 @@ static int pci9118_ai_docmd_sampl(struct comedi_device 
*dev,
/* allow INT in AMCC */
 
if (!(devpriv->ai12_startstop & (START_AI_EXT | START_AI_INT))) {
-   outl(devpriv->IntControlReg,
-dev->iobase + PCI9118_INT_CTRL_REG);
+   outl(devpriv->int_ctrl, dev->iobase + PCI9118_INT_CTRL_REG);
outl(devpriv->ai_cfg, dev->iobase + PCI9118_AI_CFG_REG);
if (devpriv->ai_do != 3) {
pci9118_start_pacer(dev, devpriv->ai_do);
devpriv->ai_ctrl |= PCI9118_AI_CTRL_SOFTG;
}
-   outl(devpriv->IntControlReg,
-dev->iobase + PCI9118_INT_CTRL_REG);
+   outl(devpriv->int_ctrl, dev->iobase + PCI9118_INT_CTRL_REG);
}
 
return 0;
@@ -1396,8 +1393,7 @@ static int pci9118_ai_docmd_dma(struct comedi_

[PATCH 02/17] staging: comedi: adl_pci9118: don't reset digital outputs

2014-09-05 Thread H Hartley Sweeten
Currently this driver resets the digital output channels to a low state
when the driver is attached and detached.

Since the digital output state can be read, initialize the subdevice
state when the driver is attached and don't reset them.

Signed-off-by: H Hartley Sweeten 
Cc: Ian Abbott 
Cc: Greg Kroah-Hartman 
---
 drivers/staging/comedi/drivers/adl_pci9118.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/comedi/drivers/adl_pci9118.c 
b/drivers/staging/comedi/drivers/adl_pci9118.c
index a9fd343..c758a46 100644
--- a/drivers/staging/comedi/drivers/adl_pci9118.c
+++ b/drivers/staging/comedi/drivers/adl_pci9118.c
@@ -1706,7 +1706,6 @@ static int pci9118_reset(struct comedi_device *dev)
outl(devpriv->ao_data[0], dev->iobase + PCI9118_AO_REG(0));
outl(devpriv->ao_data[1], dev->iobase + PCI9118_AO_REG(1));
 
-   outl(0, dev->iobase + PCI9118_DIO_REG); /* reset digi outs to L */
udelay(10);
inl(dev->iobase + PCI9118_AI_FIFO_REG);
pci9118_ai_reset_fifo(dev);
@@ -1907,6 +1906,9 @@ static int pci9118_common_attach(struct comedi_device 
*dev, int disable_irq,
s->range_table  = &range_digital;
s->insn_bits= pci9118_do_insn_bits;
 
+   /* get the current state of the digital outputs */
+   s->state = inl(dev->iobase + PCI9118_DIO_REG) >> 4;
+
devpriv->ai_maskharderr = 0x10a;
/* default measure crash condition */
if (hw_err_mask)/* disable some requested */
-- 
2.0.3

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


[PATCH 08/17] staging: comedi: adl_pci9118: fix ai range/aref programming

2014-09-05 Thread H Hartley Sweeten
Currently the analog input range and aref are set in setup_channel_list().
This works for the (*insn_read) but the (*do_cmd) has a problem.

In (*do_cmd) the ai control register is reset to 0 before the function works
out the bits needed to control the acquisition. This happens after the
setup_channel_list() call so the range is reset to bipolar and the aref to
single-ended.

Introduce a helper function, pci9118_ai_set_range_aref(), to handle the
programming of the range and aref bits. This function first clears the
cached value of the ai control register in the private data then sets the
appropriate bits. The (*insn_read) and (*do_cmd) can then set the other
bits needed to control the acquisition.

Then setup_channel_list() just needs to program the chanlist scan data.

Signed-off-by: H Hartley Sweeten 
Cc: Ian Abbott 
Cc: Greg Kroah-Hartman 
---
 drivers/staging/comedi/drivers/adl_pci9118.c | 60 +++-
 1 file changed, 33 insertions(+), 27 deletions(-)

diff --git a/drivers/staging/comedi/drivers/adl_pci9118.c 
b/drivers/staging/comedi/drivers/adl_pci9118.c
index e3e4052..398f6e1 100644
--- a/drivers/staging/comedi/drivers/adl_pci9118.c
+++ b/drivers/staging/comedi/drivers/adl_pci9118.c
@@ -318,6 +318,22 @@ static void pci9118_ai_reset_fifo(struct comedi_device 
*dev)
outl(0, dev->iobase + PCI9118_FIFO_RESET_REG);
 }
 
+static void pci9118_ai_set_range_aref(struct comedi_device *dev,
+ struct comedi_subdevice *s,
+ unsigned int chanspec)
+{
+   struct pci9118_private *devpriv = dev->private;
+   unsigned int range = CR_RANGE(chanspec);
+   unsigned int aref = CR_AREF(chanspec);
+
+   devpriv->AdControlReg = 0;
+   if (comedi_range_is_unipolar(s, range))
+   devpriv->AdControlReg |= PCI9118_AI_CTRL_UNIP;
+   if (aref == AREF_DIFF)
+   devpriv->AdControlReg |= PCI9118_AI_CTRL_DIFF;
+   outl(devpriv->AdControlReg, dev->iobase + PCI9118_AI_CTRL_REG);
+}
+
 static int check_channel_list(struct comedi_device *dev,
  struct comedi_subdevice *s, int n_chan,
  unsigned int *chanlist, int frontadd, int backadd)
@@ -371,33 +387,14 @@ static int setup_channel_list(struct comedi_device *dev,
  int backadd, int usedma)
 {
struct pci9118_private *devpriv = dev->private;
-   unsigned int i, differencial = 0, bipolar = 0;
unsigned int scanquad, gain, ssh = 0x00;
+   int i;
 
if (usedma == 1) {
rot = 8;
usedma = 0;
}
 
-   if (CR_AREF(chanlist[0]) == AREF_DIFF)
-   differencial = 1;   /* all input must be diff */
-   if (CR_RANGE(chanlist[0]) < PCI9118_BIPOLAR_RANGES)
-   bipolar = 1;/* all input must be bipolar */
-
-   /* All is ok, so we can setup channel/range list */
-
-   if (!bipolar)
-   devpriv->AdControlReg |= PCI9118_AI_CTRL_UNIP;
-   else
-   devpriv->AdControlReg &= ~PCI9118_AI_CTRL_UNIP;
-
-   if (differencial)
-   devpriv->AdControlReg |= PCI9118_AI_CTRL_DIFF;
-   else
-   devpriv->AdControlReg &= ~PCI9118_AI_CTRL_DIFF;
-
-   outl(devpriv->AdControlReg, dev->iobase + PCI9118_AI_CTRL_REG);
-   /* setup mode */
/* gods know why this sequence! */
outl(2, dev->iobase + PCI9118_AI_AUTOSCAN_MODE_REG);
outl(0, dev->iobase + PCI9118_AI_AUTOSCAN_MODE_REG);
@@ -483,7 +480,12 @@ static int pci9118_insn_read_ai(struct comedi_device *dev,
int ret;
int n;
 
-   devpriv->AdControlReg = 0;
+   /*
+   * Configure analog input based on the chanspec.
+   * Acqusition is software controlled without interrupts.
+   */
+   pci9118_ai_set_range_aref(dev, s, insn->chanspec);
+
devpriv->AdFunctionReg = PCI9118_AI_CFG_PDTRG | PCI9118_AI_CFG_PETRG;
outl(devpriv->AdFunctionReg, dev->iobase + PCI9118_AI_CFG_REG);
/*
@@ -1515,6 +1517,16 @@ static int pci9118_ai_cmd(struct comedi_device *dev, 
struct comedi_subdevice *s)
cmd->chanlist, devpriv->ai_add_front,
devpriv->ai_add_back))
return -EINVAL;
+
+   /*
+* Configure analog input based on the first chanlist entry.
+* All entries are either unipolar or bipolar and single-ended
+* or differential.
+*
+* The acqusition control bits are enabled later.
+*/
+   pci9118_ai_set_range_aref(dev, s, cmd->chanlist[0]);
+
if (!setup_channel_list(dev, s, cmd->chanlist_len,
cmd->chanlist, 0, devpriv->ai_add_front,
devpriv->ai_add_back, devpriv->usedma))
@@ -1570,12 +1582,6 @@ static int pci9118_ai_c

[PATCH 1/1] Drivers: hv: vmbus: Enable interrupt driven flow control

2014-09-05 Thread K. Y. Srinivasan
This is a win8 feature that has been implemented. Turn on the feature bit
to enable the feature. With this feature turned on, when the host is waiting
for space to become available on the ringbuffer (host to guest), the guest
will interrupt the host when space becomes available (as part of draining
the ring buffer).

Signed-off-by: K. Y. Srinivasan 
---
 drivers/hv/ring_buffer.c |5 +
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/drivers/hv/ring_buffer.c b/drivers/hv/ring_buffer.c
index 15db66b..6361d12 100644
--- a/drivers/hv/ring_buffer.c
+++ b/drivers/hv/ring_buffer.c
@@ -361,6 +361,11 @@ int hv_ringbuffer_init(struct hv_ring_buffer_info 
*ring_info,
ring_info->ring_buffer->read_index =
ring_info->ring_buffer->write_index = 0;
 
+   /*
+* Set the feature bit for enabling flow control.
+*/
+   ring_info->ring_buffer->feature_bits.value = 1;
+
ring_info->ring_size = buflen;
ring_info->ring_datasize = buflen - sizeof(struct hv_ring_buffer);
 
-- 
1.7.4.1

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


Re: [PATCH] rtl8188eu: Replace rcu_dereference() with rcu_access_pointer()

2014-09-05 Thread Andreea Bernat
2014-09-05 0:38 GMT+03:00 Greg KH :
> On Thu, Sep 04, 2014 at 11:58:36PM +0300, Andreea Bernat wrote:
>> Hello,
>>
>> I cloned this:
>> git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git
>>
>> and after moved to staging-next branch, but in both cases, in
>> those files I don't find any use of rcu_dereference() call (the call
>> which I am looking for to modify).
>
> Then there's nothing left to be done here, right?  :)

Yes :-)

Thank you,
Andreea

>
> thanks,
>
> greg k-h
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH 1/1] Drivers: hv: vmbus: Enable interrupt driven flow control

2014-09-05 Thread Greg KH
On Fri, Sep 05, 2014 at 11:23:22AM -0700, K. Y. Srinivasan wrote:
> This is a win8 feature that has been implemented. Turn on the feature bit
> to enable the feature.

What does those two sentances even mean?

> With this feature turned on,

What is "this"?

> when the host is waiting
> for space to become available on the ringbuffer (host to guest), the guest
> will interrupt the host when space becomes available (as part of draining
> the ring buffer).
> 
> Signed-off-by: K. Y. Srinivasan 
> ---
>  drivers/hv/ring_buffer.c |5 +
>  1 files changed, 5 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/hv/ring_buffer.c b/drivers/hv/ring_buffer.c
> index 15db66b..6361d12 100644
> --- a/drivers/hv/ring_buffer.c
> +++ b/drivers/hv/ring_buffer.c
> @@ -361,6 +361,11 @@ int hv_ringbuffer_init(struct hv_ring_buffer_info 
> *ring_info,
>   ring_info->ring_buffer->read_index =
>   ring_info->ring_buffer->write_index = 0;
>  
> + /*
> +  * Set the feature bit for enabling flow control.
> +  */
> + ring_info->ring_buffer->feature_bits.value = 1;

What happens if you are running on an old system that doesn't support
this new "feature"?

thanks,

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


Re: [PATCH 1/1] Drivers: hv: vmbus: Enable interrupt driven flow control

2014-09-05 Thread Greg KH
On Fri, Sep 05, 2014 at 08:53:01PM +, KY Srinivasan wrote:
> 
> 
> > -Original Message-
> > From: Greg KH [mailto:gre...@linuxfoundation.org]
> > Sent: Friday, September 5, 2014 12:12 PM
> > To: KY Srinivasan
> > Cc: linux-ker...@vger.kernel.org; de...@linuxdriverproject.org;
> > o...@aepfle.de; a...@canonical.com; jasow...@redhat.com
> > Subject: Re: [PATCH 1/1] Drivers: hv: vmbus: Enable interrupt driven flow
> > control
> > 
> > On Fri, Sep 05, 2014 at 11:23:22AM -0700, K. Y. Srinivasan wrote:
> > > This is a win8 feature that has been implemented. Turn on the feature
> > > bit to enable the feature.
> > 
> > What does those two sentances even mean?
> Greg,
> 
> The feature has been implemented and has been in the tree for a while.

What feature?  What is "This" in the first sentance?

> However, the feature was not advertised to the host and this patch does just 
> that.
> > 
> > > With this feature turned on,
> > 
> > What is "this"?
> "this" refers to the feature bit.
> > 
> > > when the host is waiting
> > > for space to become available on the ringbuffer (host to guest), the
> > > guest will interrupt the host when space becomes available (as part of
> > > draining the ring buffer).
> > >
> > > Signed-off-by: K. Y. Srinivasan 
> > > ---
> > >  drivers/hv/ring_buffer.c |5 +
> > >  1 files changed, 5 insertions(+), 0 deletions(-)
> > >
> > > diff --git a/drivers/hv/ring_buffer.c b/drivers/hv/ring_buffer.c index
> > > 15db66b..6361d12 100644
> > > --- a/drivers/hv/ring_buffer.c
> > > +++ b/drivers/hv/ring_buffer.c
> > > @@ -361,6 +361,11 @@ int hv_ringbuffer_init(struct hv_ring_buffer_info
> > *ring_info,
> > >   ring_info->ring_buffer->read_index =
> > >   ring_info->ring_buffer->write_index = 0;
> > >
> > > + /*
> > > +  * Set the feature bit for enabling flow control.
> > > +  */
> > > + ring_info->ring_buffer->feature_bits.value = 1;
> > 
> > What happens if you are running on an old system that doesn't support this
> > new "feature"?
> The control structure for the ring buffer (where this feature bit is) has not 
> changed and so, for
> hosts that don't understand this, it does not matter.
> 
> Hope this helps. Let me know if you want me to rewrite comment and resend 
> this patch.

Please do, it's confusing :)

thanks,

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


[PATCH V2 1/1] Drivers: hv: vmbus: Enable interrupt driven flow control

2014-09-05 Thread K. Y. Srinivasan
In win8 we have a feature that allows for interrupt driven flow management
for host/guest communication. For instance, if the host were blocked because
there was no space available in the ringbuffer, the host could request that the
guest send an interrupt when space becomes available in the ringbuffer (when
the guest drains the ringbuffer).

While this feature was implemented in the guest a while ago, we had not
advertised that the guest supported this feature. This patch advertises
the support to the host.

For pre-win8 hosts, this has no effect since the size of the ringbuffer
control structure has not changed and all changes have been backward
compatible - unused/reserved space has been used to implement this
feature.

In this version of the patch I have cleaned up the commit log based on
feedback from Greg KH.

Signed-off-by: K. Y. Srinivasan 
---
 drivers/hv/ring_buffer.c |5 +
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/drivers/hv/ring_buffer.c b/drivers/hv/ring_buffer.c
index 15db66b..6361d12 100644
--- a/drivers/hv/ring_buffer.c
+++ b/drivers/hv/ring_buffer.c
@@ -361,6 +361,11 @@ int hv_ringbuffer_init(struct hv_ring_buffer_info 
*ring_info,
ring_info->ring_buffer->read_index =
ring_info->ring_buffer->write_index = 0;
 
+   /*
+* Set the feature bit for enabling flow control.
+*/
+   ring_info->ring_buffer->feature_bits.value = 1;
+
ring_info->ring_size = buflen;
ring_info->ring_datasize = buflen - sizeof(struct hv_ring_buffer);
 
-- 
1.7.4.1

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


RE: [PATCH 1/1] Drivers: hv: vmbus: Enable interrupt driven flow control

2014-09-05 Thread KY Srinivasan


> -Original Message-
> From: Greg KH [mailto:gre...@linuxfoundation.org]
> Sent: Friday, September 5, 2014 12:12 PM
> To: KY Srinivasan
> Cc: linux-ker...@vger.kernel.org; de...@linuxdriverproject.org;
> o...@aepfle.de; a...@canonical.com; jasow...@redhat.com
> Subject: Re: [PATCH 1/1] Drivers: hv: vmbus: Enable interrupt driven flow
> control
> 
> On Fri, Sep 05, 2014 at 11:23:22AM -0700, K. Y. Srinivasan wrote:
> > This is a win8 feature that has been implemented. Turn on the feature
> > bit to enable the feature.
> 
> What does those two sentances even mean?
Greg,

The feature has been implemented and has been in the tree for a while.
However, the feature was not advertised to the host and this patch does just 
that.
> 
> > With this feature turned on,
> 
> What is "this"?
"this" refers to the feature bit.
> 
> > when the host is waiting
> > for space to become available on the ringbuffer (host to guest), the
> > guest will interrupt the host when space becomes available (as part of
> > draining the ring buffer).
> >
> > Signed-off-by: K. Y. Srinivasan 
> > ---
> >  drivers/hv/ring_buffer.c |5 +
> >  1 files changed, 5 insertions(+), 0 deletions(-)
> >
> > diff --git a/drivers/hv/ring_buffer.c b/drivers/hv/ring_buffer.c index
> > 15db66b..6361d12 100644
> > --- a/drivers/hv/ring_buffer.c
> > +++ b/drivers/hv/ring_buffer.c
> > @@ -361,6 +361,11 @@ int hv_ringbuffer_init(struct hv_ring_buffer_info
> *ring_info,
> > ring_info->ring_buffer->read_index =
> > ring_info->ring_buffer->write_index = 0;
> >
> > +   /*
> > +* Set the feature bit for enabling flow control.
> > +*/
> > +   ring_info->ring_buffer->feature_bits.value = 1;
> 
> What happens if you are running on an old system that doesn't support this
> new "feature"?
The control structure for the ring buffer (where this feature bit is) has not 
changed and so, for
hosts that don't understand this, it does not matter.

Hope this helps. Let me know if you want me to rewrite comment and resend this 
patch.

Regards,

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


Re: [patch -next] hyperv: NULL dereference on error

2014-09-05 Thread David Miller
From: Dan Carpenter 
Date: Thu, 4 Sep 2014 14:11:23 +0300

> We try to call free_netvsc_device(net_device) when "net_device" is NULL.
> It leads to an Oops.
> 
> Fixes: f90251c8a6d0 ('hyperv: Increase the buffer length for 
> netvsc_channel_cb()')
> Signed-off-by: Dan Carpenter 

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


[PATCH] staging: ozwpan: Fix coding style warnings

2014-09-05 Thread anicoara
The warnings addressed:
1. Missing a blank line after declarations.
2. else is not generally useful after a break or return

Signed-off-by: Adrian Nicoara 
---

Patch submitted as part of the Eudyptula challenge.

 drivers/staging/ozwpan/ozpd.c | 16 ++--
 1 file changed, 10 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/ozwpan/ozpd.c b/drivers/staging/ozwpan/ozpd.c
index 7726410..852c288 100644
--- a/drivers/staging/ozwpan/ozpd.c
+++ b/drivers/staging/ozwpan/ozpd.c
@@ -106,6 +106,7 @@ struct oz_pd *oz_pd_alloc(const u8 *mac_addr)

if (pd) {
int i;
+
atomic_set(&pd->ref_count, 2);
for (i = 0; i < OZ_NB_APPS; i++)
spin_lock_init(&pd->app_lock[i]);
@@ -153,6 +154,7 @@ static void oz_pd_free(struct work_struct *work)

list_for_each_safe(e, n, &pd->tx_queue) {
struct oz_tx_frame *f = list_entry(e, struct oz_tx_frame, link);
+
if (f->skb != NULL)
kfree_skb(f->skb);
oz_retire_frame(pd, f);
@@ -249,6 +251,7 @@ void oz_pd_heartbeat(struct oz_pd *pd, u16 apps)
hrtimer_cancel(&pd->heartbeat);
if (pd->mode & OZ_F_ISOC_ANYTIME) {
int count = 8;
+
while (count-- && (oz_send_isoc_frame(pd) >= 0))
;
}
@@ -493,11 +496,10 @@ static int oz_send_next_queued_frame(struct oz_pd *pd, 
int more_data)
oz_dbg(TX_FRAMES, "Sending ISOC Frame, nb_isoc= %d\n",
   pd->nb_queued_isoc_frames);
return 0;
-   } else {
-   kfree_skb(skb);
-   oz_dbg(TX_FRAMES, "Dropping ISOC Frame>\n");
-   return -1;
}
+   kfree_skb(skb);
+   oz_dbg(TX_FRAMES, "Dropping ISOC Frame>\n");
+   return -1;
}

pd->last_sent_frame = e;
@@ -752,6 +754,7 @@ int oz_send_isoc_unit(struct oz_pd *pd, u8 ep_num, const u8 
*data, int len)
} else {
struct oz_hdr oz;
struct oz_isoc_large iso;
+
spin_lock_bh(&pd->stream_lock);
iso.frame_number = st->frame_num;
st->frame_num += nb_units;
@@ -774,8 +777,10 @@ int oz_send_isoc_unit(struct oz_pd *pd, u8 ep_num, const 
u8 *data, int len)
if (!(pd->mode & OZ_F_ISOC_ANYTIME)) {
struct oz_tx_frame *isoc_unit = NULL;
int nb = pd->nb_queued_isoc_frames;
+
if (nb >= pd->isoc_latency) {
struct oz_tx_frame *f;
+
oz_dbg(TX_FRAMES, "Dropping ISOC Unit nb= %d\n",
   nb);
spin_lock(&pd->tx_frame_lock);
@@ -807,8 +812,7 @@ int oz_send_isoc_unit(struct oz_pd *pd, u8 ep_num, const u8 
*data, int len)
atomic_inc(&g_submitted_isoc);
if (dev_queue_xmit(skb) < 0)
return -1;
-   else
-   return 0;
+   return 0;
}

 out:   kfree_skb(skb);
--
2.0.1

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


[PATCH] staging: rtl8188eu: include missing header

2014-09-05 Thread Nicolas Thery
This patch fixes the following sparse warnings:

drivers/staging/rtl8188eu/hal/phy.c:46:5: warning: symbol
'phy_query_bb_reg' was not declared. Should it be static?
drivers/staging/rtl8188eu/hal/phy.c:56:6: warning: symbol
'phy_set_bb_reg' was not declared. Should it be static?
drivers/staging/rtl8188eu/hal/phy.c:129:5: warning: symbol
'phy_query_rf_reg' was not declared. Should it be static?
drivers/staging/rtl8188eu/hal/phy.c:140:6: warning: symbol
'phy_set_rf_reg' was not declared. Should it be static?
drivers/staging/rtl8188eu/hal/phy.c:228:6: warning: symbol
'phy_set_tx_power_level' was not declared. Should it be static?
drivers/staging/rtl8188eu/hal/phy.c:324:6: warning: symbol
'phy_set_bw_mode' was not declared. Should it be static?
drivers/staging/rtl8188eu/hal/phy.c:360:6: warning: symbol 'phy_sw_chnl'
was not declared. Should it be static?

Signed-off-by: Nicolas Thery 
---
 drivers/staging/rtl8188eu/hal/phy.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/staging/rtl8188eu/hal/phy.c 
b/drivers/staging/rtl8188eu/hal/phy.c
index 7291b46..3b569b0 100644
--- a/drivers/staging/rtl8188eu/hal/phy.c
+++ b/drivers/staging/rtl8188eu/hal/phy.c
@@ -24,6 +24,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #define MAX_PRECMD_CNT 16
 #define MAX_RFDEPENDCMD_CNT 16
-- 
1.9.1

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