summaryrefslogtreecommitdiff
path: root/drivers/iio/light/vcnl4000.c
AgeCommit message (Collapse)Author
2020-06-11iio: vcnl4000: Fix i2c swapped word reading.Mathieu Othacehe
[ Upstream commit 18dfb5326370991c81a6d1ed6d1aeee055cb8c05 ] The bytes returned by the i2c reading need to be swapped unconditionally. Otherwise, on be16 platforms, an incorrect value will be returned. Taking the slow path via next merge window as its been around a while and we have a patch set dependent on this which would be held up. Fixes: 62a1efb9f868 ("iio: add vcnl4000 combined ALS and proximity sensor") Signed-off-by: Mathieu Othacehe <m.othacehe@gmail.com> Cc: <Stable@vger.kernel.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
2015-07-11iio: Drop owner assignment from i2c_driverKrzysztof Kozlowski
i2c_driver does not need to set an owner because i2c_register_driver() will set it. Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-12-03iio:vcnl4000: Mark transfer buffer as __be16Lars-Peter Clausen
Fixes the following warnings from sparse: drivers/iio/light/vcnl4000.c:88:16: warning: cast to restricted __be16 drivers/iio/light/vcnl4000.c:88:16: warning: cast to restricted __be16 drivers/iio/light/vcnl4000.c:88:16: warning: cast to restricted __be16 drivers/iio/light/vcnl4000.c:88:16: warning: cast to restricted __be16 Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Cc: Peter Meerwald <pmeerw@pmeerw.net> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-11-24iio: light: vcnl4000: Use devm_iio_device_registerSachin Kamat
devm_iio_device_register simplifies the code. Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-10-24iio: light: vcnl4000: Remove redundant codeiio-for-3.13eSachin Kamat
The if check is redundant as the value obtained from iio_device_register() is already in the required format. Hence return the function directly. Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-08-03iio:vcnl4000: Use devm_iio_device_allocPeter Meerwald
Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-03-17iio:light:vcnl4000 move to info_mask_(shared_by_type/separate)Jonathan Cameron
The original info_mask is going away in favour of the broken out versions. Signed-off-by: Jonathan Cameron <jic23@kernel.org> cc: Peter Meerwald <pmeerw@pmeerw.net>
2013-01-03Drivers: iio: remove __dev* attributes.Greg Kroah-Hartman
CONFIG_HOTPLUG is going away as an option. As a result, the __dev* markings need to be removed. This change removes the use of __devinit, __devexit_p, and __devexit from these drivers. Based on patches originally written by Bill Pemberton, but redone by me in order to handle some of the coding style issues better, by hand. Cc: Bill Pemberton <wfp5p@virginia.edu> Cc: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-06-20iio: add vcnl4000 combined ALS and proximity sensorPeter Meerwald
minimal driver, no IR current control and proximity/event handling yet v5: * checkpatch warnings * increase msleep() to 20 ms when waiting for data ready as measurement/conversion can take up to 100 ms, 1 ms is too short v4 (address comments by Jonathan Cameron) * remove SENSORS_ prefix in Kconfig * change from IIO_INTENSITY to IIO_LIGHT * move from staging v3 (address comments by Shubhrajyoti Datta) * cleanup Kconfig entry * call I2C read/write functions directly v2 (address comments by Lars-Peter Clausen and Jonathan Cameron) * unify code for reading PS and AL data into parameterized _measure() function * limit wait for data to become ready within 20 tries * drop IIO_LIGHT channel, add SCALE to IIO_INTENSITY * drop extra string arguments used for logging purpose only Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net> Acked-by: Jonathan Cameron <jic23@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>