summaryrefslogtreecommitdiffstats
path: root/drivers/staging/iio/light
Commit message (Collapse)AuthorAgeFilesLines
* STAGING:iio:light: fix ISL29018 init to handle brownoutGrant Grundler2011-08-231-0/+46
| | | | | | | | | | | | | | | | After a voltage brownout, sensor will now operate correctly. Page 10 of ISL29018 data sheet and the Intersil Application Note 1534 describe the required initialization sequence: 1. Write 0x00 to register 0x08 (TEST) 2. Write 0x00 to register 0x00 (CMD1) 3. msleep(1) 4. program remaining registers as before Signed-off-by: Grant Grundler <grundler@chromium.org> Reviewed-by: Bryan Freed <bfreed@chromium.org> Acked-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* staging:iio:events: use IIO_<TYPE> and IIO_MOD_<> instead of ↵Jonathan Cameron2011-08-231-1/+1
| | | | | | | | | | | IIO_EV_CLASS_<TYPE> etc The original definitions were duplicated to reduce tree churn during introduction of chan_spec registration. Now there is no point in maintaining the two sets of definitions. 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>
* staging:iio:light:tsl2583 allocate chip state with iio_devJonathan Cameron2011-08-231-115/+101Star
| | | | | | | | | | | | There are some unusual corners in the probe function of this driver, so may need another look. V2: Now with the check for allocation success not inverted. V3: Now with the i2c devdata calls actually being correctly cast. Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Tested-by: Jon Brenner <jbrenner@TAOSinc.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* staging:iio:trivial sparse related cleanups.Jonathan Cameron2011-08-232-3/+3
| | | | | | | | Getting rid of messages that make it harder to spot important issues. Some code removed that will be useful one day. Can put it back then. Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* staging:iio:light:isl29018: Convert some of the isl29018 driver to the new ↵Bryan Freed2011-07-081-90/+78Star
| | | | | | | | | | | iio_chan_spec framework. Remove the driver's get_sensor_data() interfaces and replace them with iio_chan_spec channels. This converts 4 files to the new framework. Driver ABI change: The intensity_infrared_raw file is now intensity_ir_raw. Signed-off-by: Bryan Freed <bfreed@chromium.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* staging:iio:light:isl29018: Fix the "Init of isl29018 fails" failure.Bryan Freed2011-07-081-3/+3
| | | | | | | | | The I2C clientdata is set to indio_dev instead of chip as of a couple weeks ago. Correct the calls to i2c_get_clientdata() accordingly. Otherwise the driver fails to initialize. Signed-off-by: Bryan Freed <bfreed@chromium.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* staging: iio: light sensor: Add a calibscale file to the isl29018 light ↵Bryan Freed2011-07-061-1/+34
| | | | | | | | | | | | | | | | sensor driver. Defaulting to 1, this gives a way to amplify the lux value before being reduced by the programmed adc_bit shift. Only support whole numbers right now. When this driver is converted to the new IIO_CHAN framework, it will be easy to support the framework's pseudo float. Add illuminance0_calibscale documentation to sysfs-bus-iio-light. Signed-off-by: Bryan Freed <bfreed@chromium.org> Acked-by: Rhyland Klein <rklein@nvidia.com> Acked-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* iio: light sensor: Add SMBUS support to the tsl2563 driver.Bryan Freed2011-06-281-61/+45Star
| | | | | | | | | | | | | | | | | | | This is so we can support it on x86 SMBUS adapters. Since i2c adapters which do not provide an smbus_xfer interface fall back to using their I2C master_xfer interface, all the i2c_master_send() calls in this driver are changed to i2c_smbus_*() calls. This will fail on an i2c adapter that implements a proper subset of (SMBUS_BYTE | SMBUS_BYTE_DATA | SMBUS_WORD_DATA), but I do not see that in any of our adapters today. This results in a few wrapper functions that provide little additional functionality, so remove them and call the smbus functions directly from the general driver code. Signed-off-by: Bryan Freed <bfreed@chromium.org> Acked-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* iio: light sensor: Fix a panic in the tsl2563 driver.Bryan Freed2011-06-281-0/+2
| | | | | | | | | | | | Add the required read/write_raw functions to the tsl2563_info_no_irq data structure. This structure is used insted of tsl2563_info when the I2C client has no IRQ. The absence of these functions causes a panic when reading or writing the created sysfs files. Signed-off-by: Bryan Freed <bfreed@chromium.org> Acked-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* iio: light sensor: Fix a panic in the tsl2563 driver.Bryan Freed2011-06-281-8/+9
| | | | | | | | | | | Add a wrapper for this driver around the IIO_CHAN() wrapper to make channel parameters more readable. This fixes a panic caused by the info_masks being accidentally passed in as channel2 parameters which easily surpass the size of the iio_modifier_names_light array. Signed-off-by: Bryan Freed <bfreed@chromium.org> Acked-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* staging: iio light Kconfig fixletmaximilian attems2011-06-281-1/+1
| | | | | | | | No point to start comments with '\'. Signed-off-by: maximilian attems <max@stro.at> Acked-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* staging:iio:light:isl29018: allocate device state with iio_devJonathan Cameron2011-06-281-30/+22Star
| | | | | | | V2: Actually allocate the space for iio_priv Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* staging:iio: Trivial kconfig reorganization and uniformity improvements.Jonathan Cameron2011-05-201-13/+13
| | | | | Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* staging:iio: implement an iio_info structure to take some of the constant ↵Jonathan Cameron2011-05-203-12/+30
| | | | | | | | | | elements out of iio_dev. This was suggested by Arnd Bergmann, Other elements may well move in here in future, but it definitely makes sense for these. Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* staging:iio:light:tsl2563: chan_spec based channel setup.Jonathan Cameron2011-05-201-206/+117Star
| | | | | | | | Makes a small interface change by splitting event _en attr in two. Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* staging:iio: use the new central name attribute creation codeJonathan Cameron2011-05-201-12/+1Star
| | | | | Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* staging:iio:light:tsl2563 remove old style event registration.Jonathan Cameron2011-05-201-43/+19Star
| | | | | | | Untested. Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* staging:iio:light:tsl2563 constify gain level table.Jonathan Cameron2011-04-261-2/+2
| | | | | | | Trivial cleanup. Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* staging:iio:tsl2563 take advantage of new iio_device_allocate private data.Jonathan Cameron2011-04-261-39/+29Star
| | | | | Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* staging:iio: Add ability to allocate private data space to iio_allocate_deviceJonathan Cameron2011-04-263-3/+3
| | | | | | | | | | | | | Suggested by Arnd Bergmann. Note this will break ALL drivers that are out of mainline. The fix is trivial change of iio_allocate_device() -> iio_allocate_device(0) Sorry if this causes issues for any one! V2: Include new drivers in the update Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Acked-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* staging: iio: TAOS tsl258x: Device driverJon Brenner2011-04-263-0/+967
| | | | | | | | | | | | | | | | | | | Added suspend/resume functions. Changed attribute names to match existing where applicable and updated or documented new ABI as discussed. Changed integration time ABI from using index (0 to 3) to use actual gain values (1x,8x, etc.). Removed various unused variables, declarations, and functions. Revised code to accommodate different endianess (le16_to_cpu). Updated error return codes in various functions. Changed from mdelay to msleep after determining that longer wait would be acceptable. V5: Makefile and Kconfig cleanups by Jonathan Cameron. Signed-off-by: Jon August Brenner <jbrenner@taosinc.com> Acked-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* staging: iio: light remove empty light.h fileJonathan Cameron2010-10-081-5/+0Star
| | | | | | | We can put this back when there is something to put in it! Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* staging: iio: tsl2563 event attribute name updatesJonathan Cameron2010-10-081-14/+14
| | | | | | | | Patch also renames the two raw channels to add numbers so that we know to which channel the event code applies. Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* staging: iio: tsl2563 move to new event numbering scheme and remove old ↵Jonathan Cameron2010-10-082-4/+5
| | | | | | | definitions Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* staging: iio: light: Adding driver for ISL29018 ALSRhyland Klein2010-10-083-0/+576
| | | | | | | | | | | | | | | | | | adding support for the ISL 29018 ambient light and proximity sensor. Addressed comments from reviews by Jonathan Cameron and Joe Perches * Removed some excess dbg prints that only printed function name * Renamed some properties to make them more descriptive * Added a property to list available adc resolutions * Defined arrays for resolutions/ranges as static const * Change loops initialization to memset for extensibility. * used sizeof() instead of ARRAY_SIZE() to be safer * Added a property to list available adc ranges * Fixed warnings and property names. Signed-off-by: Rhyland Klein <rklein@nvidia.com> Acked-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* staging:iio: tsl2563 abi fixes and interrupt handlingJonathan Cameron2010-07-082-96/+300
| | | | | Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* Staging: iio: standardize kconfig/makefile spacing/styleMike Frysinger2010-06-181-1/+0Star
| | | | | | | | | | | | Standardize the spacing/style across the IIO build files: - comment block in Kconfigs - newlines at ends of files - trailing lines at ends of files - indent with one tab, not spaces or mixed Signed-off-by: Mike Frysinger <vapier@gentoo.org> Acked-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* i2c: Remove all i2c_set_clientdata(client, NULL) in driversWolfram Sang2010-06-031-2/+0Star
| | | | | | | | | | | | | | | | | | | | | I2C drivers can use the clientdata-pointer to point to private data. As I2C devices are not really unregistered, but merely detached from their driver, it used to be the drivers obligation to clear this pointer during remove() or a failed probe(). As a couple of drivers forgot to do this, it was agreed that it was cleaner if the i2c-core does this clearance when appropriate, as there is no guarantee for the lifetime of the clientdata-pointer after remove() anyhow. This feature was added to the core with commit e4a7b9b04de15f6b63da5ccdd373ffa3057a3681 to fix the faulty drivers. As there is no need anymore to clear the clientdata-pointer, remove all current occurrences in the drivers to simplify the code and prevent confusion. Signed-off-by: Wolfram Sang <w.sang@pengutronix.de> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Greg Kroah-Hartman <gregkh@suse.de> Acked-by: Richard Purdie <rpurdie@linux.intel.com> Acked-by: Dmitry Torokhov <dtor@mail.ru> Signed-off-by: Jean Delvare <khali@linux-fr.org>
* Merge staging-next tree into Linus's latest versionGreg Kroah-Hartman2010-05-211-3/+15
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: drivers/staging/arlan/arlan-main.c drivers/staging/comedi/drivers/cb_das16_cs.c drivers/staging/cx25821/cx25821-alsa.c drivers/staging/dt3155/dt3155_drv.c drivers/staging/hv/hv.c drivers/staging/netwave/netwave_cs.c drivers/staging/wavelan/wavelan.c drivers/staging/wavelan/wavelan_cs.c drivers/staging/wlags49_h2/wl_cs.c This required a bit of hand merging due to the conflicts that happened in the later .34-rc releases, as well as some staging driver changing coming in through other trees (v4l and pcmcia). Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| * Staging: iio: light: tsl2563: fix static sparse warningGreg Kroah-Hartman2010-05-111-1/+1
| | | | | | | | | | Cc: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| * Staging: iio: light trivial whitespace fixJonathan Cameron2010-05-111-1/+1
| | | | | | | | | | Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| * staging:iio:tsl2563 add a name attribute under the iioJonathan Cameron2010-05-111-0/+12
| | | | | | | | | | Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| * staging:iio:tsl2563: change lux to illuminance0_input to match new abiJonathan Cameron2010-05-111-2/+2
| | | | | | | | | | Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* | Staging: iio: light: fix dangling pointersWolfram Sang2010-04-301-0/+2
|/ | | | | | | | | | | Fix I2C-drivers which missed setting clientdata to NULL before freeing the structure it points to. Also fix drivers which do this _after_ the structure was freed already. Signed-off-by: Wolfram Sang <w.sang@pengutronix.de> Acked-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* include cleanup: Update gfp.h and slab.h includes to prepare for breaking ↵Tejun Heo2010-03-301-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | implicit slab.h inclusion from percpu.h percpu.h is included by sched.h and module.h and thus ends up being included when building most .c files. percpu.h includes slab.h which in turn includes gfp.h making everything defined by the two files universally available and complicating inclusion dependencies. percpu.h -> slab.h dependency is about to be removed. Prepare for this change by updating users of gfp and slab facilities include those headers directly instead of assuming availability. As this conversion needs to touch large number of source files, the following script is used as the basis of conversion. http://userweb.kernel.org/~tj/misc/slabh-sweep.py The script does the followings. * Scan files for gfp and slab usages and update includes such that only the necessary includes are there. ie. if only gfp is used, gfp.h, if slab is used, slab.h. * When the script inserts a new include, it looks at the include blocks and try to put the new include such that its order conforms to its surrounding. It's put in the include block which contains core kernel includes, in the same order that the rest are ordered - alphabetical, Christmas tree, rev-Xmas-tree or at the end if there doesn't seem to be any matching order. * If the script can't find a place to put a new include (mostly because the file doesn't have fitting include block), it prints out an error message indicating which .h file needs to be added to the file. The conversion was done in the following steps. 1. The initial automatic conversion of all .c files updated slightly over 4000 files, deleting around 700 includes and adding ~480 gfp.h and ~3000 slab.h inclusions. The script emitted errors for ~400 files. 2. Each error was manually checked. Some didn't need the inclusion, some needed manual addition while adding it to implementation .h or embedding .c file was more appropriate for others. This step added inclusions to around 150 files. 3. The script was run again and the output was compared to the edits from #2 to make sure no file was left behind. 4. Several build tests were done and a couple of problems were fixed. e.g. lib/decompress_*.c used malloc/free() wrappers around slab APIs requiring slab.h to be added manually. 5. The script was run on all .h files but without automatically editing them as sprinkling gfp.h and slab.h inclusions around .h files could easily lead to inclusion dependency hell. Most gfp.h inclusion directives were ignored as stuff from gfp.h was usually wildly available and often used in preprocessor macros. Each slab.h inclusion directive was examined and added manually as necessary. 6. percpu.h was updated not to include slab.h. 7. Build test were done on the following configurations and failures were fixed. CONFIG_GCOV_KERNEL was turned off for all tests (as my distributed build env didn't work with gcov compiles) and a few more options had to be turned off depending on archs to make things build (like ipr on powerpc/64 which failed due to missing writeq). * x86 and x86_64 UP and SMP allmodconfig and a custom test config. * powerpc and powerpc64 SMP allmodconfig * sparc and sparc64 SMP allmodconfig * ia64 SMP allmodconfig * s390 SMP allmodconfig * alpha SMP allmodconfig * um on x86_64 SMP allmodconfig 8. percpu.h modifications were reverted so that it could be applied as a separate patch and serve as bisection point. Given the fact that I had only a couple of failures from tests on step 6, I'm fairly confident about the coverage of this conversion patch. If there is a breakage, it's likely to be something in one of the arch headers which should be easily discoverable easily on most builds of the specific arch. Signed-off-by: Tejun Heo <tj@kernel.org> Guess-its-ok-by: Christoph Lameter <cl@linux-foundation.org> Cc: Ingo Molnar <mingo@redhat.com> Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>
* Staging: IIO: Add tsl2560-2 support to tsl2563 driver.Jonathan Cameron2009-12-112-8/+9
| | | | | | | | | | | | | Minimal changes to driver. Just adds the device to the id table and adjusts the Kconfig elements appropriately. Adding further similar chips from TAOS is complicated by their different conversion functions (and hence left for now). Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Acked-by: Amit Kucheria <amit.kucheria@verdurent.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* Staging: IIO: Remove tsl2561 driver. Support merged with tsl2563.Jonathan Cameron2009-12-113-282/+0Star
| | | | | | | | | This patch simply removes the tsl2561 driver. Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Acked-by: Amit Kucheria <amit.kucheria@verdurent.com>
* Staging: iio: tsl2563 ambient light sensor driverAmit Kucheria2009-12-114-0/+793
| | | | | | | | | | | | | | | | Add driver support for the tsl2563 TAOS ambient light sensor. After looking at discussions on LKML, the driver was modified from a 'hwmon' driver to an 'iio' driver. The sysfs interfaces have been tested on an RX51 (N900) to see if it responds to changing light conditions. The only real reason for submitting this to staging is that it is dependent on the IIO subsystem. Signed-off-by: Amit Kucheria <amit.kucheria@verdurent.com> Cc: Jonathan Cameron <jic23@cam.ac.uk> Cc: linux-omap@vger.kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* Staging: IIO: tsl2561: Drop unused module parametersJean Delvare2009-10-041-4/+0Star
| | | | | | | | | The I2C_CLIENT_INSMOD macro is only useful for i2c drivers which implement device detection. The tsl2561 driver doesn't, so there is no point in calling it. Signed-off-by: Jean Delvare <khali@linux-fr.org> Cc: Jonathan Cameron <jic23@cam.ac.uk>
* Staging: IIO: tsl2561 digital light sensor core supportJonathan Cameron2009-09-154-0/+306
This is a pretty minimalist example of an IIO driver. Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>