In dt282x_ai_insn_read() we call this macro like:
wait_for(!mux_busy(), comedi_error(dev, "timeout\n"); return -ETIME;);
Because the if statement doesn't have curly braces it means we always
return -ETIME and the function never succeeds.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Acked-by: Ian Abbott <abbotti@mev.co.uk> Cc: stable <stable@vger.kernel.org> # 2.6.36+ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Mark Einon [Tue, 20 Aug 2013 21:42:43 +0000 (22:42 +0100)]
staging: et131x: Remove frame error TODO item
After prolonged testing for a few days of normal use with new et131x
hardware, I've concluded that this was a hardware issue with the older
hardware I had. Removing this item from the TODO.
Signed-off-by: Mark Einon <mark.einon@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Jens Frederich [Tue, 20 Aug 2013 13:53:06 +0000 (15:53 +0200)]
Staging: olpc_dcon: Removed more completed TODO entries
1. Console event notifier support: No one I've asked knows what this
all about.
2. Audit code for unnecessary code: This is done.
3. Verify sane i2cAPI usage: This is also done.
This patch removes the HAVE_UNLOCKED_IOCTL conditional
statements from driver.c, mgmt.c and mgmt.h. This was
used to support older kernels. It isn't needed now.
Won Kang [Fri, 16 Aug 2013 04:13:44 +0000 (13:13 +0900)]
staging: gdm7240: a TTY rewrite according to the latest TTY APIs
Fixed mis-use of mutex for gdm_table. gdm_table is refered to only
inside tty_install and port destrcut, and usb callbacks use internal
reference which was saved during urb submission
Signed-off-by: Won Kang <wonkang@gctsemi.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Jens Frederich [Sat, 17 Aug 2013 14:20:29 +0000 (16:20 +0200)]
Staging: olpc_dcon: Already completed TODO entry removed
The TODO entry - drop global variables, use a proper olpc_dcon_priv
struct - is already finished. The driver has no global variables.
It uses the private structure 'dcon_priv'.
Merge tag 'iio-for-3.12b' of git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into staging-next
Jonathan writes:
Second round of new drivers, features and cleanups for IIO in the 3.12 cycle.
New driver:
1) tmp006 IR thermopile driver. This is an unusual temperature sensor
and was taken in to IIO with the knowledge and agreement of a hwmon
maintainer.
It measures remote temperature using infrared emissions.
I guess taking this may mean we have to fight off submissions of
devices much more suited to hwmon but such is life and we end up
doing this from time to time already.
2) twl6030 adc driver.
Cleanups:
1) More devm_* cleanups following on from the introduction of
devm_iio_device_alloc. Mostly an heroic effort from
Sachin Kamat!
2) Introduce devm_iio_trigger_alloc etc to handle trigger
allocation and deallocation in a managed fashion. There
aren't as many instances of triggers as devices, but this
will allow futher reduction in error patch complexity in
some of our most complex drivers making it a very good thing.
3) Trivial removal of unused defines in adjd_s311
4) Drop some write_raw_get_fmt callbacks where they were only
returning the default value.
5) Change mxs-lradc realbits to 12. Whilst an 18bit register
is used on the device, in its current mode only 12 bits of
useful data are returned. For now the packing is unchanged
in the buffer and this change mainly effects the input support
in the driver.
Add a resource managed devm_iio_trigger_alloc()/devm_iio_triger_free()
to automatically clean up triggers allocated by IIO drivers, thus
leading to simplified IIO drivers code.
Signed-off-by: Jacek Anaszewski <j.anaszewski@samsung.com> Signed-off-by: Kyunmin Park <kyungmin.park@samsung.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
The GPADC is general purpose ADC found on TWL6030, and TWL6032 PMIC,
known also as Phoenix and PhoenixLite.
The TWL6030 and TWL6032 have GPADC with 17 and 19 channels
respectively. Some channels have current source and are used for
measuring voltage drop on resistive load for detecting battery ID
resistance, or measuring voltage drop on NTC resistors for external
temperature measurements. Some channels measure voltage, (i.e. battery
voltage), and have voltage dividers, thus, capable to scale voltage.
Some channels are dedicated for measuring die temperature.
Some channels are calibrated in 2 points, having offsets from ideal
values kept in trim registers. This is used to correct measurements.
The differences between GPADC in TWL6030 and TWL6032:
- 10 bit vs 12 bit ADC;
- 17 vs 19 channels;
- channels have different purpose(i.e. battery voltage
channel 8 vs channel 18);
- trim values are interpreted differently.
Based on the driver patched from Balaji TK, Graeme Gregory, Ambresh K,
Girish S Ghongdemath.
Signed-off-by: Balaji T K <balajitk@ti.com> Signed-off-by: Graeme Gregory <gg@slimlogic.co.uk> Signed-off-by: Oleksandr Kozaruk <oleksandr.kozaruk@ti.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
The LRADC virtual channels have an 18 bit field to store the sum of up
to 2^5 accumulated samples. The read_raw function however only operates
over a single sample (12 bit resolution).
In order to use this field for scaling operations, we need it to be the
exact resolution value of the LRADC.
Besides, the driver was using an 18 bit mask (LRADC_CH_VALUE_MASK) to
report touch coordinates to userland. A 12 bit mask should be used instead
or else the touch libraries will expect a coordinates range between 0
and 0x3ffff (18 bits), instead of between 0 and 0xfff (12 bits).
Signed-off-by: Hector Palacios <hector.palacios@digi.com> Acked-by: Marek Vasut <marex@denx.de> Acked-by: Alexandre Belloni <alexandre.belloni@free-electrons.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Peter Meerwald [Thu, 8 Aug 2013 16:39:00 +0000 (17:39 +0100)]
iio: Add tmp006 IR temperature sensor
the TI TMP006 is a non-contact temperature sensor with I2C interface;
it measures the surface temperature of a distance object using a
thermopile to absorb IR energy emitted from the object
the sensor has two channels: IR sensor voltage (16-bit) and reference
temperature of the chip (14-bit); datasheet is here:
http://www.ti.com/lit/ds/symlink/tmp006.pdf
v2 (thanks to Grygorii Strashko, Lars-Peter Clausen, Jonathan Cameron
for review comments):
* power down device on driver remove
* use sign_extend32()
* style cleanup
* add comments what channel raw LSBs mean
* spelling of thermopile
Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net> Cc: Grygorii Strashko <grygorii.strashko@ti.com> Cc: Lars-Peter Clausen <lars@metafoo.de> Cc: Jonathan Cameron <jic23@kernel.org> Cc: LM Sensors <lm-sensors@lm-sensors.org> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Yann Droneaud [Thu, 15 Aug 2013 13:10:54 +0000 (15:10 +0200)]
android/sync: use get_unused_fd_flags(O_CLOEXEC) instead of get_unused_fd()
Macro get_unused_fd() is used to allocate a file descriptor with
default flags. Those default flags (0) can be "unsafe":
O_CLOEXEC must be used by default to not leak file descriptor
across exec().
Instead of macro get_unused_fd(), functions anon_inode_getfd()
or get_unused_fd_flags() should be used with flags given by userspace.
If not possible, flags should be set to O_CLOEXEC to provide userspace
with a default safe behavor.
In a further patch, get_unused_fd() will be removed so that
new code start using anon_inode_getfd() or get_unused_fd_flags()
with correct flags.
This patch replaces calls to get_unused_fd() with call to
get_unused_fd_flags(O_CLOEXEC) following advice from Erik Gilling.
Yann Droneaud [Thu, 15 Aug 2013 13:10:53 +0000 (15:10 +0200)]
android/sw_sync: use get_unused_fd_flags(O_CLOEXEC) instead of get_unused_fd()
Macro get_unused_fd() is used to allocate a file descriptor with
default flags. Those default flags (0) can be "unsafe":
O_CLOEXEC must be used by default to not leak file descriptor
across exec().
Instead of macro get_unused_fd(), functions anon_inode_getfd()
or get_unused_fd_flags() should be used with flags given by userspace.
If not possible, flags should be set to O_CLOEXEC to provide userspace
with a default safe behavor.
In a further patch, get_unused_fd() will be removed so that
new code start using anon_inode_getfd() or get_unused_fd_flags()
with correct flags.
This patch replaces calls to get_unused_fd() with call to
get_unused_fd_flags(O_CLOEXEC) following advice from Erik Gilling.
Jens Frederich [Thu, 15 Aug 2013 19:34:55 +0000 (21:34 +0200)]
Staging: olpc_dcon: replace some magic numbers
This patch replace some magic numbers. I believe it makes
the driver more readable.
The magic number 0x26 is the XO system embedded controller
(EC) command 'DCON power enable/disable'.
Number 0x41, and 0x42 are special memory controller settings
register. The 0x41 initialize bit sequence 0x101 means:
enable memory power down function and special SDRAM clock
delay for synchronize SDRAM output and clock signal.
The 0x42 initialize squence 0x101 is wrong. According to
the specification Bit 8 is reserved, thus not in use.
I removed it.
Lidza Louina [Thu, 15 Aug 2013 14:28:22 +0000 (10:28 -0400)]
staging: dgnc: removes proc code
This patch removes the dgnc_proc.c and dgnc_proc.h files and all
references to proc functions in dgnc_driver.c. This also removes proc.h
from the include headers in driver.c, mgmt.c and sysfs.c and proc.o
from the Makefile.
drivers/staging/comedi/drivers/das16.c: In function 'das16_detach':
drivers/staging/comedi/drivers/das16.c:1234: error: implicit declaration of function 'kfree'
Cc: Ian Abbott <abbotti@mev.co.uk> Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Dan Carpenter [Tue, 13 Aug 2013 17:29:26 +0000 (18:29 +0100)]
staging: ozwpan: Separate success & failure case for oz_hcd_pd_arrived()
This patch separates success & failure block along with fixing
following issues:-
1. The way oz_hcd_pd_arrived() looks now it's easy to think we free "ep" but
actually we do this spaghetti thing of setting it to NULL on success.
2. It is hard to read it because there are unlocks scattered throughout.
3. Currently we set "ep" to NULL on the success path and then test it and or
free it. In current code you have to scroll to the start of the function
to read code.
Original patch was submitted by Dan here :-
http://driverdev.linuxdriverproject.org/pipermail/driverdev-devel/2013-August/040113.html