aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/iio/light (follow)
AgeCommit message (Collapse)AuthorFilesLines
2013-09-03Merge tag 'staging-3.12-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/stagingLinus Torvalds8-99/+583
Pull staging tree merge from Greg KH: "Here's the bit staging tree pull request for 3.12-rc1. Lots of staging driver updates, and fixes. Lustre is finally enabled in the build, and lots of cleanup started happening in it. There's a new wireless driver in here, and 2 new TTY drivers, which cause the overall lines added/removed to be quite large on the "added" side. The IIO driver updates are also coming through here, as they are tied to the staging iio drivers" * tag 'staging-3.12-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging: (942 commits) staging: dwc2: make dwc2_core_params documentation more complete staging: dwc2: validate the value for phy_utmi_width staging: dwc2: interpret all hwcfg and related register at init time staging: dwc2: properly mask the GRXFSIZ register staging: dwc2: remove redundant register reads staging: dwc2: re-use hptxfsiz variable staging: dwc2: simplify debug output in dwc_hc_init staging: dwc2: add missing shift staging: dwc2: simplify register shift expressions staging: dwc2: only read the snpsid register once staging: dwc2: unshift non-bool register value constants staging: dwc2: fix off-by-one in check for max_packet_count parameter staging: dwc2: remove specific fifo size constants Staging:BCM:DDRInit.c:Renaming __FUNCTION__ staging: bcm: remove Version.h file. staging: rtl8188eu: off by one in rtw_set_802_11_add_wep() staging: r8188eu: copying one byte too much staging: rtl8188eu: || vs && typo staging: r8188eu: off by one bugs staging: crystalhd: Resolve sparse 'different base types' warnings. ...
2013-08-19iio: adjd_s311: Cleanup unused #definesPeter Meerwald1-18/+10
using word reads, no need for HI/LO register #defines Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-08-19iio: Remove unnecessary _write_raw_get_fmt() in several hid-sensor driversPeter Meerwald1-8/+0
IIO_VAL_INT_PLUS_MICRO is the default, no need to return it explicitly Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net> Acked-by: srinivas pandruvada <srinivas.pandruvada@intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-08-19iio: adjd_s311: Fix non-scan mode data readPeter Meerwald1-1/+2
forgot to convert channel index to data register Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-08-03iio:vcnl4000: Use devm_iio_device_allocPeter Meerwald1-12/+4
Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-08-03iio:adjd_s311: Use devm_iio_device_allocPeter Meerwald1-10/+5
Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-08-03iio: light: tsl2563: Use devm_* APIsSachin Kamat1-17/+8
devm_* APIs are device managed and make code simpler. Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Reviewed-by: Amit Kucheria <amit.kucheria@linaro.org> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-08-03iio: light: lm3533-als: Use devm_iio_device_allocSachin Kamat1-5/+2
Using devm_iio_device_alloc makes code simpler. Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Cc: Johan Hovold <jhovold@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-08-03iio: light: hid-sensor-als: Use devm_iio_device_allocSachin Kamat1-12/+5
Using devm_iio_device_alloc makes code simpler. Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Cc: Srinivas Pandruvada <srinivas.pandruvada@intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-08-03iio: add APDS9300 ambilent light sensor driverOleksandr Kravchenko3-0/+523
This patch adds IIO driver for APDS9300 ambient light sensor (ALS). http://www.avagotech.com/docs/AV02-1077EN The driver allows to read raw data from ADC registers or calculate lux value. It also can handle threshold interrupt. Signed-off-by: Oleksandr Kravchenko <o.v.kravchenko@globallogic.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-08-03iio: Add a comment to about alphabetical order to Kconfigs and MakefilesLars-Peter Clausen2-12/+15
Keeping Makefile and Kconfig entries in alphabetical order usually works better than just appending new entries at the end, since it reduces the amount of conflicts. This patch adds a comment to the IIO Kconfig and Makefile files to document that the entries should be kept in alphabetical order. Also reorder those entries which weren't in alphabetical order yet. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-08-03iio: hid-sensor-als: add module alias for autoloadAlexander Holler1-5/+11
Add a MODULE_DEVICE_TABLE in order to let hotplug mechanisms automatically load the driver. This makes it also possible to use the usual driver name instead of HID-SENSOR-2000xx which isn't very descriptive in kernel messages. Signed-off-by: Alexander Holler <holler@ahsoftware.de> Acked-by:Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-05-22iio: Correct HID light sensor name in commentsAlexandre Relange1-1/+1
The original driver was pasted from accelerometer driver, but the name of the ID was not changed. This patch fixes this comment. Signed-off-by: Alexandre Relange <alexandre@relange.org> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-03-17iio:light:vcnl4000 move to info_mask_(shared_by_type/separate)Jonathan Cameron1-3/+3
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-03-17iio:light:tsl2563 move to info_mask_(shared_by_type/separate)Jonathan Cameron1-5/+5
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 <jbrenner@taosinc.com>
2013-03-17iio:light:lm3533 move to info_mask_(shared_by_type/separate)Jonathan Cameron1-3/+3
The original info_mask is going away in favour of the broken out versions. Signed-off-by: Jonathan Cameron <jic23@kernel.org> cc: Johan Hovold <jhovold@gmail.com>
2013-03-17iio:light:adjd_s311 move to info_mask_(shared_by_type/separate)Jonathan Cameron1-2/+2
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-03-17iio:hid_sensors move to info_mask_(shared_by_type/separate)Jonathan Cameron1-4/+4
The original info_mask is going away in favour of the broken out versions. Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-01-27iio:light:tsl2563 move out of stagingJonathan Cameron3-0/+898
This driver is simple, uses the latest interfaces and contains few if any controversial elements. All of its interfaces have been in place for a long time now. Hence let's move it out of staging. Signed-off-by: Jonathan Cameron <jic23@kernel.org> Acked-by: Peter Meerwald <pmeerw@pmeerw.net>
2013-01-25Merge 3.8-rc5 into staging-nextGreg Kroah-Hartman4-20/+19
This resolves a merge issue with a iio driver, and the zram code. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-01-14Merge tag 'staging-3.8-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/stagingLinus Torvalds1-0/+1
Pull staging fixes from Greg Kroah-Hartman: "Here are a number of small fixes to staging drivers for your 3.8-rc3 tree. Well, the omapdrm fixes aren't really "small" but they were waiting on a number of other drm patches to go in through the drm tree, and got delayed by my vacation over the holidays. They are totally self-contained, everyone involved have acked them, and they fix issues that people have been having with the driver. Other than that one, it's a bunch of tiny bugfixes for a number of reported issues. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>" * tag 'staging-3.8-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging: (36 commits) staging: zram: fix invalid memory references during disk write staging: tidspbridge: use prepare/unprepare on dsp clocks staging: tidspbridge: Fix build breakage due to splitting CM functions. staging: comedi: comedi_test: fix race when cancelling command staging: comedi: Kconfig: COMEDI_NI_AT_A2150 should select COMEDI_FC staging: comedi: prevent auto-unconfig of manually configured devices staging: comedi: fix minimum AO period for NI 625x and NI 628x staging: vme_pio2: fix oops on module unloading staging: speakup: avoid out-of-range access in synth_add() staging: speakup: avoid out-of-range access in synth_init() staging: rtl8192e: Fix failure to check pci_map_single() staging: rtl8187se: Fix failure to check pci_map_single() staging: drm/imx: fix double free bug in error path staging: drm/imx: several bug fixes staging: drm/imx: check return value of ipu_reset() staging: drm/omap: fix flags in dma buf exporting staging: drm/omap: use omapdss low level API staging/fwserial: Update TODO file per reviewer comments staging/fwserial: Limit tx/rx to 1394-2008 spec maximum staging/fwserial: Refine Kconfig help text ...
2013-01-07Merge branch 'staging-linus' into staging-nextGreg Kroah-Hartman1-0/+1
This is to get the comedi fixes, and resolve the issue in comdi_test.c and comedi_fops.c that were caused by changes in both branches. It also allows the fwserial driver changes to be applied, as they required the fixes that are in staging-linus. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-01-06hid: iio: rename struct hid_sensor_iio_common to hid_sensor_commonAlexander Holler1-1/+1
The structure with common attributes for hid-sensors isn't specific to the iio-subsystem, so rename it to hid_sensor_common. Signed-off-by: Alexander Holler <holler@ahsoftware.de> Acked-by: Jiri Kosina <jkosina@suse.cz> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-01-06iio: merge hid-sensor-attributes.h into hid-sensor-hub.hAlexander Holler1-1/+0
The stuff in hid-sensor-attributes.h is needed by every piece which uses hid-sensor-hub and merging it into hid-sensor-hub.h makes it accessible from outside the iio subdirectory. Signed-off-by: Alexander Holler <holler@ahsoftware.de> Acked-by: Jiri Kosina <jkosina@suse.cz> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-01-03Drivers: iio: remove __dev* attributes.Greg Kroah-Hartman4-20/+19
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-12-27iio: hid-sensors: respect CONFIG_IIO_TRIGGERAlexander Holler1-0/+1
Not much to say, without that change, hid-sensor-trigger will be always compiled if HID_SENSOR_IIO_COMMON is selected which fails if CONFIG_IIO_TRIGGER is not set because CONFIG_IIO_CONSUMERS_PER_TRIGGER will not be defined. Signed-off-by: Alexander Holler <holler@ahsoftware.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-11-17iio: hid-sensor: Return proper error if kmemdup failsAxel Lin1-3/+2
Return -ENOMEM instead of 0 if kmemdup fails. Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-11-10staging:iio: Add support for multiple buffersJonathan Cameron2-16/+2
Route all buffer writes through the demux. Addition or removal of a buffer results in tear down and setup of all the buffers for a given device. Signed-off-by: Jonathan Cameron <jic23@kernel.org> Tested-by: srinivas pandruvada <srinivas.pandruvada@intel.com>
2012-09-08iio: Drop timestamp parameter from buffer store_to callbackLars-Peter Clausen2-3/+2
Drop timestamp parameter from buffer store_to callback and subsequently from iio_push_to_buffer. The timestamp parameter is unused and it seems likely that it will stay unused in the future, so it should be safe to remove it. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-09-07staging:iio: hid-sensors Use iio_push_to_bufferJonathan Cameron1-1/+1
Consistently use iio_push_to_buffer instead of manually calling the buffers store_to callback. These crossed with Lars-Peter's patch set doing every other case. Signed-off-by: Jonathan Cameron <jic23@kernel.org> Acked-by: srinivas pandruvada <srinivas.pandruvada@intel.com>
2012-09-06iio: hid-sensors: Added ALSsrinivas pandruvada3-0/+397
Added usage id processing for ALS. 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: srinivas pandruvada <srinivas.pandruvada@intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-08-16iio: lm3533-als: Fix build warningsAxel Lin1-2/+2
Fix below build warnings: CC [M] drivers/iio/light/lm3533-als.o drivers/iio/light/lm3533-als.c:667:8: warning: initialization from incompatible pointer type [enabled by default] drivers/iio/light/lm3533-als.c:667:8: warning: (near initialization for 'dev_attr_in_illuminance0_thresh_either_en.show') [enabled by default] drivers/iio/light/lm3533-als.c:667:8: warning: initialization from incompatible pointer type [enabled by default] drivers/iio/light/lm3533-als.c:667:8: warning: (near initialization for 'dev_attr_in_illuminance0_thresh_either_en.store') [enabled by default] Signed-off-by: Axel Lin <axel.lin@gmail.com>
2012-08-16iio/adjd_s311: Fix potential memory leak in adjd_s311_update_scan_mode()Alexey Khoroshilov1-3/+4
Do not leak memory by updating pointer with potentially NULL realloc return value. There is no need to preserve data in the buffer, so replace krealloc() by kfree()-kmalloc() pair. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru> Acked-by: Peter Meerwald <pmeerw@pmeerw.net> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-07-15iio: fix pointer cast warningPeter Meerwald1-1/+1
fix compile warning reported by Fengguang Wu: drivers/iio/light/adjd_s311.c: In function 'adjd_s311_trigger_handler': drivers/iio/light/adjd_s311.c:188:12: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast] drivers/iio/light/adjd_s311.c:188:4: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] 185 } 186 187 if (indio_dev->scan_timestamp) > 188 *(s64 *)((phys_addr_t)data->buffer + ALIGN(len, sizeof(s64))) 189 = time_ns; 190 iio_push_to_buffer(buffer, (u8 *)data->buffer, time_ns); 191 Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net> Reported-by: Fengguang Wu <fengguang.wu@intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-07-12iio: add adjd_s311 I2C digital color sensor driverPeter Meerwald3-0/+377
sensor has 4 channels (10-bit each, R/G/B and clear), sensitivity and gain is controlled in the driver by ext_info integration_time and CHAN_INFO_HARDWAREGAIN driver supports triggered buffer and IIO_CHAN_INFO_RAW to get the sensor data v5: address comments by Jonathan Cameron * use macro for channel declaration * get timestamp right before measurement * cleanups v4: address comments by Lars-Peter Clausen * make sure trigger handler is exited with iio_trigger_notify_done() and IRQ_HANDLED * kfree()/kalloc() -> krealloc() v3: * fix warnings v2: address comments by Lars-Peter Clausen * buffer allocation now in update_scan_mode instead of in trigger handler * simplify trigger code (assume active_scan_mask is not empty, use for_each_set_bit, use iio_push_to_buffer) * reorder entry in Makefile and Kconfig * fix remove Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-06-20iio: add vcnl4000 combined ALS and proximity sensorPeter Meerwald3-0/+229
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>
2012-06-04iio: add LM3533 ambient-light-sensor driverJohan Hovold3-0/+959
Add sub-driver for the ambient-light-sensor interface on National Semiconductor / TI LM3533 lighting power chips. The sensor interface can be used to control the LEDs and backlights of the chip through defining five light zones and three sets of corresponding output-current values. The driver provides raw and mean adc readings along with the current light zone through sysfs. A threshold event can be generated on zone changes. The ALS-control output values can be set per zone for the three current output channels. Signed-off-by: Johan Hovold <jhovold@gmail.com> Acked-by: Jonathan Cameron <jic23@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>