summaryrefslogtreecommitdiff
path: root/drivers/staging/iio/light/isl29018.c
AgeCommit message (Collapse)Author
2012-11-02iio: isl29018: Support suspend and resume.iio-for-3.8bBryan Freed
The driver leaves the device in power-down state anyway, so there is nothing to do on suspend. On resume, we just have to make sure the range and ADC values are updated in the device since it may have been powered down in suspend. Signed-off-by: Bryan Freed <bfreed@chromium.org> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-09-08iio: isl29018: Support fractional ALS scaling.iio-for-3.7cBryan Freed
The Industrial IO framework supports scaling ADC values by fractions, but most drivers default to using whole numbers. This change turns on fractional scaling in the isl29018 driver. Signed-off-by: Bryan Freed <bfreed@chromium.org> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-06-18iio staging: fix spelling of suppression in isl29018Peter Meerwald
beware, does change the ABI as proximity_on_chip_ambient_infrared_supression is changed to proximity_on_chip_ambient_infrared_suppression Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net> Acked-by: Jonathan Cameron <jic23@kernel.org> Acked-by: Laxman Dewangan <ldewangan@nvidia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-05-14staging:iio:light: Use dev_to_iio_dev()Lars-Peter Clausen
Replace open-coded instances of getting a iio_dev struct from a device struct with dev_to_iio_dev(). Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Acked-by: Jonathan Cameron <jic23@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-04-29staging:iio: Streamline API function namingLars-Peter Clausen
Currently we use two different naming schemes in the IIO API, iio_verb_object and iio_object_verb. E.g iio_device_register and iio_allocate_device. This patches renames instances of the later to the former. The patch also renames allocate to alloc as this seems to be the preferred form throughout the kernel. In particular the following renames are performed by the patch: iio_put_device -> iio_device_put iio_allocate_device -> iio_device_alloc iio_free_device -> iio_device_free iio_get_trigger -> iio_trigger_get iio_put_trigger -> iio_trigger_put iio_allocate_trigger -> iio_trigger_alloc iio_free_trigger -> iio_trigger_free The conversion was done with the following coccinelle patch with manual fixes to comments and documentation. <smpl> @@ @@ -iio_put_device +iio_device_put @@ @@ -iio_allocate_device +iio_device_alloc @@ @@ -iio_free_device +iio_device_free @@ @@ -iio_get_trigger +iio_trigger_get @@ @@ -iio_put_trigger +iio_trigger_put @@ @@ -iio_allocate_trigger +iio_trigger_alloc @@ @@ -iio_free_trigger +iio_trigger_free </smpl> Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Acked-by: Jonathan Cameron <jic23@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-04-25IIO: Move core headers to include/linux/iioJonathan Cameron
Step 1 in moving the IIO core out of staging. Signed-off-by: Jonathan Cameron <jic23@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-04-24staging: iio: light: isl29018: use regmap for register accessLaxman Dewangan
Using regmap for accessing register through i2c bus. This will remove the code for caching registers, read-modify-write logics. Also it will provide the debugfs feature to dump register through regmap debugfs. Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com> Reviewed-by: Grant Grundler <grundler@chromium.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-04-24staging: iio: light: of: Fix vendor prefix of isl29018/isl29028Laxman Dewangan
ISL29018/ISL29028 is from Intersil Corporation and making the vendor prefix for this part as "isil" for OF compatibity. Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-04-18staging:iio: drop procesed_val element of chan_spec.Jonathan Cameron
There is no longer any need for this as we have separate info_mask elements for raw and processed value reads. Signed-off-by: Jonathan Cameron <jic23@kernel.org> Acked-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-04-18staging:iio:light Add IIO_CHAN_INFO_RAW/PROCESSED entries to all drivers.Jonathan Cameron
Precursor to making value read / write attribute optional. Note that minimal change route taken here. The read_raw callbacks in both drivers could do fewer checks to identify the channel than they now do. Signed-off-by: Jonathan Cameron <jic23@kernel.org> Acked-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-02-09staging:iio: isl29018: add of_match table for device-tree probingOlof Johansson
As simple as can be right now; just one ID and no custom properties to parse. Signed-off-by: Olof Johansson <olof@lixom.net> Acked-by: Grant Likely <grant.likely@secretlab.ca> Acked-by: Jonathan Cameron <jic23@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-01-09Merge 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: (466 commits) net/hyperv: Add support for jumbo frame up to 64KB net/hyperv: Add NETVSP protocol version negotiation net/hyperv: Remove unnecessary kmap_atomic in netvsc driver staging/rtl8192e: Register against lib80211 staging/rtl8192e: Convert to lib80211_crypt_info staging/rtl8192e: Convert to lib80211_crypt_data and lib80211_crypt_ops staging/rtl8192e: Add lib80211.h to rtllib.h staging/mei: add watchdog device registration wrappers drm/omap: GEM, deal with cache staging: vt6656: int.c, int.h: Change return of function to void staging: usbip: removed unused definitions from header staging: usbip: removed dead code from receive function staging:iio: Drop {mark,unmark}_in_use callbacks staging:iio: Drop buffer mark_param_change callback staging:iio: Drop the unused buffer enable() and is_enabled() callbacks staging:iio: Drop buffer busy flag staging:iio: Make sure a device is only opened once at a time staging:iio: Disallow modifying buffer size when buffer is enabled staging:iio: Disallow changing scan elements in all buffered modes staging:iio: Use iio_buffer_enabled instead of open coding it ... Fix up conflict in drivers/staging/iio/adc/ad799x_core.c (removal of module_init due to using module_i2c_driver() helper, next to removal of MODULE_ALIAS due to using MODULE_DEVICE_TABLE instead).
2011-11-26staging:iio:treewide only use shared to decide on interfacesJonathan Cameron
Internally the fact that say scale is shared across channels is actually of remarkably little interest. Hence lets not store it. Numerous devices have weird combinations of channels sharing scale anyway so it is not as though this was really telling us much. Note however that we do still use the shared sysfs attrs thus massively reducing the number of attrs in complex drivers. Side effect is that certain drivers that were abusing this (mostly my work) needed to do a few more checks on what the channel they are being queried on actually is. This is also helpful for in kernel interfaces where we just want to query the scale and don't care whether it is shared with other channels or not. Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Acked-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-26staging:iio: Do not use bitmasks for channel info addressesLars-Peter Clausen
Currently the iio framework uses bitmasks for the address field of channel info attributes. This is for historical reasons and no longer required since it will only ever query a single info attribute at once. This patch changes the code to use the non-shifted iio_chan_info_enum values for the info attribute address. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-17staging:iio: Use module_i2c_driver to register I2C driversLars-Peter Clausen
Use the newly introduced module_i2c_driver macro for registering I2C drivers. This allows us to remove a few lines of boilerplate code. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Acked-by: Jonathan Cameron <jic23@kernel.org> Acked-by: Wolfram Sang <w.sang@pengutronix.de> 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-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-09-09staging:iio:light: V3 fix out of bounds reg_cache[] accessJonathan Cameron
V3 is a straightforward forward port to teh current tree of V2. Simple fix is to just not cache REG_TEST (offset 8). Cache doesn't help REG_TEST anyway since we write all 8 bits exactly once (at resume/init time). Also fix an "off-by-one" allocation of reg_cache[] array size that was in the original code before I touched it. Reported-by: Dan Carpenter <error27@gmail.com> Signed-off-by: Grant Grundler <grundler@chromium.org> Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-09-06staging:iio: push "sysfs.h" and linux/irq.h out of iio.hJonathan Cameron
These are no longer needed. Requires a few driver updates for places "sysfs.h" should have been present but wasn't. Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-08-23STAGING:iio:light: fix ISL29018 init to handle brownoutGrant Grundler
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>
2011-07-08staging:iio:light:isl29018: Convert some of the isl29018 driver to the new ↵Bryan Freed
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>
2011-07-08staging:iio:light:isl29018: Fix the "Init of isl29018 fails" failure.Bryan Freed
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>
2011-07-05staging: iio: light sensor: Add a calibscale file to the isl29018 light ↵Bryan Freed
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>
2011-06-28staging:iio:light:isl29018: allocate device state with iio_devJonathan Cameron
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>
2011-05-19staging:iio: implement an iio_info structure to take some of the constant ↵Jonathan Cameron
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>
2011-05-19staging:iio: use the new central name attribute creation codeJonathan Cameron
Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-04-25staging:iio: Add ability to allocate private data space to iio_allocate_deviceJonathan Cameron
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>
2010-10-07staging: iio: light: Adding driver for ISL29018 ALSRhyland Klein
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>