summaryrefslogtreecommitdiff
path: root/drivers/staging/iio
AgeCommit message (Collapse)Author
2011-11-26iio: iio_event_getfd -- fix ev_int build failureAndy Whitcroft
Fix build failure in staging iio driver: .../drivers/staging/iio/industrialio-core.c: In function 'iio_event_getfd': .../drivers/staging/iio/industrialio-core.c:262:32: error: 'ev_int' undeclared (first use in this function) Also convert the rest of the function to use the new variable. Signed-off-by: Andy Whitcroft <apw@canonical.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-11-21iio: fix a leak due to improper use of anon_inode_getfd()Al Viro
it can fail and in that case ->release() will *not* be called... Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2011-11-06Merge branch 'modsplit-Oct31_2011' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/paulg/linux * 'modsplit-Oct31_2011' of git://git.kernel.org/pub/scm/linux/kernel/git/paulg/linux: (230 commits) Revert "tracing: Include module.h in define_trace.h" irq: don't put module.h into irq.h for tracking irqgen modules. bluetooth: macroize two small inlines to avoid module.h ip_vs.h: fix implicit use of module_get/module_put from module.h nf_conntrack.h: fix up fallout from implicit moduleparam.h presence include: replace linux/module.h with "struct module" wherever possible include: convert various register fcns to macros to avoid include chaining crypto.h: remove unused crypto_tfm_alg_modname() inline uwb.h: fix implicit use of asm/page.h for PAGE_SIZE pm_runtime.h: explicitly requires notifier.h linux/dmaengine.h: fix implicit use of bitmap.h and asm/page.h miscdevice.h: fix up implicit use of lists and types stop_machine.h: fix implicit use of smp.h for smp_processor_id of: fix implicit use of errno.h in include/linux/of.h of_platform.h: delete needless include <linux/module.h> acpi: remove module.h include from platform/aclinux.h miscdevice.h: delete unnecessary inclusion of module.h device_cgroup.h: delete needless include <linux/module.h> net: sch_generic remove redundant use of <linux/module.h> net: inet_timewait_sock doesnt need <linux/module.h> ... Fix up trivial conflicts (other header files, and removal of the ab3550 mfd driver) in - drivers/media/dvb/frontends/dibx000_common.c - drivers/media/video/{mt9m111.c,ov6650.c} - drivers/mfd/ab3550-core.c - include/linux/dmaengine.h
2011-10-31treewide: use __printf not __attribute__((format(printf,...)))Joe Perches
Standardize the style for compiler based printf format verification. Standardized the location of __printf too. Done via script and a little typing. $ grep -rPl --include=*.[ch] -w "__attribute__" * | \ grep -vP "^(tools|scripts|include/linux/compiler-gcc.h)" | \ xargs perl -n -i -e 'local $/; while (<>) { s/\b__attribute__\s*\(\s*\(\s*format\s*\(\s*printf\s*,\s*(.+)\s*,\s*(.+)\s*\)\s*\)\s*\)/__printf($1, $2)/g ; print; }' [akpm@linux-foundation.org: revert arch bits] Signed-off-by: Joe Perches <joe@perches.com> Cc: "Kirill A. Shutemov" <kirill@shutemov.name> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-10-31staging: Add module.h to more drivers implicitly using it.Paul Gortmaker
This 2nd batch of implicit module.h users only appeared when we removed the unnecessary module.h from include/linux/miscdevice.h [The 1st batch is already present in Greg's staging tree.] Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
2011-10-31staging: Add export.h for THIS_MODULE/EXPORT_SYMBOL to drivers/staging users.Paul Gortmaker
Lots of drivers have in the past expected the presence of basic things like THIS_MODULE and EXPORT_SYMBOL. With the header cleanup, they wont have these. Call out the include explicitly. Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
2011-10-26Merge branch 'staging-next' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging * 'staging-next' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging: (1519 commits) staging: et131x: Remove redundant check and return statement staging: et131x: Mainly whitespace changes to appease checkpatch staging: et131x: Remove last of the forward declarations staging: et131x: Remove even more forward declarations staging: et131x: Remove yet more forward declarations staging: et131x: Remove more forward declarations staging: et131x: Remove forward declaration of et131x_adapter_setup staging: et131x: Remove some forward declarations staging: et131x: Remove unused rx_ring.recv_packet_pool staging: et131x: Remove call to find pci pm capability staging: et131x: Remove redundant et131x_reset_recv() call staging: et131x: Remove unused rx_ring.recv_buffer_pool Staging: bcm: Fix three initialization errors in InterfaceDld.c Staging: bcm: Fix coding style issues in InterfaceDld.c staging:iio:dac: Add AD5360 driver staging:iio:trigger:bfin-timer: Fix compile error Staging: vt6655: add some range checks before memcpy() Staging: vt6655: whitespace fixes to iotcl.c Staging: vt6656: add some range checks before memcpy() Staging: vt6656: whitespace cleanups in ioctl.c ... Fix up conflicts in: - drivers/{Kconfig,Makefile}, drivers/staging/{Kconfig,Makefile}: vg driver movement - drivers/staging/brcm80211/brcmfmac/{dhd_linux.c,mac80211_if.c}: driver removal vs now stale changes - drivers/staging/rtl8192e/r8192E_core.c: driver removal vs now stale changes - drivers/staging/et131x/et131*: driver consolidation into one file, tried to do fixups
2011-10-23staging:iio:dac: Add AD5360 driverLars-Peter Clausen
This patch adds support for the Analog Devices AD5360, AD5361, AD5362, AD5363, AD5370, AD5371, AD5372, AD5373 multi-channel digital-to-analog converters. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Acked-by: Jonathan Cameron <jic23@cam.ac.uk> Acked-by: Michael Hennerich <michael.hennerich@analog.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-10-23staging:iio:trigger:bfin-timer: Fix compile errorLars-Peter Clausen
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Acked-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-10-19staging:iio:dac:ad5686: Check for negative valuesLars-Peter Clausen
Currently it is possible to write negative values to the ad5686's raw attribute. This will cause undefined behaviour, so reject negative values. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Acked-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-10-19staging:iio:dac:ad5791: Fix scale unitLars-Peter Clausen
Scale is currently reported in volts instead of millivolts. This patch fixes it. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Acked-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-10-19staging:iio:dac:ad5791: Convert attributes to new naming specLars-Peter Clausen
Add the missing "voltage" chan_type to the powerdown attributes. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Acked-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-10-19staging:iio:dac:ad5791: Allow asymmetrical reference voltagesLars-Peter Clausen
The ad5791 currently assumes that the negative and positive supply have the same absolute value, which is not necessarily true. This patch introduces a offset attribute which will contain the negative supply voltage scaled according to the iio spec. The raw attribute now accepts values in the range of 0 to max instead of -max/2 to max/2. While we are at it also fix the vref span calculation. Since both positive and negative reference voltages are specificed as absolute values we need to add them and not subtract them to get the reference voltage span. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Acked-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-10-19staging:iio:dac:ad5791: Use correct DAC bit-sizeLars-Peter Clausen
Commit c5b99396 ("staging:iio:dac:ad5791 chan spec conversion.") introduced a small bug, using storagebits instead of realbits throughout the driver, which causes the driver to work incorrectly. This patch fixes it. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Acked-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-10-19iio: cdc: Fix pushed event code - Typo, should be IIO_CAPACITANCE.Michael Hennerich
Signed-off-by: Michael Hennerich <michael.hennerich@analog.com> Acked-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-10-19iio: adc: Relocate Capacitance to Digital Converters (CDC) into own subdirMichael Hennerich
No functional changes. Fix Kconfig description. Signed-off-by: Michael Hennerich <michael.hennerich@analog.com> Acked-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-10-19iio: Spell fix - consistent use of Converter - no functional changesMichael Hennerich
Signed-off-by: Michael Hennerich <michael.hennerich@analog.com> Acked-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-10-19staging:iio:dac: Add AD5064 driverLars-Peter Clausen
This patch adds support for the Analog Devices AD6064, AD6064-1, AD6044, AD6024 quad channel digital-to-analog converter devices. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Acked-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-10-17staging:iio:dummy Add buffered reading supportJonathan Cameron
Very simple buffered reading. Did not provide a trigger as the sysfs trigger already meets that requirement. Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-10-17staging:iio:dummy Add event support + fake event generatorJonathan Cameron
The event generator is not very pretty but does the job and allows this driver to look a lot more like a normal driver than it otherwise would. Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-10-17staging:iio:Documentation Simple dummy driver to explain the basicsJonathan Cameron
The documenation explaining how to go about writing a driver is lagging horribly, so here is another approach; an actual driver with lots of explanatory comments. Note it is currently minimal in that there are no events and no buffer. With care they can probably be added in additional files without messing up the clarity of what we have here. V2: Addressed some of Manuel Stahl's feedback. Fixed up kernel doc. Added more general description. Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-10-17staging:iio:adc:max1363 incorrect allocation of available_scanmasksJonathan Cameron
Longs are not known for being 8 bits. Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-10-17staging:iio: fix removal path to allow correct freeing.Jonathan Cameron
Fix a dumb lack of consideration of the effect of combining the iio_device_unregister and iio_free_device calls into one. There is no valid place to free some of the sysfs array elements. Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-10-17iio: adc: remove ADT75 driver - hwmon/lm75 will take over ADT75 supportMichael Hennerich
Signed-off-by: Michael Hennerich <michael.hennerich@analog.com> Acked-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-10-17staging:iio: gpio build dependency fixingJonathan Cameron
Numerous drivers either had pointless includes of gpio.h or should have been dependent on GENERIC_GPIO and were not. Conversion of ads1210 to use array registration triggered build failures that highlighted all was not well. Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Reported-by: Randy Dunlap <rdunlap@xenotime.net> Acked-by: Randy Dunlap <rdunlap@xenotime.net> Acked-by: Michael Hennerich <michael.hennerich@analog.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-10-11staging:iio:dac:ad5638: Fix channel addressLars-Peter Clausen
Commit c6fc806247 ("staging:iio: ABI rework - add in_ or out_ prefix to channnels") added the AD5868_CHANNEL macro to simplify channel initialization. Unfortunately the macro hardcodes the channel's address to AD5686_ADDR_DAC0. As a result writing to any of the channels will change the value of the first channel. This patch fixes the issue by calculating the channel address based on the channel number. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Acked-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-10-11staging:iio:dac/dds/impedance dev_info to indio_dev for consistencyJonathan Cameron
We had a random missmatch of these two. Lets pick the most common and get rid of the other. Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> For adxxxx parts Acked-by: Michael Hennerich <michael.hennerich@analog.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-10-11staging:iio:adc:naming: dev_info to indio_dev for consistencyJonathan Cameron
We had a random missmatch of these two. Lets pick the most common and get rid of the other. Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Acked-by: Michael Hennerich <michael.hennerich@analog.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-10-11staging:iio:accel:sca3000 dev_info to indio_dev renaming.Jonathan Cameron
Again, there is a mix of the two names for the struct iio_dev. Lets pick one and run with it. Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-10-11staging:iio:core:naming: dev_info to indio_dev for consistencyJonathan Cameron
We had a random missmatch of these two. Lets pick the most common and get rid of the other. This patch covers the core. Others will clean up the drivers. Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-10-11Staging: iio/adc/ad7150: release lock on errorDan Carpenter
The error_ret label should have been before the mutex_unlock(). It's a typo. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Acked-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-10-11Staging: iio/light/tsl2563: fix compile warningDan Carpenter
This fixes a compile warning: drivers/staging/iio/light/tsl2563.c:696:2: warning: initialization from incompatible pointer type [enabled by default] drivers/staging/iio/light/tsl2563.c:696:2: warning: (near initialization for ‘tsl2563_info.write_event_value’) [enabled by default] The tsl2563_write_thresh() function returns zero on success and error codes on failure, so nothing is lost by making the return type int instead of ssize_t. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Acked-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-10-11Staging: iio/light/tsl2563: unlock on an error pathDan Carpenter
We need to unlock here before returning. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Acked-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-10-05staging:iio:resolver:ad2s1210 cleanup gpio handling.Jonathan Cameron
Basically make use of the gpio array functions. Technically the free doesn't need as much info as given here, but this keeps it clean and easy to follow. Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Acked-by: Michael Hennerich <michael.hennerich@analog.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-10-05staging:iio:resolver:ad2s1210 drop raw config register accessJonathan Cameron
This should never have been exposed to userspace Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Acked-by: Michael Hennerich <michael.hennerich@analog.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-10-05staging:iio:resolver:ad2s1210 minimal chan spec conversion.Jonathan Cameron
Just convert the raw reads in this patch. Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Acked-by: Michael Hennerich <michael.hennerich@analog.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-10-05staging:iio:resolver:ad2s1210 ensure iio_dev->name is setJonathan Cameron
This is needed to ensure the required name attribute is created. Using an id table is the route most consistent with other drivers. Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Acked-by: Michael Hennerich <michael.hennerich@analog.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-10-05staging:iio:resolver rename ad2s120x ->ad2s1200Jonathan Cameron
There are far too many possible part numbers that are not covered in here to have such a generic name. So move to naming after one of the supported parts. Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Acked-by: Michael Hennerich <michael.hennerich@analog.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-10-05staging:iio:resolver:ad2s120x chan spec conversionJonathan Cameron
Straight forward conversion. Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Acked-by: Michael Hennerich <michael.hennerich@analog.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-10-05staging:iio:Documentation gyro -> anglvel updates in attribute namesJonathan Cameron
Follows directly from change made in previous patch. Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Acked-by: Michael Hennerich <michael.hennerich@analog.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-10-05staging:iio: rename gyro channels to anglvelJonathan Cameron
Ensure naming reflects what is measured, not how it is done. Resolvers can measure the same thing for starters. IIO_GYRO->IIO_ANGL_VEL to ensure consistent naming. Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Acked-by: Michael Hennerich <michael.hennerich@analog.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-10-05staging:iio:resolver:ad2s90 chan spec conversionJonathan Cameron
Trivial conversion. Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Acked-by: Michael Hennerich <michael.hennerich@analog.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-10-05staging:iio:resolver:ad2s90 ensure name is passed to iio_core.Jonathan Cameron
Scraps the pointless name define and adds an id table. It's not technically required in drivers with only one supported part but it does make the probe code more consistent. Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Acked-by: Michael Hennerich <michael.hennerich@analog.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-10-05staging:iio:resolver:ad2s90 fix registration of null pointerJonathan Cameron
When the new allocation code was introduced a stray pointer to iio_dev structure was left in the chip state structure. This was never set but was then registered with the core. Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Acked-by: Michael Hennerich <michael.hennerich@analog.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-10-05staging:iio:lisght:isl29018 use IIO_PROCESSED enum value.Jonathan Cameron
No functional change, just a trivial tidy up so all drivers do the same thing. Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-10-05staging:iio:adc:ad7314 removal. Supported via hwmon.Jonathan Cameron
Driver ported over to hwmon where it fits much better. Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Acked-by: Michael Hennerich <michael.hennerich@analog.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-10-04staging: iio: if(__LITTLE_ENDIAN) -> #ifdef __LITTLE_ENDIANJonathan Cameron
Unsuprisingly this symbol isn't defined on big endian systems. Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Reported-by: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-10-04staging: iio: adc: add includes of module.h and stat.hStephen Rothwell
fixes these build problems: drivers/staging/iio/adc/ad7746.c:345:8: error: 'S_IWUSR' undeclared here (not in a function) drivers/staging/iio/adc/ad7746.c:436:8: error: 'S_IRUGO' undeclared here (not in a function) drivers/staging/iio/adc/ad7746.c:681:19: error: 'THIS_MODULE' undeclared here (not in a function) drivers/staging/iio/adc/ad7746.c:778:1: warning: data definition has no type or storage class [enabled by default] drivers/staging/iio/adc/ad7746.c:778:1: warning: type defaults to 'int' in declaration of 'MODULE_DEVICE_TABLE' [-Wimplicit-int] drivers/staging/iio/adc/ad7746.c:778:1: warning: parameter names (without types) in function declaration [enabled by default] drivers/staging/iio/adc/ad7746.c:799:15: error: expected declaration specifiers or '...' before string constant drivers/staging/iio/adc/ad7746.c:800:20: error: expected declaration specifiers or '...' before string constant drivers/staging/iio/adc/ad7746.c:801:16: error: expected declaration specifiers or '...' before string constant Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au> Acked-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-10-03staging: add module.h to various iio driversPaul Gortmaker
Since they are assuming it is there implicitly and will fail otherwise with things like: drivers/staging/iio/impedance-analyzer/ad5933.c:816: warning: type defaults to ‘int’ in declaration of ‘MODULE_AUTHOR’ drivers/staging/iio/adc/ad7280a.c:990: warning: type defaults to ‘int’ in declaration of ‘MODULE_AUTHOR’ Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-10-03staging:iio:imu:adis16400 rename adis16344 -> adis16334.Jonathan Cameron
Part never existed under that name. Ooops Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>