summaryrefslogtreecommitdiffstats
path: root/drivers/staging/iio/light/tsl2x7x_core.c
AgeCommit message (Collapse)AuthorFilesLines
2014-03-18staging: iio: light: Checkpatch fixes tsl2x7x_core.cAybuke Ozdemir1-4/+4
This patch fixes these errors and warning messages found by checkpatch.pl: ERROR: return is not a function, parentheses are not required. WARNING: space prohibited before semicolon. Signed-off-by: Aybuke Ozdemir <aybuke.147@gmail.com> Acked-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-12-08iio: Remove support for the legacy event config interfaceLars-Peter Clausen1-20/+20
Now that all drivers have been converted to the new event config interface we can remove for the legacy event config interface. Also drop the '_new' suffix for the event config interface callbacks, since those are the only callbacks now. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-10-12staging:iio:tsl2x7x: Switch to new event config interfaceLars-Peter Clausen1-47/+73
Switch the tsl2x7x driver to the new IIO event config interface as the old one is going to be removed. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Cc: Jon Brenner <jbrenner@taosinc.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-09-14staging: iio: tsl2x7x_core: Remove redundant breakSachin Kamat1-8/+0
'break' after return is redundant. Remove it. Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-09-07staging: iio: tsl2x7x_core: Fix sparse warningSachin Kamat1-1/+1
Silences the following warning: drivers/staging/iio/light/tsl2x7x_core.c:553:70: warning: Using plain integer as NULL pointer Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Cc: J. August Brenner <jbrenner@taosinc.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-09-07staging: iio: tsl2x7x_core: Use devm_* APIsSachin Kamat1-25/+13
devm_* APIs are device managed and make code simpler. Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Cc: J. August Brenner <jbrenner@taosinc.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-05-22staging:iio:light:tsl2x7x: fix the error handling in tsl2x7x_probe()Wei Yongjun1-4/+5
Fix to return -EINVAL in the i2c device found error handling case instead of 0, as done elsewhere in this function. And also correct the fail1 and fail2 lable to do the right thing. Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-03-17staging:iio:light:tsl2x7x move to info_mask_(shared_by_type/separate)Jonathan Cameron1-20/+20
The original info_mask is going away in favour of the broken out versions. Signed-off-by: Jonathan Cameron <jic23@kernel.org> cc: Jon Brenner <jon.brenner@ams.com>
2013-01-26staging:iio:tsl2x7x: Use iio_str_to_fixedpoint instead of open-coding itLars-Peter Clausen1-66/+12
The tsl2x7x driver has a copy'n'pasted version of the iio_str_to_fixedpoint() function from the IIO core. Replace this custom copy and use iio_str_to_fixedpoint instead. The patch also introduces a slight functional change in that it makes sure that in case of a parsing error the error is reported back to userspace instead of silently ignoring it. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Acked-by: Jon Brenner <jon.brenner@ams.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-11-21staging: iio: remove use of __devexit_pBill Pemberton1-1/+1
CONFIG_HOTPLUG is going away as an option so __devexit_p is no longer needed. Signed-off-by: Bill Pemberton <wfp5p@virginia.edu> Cc: Jonathan Cameron <jic23@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-21staging: iio: remove use of __devexitBill Pemberton1-1/+1
CONFIG_HOTPLUG is going away as an option so __devexit is no longer needed. Signed-off-by: Bill Pemberton <wfp5p@virginia.edu> Cc: Jonathan Cameron <jic23@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-21staging: iio: remove use of __devinitBill Pemberton1-1/+1
CONFIG_HOTPLUG is going away as an option so __devinit is no longer needed. Signed-off-by: Bill Pemberton <wfp5p@virginia.edu> Cc: Jonathan Cameron <jic23@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-07-14staging:iio:tsl2x7x: Ensure request_irq and free_irq dev_id parameter matchLars-Peter Clausen1-2/+1
The data parameters for request_irq and free_irq have to match, otherwise the IRQ wont be freed. The issue has been discovered using the following coccinelle patch: // <smpl> @r1@ type T; T data; @@ ( request_irq(..., (void *)data) | request_irq(..., data) | request_threaded_irq(..., (void *)data) | request_threaded_irq(..., data) ) @r2@ type r1.T; T data; position p; @@ ( free_irq@p(..., (void *)data) | free_irq@p(..., data) ) @depends on r1@ position p != r2.p; @@ *free_irq@p(...) // </smpl> Cc: Jon Brenner <jbrenner@taosinc.com> Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-07-14staging:iio:tsl2x7x: Fix client data inconsistencyLars-Peter Clausen1-2/+2
In probe the I2C client data is set to the iio_dev struct in probe(), but assumed to be the tsl2X7X_chip struct in remove(). Fix this by reading the client data back as iio_dev as well. The issue has been discovered using the following coccinelle patch: // <smpl> @r1@ type T; T data; expression dev; @@ ( i2c_set_clientdata(dev, (void *)data) | i2c_set_clientdata(dev, data) ) @r2@ type r1.T; T data; position p; expression dev; @@ data = i2c_get_clientdata@p(dev) @depends on r1@ position p != r2.p; expression dev; identifier data; @@ *data = i2c_get_clientdata@p(dev) // </smpl> Cc: Jon Brenner <jbrenner@taosinc.com> Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-06-18iio staging: fix tsl2x7x file modePeter Meerwald1-0/+0
just drop execute permission Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net> Acked-by: Jonathan Cameron <jic23@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-06-18iio staging: fix typos in tsl*: registerPeter Meerwald1-1/+1
Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net> Acked-by: Jonathan Cameron <jic23@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-06-04staging: iio: Remove version.h header file inclusionSachin Kamat1-1/+0
version.h header file is no longer required. Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-05-14staging:iio:light: Use dev_to_iio_dev()Lars-Peter Clausen1-20/+20
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 Clausen1-3/+3
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 Cameron1-3/+3
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: tsl2x7x: bugfixesJon Brenner1-8/+18
TAOS (version 9a) tsl2x7x driver change / bug fix. Fixed - removed decimal multiplications. Added missing 'static' declarations Fixed _read_raw case logic to allow reading of _PROCESSED IIO_LIGHT Replaced udelay with mdelay to accomodate eabi. Signed-off-by: Jon Brenner <jbrenner@taosinc.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-04-24staging: iio: add TAOS tsl2x7x driverJon Brenner1-0/+2072
TAOS device driver (version 9) for the tsl/tmd 2771 and 2772 device families (inc. all variants). Update: Removed bonus lines. Signed-off-by: Jon Brenner <jbrenner@taosinc.com> Acked-by: Jonathan Cameron<jic23@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>