summaryrefslogtreecommitdiff
path: root/drivers
AgeCommit message (Collapse)Author
2014-03-02iio:adc:vf610 ensure correct handing of interruption of wait for completioniio-for-3.15cJonathan Cameron
Issue highlighted by smatch warning: CHECK drivers/iio/adc/vf610_adc.c drivers/iio/adc/vf610_adc.c:466 vf610_read_raw() warn: unsigned 'ret' is never less than zero. As wait_for_completion_interruptible_timeout can return -ERESTARTSTSYS, if interrupted, ret must be signed. Signed-off-by: Jonathan Cameron <jic23@kernel.org> Acked-by: Fugang Duan <B38611@freescale.com>
2014-03-01iio:adc: Add Xilinx XADC driverLars-Peter Clausen
The Xilinx XADC is a ADC that can be found in the series 7 FPGAs from Xilinx. The XADC has a DRP interface for communication. Currently two different frontends for the DRP interface exist. One that is only available on the ZYNQ family as a hardmacro in the SoC portion of the ZYNQ. The other one is available on all series 7 platforms and is a softmacro with a AXI interface. This driver supports both interfaces and internally has a small abstraction layer that hides the specifics of these interfaces from the main driver logic. The ADC has a couple of internal channels which are used for voltage and temperature monitoring of the FPGA as well as one primary and up to 16 channels auxiliary channels for measuring external voltages. The external auxiliary channels can either be directly connected each to one physical pin on the FPGA or they can make use of an external multiplexer which is responsible for multiplexing the external signals onto one pair of physical pins. The voltage and temperature monitoring channels also have an event capability which allows to generate a interrupt when their value falls below or raises above a set threshold. Buffered sampling mode is supported by the driver, but only for AXI-XADC since the ZYNQ XADC interface does not have capabilities for supporting buffer mode (no end-of-conversion interrupt). If buffered mode is supported the driver will register two triggers. One "xadc-samplerate" trigger which will generate samples with the configured samplerate. And one "xadc-convst" trigger which will generate one sample each time the CONVST (conversion start) signal is asserted. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2014-02-25iio:magnetometer:mag3110: Fix unreachable codePeter Meerwald
drivers/iio/magnetometer/mag3110.c:197 mag3110_read_raw() info: ignoring unreachable code. drivers/iio/magnetometer/mag3110.c 185 case IIO_CHAN_INFO_SCALE: 186 switch (chan->type) { 187 case IIO_MAGN: 188 *val = 0; 189 *val2 = 1000; 190 return IIO_VAL_INT_PLUS_MICRO; 191 case IIO_TEMP: 192 *val = 1000; 193 return IIO_VAL_INT; 194 default: 195 return -EINVAL; 196 } 197 return IIO_VAL_INT_PLUS_MICRO; ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ introduced by f9279d3a, mag3110: Scale factor missing Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net> Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2014-02-23Merge tag 'iio-for-3.15b' of ↵Greg Kroah-Hartman
git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into staging-next Jonathan writes: Second round of IIO new driver, functionality and cleanups for the 3.15 series. There are a few fixes in here that might, earlier in a cycle, have gone to Greg as fixes. Given they are either minor or have never actually been observed as causing trouble (the locking bug in the event code) and are invasive, I have included them in this pull request, targeting the 3.15 merge window instead. The rest are pretty uncontroversial new drivers, a handy little tool for the example code in our documentation and little cleanups. New drivers * Freescale Vybrid and i.MX6SLX ADC driver. * HID Sensor hub proximity sensors. * HID Sensor hub pressure sensors. * LPS25H Pressure sensors added to the ST micro pressure sensor driver. New functionality * lsiio tool. This is added to the staging tree as we haven't yet moved the example code it sits with out. Moving this code out is now a reasonably high priority but holding up this tool in the meantime did not seem worthwhile. * mag3110 - add missing scale factor for temperature output to userspace. Cleanups * Fix a bug in the event reporting in which a spin lock might be held over when a sleep occured. A similar bug was found by Lars in the buffer code. It has not to our knowledge been observed as actually occuring and is a little too invasive to push out as a fix. * Drop the IIO_ST macro after clearing out all users. This macro was a very bad idea leading to a number of bugs after it stopped covering all elements of the structure being assigned and people started making assumptions about what it did cover. Glad to see it go! * Avoid applying extended name to shared attributes as it makes no sense. No in tree drivers were using the combination, hence not pushed out as a fix. * ad799x - move to devm_request_threaded_irq to reduce boilerplate clean up. * bma180 - make the low_pass_filter_3db_frequency info element shared rather than per attribute. The old approach was valid but not as clean as it might be and was setting a bad example. Hence the cleanup. * mxs-lradc - propogate the error code form a platform_get_irq call rather than eating it up by returning -EINVAL on all errors. * ad799x - typo fix in the copyright message. Either that or Michael was asserting a copyright that moved backwards in time by about a thousand years. * ad799x - use a regulator for vref rather than platform data. The driver dates from just as the regulator framework was coming into common use so provides an alternative way of specifying the reference voltage. We no longer need that approach so drop it in favour of a regulator only approach. * max1363 - some internal vref values were out by a small amount. The effect would have been tiny and no one noticed hence not pushing this through as a fix. * core - replace some pointless goto error_ret (with no clean up) lines with direct returns. This is my bad coding style so I'm glad to see it cleaned up. * core - avoid a kasprintf that just directly prints a string with no formatting elements. This has always been there but Lars just noticed it. Oops.
2014-02-23iio:event: Fix and cleanup lockingiio-for-3.15bLars-Peter Clausen
The event code currently holds a spinlock with IRQs disabled while calling kfifo_to_user(). kfifo_to_user() can generate a page fault though, which means we have to be able to sleep, which is not possible if the interrupts are disabled. The good thing is that kfifo handles concurrent read and write access just fine as long as there is only one reader and one writer, so we do not any locking to protect against concurrent access from the read and writer thread. It is possible though that userspace is trying to read from the event FIFO from multiple concurrent threads, so we need to add locking to protect against this. This is done using a mutex. The mutex will only protect the kfifo_to_user() call, it will not protect the waitqueue. This means that multiple threads can be waiting for new data and once a new event is added to the FIFO all waiting threads will be woken up. If one of those threads is unable to read any data (because another thread already read all the data) it will go back to sleep. The only remaining issue is that now that the clearing of the BUSY flag and the emptying of the FIFO does no longer happen in one atomic step it is possible that a event is added to the FIFO after it has been emptied and this sample will be visible the next time a new event file descriptor is created. To avoid this rather move the emptying of the FIFO from iio_event_chrdev_release to iio_event_getfd(). Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2014-02-22iio:pressure: Add support for LPS25H pressure sensorDenis CIOCCA
This patch adds support for the new barometer sensor: LPS25H. Signed-off-by: Denis Ciocca <denis.ciocca@st.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2014-02-22iio: hid-sensors: Added Pressure Sensor driverArchana Patni
Added usage id processing for Pressure Sensor. This uses IIO interfaces for triggered buffer to present data to user mode. This uses HID sensor framework for registering callback events from the sensor hub. Signed-off-by: Archana Patni <archana.patni@intel.com> Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2014-02-22iio: hid-sensors: Added Proximity Sensor DriverArchana Patni
Added usage id processing for Proximity (Human Presence). This uses IIO interfaces for triggered buffer to present data to user mode. This uses HID sensor framework for registering callback events from the sensor hub. Signed-off-by: Archana Patni <archana.patni@intel.com> Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2014-02-21staging: comedi: pcl816: tidy up pcl818_check()H Hartley Sweeten
This function probes a number of the boards registers during the (*attach) to verify that it is actually a PCL-816 compatible board. For aesthetics, move the function closer to the (*attach). To better match the pcl818 driver, allocate the private data before calling pcl816_check(). Refactor the function to return an errno if fails. Change the errno from -EIO to -ENODEV and remove the unnecessary dev_err() noise. Make sure the CONTROL register is reset to a known state after the check. The 0x18 value actually defines an invalid interrupt selection and sets an undefined bit. Add a couple comments to clarify the magic values. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-02-21staging: comedi: pcl816: remove unnecessary function separation commentsH Hartley Sweeten
These comments are just added cruft. Remove them. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-02-21staging: comedi: pcl816: remove unnecessary 'dev->irq' checkH Hartley Sweeten
If the dev->irq is not valid the interrupt function will not be hooked up during the attach. Remove the unnecessary check. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-02-21staging: comedi: pcl816: rename 'irq_blocked' in private dataH Hartley Sweeten
This member in the private data is a flag that indicates that an analog input async command is currently running. Rename it to make this clear. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-02-21staging: comedi: pcl816: kzalloc'ed memory does not need to be clearedH Hartley Sweeten
The private data is kzalloc'ed in the (*attach). There is no need to initialize any of the members to 0. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-02-21staging: comedi: pcl816: convert private data flags to bit-fieldsH Hartley Sweeten
The 'irq_was_now_closed' member is actually a flag, devpriv->int816_mode will always be > 0 when it's used to set irq_was_now_closed in the cancel function. Convert the flags in the private data to bit-fields to save a bit of space. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-02-21staging: comedi: pcl816: remove 'ai_act_chanlist_{len, pos}' from private dataH Hartley Sweeten
These members of the private data don't do anything usefull. Just remove them. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-02-21staging: comedi: pcl816: use subdevice (*cancel)H Hartley Sweeten
Use the subdevice (*cancel) operation to remove the need for a forward declaration. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-02-21staging: comedi: pcl816: don't calc the timer divisors twiceH Hartley Sweeten
The timer divisors are calculated in the (*do_cmdtest) before the (*do_cmd) is called by the comedi core. The extra sanity checks in the (*do_cmd) are not necessary, the values returned from i8253_cascade_ns_to_timer() will be greater than 1. Save the values in the private data so they don't need to be recalced. Refactor pcl816_start_pacer() to use the values from the private data. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-02-21staging: comedi: pcl816: clarify irq request in pcl816_attach()H Hartley Sweeten
All the board types can use IRQ 2-7 for async command support. Remove the 'IRQbits', which is a mask of the valid IRQs, from the boardinfo and refactor pcl816_attach(). Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-02-21staging: comedi: pcl816: remove 'n_aochan' from boardinfoH Hartley Sweeten
This member of the boardinfo is the same for all board types. Remove this data from the boardinfo. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-02-21staging: comedi: pcl816: remove 'ai_ns_min' from boardinfoH Hartley Sweeten
This member of the boardinfo is the same for all board types. Remove this data from the boardinfo. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-02-21Staging: comedi: addi-data: don't initialize a static variable to 0Chase Southwood
In hwdrv_apci1564.c, one static variable is zero initialized. This is unneeded and redundant, so we remove the initialization. Signed-off-by: Chase Southwood <chase.southwood@yahoo.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-02-21Staging: comedi: addi-data: replace printk() with dev_err() in hwdrv_apci1564.cChase Southwood
There were a small handful of printk() calls in hwdrv_apci1564.c. It is generally better to use dev_err() for error messages instead, so I switched all the printk() calls out, as well as cleaned up the error strings. Signed-off-by: Chase Southwood <chase.southwood@yahoo.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-02-21Staging: comedi: addi-data: cleanup brace usage in hwdrv_apci1564.cChase Southwood
hwdrv_apci1564.c had many single statments wrapped in braces, so we can delete these. Also, some else statements were improperly placed, fix these too. Signed-off-by: Chase Southwood <chase.southwood@yahoo.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-02-21Staging: comedi: addi-data: cleanup comments in hwdrv_apci1564.cChase Southwood
hwdrv_apci1564.c had a lot of commented out conditional statements that were often identical to other un-commented out statements nearby, so it should be safe to just delete all of these commented out lines. This patch also converts the remaining comments to the preferred kernel style for comments. Signed-off-by: Chase Southwood <chase.southwood@yahoo.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-02-18staging: et131x: fix allocation failuresAlan
We should check the ring allocations don't fail. If we get a fail we need to clean up properly. The allocator assumes the deallocator will be used on failure, but it isn't. Make sure the right deallocator is always called and add a missing check against fbr allocation failure. [v2]: Correct check logic Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-02-18staging: comedi: pcl818: kzalloc'ed memory does not need to be clearedH Hartley Sweeten
The private data is kzalloc'ed in the (*attach). There is no need to initialize and the members to 0. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-02-18staging: comedi: pcl812: allocate private data before requesting the I/O regionH Hartley Sweeten
To better match the pcl818 and pcl816 drivers, allocate the private data before calling comedi_request_region(). Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-02-18staging: comedi: pcl818: tidy up pcl818_check()H Hartley Sweeten
This function probes a number of the boards registers during the (*attach) to verify that it is actually a PCL-818 compatible board. For aesthetics, move the function closer to the (*attach). Refactor the function to return an errno if fails. Change the errno from -EIO to -ENODEV and remove the unnecessary comedi_error() noise. Make sure the CONTROL register is reset to a known state after the check. The 0x18 value actually defines an invalid interrupt selection and sets an undefined bit. Add a couple comments to clarify the magic values. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-02-18staging: comedi: pcl818: remove unnecessary function separation commentsH Hartley Sweeten
These comments are just added cruft. Remove them. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-02-18staging: comedi: pcl812: remove unnecessary function separation commentsH Hartley Sweeten
These comments are just added cruft. Remove them. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-02-18staging: comedi: pcl818: rename 'irq_blocked' in private dataH Hartley Sweeten
This member in the private data is a flag that indicates that an analog input async command is currently running. Rename it to make this clear. The private data is kzalloc'ed in the attach so remove the unnecessary clearing of this flag. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-02-18staging: comedi: pcl818: convert private data flags to bit-fieldsH Hartley Sweeten
Convert the flags in the private data to bit-fields to save a bit of space. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-02-18staging: comedi: pcl812: convert private data flags to bit-fieldsH Hartley Sweeten
Convert the flags in the private data to bit-fields to save a bit of space. Rename the CamelCase 'use_MPC' member. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-02-18staging: comedi: pcl818: remove 'ai_chanlist' from private dataH Hartley Sweeten
This member of the private data is just a pointer to the cmd->chanlist. Use that instead. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-02-18staging: comedi: pcl812: remove 'ai_chanlist' from private dataH Hartley Sweeten
This member of the private data is just a copy of the cmd->chanlist. Use that instead. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-02-18staging: comedi: pcl818: remove 'ai_timer[12]' from private dataH Hartley Sweeten
These members of the private data are set but never used. Remove them. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-02-18staging: comedi: pcl818: remove analog output interrupt codeH Hartley Sweeten
The hardware does not have any analog output interrupt support. Remove the stubbed in code. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-02-18staging: comedi: pcl818: use subdevice (*cancel)H Hartley Sweeten
Use the subdevice (*cancel) operation to remove the need for a forward declaration. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-02-18staging: comedi: pcl812: use subdevice (*cancel)H Hartley Sweeten
Use the subdevice (*cancel) operation to remove the need for a forward declaration. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-02-18staging: comedi: pcl818: don't calc the timer divisors twiceH Hartley Sweeten
The timer divisors are calculated in the (*do_cmdtest) before the (*do_cmd) is called by the comedi core. The extra sanity checks in the (*do_cmd) are not necessary, the values returned from i8253_cascade_ns_to_timer() will be greater than 1. Save the values in the private data so they don't need to be recalced. Refactor pcl818_start_pacer() to use the values from the private data. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-02-18staging: comedi: pcl812: don't calc the timer divisors twiceH Hartley Sweeten
The timer divisors are calculated in the (*do_cmdtest) before the (*do_cmd) is called by the comedi core. Save the values in the private data so they don't need to be recalced. Refactor pcl812_start_pacer() to use the values from the private data. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-02-18staging: comedi: pcl816: remove unneeded forward declarationsH Hartley Sweeten
These forward declarations are not needed. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-02-18staging: comedi: pcl818: use 8253.h helpersH Hartley Sweeten
Use the helper functions in 8253.h to clarify the timer programming. Move start_pacer() to remove the need for the forward declarations. Rename the function so it has namespace associated with the driver. Change the 'mode' parameter. This parameter is really a flag to the function indicating if the divisors should be loaded into the timers. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-02-18staging: comedi: pcl816: use 8253.h helpersH Hartley Sweeten
Use the helper functions in 8253.h to clarify the timer programming. Move start_pacer() to remove the need for the forward declarations. Rename the function so it has namespace associated with the driver. Change the 'mode' parameter. This parameter is really a flag to the function indicating if the divisors should be loaded into the timers. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-02-18staging: comedi: pcl812: use 8253.h helpersH Hartley Sweeten
Use the helper functions in 8253.h to clarify the timer programming. Move start_pacer() to remove the need for the forward declarations. Rename the function so it has namespace associated with the driver. Change the 'mode' parameter. This parameter is really a flag to the function indicating if the divisors should be loaded into the timers. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-02-18staging: comedi: pcl818: remove 'last_int_sub' from private dataH Hartley Sweeten
THis member of the private data is set but never used. Remove it. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-02-18staging: comedi: pcl816: remove 'last_int_sub' from private dataH Hartley Sweeten
THis member of the private data is set but never used. Remove it. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-02-18staging: comedi: pcl818: tidy up dma buffer allocationH Hartley Sweeten
This driver uses 2 buffers for DMA. Refactor the buffer allocation to use a for loop to remove code duplication. Remove the dev_err() messages when __get_dma_pages() fails and change the errno returned from -EBUSY to -ENOMEM. Both buffers are the same size so replace the 'dmapages' and 'hwdmasize' arrays in the private data with variables to save a bit of space. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-02-18staging: comedi: pcl816: tidy up dma buffer allocationH Hartley Sweeten
This driver uses 2 buffers for DMA. Refactor the buffer allocation to use a for loop to remove code duplication. Remove the dev_err() messages when __get_dma_pages() fails and change the errno returned from -EBUSY to -ENOMEM. Both buffers are the same size so replace the 'dmapages' and 'hwdmasize' arrays in the private data with variables to save a bit of space. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-02-18staging: comedi: pcl812: tidy up dma buffer allocationH Hartley Sweeten
This driver uses 2 buffers for DMA. Refactor the buffer allocation to use a for loop to remove code duplication. Remove the dev_err() messages when __get_dma_pages() fails and change the errno returned from -EBUSY to -ENOMEM. Both buffers are the same size so replace the 'dmapages' and 'hwdmasize' arrays in the private data with variables to save a bit of space. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>