summaryrefslogtreecommitdiff
path: root/drivers/iio/light
AgeCommit message (Collapse)Author
2014-08-26iio: remove .owner field for driver using module_platform_driverSanjeev Sharma
This patch removes the .owner field for drivers which use the platform_driver_register api because this is overriden in _platform_driver_register. Signed-off-by: Sanjeev Sharma <Sanjeev_Sharma@mentor.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2014-07-13Merge 3.16-rc5 into staging-nextGreg Kroah-Hartman
We want the fixes in -rc5 in here as well. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-07iio: Add driver for AMS/TAOS tcs3414 digital color sensorPeter Meerwald
16-bit digital color sensor with red, green, blue and clear channel datasheet: http://ams.com/eng/content/download/250258/975997/TCS3414_Datasheet_EN_v1.pdf Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2014-07-07iio: Add Intersil isl29125 digital color light sensor driverPeter Meerwald
datasheet: http://www.intersil.com/content/dam/Intersil/documents/isl2/isl29125.pdf Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2014-07-07iio:tcs3472: Check for buffer enabled and lockingPeter Meerwald
Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2014-07-05iio: hid-sensor-prox: Fix return valuesSachin Kamat
IIO_CHAN_INFO_SAMP_FREQ and IIO_CHAN_INFO_HYSTERESIS cases ignored the actual return values (which could be -EINVAL) and instead returned IIO_VAL_INT_PLUS_MICRO always. Return the actual value obtained from the functions. Both functions return IIO_VAL_INT_PLUS_MICRO upon success. Signed-off-by: Sachin Kamat <sachin.kamat@samsung.com> Cc: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2014-07-05iio: hid-sensor-als: Fix return valuesSachin Kamat
IIO_CHAN_INFO_SAMP_FREQ and IIO_CHAN_INFO_HYSTERESIS cases ignored the actual return values (which could be -EINVAL) and instead returned IIO_VAL_INT_PLUS_MICRO always. Return the actual value obtained from the functions. Both functions return IIO_VAL_INT_PLUS_MICRO upon success. Signed-off-by: Sachin Kamat <sachin.kamat@samsung.com> Cc: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2014-06-21iio: light: cm32181: Use devm_* APIsBeomho Seo
This patch changes API from iio_device_register() to devm_* API. Using API make code simpler. Signed-off-by: Beomho Seo <beomho.seo@samsung.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2014-06-14iio: Remove timestamp argument from iio_trigger_poll() and ↵Peter Meerwald
iio_trigger_poll_chained() argument has been ignored; adjust drivers accordingly Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2014-05-05iio: hid-sensors: Proximity: Raw read supportSrinivas Pandruvada
Added support for raw reading of channel. If the sensor is powered off, it will turn on for reading value. Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2014-05-05iio: hid-sensors: ALS: Raw read supportSrinivas Pandruvada
Added support for raw reading of channel. If the sensor is powered off, it will turn on for reading value. Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2014-05-05iio: hid-sensors: Add API to power on/offSrinivas Pandruvada
Added an API to allow client drivers to turn ON and OFF sensors for quick read. Added data_read as counting varaible instead of boolean, so that sensor is powered off only when last user released it. Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2014-05-05iio: hid-sensors: ALS: adjust scale and offsetSrinivas Pandruvada
Using units and unit exponent to calculate scale which is compliant to IIO ABI. Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2014-05-03iio: Fix spelling of illuminance in gp2ap020a00f driverPeter Meerwald
Cc: Jacek Anaszewski <j.anaszewski@samsung.com> Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2014-04-23Merge tag 'iio-fixes-for-3.15a' of ↵Greg Kroah-Hartman
git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into staging-linus Jonathan writes: First found of IIO fixes for the 3.15 cycle. * Fix the platform data support for the at91 adc driver. * A couple of related follow up patches get the support working again for at91sam9260 and at91sam9g45 as the earlier patch results in a device name change. * A default timer value in the at91 adc driver was bonkers. Make it sane. * Fix incorrect reporting of the integration time for the cm32181 light sensor * Fix a missing break in the ad2s1200 driver which would have give a false error return. * Make sure buffer scan mask queries from userspace return 0/1 rather than a fairly random value depending on their implementation of test_bit * Fix leak of the i2c client and a null pointer dereference in the cm36651 driver. * Fix a build warning on avr32 for the mxs-lradc (not exactly a critical combination - but the issue was real).
2014-03-22iio: cm36651: Fix i2c client leak and possible NULL pointer dereferenceKrzysztof Kozlowski
During probe the driver allocates dummy I2C devices (i2c_new_dummy()) but they aren't unregistered during driver remove or probe failure. Additionally driver does not check the return value of i2c_new_dummy(). In case of error (i2c_new_device(): memory allocation failure or I2C address cannot be used) this function returns NULL which is later dereferenced by i2c_smbus_{read,write}_data() functions. Fix issues by properly checking for i2c_new_dummy() return value and unregistering I2C devices on driver remove or probe failure. Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com> Acked-by: Beomho Seo <beomho.seo@samsung.com> Cc: stable@vger.kernel.org Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2014-03-15iio: cm32181: Fix read integration time functionBeomho Seo
In read integration time function, assign 0 to val. Because, prevent return inaccurate value when call read integration time. Cc: Stable@vger.kernel.org Cc: Kevin Tsai <ktsai@capellamicro.com> Signed-off-by: Beomho Seo <beomho.seo@samsung.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2014-03-03Merge 3.14-rc5 into staging-nextGreg Kroah-Hartman
We want those fixes in here
2014-02-22iio: hid-sensors: Added Proximity Sensor DriverArchana Patni
Added usage id processing for Proximity (Human Presence). This uses IIO interfaces for triggered buffer to present data to user mode. This uses HID sensor framework for registering callback events from the sensor hub. Signed-off-by: Archana Patni <archana.patni@intel.com> Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2014-02-18iio: cm32181: Change cm32181 ambient light sensor driverBeomho Seo
Integration time of cm32181 is guessed about milliseconds. But cm32181_read_als_it function return IIO_VAL_INT. So fixed to return IIO_VAL_INT_PLUS_MICRO. Next, add .write_raw_get_fmt callback function for call iio_str_to_fixpoint. v2: cm32181_write_als_id function fixed as it was. Cc: Kevin Tsai <ktsai@capellamicro.com> Signed-off-by: Beomho Seo <beomho.seo@samsung.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2014-02-18iio: cm36651: Fix read/write integration time function.Beomho Seo
This patch is fixed [read/write] integration time function. cm36651 have integration time from 1 to 640 milliseconds. But, print more then the thousand second. when call *_integration_time attribute. Because read_integration_time function return IIO_VAL_INT. read integration time function is changed return IIO_VAL_INT_PLUS_MICRO; And then .write_raw_get_fmt callback function for parse a fixed-point number from a string. Some description is revised milliseconds unit. v2: cm36651_write_int_time function fixed as it was. Signed-off-by: Beomho Seo <beomho.seo@samsung.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2014-02-11Merge tag 'iio-for-3.15a' of ↵Greg Kroah-Hartman
git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into staging-next Jonathan writes: First set of new drivers and cleanups for IIO in the 3.15 cycle. New drivers: * si7005 relative humidity and temperature sensor * Lite-on ltr501 ambient light and proximity sensor Cleanups * Clean up some dead comments in max1363 * Drop some obsolete variables in adjd_s311 and tcs3472 left over from the introduction of iio_push_to_buffers_with_timestamp. * Drop some unneeded linux/init.h includes * Squish a sparse warning in mpl3115 by correctly specifying a be32 variable. * A number of cleanups and fixes for sca3000 * Drop an unneed checks in mxs-lradc, ad7303 and adis16400. * Drop a platform_set_drvdata in viperboard after the only use of it was removed during a devm conversion. * Add a missing device name for ak8975 to comply with the ABI. * Put mpu6050 into the IMU menu as it slipped out into the main menu. * Fix a typo and some comment formatting in mpu6050. * Document at91 ADC clock properties.
2014-02-07Merge tag 'iio-fixes-for-3.14a' of ↵Greg Kroah-Hartman
git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into staging-linus Jonathan writes: First set of IIO fixes for the 3.14 cycle. Included is the patch previously set as the fourth round for 3.13 which was to late to be appropriate. * Another endian fix (ad799x adc) due to missuse of the IIO_ST macro (which is going away very shortly) * A reversed error check in ad5933 which will make the probe fail. * A buffer overflow in the example code in the documentation. * ad799x was freeing an irq that might or might not have been requested. * tsl2563 was checking the wrong element of chan_spec for modifiers. Thus some sysfs reads would give the wrong values. * A missing dependency on HAS_IOMEM in spear_adc and lpc32xx was causing some test build failures (on s390 and perhaps elsewhere). I also have a few fixes queued up for things that went in during the 3.14 merge window which will follow as a separate pull request (to avoid rebasing my tree).
2014-01-18iio: tsl2563: Use the correct channel2 memberIvaylo Dimitrov
Use the correct channel2 member instead of channel when dealing with sysfs reads/writes Signed-off-by: Ivaylo Dimitrov <ivo.g.dimitrov.75@gmail.com> Acked-by: Peter Meerwald <pmeerw@pmeerw.net> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2014-01-12iio: Add Lite-On ltr501 ambient light / proximity sensor driverPeter Meerwald
combined ambient light (two channels) and proximity sensor with I2C interface; the ALS channels are visible+IR and IR datasheet is here http://optoelectronics.liteon.com/upload/download/DS86-2012-0006/P_100_LTR-501ALS-01_PrelimDS_ver1.1.pdf v3: * fix use of sizeof in _read_als() v2: (thanks to Lars-Peter Clausen) * cannot use devm_iio_device_register() due to cleanup order in _remove() * mutex around data wait/read * turn info message in _probe() into check for part number * change copyright year to 2014 Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net> Reviewed-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2014-01-11iio: delete non-required instances of include <linux/init.h>Paul Gortmaker
None of these files are actually using any __init type directives and hence don't need to include <linux/init.h>. Most are just a left over from __devinit and __cpuinit removal, or simply due to code getting copied from one driver to the next. Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2014-01-11iio: Remove obsolete variable in tcs3472 driverPeter Meerwald
len variable became obsolete with iio_push_to_buffers_with_timestamp() Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2014-01-11iio: Remove obsolete variable in adjd_s311 driverPeter Meerwald
len variable become obsolete with iio_push_to_buffers_with_timestamp() Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2014-01-01iio: add Capella CM32181 ambient light sensor driver.Kevin Tsai
Add Capella Microsystem CM32181 Ambient Light Sensor IIO driver. This driver will convert raw data to lux value under open-air condition. Change the calibscale based on the cover material. Signed-off-by: Kevin Tsai <ktsai@capellamicro.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-12-24Merge tag 'iio-for-3.14b' of ↵Greg Kroah-Hartman
git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into staging-next Jonathan writes: 2nd round of new IIO drivers, features and cleanups for the 3.14 cycle. New drivers * HID inclinometer driver. * DHT11 humidity driver. Note that previous humidity drivers have been in hwmon, but no one was ever entirely happy with that, and they should find a more comfortable home in IIO (their original placement in hwmon was my fault - oops). As this is our first humidity driver, core support is also added. New features * Two of mxs-lradc channels are internally wired to a temperature sensor, make this explicit in the driver by providing the relevant temperature channel. * Add support for blocking IO on buffers. * Add a data_available call back to the interface between buffer implementations and the core. This is much cleaner than the old, 'stufftoread' flag. Implemented in the kfifo buffer. Cleanups * Last user of the old event configuration interface is converted and the old interface dropped. Nice to be rid of this thanks to Lars-Peter's hard work! * Replace all remaining instances of the IIO_ST macro with explicit filling of the scan_type structure within struct iio_chan_spec. This macro was a bad idea, that rapidly ceased to cover all elements of the structure. Miss reading of the macro arguements has led to a number of bugs so lets just get rid of it. The final removal patch is awaiting for some fixes to make their way into mainline. In a couple of drivers, no elements of scan_type were even being used so in those case, it has been dropped entirely. * Drop a couple of of_match_ptr helper uses in drivers where devicetree is not optional and hence the structures being protected by this always exist. * Fix up some cases where data was read from a device in a particular byte order, but he code placed it into a s16 or similar. These were highlighted by Sparse. * Use the new ATTRIBUTE_GROUPS macro to drop some boiler plate in the triggers core code. * ad7746 and ad7280a - stop storing buffers on the stack, giving cleaner code and possibly avoiding issues with i2c bus drivers that assume they can dma directly into the buffer. Note that this cannot currently happen as the the i2c_smbus_read_i2c_block_data function has a memcpy from the buffer actually passed to the bus driver. I missed this element of the commit message and don't think it is major enough to rebase the iio tree. * ad5791 and ad5504 stop storing buffers on the stack for an SPI driver. Unlike the i2c drivers, this is a real issue for SPI drivers which can dma directly into the buffer supplied.
2013-12-24Merge 3.13-rc5 into staging-nextGreg Kroah-Hartman
This resolves a merge issue with drivers/staging/imx-drm/imx-drm-core.c Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-12-22iio: cm36651: Remove redundant of_match_ptr helperSachin Kamat
'cm36651_of_match' is always compiled in. Hence the helper macro is not needed. Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-12-17iio:light:tcs3472 replaces IIO_ST macro with explicit entries to struct ↵Jonathan Cameron
scan_type IIO_ST is going away as it is a pain to maintain. Signed-off-by: Jonathan Cameron <jic23@kernel.org> Acked-by: Lars-Peter Clausen <lars@metafoo.de>
2013-12-17iio:light:adjd_s311 replaces IIO_ST macro with explicit entries to struct ↵Jonathan Cameron
scan_type IIO_ST is going away as it is a pain to maintain. Signed-off-by: Jonathan Cameron <jic23@kernel.org> Acked-by: Lars-Peter Clausen <lars@metafoo.de>
2013-12-17Merge 3.13-rc4 into staging-next.Greg Kroah-Hartman
We want the fixes in here as well. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-12-15iio: cm36651: Changed return value of read functionBeomho Seo
A return value of callback have been changed to IIO_VAL_INT. If not IIO_VAL_INT, driver will print wrong value(*_read_int_time). A follow up patch will deal with a related bug in the new event handling code. Signed-off-by: Beomho Seo <beomho.seo@samsung.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-12-08iio: Remove support for the legacy event config interfaceLars-Peter Clausen
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-12-08iio:cm36651: Convert to new event config interfaceLars-Peter Clausen
Switch the cm36651 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: Beomho Seo <beomho.seo@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-12-03Merge v3.13-rc2 into staging-nextGreg Kroah-Hartman
we want these fixes in here. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-12-02Fix build failure for gp2ap020a00f.cRussell King - ARM Linux
drivers/built-in.o: In function `gp2ap020a00f_thresh_event_handler': powercap_sys.c:(.text+0x15f90c): undefined reference to `irq_work_queue' make[1]: *** [vmlinux] Error 1 make[1]: Target `uImage' not remade because of errors. make: *** [sub-make] Error 2 make: Target `uImage' not remade because of errors. You need the IRQ work support, but GP2AP020A00F is not selecting this symbol. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk> 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-11-24iio:light:tsl2563: Add DT supportSebastian Reichel
Add Device Tree support for the TSL2563 driver, document the binding and add AMS-TAOS Inc. to the list of vendor prefixes. Signed-off-by: Sebastian Reichel <sre@debian.org> Acked-by: Kumar Gala <galak@codeaurora.org> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-11-09iio: Fix tcs3472 Kconfig dependenciesPeter Meerwald
Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-11-05iio: hid-sensors: light/als : Add sensitivitySrinivas Pandruvada
A number of Properties that can be applied to Data Fields are per data field basis or for all data fields. Adding sensitivity field for all als fields, which is most commonly used in currently available sensor hubs. Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-11-02iio: hid_Sensors: fix crash during trigger unregisterSrinivas Pandruvada
We can't store the trigger instance created by iio_trigger_alloc, in trig field of iio_device structure. This needs to be stored in the driver private data. Othewise it can result in crash during module unload. Hence created a trig_ptr in the common data structure for each HID sensor IIO driver and storing here. Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-10-24iio: light: vcnl4000: Remove redundant codeSachin 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-10-18iio: light: gp2ap020a00f: Include linux/of.h headerSachin Kamat
'of_match_ptr' is defined in linux/of.h. Include it explicitly to avoid build breakage in the future. Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-10-17iio: cm36651: Add CM36651 proximity/light sensorBeomho Seo
This patch adds a new driver for Capella CM36651 proximity and RGB sensor. Signed-off-by: Beomho Seo <beomho.seo@samsung.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-10-16iio:gp2ap020a00f: Remove redundant call to iio_sw_buffer_preenable()Lars-Peter Clausen
The equivalent of iio_sw_buffer_preenable() is now done in the IIO buffer core, so there is no need to do this from the driver anymore. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Cc: Jacek Anaszewski <j.anaszewski@samsung.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>