summaryrefslogtreecommitdiff
path: root/drivers/iio
AgeCommit message (Collapse)Author
2015-04-14Merge branch 'for-linus' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial Pull trivial tree from Jiri Kosina: "Usual trivial tree updates. Nothing outstanding -- mostly printk() and comment fixes and unused identifier removals" * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial: goldfish: goldfish_tty_probe() is not using 'i' any more powerpc: Fix comment in smu.h qla2xxx: Fix printks in ql_log message lib: correct link to the original source for div64_u64 si2168, tda10071, m88ds3103: Fix firmware wording usb: storage: Fix printk in isd200_log_config() qla2xxx: Fix printk in qla25xx_setup_mode init/main: fix reset_device comment ipwireless: missing assignment goldfish: remove unreachable line of code coredump: Fix do_coredump() comment stacktrace.h: remove duplicate declaration task_struct smpboot.h: Remove unused function prototype treewide: Fix typo in printk messages treewide: Fix typo in printk messages mod_devicetable: fix comment for match_flags
2015-04-14Merge branch 'for-linus' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid Pull HID updates from Jiri Kosina: - quite a few firmware fixes for RMI driver by Andrew Duggan - huion and uclogic drivers have been substantially overlaping in functionality laterly. This redundancy is fixed by hid-huion driver being merged into hid-uclogic; work done by Benjamin Tissoires and Nikolai Kondrashov - i2c-hid now supports ACPI GPIO interrupts; patch from Mika Westerberg - Some of the quirks, that got separated into individual drivers, have historically had EXPERT dependency. As HID subsystem matured (as well as the individual drivers), this made less and less sense. This dependency is now being removed by patch from Jean Delvare - Logitech lg4ff driver received a couple of improvements for mode switching, by Michal Malý - multitouch driver now supports clickpads, patches by Benjamin Tissoires and Seth Forshee - hid-sensor framework received a substantial update; namely support for Custom and Generic pages is being added; work done by Srinivas Pandruvada - wacom driver received substantial update; it now supports i2c-conntected devices (Mika Westerberg), Bamboo PADs are now properly supported (Benjamin Tissoires), much improved battery reporting (Jason Gerecke) and pen proximity cleanups (Ping Cheng) - small assorted fixes and device ID additions * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid: (68 commits) HID: sensor: Update document for custom sensor HID: sensor: Custom and Generic sensor support HID: debug: fix error handling in hid_debug_events_read() Input - mt: Fix input_mt_get_slot_by_key HID: logitech-hidpp: fix error return code HID: wacom: Add support for Cintiq 13HD Touch HID: logitech-hidpp: add a module parameter to keep firmware gestures HID: usbhid: yet another mouse with ALWAYS_POLL HID: usbhid: more mice with ALWAYS_POLL HID: wacom: set stylus_in_proximity before checking touch_down HID: wacom: use wacom_wac_finger_count_touches to set touch_down HID: wacom: remove hardcoded WACOM_QUIRK_MULTI_INPUT HID: pidff: effect can't be NULL HID: add quirk for PIXART OEM mouse used by HP HID: add HP OEM mouse to quirk ALWAYS_POLL HID: wacom: ask for a in-prox report when it was missed HID: hid-sensor-hub: Fix sparse warning HID: hid-sensor-hub: fix attribute read for logical usage id HID: plantronics: fix Kconfig default HID: pidff: support more than one concurrent effect ...
2015-04-13Merge tag 'staging-4.1-rc1' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging Pull staging driver updates from Greg KH: "Here's the big staging driver patchset for 4.1-rc1. There's a lot of patches here, the Outreachy application period happened during this development cycle, so that means that there was a lot of cleanup patches accepted. Other than the normal coding style and sparse fixes here, there are some driver updates and work toward making some of the drivers into "mergable" shape (like the Unisys drivers.) All of these have been in linux-next for a while" * tag 'staging-4.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging: (1214 commits) staging: lustre: orthography & coding style staging: lustre: lnet: lnet: fix error return code staging: lustre: fix sparse warning Revert "Staging: sm750fb: Fix C99 Comments" Staging: rtl8192u: use correct array for debug output staging: rtl8192e: Remove dead code staging: rtl8192e: Comment cleanup (style/format) staging: rtl8192e: Fix indentation in rtllib_rx_auth_resp() staging: rtl8192e: Decrease nesting of rtllib_rx_auth_resp() staging: rtl8192e: Divide rtllib_rx_auth() staging: rtl8192e: Fix PRINTK_WITHOUT_KERN_LEVEL warnings staging: rtl8192e: Fix DO_WHILE_MACRO_WITH_TRAILING_SEMICOLON warning staging: rtl8192e: Fix BRACES warning staging: rtl8192e: Fix LINE_CONTINUATIONS warning staging: rtl8192e: Fix UNNECESSARY_PARENTHESES warnings staging: rtl8192e: remove unused EXPORT_SYMBOL_RSL macro staging: rtl8192e: Fix RETURN_VOID warnings staging: rtl8192e: Fix UNNECESSARY_ELSE warning staging: rtl8723au: Remove unneeded comments staging: rtl8723au: Use __func__ in trace logs ...
2015-04-13Merge tag 'for-v4.1' of git://git.infradead.org/battery-2.6Linus Torvalds
Pull power supply and reset changes from Sebastian Reichel: - new API for safe access of power supply function attrs - devres support for power supply (un)registration - new drivers / chips: - generic syscon based poweroff driver - iio & charger driver for da9150 - fuel gauge driver for axp288 - bq27x00: add support for bq27510 - bq2415x: add support for bq24157s - twl4030-madc-battery: convert to iio consumer - misc fixes * tag 'for-v4.1' of git://git.infradead.org/battery-2.6: (66 commits) power: twl4030_madc_battery: Add missing MODULE_ALIAS power: twl4030-madc-battery: Convert to iio consumer. dt: power: Add docs for generic SYSCON poweroff driver. power: reset: Add generic SYSCON register mapped poweroff. power: max17042_battery: add missed blank power: max17042_battery: Use reg type instead of chip type power/reset: at91: big endian fixes for atsama5d3x power_supply: charger-manager: Fix dereferencing of ERR_PTR HID: input: Fix NULL pointer dereference when power_supply_register fails power: constify of_device_id array power/reset/rmobile-reset.c: Fix !HAS_IOMEM build power_supply: 88pm860x_charger: Fix possible NULL pointer dereference and use of initialized variable arm: mach-pxa: Decrement the power supply's device reference counter mfd: ab8500: Decrement the power supply's device reference counter power_supply: bq2415x_charger: Decrement the power supply's device reference counter power_supply: 88pm860x_charger: Decrement the power supply's device reference counter x86/olpc/xo15/sci: Use newly added power_supply_put API x86/olpc/xo1/sci: Use newly added power_supply_put API power_supply: charger-manager: Decrement the power supply's device reference counter power_supply: Increment power supply use counter when obtaining references ...
2015-04-13Merge branch 'for-4.1/sensor-hub' into for-linusJiri Kosina
Conflicts: drivers/iio/common/hid-sensors/hid-sensor-trigger.c include/linux/hid-sensor-hub.h
2015-04-07Merge 4.0-rc7 into staging-nextGreg Kroah-Hartman
We want those fixes (iio primarily) into the -next branch to help with merge and testing issues. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-04-02iio: light: ltr501: Powerdown device on errorCristina Opriceana
Power down device when an error occurs in order to avoid wasting power. Move powerdown function up to be seen by the new call and align parameters for the ltr501_write_contr() call. Signed-off-by: Cristina Opriceana <cristina.opriceana@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-04-01iio: magnetometer: mag3110: Place driver on standby on errorCristina Opriceana
Place driver on standby mode on error in order to prevent wasting power. Move standby function above to be seen by the new call. Signed-off-by: Cristina Opriceana <cristina.opriceana@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-29iio: mlx90614: Support devices with dual IR sensorVianney le Clément de Saint-Marcq
The model is detected by reading the EEPROM configuration during probing. Signed-off-by: Vianney le Clément de Saint-Marcq <vianney.leclement@essensium.com> Cc: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2015-03-29iio: mlx90614: Add symbols for accessible registersVianney le Clément de Saint-Marcq
Add symbols for all accessible RAM and EEPROM registers, as well as the sleep command and timings defined in the datasheet. Signed-off-by: Vianney le Clément de Saint-Marcq <vianney.leclement@essensium.com> Cc: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2015-03-29iio: bmc150_accel: add support for hardware fifoOctavian Purdila
We only advertise hardware fifo support if the I2C bus supports full I2C or smbus I2C block data reads since it is mandatory to read the full frame in one read (otherwise the rest of the frame is discarded). The hardware fifo is enabled only when triggers are not active because: (a) when using the any-motion trigger the user expects to see samples based on ROC events, but the fifo stores samples based on the sample frequency (b) the data-ready trigger is waking the CPU for for every sample, so using the hardware fifo does not have any benefit Signed-off-by: Octavian Purdila <octavian.purdila@intel.com> Reviewed-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2015-03-29iio: add support for hardware fifoOctavian Purdila
Some devices have hardware buffers that can store a number of samples for later consumption. Hardware usually provides interrupts to notify the processor when the FIFO is full or when it has reached a certain watermark level. This helps with reducing the number of interrupts to the host processor and thus it helps decreasing the power consumption. This patch enables usage of hardware FIFOs for IIO devices in conjunction with software device buffers. When the hardware FIFO is enabled the samples are stored in the hardware FIFO. The samples are later flushed to the device software buffer when the number of entries in the hardware FIFO reaches the hardware watermark or when a flush operation is triggered by the user when doing a non-blocking read on an empty software device buffer. In order to implement hardware FIFO support the device drivers must implement the following new operations: setting and getting the hardware FIFO watermark level, flushing the hardware FIFO to the software device buffer. The device must also expose information about the hardware FIFO such it's minimum and maximum watermark and if necessary a list of supported watermark values. Finally, the device driver must activate the hardware FIFO when the device buffer is enabled, if the current device settings allows it. The software device buffer watermark is passed by the IIO core to the device driver as a hint for the hardware FIFO watermark. The device driver can adjust this value to allow for hardware limitations (such as capping it to the maximum hardware watermark or adjust it to a value that is supported by the hardware). It can also disable the hardware watermark (and implicitly the hardware FIFO) it this value is below the minimum hardware watermark. Since a driver may support hardware FIFO only when not in triggered buffer mode (due to different semantics of hardware FIFO sampling and triggered sampling) this patch changes the IIO core code to allow falling back to non-triggered buffered mode if no trigger is enabled. Signed-off-by: Octavian Purdila <octavian.purdila@intel.com> Reviewed-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2015-03-29iio: add watermark logic to iio read and pollJosselin Costanzi
Currently the IIO buffer blocking read only wait until at least one data element is available. This patch makes the reader sleep until enough data is collected before returning to userspace. This should limit the read() calls count when trying to get data in batches. Co-author: Yannick Bedhomme <yannick.bedhomme@mobile-devices.fr> Signed-off-by: Josselin Costanzi <josselin.costanzi@mobile-devices.fr> [rebased and remove buffer timeout] Signed-off-by: Octavian Purdila <octavian.purdila@intel.com> Reviewed-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2015-03-28iio: imu: Use iio_trigger_get for indio_dev->trig assignmentDarshana Padmadas
This patch uses iio_trigger_get to increment the reference count of trigger device, to avoid incorrect assignment. Can result in a null pointer dereference during removal if the trigger has been changed before removal. This patch refers to a similar situation encountered through the following discussion: http://www.spinics.net/lists/linux-iio/msg13669.html Signed-off-by: Darshana Padmadas <darshanapadmadas@gmail.com> Cc: <Stable@vger.kernel.org> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2015-03-28iio: adc: vf610: use ADC clock within specificationStefan Agner
Depending on conversion mode used, the ADC clock (ADCK) needs to be below a maximum frequency. According to Vybrid's data sheet this is 20MHz for the low power conversion mode. The ADC clock is depending on input clock, which is the bus clock by default. Vybrid SoC are typically clocked at at 400MHz or 500MHz, which leads to 66MHz or 83MHz bus clock respectively. Hence, a divider of 8 is required to stay below the specified maximum clock of 20MHz. Due to the different bus clock speeds, the resulting sampling frequency is not static. Hence use the ADC clock and calculate the actual available sampling frequency dynamically. This fixes bogous values observed on some 500MHz clocked Vybrid SoC. The resulting value usually showed Bit 9 being stuck at 1, or 0, which lead to a value of +/-512. Signed-off-by: Stefan Agner <stefan@agner.ch> Acked-by: Fugang Duan <B38611@freescale.com> Cc: <Stable@vger.kernel.org> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2015-03-28iio/adc/cc10001_adc.c: Fix !HAS_IOMEM buildRichard Weinberger
Fixes: drivers/built-in.o: In function `cc10001_adc_probe': cc10001_adc.c:(.text+0x412e92): undefined reference to `devm_ioremap_resource' Signed-off-by: Richard Weinberger <richard@nod.at> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2015-03-28IIO: Add support for L3GD20H gyroscopeRobert Dolca
It can be used exactly like L3GD20 but it has a different WhoAmI register value. Signed-off-by: Robert Dolca <robert.dolca@intel.com> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2015-03-28iio: max517: Add support for MAX520 and MAX521 chips.Antonio Fiol
MAX520 and MAX521 are protocol-compatible with the already supported chips, just have more channels. Signed-off-by: Antonio Fiol <antonio@fiol.es> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2015-03-28iio: constify of_device_id arrayFabian Frederick
of_device_id is always used as const. (See driver.of_match_table and open firmware functions) Signed-off-by: Fabian Frederick <fabf@skynet.be> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2015-03-28iio: st-sensors: add support for lis3lv02d accelerometerLinus Walleij
This adds support for the LIS3LV02 accelerometer found in the ST Microelectronics Nomadik board series. Cc: devicetree@vger.kernel.org Cc: Denis CIOCCA <denis.ciocca@st.com> Acked-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2015-03-24Merge tag 'iio-for-4.1a' 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, cleanups and functionality for IIO in the 4.1 cycle. New drivers * CM3323 color sensor. * MS5611 pressure and temperature sensor. New functionality * mup6050 - create mux clients for devices described via ACPI. The reasoning and approach taken in this patch are complex. Basically there is no otherway of finding out what is there than by some esoteric look ups in the ACPI data. * cm3232 - PM support * itg3200 - suspend/resume support * mcp320x - add more ADCs to the kconfig to reflect what the driver supports (this patch and the bindings got left behind when the support was added a while back). Docs / utils * ti-adc128s052 - DT bindings. * mcp3422 - DT bindings. * mcp320x - DT bindings * ABI docs for event threshold scale attributes, in_magn_offset, proximity scan_element and thresh falling/rising values for accelerometers. All elements long in use that have slipped by being explicitly documented. * Tidy up the tools previously in drivers/staging/iio/Documentation and move them out to /tools/iio. Yet another move that should have happened long ago. This time Roberta Dobrescu did the leg work. Thanks! Core Cleanups * Export userspace IIO headers. We should have done the appropriate header splitting a long time ago. Thanks to Daniel for sorting this out. * Refactor the registring of attributes for buffers to move all non-custom ones to a vector allowing easier additions to the current set in the future. Driver Cleanups * gpiod related cleanups. Make use of the additional parameter to specify initial direciton to avoid extra code. * bmc150 - Various refactorings to reduce code repitition and prepare for hardware buffer support. Some of these cleanups are good even without the new functionality. * kmx61 - direct use of index to an array avoiding a structure element which was always the index to an element in an array of that structure. * vf610 - avoid incorrect type for return from wait_for_completion_timeout. * gp2ap020a00f - use put_unaligned_le32 for slight code simplification. * ade7754 - improve error handling including suppressing some build warnings. * ade7759 - improve error handling including suppressing some build warnings. * hmc5843 - Long line and indentation fixes. Also some constifying of various constant data. * ade7854 - 80+ character line splitting. * ad2s1210 - fix wrong printf format string. * mxs-lradc - fix wrong printf format string. * ade7954-i2c - code alignment fixes and other trivial but worthwhile bits. * periodic rtc trigger - make the frequency type an unsigned int as it is always treated as such. * jsa1212 - constify struct regmap_config as it is constant. * ad7793 - typo in the MODULE_DESCRIPTION * mma9551 - check gpiod_to_irq errors. Note that this doesn't actually cause any trouble but is worth tidying up as obviously incorrect. * mlx90614 - refactor the register symbols to make it clear which reads are to RAM not PROM.
2015-03-15iio: pressure: add support for MS5611 pressure and temperature sensorTomasz Duszynski
Add support for Measurement Specialities MS5611 pressure and temperature sensor. Signed-off-by: Tomasz Duszynski <tduszyns@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2015-03-15iio: light: Add support for Capella CM3323 color sensorDaniel Baluta
Minimal implementation providing raw light intensity and integration time attribute. Userspace applications can use GREEN channel for raw illuminance readings following this table: Integration Time | G Sensitivity ================================ 40 ms | 0.18 80 ms | 0.09 160 ms | 0.045 320 ms | 0.0225 640 ms | 0.01125 1280 ms | 0.005625 Signed-off-by: Daniel Baluta <daniel.baluta@intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2015-03-14iio: bmc150: introduce bmc150_accel_triggerOctavian Purdila
Add a separate structure for triggers and add the infrastructure to support an arbitrary number of triggers. Each trigger is associated with an interrupt and has an enabled/disabled state. Signed-off-by: Octavian Purdila <octavian.purdila@intel.com> Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2015-03-14iio: bmc150: introduce bmc150_accel_interruptOctavian Purdila
Since both triggers and events can share an interrupt, add a data structure that tracks the users of an interrupt so that it enables or disables it only for the first users and respectively last user. This will allows us to easily add more events or triggers. The patch also adds an interrupt enabled counter, so that we can easily know if we need to put the device in normal mode when the resume callback is issued. Signed-off-by: Octavian Purdila <octavian.purdila@intel.com> Reviewed-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2015-03-14iio: core: Fix double free.Martin Fuzzey
When an error occurred during event registration memory was freed twice resulting in kernel memory corruption and a crash in unrelated code. The problem was caused by iio_device_unregister_eventset() iio_device_unregister_sysfs() being called twice, once on the error path and then again via iio_dev_release(). Fix this by making these two functions idempotent so they may be called multiple times. The problem was observed before applying 78b33216 iio:core: Handle error when mask type is not separate Signed-off-by: Martin Fuzzey <mfuzzey@parkeon.com> Cc: <Stable@vger.kernel.org> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2015-03-14iio:inv-mpu6050: Fix inconsistency for the scale channelAdriana Reus
Fix inconsistency in the semantics of the scale attribute. For scale the write_raw function was considering the scale table index and writing the appropriate value into the range register, while for read_raw it was outputting the actual scale. Fix this behaviour and adhere to the iio ABI specification. Signed-off-by: Adriana Reus <adriana.reus@intel.com> Reviewed-by: Viorel Suman <viorel.suman@intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2015-03-14iio: inv_mpu6050: Clear timestamps fifo while resetting hardware fifoViorel Suman
A hardware fifo reset always imply an invalidation of the existing timestamps, so we'll clear timestamps fifo on successfull hardware fifo reset. Signed-off-by: Viorel Suman <viorel.suman@gmail.com> Cc: <Stable@vger.kernel.org> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2015-03-14iio: bmc150: change sampling frequencySathyanarayanan Kuppuswamy
Currently driver reports device bandwidth list as available sampling frequency. But sampling frequency is actually twice the device bandwidth. This patch fixes this issue. Signed-off-by: Sathyanarayanan Kuppuswamy <sathyanarayanan.kuppuswamy@intel.com> Signed-off-by: Octavian Purdila <octavian.purdila@intel.com> Cc: <Stable@vger.kernel.org> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2015-03-12iio: adc: Kconfig mcp320x change description Add more ADCsSøren Andersen
Bring the Kconfig entry up to date with parts supported by the driver. Signed-off-by: Soeren Andersen <san@rosetechnology.dk> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2015-03-09iio: mlx90614: Refactor register symbolsVianney le Clément de Saint-Marcq
The defined registers only make sense when used for accessing RAM. Make MLX90614_OP_RAM part of the symbol definition to avoid accidental access to the wrong register. Signed-off-by: Vianney le Clément de Saint-Marcq <vianney.leclement@essensium.com> Cc: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2015-03-09iio: gyro: itg3200: add suspend/resume support.NeilBrown
Unless we put the device to sleep when not it use, it wastes 6mA. If the device is asleep on probe, the 'id' register sometimes mis-reads - so reset first. If the device responds at all a command sent to the address, it is almost certainly the correct device already. Acked-by: Manuel Stahl <manuel.stahl@iis.fraunhofer.de> Acked-by: Hartmut Knaack <knaack.h@gmx.de> Signed-off-by: NeilBrown <neil@brown.name> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2015-03-09iio: accel: mma9551: Check gpiod_to_irq return valueRoberta Dobrescu
The return value of gpiod_to_irq should be checked before giving it to devm_request_threaded_irq in order to not pass an error code in case it fails. Signed-off-by: Roberta Dobrescu <roberta.dobrescu@gmail.com> Reviewed-by: Vlad Dogaru <vlad.dogaru@intel.com> Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2015-03-08iio: light: Added PM support for Capella CM3232 ambient light sensor driver.Kevin Tsai
Added Power Management Support. Signed-off-by: Kevin Tsai <ktsai@capellamicro.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2015-03-07iio:adc: Fix typo in MODULE_DESCRIPTION in ad7793.cMasanari Iida
This patch fix spelling typo in MODULE_DESCRIPTION Signed-off-by: Masanari Iida <standby24x7@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2015-03-07iio: fix drivers that check buffer->scan_maskOctavian Purdila
If the in-kernel push interface is used we may have a different masks on the device buffer and the kernel buffer and in this case the device should generate data for the reunion of the buffers, which is available at indio_dev->active_scan_mask. Compiled tested only except for bmc150-accel which was tested at runtime with the hardware. Signed-off-by: Octavian Purdila <octavian.purdila@intel.com> Cc: <stable@vger.kernel.org> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2015-03-06treewide: Fix typo in printk messagesMasanari Iida
This patch fix spelling typo in printk messages. Signed-off-by: Masanari Iida <standby24x7@gmail.com> Acked-by: Randy Dunlap <rdunlap@infradead.org> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2015-02-28Merge tag 'iio-fixes-for-4.0b' of ↵Greg Kroah-Hartman
git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into staging-linus Jonathan writes: Second round of IIO fixes for the 4.0 cycle (or round one part two really!) These are fixes for patches in the recent merge window and are in a separate branch to avoid rebasing the main fixes-togreg branch. * jsa1212 - select missing REGMAP_I2C * ssp_common - build warning fix for PM functions when PM not in use. * ak8975 - the addition of a utility library for this driver (as part of adding new device support) led to a dependency not being inforced for the original driver (I2C and GPIOLIB).
2015-02-28Merge tag 'iio-fixes-for-4.0a' of ↵Greg Kroah-Hartman
git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into staging-linus Jonathan writes: First round of fixes for IIO in the 4.0 cycle. Note a followup set dependent on patches in the recent merge windows will follow shortly. * dht11 - fix a read off the end of an array, add some locking to prevent the read function being interrupted and make sure gpio/irq lines are not enabled for irqs during output. * iadc - timeout should be in jiffies not msecs * mpu6050 - avoid a null id from ACPI emumeration being dereferenced. * mxs-lradc - fix up some interaction issues between the touchscreen driver and iio driver. Mostly about making sure that the adc driver only affects channels that are not being used for the touchscreen. * ad2s1200 - sign extension fix for a result of c type promotion. * adis16400 - sign extension fix for a result of c type promotion. * mcp3422 - scale table was transposed. * ad5686 - use _optional regulator get to avoid a dummy reg being allocate which would cause the driver to fail to initialize. * gp2ap020a00f - select REGMAP_I2C * si7020 - revert an incorrect cleanup up and then fix the issue that made that cleanup seem like a good idea.
2015-02-28iio: ak8975: fix AK09911 dependenciesArnd Bergmann
ak8975 depends on I2C and GPIOLIB, so any symbols that selects ak8975 must have the same dependency, or we get build errors: drivers/iio/magnetometer/ak8975.c: In function 'ak8975_who_i_am': drivers/iio/magnetometer/ak8975.c:393:2: error: implicit declaration of function 'i2c_smbus_read_i2c_block_data' [-Werror=implicit-function-declaration] ret = i2c_smbus_read_i2c_block_data(client, AK09912_REG_WIA1, ^ drivers/iio/magnetometer/ak8975.c: In function 'ak8975_set_mode': drivers/iio/magnetometer/ak8975.c:431:2: error: implicit declaration of function 'i2c_smbus_write_byte_data' [-Werror=implicit-function-declaration] ret = i2c_smbus_write_byte_data(data->client, Signed-off-by: Arnd Bergmann <arnd@arndb.de> Fixes: 57e73a423b1e85 ("iio: ak8975: add ak09911 and ak09912 support") Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2015-02-25iio: Add support for DA9150 GPADCAdam Thomson
This patch adds support for DA9150 Charger & Fuel-Gauge IC GPADC. Signed-off-by: Adam Thomson <Adam.Thomson.Opensource@diasemi.com> Reviewed-by: Hartmut Knaack <knaack.h@gmx.de> Acked-by: Jonathan Cameron <jic23@kernel.org> Signed-off-by: Sebastian Reichel <sre@kernel.org>
2015-02-25iio: imu: inv_mpu6050: Create mux clients for ACPISrinivas Pandruvada
This is a follow up patches after adding i2c mux adapter for bypass mode. Potentially many different types of sensor can be attached to INVMPU6XXX device, which can be connected to main cpu i2c bus in bypass mode. Why do we need this? The system ACPI table entry will consist of only one device for INV6XXX, assuming that this driver will handle all connected sensors. That is not true for the Linux driver. There are bunch of IIO drivers for each sensors, hence we created a mux on this device. So to load these additional drivers, we need to create i2c devices for them in this driver using this mux adapter. There are multiple options: 1. Use the auto detect feature, this needs a new i2c class for the adapter as the existing HWMON class is not acceptable. Also the autodetect has overhead of executing detect method for each matching class of adapters. This is a simple implementation. This option was previously submitted with not a happy feedback. 2. Option is use ACPI magic and parse the configuration data. What we need to create a i2c device at a minimum is address and a name. Address can be obtained for secondary device in more or less in a standard way from using _CRS element. But there is no name. To get name we need to process proprietary vendor data. Not having name is not fun, as you have to create device using the device name of INVN6XXXX, respecting driver duplicate name space restriction. Also each client driver needs to have this name in the id table. Since multiple driver can be loaded, the driver should be able to detect its presence and gracefully exit for the other client driver to take it over. So we use two step process: - Use DMI to id platform and parse propritery data. This is not uncommon for many x86 platform specific driver. We will get both name and address. The change created necessary infrastructure to add more properitery vendor data parsing. - If DMI match fails, then create device on INV6XXX-client (we can't create with same name as INV6XXX as it will cause duplicate name and driver model will reject.) With this each client sensor driver which needs to get attached via INV6XXXX, need this name in the id table and detect the physical presence of sensor in probe and exit if not found. Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2015-02-25iio: jsa1212: Constify struct regmap_configKrzysztof Kozlowski
The regmap_config struct may be const because it is not modified by the driver and regmap_init() accepts pointer to const. Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2015-02-23HID: hid-sensor-hub: Enhance feature report set APISrinivas Pandruvada
Current API only allows setting one offset in the field. This API is extended to set multiple offsets in the field report. Also update parameters in the users of this API. Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Reviewed-by: Jonathan Cameron <jic23@kernel.org> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2015-02-23HID: hid-sensor-hub: Enhance get feature report APISrinivas Pandruvada
Some hid sensor feature report can contain more than one reports. This API can now support receiving multiple values from the feature report. Also update the parameters in the users of this API. Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Acked-by: Jonathan Cameron <jic23@kernel.org> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2015-02-23HID: hid-sensor-hub: Extend API for async readsSrinivas Pandruvada
Add additional flag to read in async mode. In this mode the caller will get reply via registered callback for capture_sample. Callbacks can be registered using sensor_hub_register_callback function. The usage id parameter of the capture_sample can be matched with the usage id of the requested attribute. Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Acked-by: Jonathan Cameron <jic23@kernel.org> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2015-02-22iio: improve usage of gpiod APIUwe Kleine-König
Since 39b2bbe3d715 (gpio: add flags argument to gpiod_get*() functions) which appeared in v3.17-rc1, the gpiod_get* functions take an additional parameter that allows to specify direction and initial value for outputs. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Reviewed-by: Alexandre Courbot <acourbot@nvidia.com> Reviewed-by: Daniel Baluta <daniel.baluta@intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2015-02-22iio: common: ssp_sensors: Protect PM-only functions to kill warningGeert Uytterhoeven
If CONFIG_PM_SLEEP=n: drivers/iio/common/ssp_sensors/ssp_dev.c:644: warning: ‘ssp_suspend’ defined but not used drivers/iio/common/ssp_sensors/ssp_dev.c:669: warning: ‘ssp_resume’ defined but not used Protect the unused functions by #ifdef CONFIG_PM_SLEEP to fix this. Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org> Acked-by: Karol Wrona <k.wrona@samsung.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2015-02-19Merge branch 'kconfig' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild Pull kconfig updates from Michal Marek: "Yann E Morin was supposed to take over kconfig maintainership, but this hasn't happened. So I'm sending a few kconfig patches that I collected: - Fix for missing va_end in kconfig - merge_config.sh displays used if given too few arguments - s/boolean/bool/ in Kconfig files for consistency, with the plan to only support bool in the future" * 'kconfig' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild: kconfig: use va_end to match corresponding va_start merge_config.sh: Display usage if given too few arguments kconfig: use bool instead of boolean for type definition attributes
2015-02-15Merge tag 'staging-3.20-rc1' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging Pull staging drivers patches from Greg KH: "Here's the big staging driver tree update for 3.20-rc1. Lots of little things in here, adding up to lots of overall cleanups. The IIO driver updates are also in here as they cross the staging tree boundry a lot. I2O has moved into staging as well, as a plan to drop it from the tree eventually as that's a dead subsystem. All of this has been in linux-next with no reported issues for a while" * tag 'staging-3.20-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging: (740 commits) staging: lustre: lustre: libcfs: define symbols as static staging: rtl8712: Do coding style cleanup staging: lustre: make obd_updatemax_lock static staging: rtl8188eu: core: switch with redundant cases staging: rtl8188eu: odm: conditional setting with no effect staging: rtl8188eu: odm: condition with no effect staging: ft1000: fix braces warning staging: sm7xxfb: fix remaining CamelCase staging: sm7xxfb: fix CamelCase staging: rtl8723au: multiple condition with no effect - if identical to else staging: sm7xxfb: make smtc_scr_info static staging/lustre/mdc: Initialize req in mdc_enqueue for !it case staging/lustre/clio: Do not allow group locks with gid 0 staging/lustre/llite: don't add to page cache upon failure staging/lustre/llite: Add exception entry check after radix_tree staging/lustre/libcfs: protect kkuc_groups from write access staging/lustre/fld: refer to MDT0 for fld lookup in some cases staging/lustre/llite: Solve a race to access lli_has_smd in read case staging/lustre/ptlrpc: hold rq_lock when modify rq_flags staging/lustre/lnet: portal spreading rotor should be unsigned ...