summaryrefslogtreecommitdiffstats
path: root/drivers
Commit message (Collapse)AuthorAgeFilesLines
* Staging: iio: adc: fix indent on break statementColin Ian King2016-01-241-1/+1
| | | | | | | | | Fix indent warning when building with gcc 6: drivers/staging/iio/adc/ad7192.c:239:4: warning: statement is indented as if it were guarded by... [-Wmisleading-indentation] Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* iio: add ad5761 DAC driverRicardo Ribalda Delgado2016-01-243-0/+441
| | | | | | | | | | | | | | ad5761 is a 1-channel DAC with configurable output range. The driver uses the regulator interface for its voltage ref. It shares its register layout with ad5761r, ad5721 and ad5721r. Differences: ad5761* are 16 bit, ad5721* are 12 bits. ad57*1r have an internal reference. Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* iio: adc: axp288: remove redundant duplicate const on axp288_adc_channelsColin Ian King2016-01-231-1/+1
| | | | | | | | duplicate const can be removed, it is redundant. Found by static analysis using smatch. Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* iio: mma8452: add support for MMA8451QMartin Kepplinger2016-01-232-7/+37
| | | | | | | | | | | This adds support for this series' 14 bit accelerometer chip, MMA8451Q. It's datasheet is available at the vendor's website: https://cache.freescale.com/files/sensors/doc/data_sheet/MMA8451Q.pdf Signed-off-by: Martin Kepplinger <martin.kepplinger@theobroma-systems.com> Signed-off-by: Christoph Muellner <christoph.muellner@theobroma-systems.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* iio: mma8452: whitespace cleanupMartin Kepplinger2016-01-231-2/+2
| | | | | | Signed-off-by: Martin Kepplinger <martin.kepplinger@theobroma-systems.com> Signed-off-by: Christoph Muellner <christoph.muellner@theobroma-systems.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* iio: mma8452: add freefall detection for Freescale's accelerometersMartin Kepplinger2016-01-231-16/+144
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds freefall event detection to the supported devices. It adds the in_accel_x&y&z_mag_falling_en iio event attribute, which activates freefall mode. In freefall mode, the current acceleration magnitude (AND combination of all axis values) is compared to the specified threshold. If it falls under the threshold (in_accel_mag_falling_value), the appropriate IIO event code is generated. This is what the sysfs "events" directory for these devices looks like after this change: -rw-r--r-- 4096 Oct 23 08:45 in_accel_mag_falling_period -rw-r--r-- 4096 Oct 23 08:45 in_accel_mag_falling_value -rw-r--r-- 4096 Oct 23 08:45 in_accel_mag_rising_period -rw-r--r-- 4096 Oct 23 08:45 in_accel_mag_rising_value -r--r--r-- 4096 Oct 23 08:45 in_accel_scale -rw-r--r-- 4096 Oct 23 08:45 in_accel_x&y&z_mag_falling_en -rw-r--r-- 4096 Oct 23 08:45 in_accel_x_mag_rising_en -rw-r--r-- 4096 Oct 23 08:45 in_accel_y_mag_rising_en -rw-r--r-- 4096 Oct 23 08:45 in_accel_z_mag_rising_en Signed-off-by: Martin Kepplinger <martin.kepplinger@theobroma-systems.com> Signed-off-by: Christoph Muellner <christoph.muellner@theobroma-systems.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* iio:adc:at91-sama5d2: code cleanupLudovic Desroches2016-01-231-2/+1
| | | | | | | Use var type for sizeof argument instead of the struct name. Signed-off-by: Ludovic Desroches <ludovic.desroches@atmel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* iio:adc:at91-sama5d2: fix vref_uv typeLudovic Desroches2016-01-231-1/+1
| | | | | | | | vref_uv has to be an int. Signed-off-by: Ludovic Desroches <ludovic.desroches@atmel.com> Reported-by: Julia Lawall <julia.lawall@lip6.fr> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* iio: adc: mcp320x: support more differential voltage measurementAkinobu Mita2016-01-161-12/+19
| | | | | | | | | | | | | | | | | | | | | | mcp320x driver supports the pseudo-differential mode by in_voltage'IN+'-voltage'IN-'_raw where (IN+, IN-) = (0, 1), (2, 3), ... mcp320x chips except MCP3X01 can also select swapped IN+ and IN- pairs in the pseudo-differential mode. i.e. in_voltage'IN+'-voltage'IN-'_raw where (IN+, IN-) = (1, 0), (3, 2), ... If the voltage level of IN+ is equal to or less than IN-, the resultant code will be 000h. So it is useful to provide these, too. Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com> Cc: Oskar Andero <oskar.andero@gmail.com> Cc: Jonathan Cameron <jic23@kernel.org> Cc: Hartmut Knaack <knaack.h@gmx.de> Cc: Lars-Peter Clausen <lars@metafoo.de> Cc: Peter Meerwald <pmeerw@pmeerw.net> Cc: linux-iio@vger.kernel.org Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* MAINTAINERS: add entry for Atmel SAMA5D2 ADC driverLudovic Desroches2016-01-161-2/+1
| | | | | Signed-off-by: Ludovic Desroches <ludovic.desroches@atmel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* iio:adc:at91_adc8xx: introduce new atmel adc driverLudovic Desroches2016-01-163-0/+521
| | | | | | | | | This driver supports the new version of the Atmel ADC device introduced with the SAMA5D2 SoC family. Signed-off-by: Ludovic Desroches <ludovic.desroches@atmel.com> Acked-by: Rob Herring <robh@kernel.org> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* iio: ak8975: constify ak_def structuresJulia Lawall2016-01-101-2/+2
| | | | | | | | | The ak_def structures are never modified, so declare them as const. Done with the help of Coccinelle. Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* iio: st_sensors: support active-low interruptsLinus Walleij2016-01-107-12/+97
| | | | | | | | | | | | | | | | | | | | | Most ST MEMS Sensors that support interrupts can also handle sending an active low interrupt, i.e. going from high to low on data ready (or other interrupt) and thus triggering on a falling edge to the interrupt controller. Set up logic to inspect the interrupt line we get for a sensor: if it is triggering on rising edge, leave everything alone, but if it triggers on falling edges, set up active low, and if unsupported configurations appear: warn with errors and reconfigure the interrupt to a rising edge, which all interrupt generating sensors support. Create a local header for st_sensors_core.h to share functions between the sensor core and the trigger setup code. Cc: Giuseppe Barba <giuseppe.barba@st.com> Cc: Denis Ciocca <denis.ciocca@st.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* Staging: iio: cdc: ad7150: Fix alignment should match open parenthesisShraddha Barke2016-01-041-13/+15
| | | | | | | | Fix the checkpatch warning of alignment should match open parenthesis. Signed-off-by: Shraddha Barke <shraddha.6596@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* Staging: iio: cdc: ad7150: Prefer using the BIT macroShraddha Barke2016-01-041-3/+3
| | | | | | | Replace bit shifting on 1 with the BIT(x) macro Signed-off-by: Shraddha Barke <shraddha.6596@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* iio: health: max30100: add config for LED currentMatt Ranostay2016-01-031-6/+75
| | | | | | | | | | | | Allow the current for both RED and IR LEDs to be set via an device tree property setting. This is an optional setting that is useful for applications that have a known glass attenuation factor. Signed-off-by: Matt Ranostay <mranostay@gmail.com> Acked-by: Rob Herring <robh@kernel.org> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* iio: dac: mcp4725: Add basic support for MCP4726Akinobu Mita2016-01-032-22/+69
| | | | | | | | | | | | | | | | | | | | | | MCP4726 is a single channel 12-bit DAC. We can support MCP4726 with a little changes to mcp4725 driver. In power-down mode, they have different selection of VOUT pull-down registers. MCP4726 also has features: - Output gain options: 1x, 2x - Voltage reference selection: VDD, VREF (Unbuffered or Buffered) But these are not supported in this change. (1x gain, VDD is selected) datasheet: http://ww1.microchip.com/downloads/en/DeviceDoc/22272C.pdf Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com> Cc: Jonathan Cameron <jic23@kernel.org> Cc: Hartmut Knaack <knaack.h@gmx.de> Cc: Lars-Peter Clausen <lars@metafoo.de> Cc: Peter Meerwald <pmeerw@pmeerw.net> Cc: linux-iio@vger.kernel.org Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* iio: adc: mcp3422: Add support for MCP3425Akinobu Mita2016-01-022-5/+8
| | | | | | | | | | | | | | | | | | | | The MCP3425 is a single channel up to 16-bit A/D converter which has features: - On-Board Programmable Gain Amplifier (PGA): - Gains of 1, 2, 4 or 8 - Programmable Data Rate Options: - 15 SPS (16 bits), 60 SPS (14 bits), 240 SPS (12 bits) The mcp3422 driver also supports the MCP3421 which is a single channel. So we can support MCP3425 with a little changes to mcp3422 driver. Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com> Cc: Sascha Hauer <s.hauer@pengutronix.de> Cc: Angelo Compagnucci <angelo.compagnucci@gmail.com> Cc: Peter Meerwald <pmeerw@pmeerw.net> Cc: linux-iio@vger.kernel.org Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* Merge tag 'iio-for-4.5c' of ↵Greg Kroah-Hartman2015-12-265-103/+388
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into staging-next Jonathan writes: Third set of new stuff for IIO in the 4.5 cycle. New driver features - us5182 * Add interrupt support and rising / falling threshold events. Cleanups / fixes to new stuff / minor additions * Expose the IIO value formatting function for drivers to make use of internally. - ina2xx * Fix wrong channel order * Fix incorrect reporting of endianness * Adding documentation of ABI unique to this device - mma8452 * Drop an unused register description * Use an enum for the channel index to aid readability - sca3000 * Use standard NULL comparison style - us5182 * fix an inconsistency in status of enable (a bug with no real effect until above patches are applied) * refactor the read_raw function to improve maintainability / readability.
| * iio: adc: ina2xx: Fix incorrect report of data endianness to userspace.Jonathan Cameron2015-12-221-1/+1
| | | | | | | | | | | | | | | | This was extracted from a reposting of the driver after it had been applied to the IIO tree. I have fast tracked it as the driver will be in 4.5 and it would be nice to fix this trivial issue before it is. Signed-off-by: Jonathan Cameron <jic23@kernel.org>
| * iio: light: us5182d: Refactor read_raw functionAdriana Reus2015-12-221-77/+78
| | | | | | | | | | | | | | | | | | | | A bit of refactoring for better readability. Moved and slightly reorganized all the activity necessary for reading als and proximity into a different function. This way the switch in read raw becomes clearer and more compact. Signed-off-by: Adriana Reus <adriana.reus@intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
| * iio: light: us5182d: Add interrupt support and eventsAdriana Reus2015-12-221-1/+270
| | | | | | | | | | | | | | | | Add interrupt support for proximity. Add two threshold events to signal rising and falling directions. Signed-off-by: Adriana Reus <adriana.reus@intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
| * iio: light: us5182d: Fix enable status inconcistencyAdriana Reus2015-12-221-4/+12
| | | | | | | | | | | | | | | | | | | | | | | | When setting als only or proximity only modes make sure that we mark the other component as disabled. This fix is in preparation of adding event support because that will make it possible to switch between one-shot and continuous modes and not tracking these correctly may cause faulty behaviour (e.g wrongfully considering px enabled and not setting an appropriate mode in the chip). Signed-off-by: Adriana Reus <adriana.reus@intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
| * iio: Make IIO value formating function globally available.Andrew F. Davis2015-12-221-0/+1
| | | | | | | | | | | | | | | | Make IIO value formating function globally available to allow IIO drivers to output values as the core does. Signed-off-by: Andrew F. Davis <afd@ti.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
| * iio: mma8452: use enum for channel indexMartin Kepplinger2015-12-191-16/+23
| | | | | | | | | | | | | | | | This gets rid of some magic numbers by adding an enum. Signed-off-by: Martin Kepplinger <martin.kepplinger@theobroma-systems.com> Signed-off-by: Christoph Muellner <christoph.muellner@theobroma-systems.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
| * iio: mma8452: remove unused register descriptionMartin Kepplinger2015-12-191-1/+0
| | | | | | | | | | | | Signed-off-by: Martin Kepplinger <martin.kepplinger@theobroma-systems.com> Signed-off-by: Christoph Muellner <christoph.muellner@theobroma-systems.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
| * Staging: iio: accel: sca3000: Fixed NULL comparison styleBhaktipriya Shridhar2015-12-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | The variable u8 **rx_p, is a pointer-to-pointer and hence the check should be "if (!*rx_p)" and not "if (!rx_p)". In the earlier version, checkpatch.pl gave the following check, which was incorrect: CHECK: Comparison to NULL could be written "!rx_p" + if (*rx_p == NULL) { Signed-off-by: Bhaktipriya Shridhar <bhaktipriya96@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
| * iio: ina2xx: fix channel order in software bufferMarc Titinger2015-12-191-2/+2
| | | | | | | | | | | | | | | | POWER and CURRENT were swapped out in the buffer: was current2 and power3, correct order is power2 and current3. Signed-off-by: Marc Titinger <mtitinger@baylibre.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* | Merge tag 'iio-for-4.5b' of ↵Greg Kroah-Hartman2015-12-2631-76/+2905
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into staging-next Jonathan writes: Second set of IIO new drivers, functionality and cleanups for the 4.5 cycle. The big one here is the configfs support which has been a long time in the works but should allow for cleaner ways to do instantiation of those elements of IIO that aren't directly connected to specific hardware. Lots of cool new stuff we can use this for in the works! New core stuff (basically all configfs support related) * Configfs support - Core support (was waiting for a configfs patch that went in around 4.4rc2) - A little fixlet to add a configfs.h to contain a reference to the configfs_subsystem structure. * Some infrastructure to simplify handling of software based triggers (i.e. ones with no actual hardware associated with them) * A high resolution timer based trigger. This has been around for years but until the configfs support was ready we didn't have a sensible way of instantiating instances of it (the method used for the sysfs_trigger has never been really satisfactory) New Device Support * AMS iAQ Volatile Organic Compounds sensor support. * Freescale imx7d ADC driver * Maxim MAX30100 oximeter driver (note that for these devices most of the smart stuff will be in userspace - effectively they are just light sensors with some interesting led synchronization as far as the kernel is concerned). * Microchip mcp3421 support added to the mcp3422 driver. * TI adc124s021 support added to the adc128s052 driver. * TI ina219, inda226 power monitors. Note that there is an existing hwmon driver for these parts, the usecase is somewhat different so it is unclear at this point if the hwmon driver will eventually be replaced by a bridge from this driver. In the meantime the Kconfig dependencies should prevent both from being built. New driver functionality * us8152d power management support. Cleanups, fixups * Use list_for_each_entry_safe instead of list_for_each_safe with the entry bit coded longhand. * Select IRQ_WORK for IIO_DUMMY_EVGEN. This is a fix that somehow got lost when the driver was moved so lets do it again. * st-accel - drop an unused define. * vz89x, lidar - optimize i2c transactions by using a single i2c tranfers instead of multiple calls where supported (fall back to smbus calls as before if not). * Use dev_get_platdata() in staging drivers: tsl2x7x, adcs and frequency drivers instead of direct access to the structure element.
| * iio/inkern.c Use list_for_each_entry_safeAnshul Garg2015-12-121-4/+2
| | | | | | | | | | | | | | | | Use list_for_each_entry_safe instead of list_for_each_safe and list_entry call. Signed-off-by: Anshul Garg <aksgarg1989@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
| * iio: adc: add IMX7D ADC driver supportHaibo Chen2015-12-123-0/+619
| | | | | | | | | | | | | | | | Freescale i.MX7D soc contains a new ADC IP. This patch add this ADC driver support, and the driver only support ADC software trigger. Signed-off-by: Haibo Chen <haibo.chen@freescale.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
| * iio: ina2xx: give the capture kthread a more useful name string.Marc Titinger2015-12-121-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | PID PPID USER STAT VSZ %VSZ %CPU COMMAND 144 2 root DW 0 0% 33% [ina226:1-8800us] 141 2 root DW 0 0% 25% [ina226:0-8800us] 40 2 root SW 0 0% 15% [irq/156-4802a00] 147 2 root DW 0 0% 7% [ina226:2-8800us] 145 1 root S 1236 0% 6% dd if /dev/iio:device1 of /dev/null 148 1 root S 1236 0% 4% dd if /dev/iio:device2 of /dev/null 149 137 root R 1244 0% 3% top -d 1 142 1 root S 1236 0% 2% dd if /dev/iio:device0 of /dev/null Signed-off-by: Marc Titinger <mtitinger@baylibre.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
| * iio: ina2xx: re-instate a sysfs show/store for the shunt resistor valueMarc Titinger2015-12-121-6/+46
| | | | | | | | | | | | | | | | | | Different probe modules use different resistor values. The front-end application may read a probe ID (from eeprom) and set the shunt value accordingly. Signed-off-by: Marc Titinger <mtitinger@baylibre.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
| * iio: ina2xx: provide a sysfs parameter to allow async readout of the ADCsMarc Titinger2015-12-121-9/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This can lead to repeated or skipped samples depending on the clock beat between the capture thread and the chip sampling clock, but will also spare reading/waiting for the Capture Ready Flag and improve the available i2c bandwidth for reading measurements. Output of iio_info: ...snip... 4 device-specific attributes found: attr 0: in_oversampling_ratio value: 4 attr 1: in_allow_async_readout value: 0 attr 2: integration_time_available value: 140 204 332 588 1100 2116... attr 3: in_sampling_frequency value: 114 Signed-off-by: Marc Titinger <mtitinger@baylibre.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
| * iio: ina2xx: add support for TI INA2xx Power MonitorsMarc Titinger2015-12-123-0/+679
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | in SOFTWARE buffer mode, a kthread will capture the active scan_elements into a kfifo, then compute the remaining time until the next capture tick and do an active wait (udelay). This will produce a stream of up to fours channels plus a 64bits timestamps (ns). Tested with ina226, on BeagleBoneBlack. Datasheet: http://www.ti.com/lit/gpn/ina226 Signed-off-by: Marc Titinger <mtitinger@baylibre.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
| * iio: chemical: add AMS iAQ-core supportMatt Ranostay2015-12-123-0/+209
| | | | | | | | | | | | | | Add support for AMS iAQ-core continuous and pulsed VOC sensors. Signed-off-by: Matt Ranostay <mranostay@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
| * iio: light: add MAX30100 oximeter driver supportMatt Ranostay2015-12-125-0/+483
| | | | | | | | | | | | | | | | | | | | | | | | | | MAX30100 is an heart rate and pulse oximeter sensor that works using two LEDS of different wavelengths, and detecting the light reflected back. This patchset adds support for both IR and RED LED channels which can be processed in userspace to determine heart rate and blood oxygen levels. Signed-off-by: Matt Ranostay <mranostay@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
| * iio:adc128s052: add support for adc124s021Oliver Stäbler2015-12-122-4/+15
| | | | | | | | | | | | Signed-off-by: Oliver Stäbler <oliver.staebler@bytesatwork.ch> Reviewed-by: Martin Kepplinger <martink@posteo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
| * staging: iio: select IRQ_WORK for IIO_DUMMY_EVGENArnd Bergmann2015-12-051-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The iio dummy code was recently changed to use irq_work_queue, but that code is compiled into the kernel only if IRQ_WORK is set, so we can get a link error here: drivers/built-in.o: In function `iio_evgen_poke': (.text+0x208a04): undefined reference to `irq_work_queue' This changes the Kconfig file to match what other drivers do. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Fixes: fd2bb310ca3d ("Staging: iio: Move evgen interrupt generation to irq_work") Acked-by: Daniel Baluta <daniel.baluta@intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
| * iio: st_accel_core: Remove unneeded defineRobert Kmiec2015-12-051-3/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Definition of ST_SENSORS_WAI_ADDRESS was introduced within a very first commit of this driver, but it was never used. This address is already defined as ST_SENSORS_DEFAULT_WAI_ADDRESS in include/linux/iio/common/st_sensors.h To avoid duplication of the same constant in two different places called almost exactly the same, the one which was never used should be removed. Signed-off-by: Robert Kmiec <robert.r.kmiec@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
| * iio: proximity: lidar: optimize i2c transactionsMatt Ranostay2015-12-051-25/+70
| | | | | | | | | | | | | | | | | | | | Optimize device tranactions using i2c transfers versus multiple possibly racey i2c_smbus_* function calls, and only one transaction for distance measurement. Falls back to smbus method if i2c functionality isn't available. Signed-off-by: Matt Ranostay <mranostay@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
| * iio:configfs: Introduce iio/configfs.h to provide a location for the ↵Jonathan Cameron2015-12-052-0/+2
| | | | | | | | | | | | | | | | | | | | | | configfs_subsystem This exported element needs to be accesible to all drivers using configfs within IIO. Previously it was in the sw_trig.h file which only convered one such usecase. This also fixes a sparse warning as it is now in a header that makes sense to include from industrialio-configfs.c Signed-off-by: Jonathan Cameron < jic23@kernel.org>
| * iio: chemical: vz89x: rework i2c transfer readingMatt Ranostay2015-12-031-14/+52
| | | | | | | | | | | | | | | | Add an optimized i2c transfer reading function, and fallback to racey smbus transfers if client->adapter doesn't support this. Signed-off-by: Matt Ranostay <mranostay@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
| * iio: trigger: Introduce IIO hrtimer based triggerDaniel Baluta2015-12-033-0/+205
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch registers a new IIO software trigger interrupt source based on high resolution timers. Notice that if configfs is enabled we create sampling_frequency attribute allowing users to change hrtimer period (1/sampling_frequency). The IIO hrtimer trigger has a long history, this patch is based on an older version from Marten and Lars-Peter. Signed-off-by: Marten Svanfeldt <marten@intuitiveaerial.com> Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Daniel Baluta <daniel.baluta@intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
| * iio: core: Introduce IIO software triggersDaniel Baluta2015-12-033-0/+192
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A software trigger associates an IIO device trigger with a software interrupt source (e.g: timer, sysfs). This patch adds the generic infrastructure for handling software triggers. Software interrupts sources are kept in a iio_trigger_types_list and registered separately when the associated kernel module is loaded. Software triggers can be created directly from drivers or from user space via configfs interface. To sum up, this dynamically creates "triggers" group to be found under /config/iio/triggers and offers the possibility of dynamically creating trigger types groups. The first supported trigger type is "hrtimer" found under /config/iio/triggers/hrtimer. Signed-off-by: Daniel Baluta <daniel.baluta@intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
| * iio: core: Introduce IIO configfs supportDaniel Baluta2015-12-033-0/+59
| | | | | | | | | | | | | | | | | | | | | | | | | | This patch creates the IIO configfs root group. The group will appear under <mount-point>/iio/, usually /config/iio. We introduce configfs support in IIO in order to be able to easily create IIO objects from userspace. The first supported IIO objects are triggers introduced with next patches. Signed-off-by: Daniel Baluta <daniel.baluta@intel.com> Tested-by: Matt Ranostay <matt.ranostay@intel> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
| * Staging: iio: frequency: use dev_get_platdata()Nizam Haider2015-12-022-2/+2
| | | | | | | | | | | | | | | | Use the wrapper function for retrieving the platform data instead of accessing dev->platform_data directly. Signed-off-by: Nizam Haider <nijamh@cdac.in> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
| * Staging: iio: light: tsl2x7x_core: use dev_get_platdata()Nizam Haider2015-12-021-1/+1
| | | | | | | | | | | | | | | | Use the wrapper function for retrieving the platform data instead of accessing dev->platform_data directly. Signed-off-by: Nizam Haider <nijamh@cdac.in> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
| * Staging: iio: adc: use dev_get_platdata()Nizam Haider2015-12-023-3/+3
| | | | | | | | | | | | | | | | Use the wrapper function for retrieving the platform data instead of accessing dev->platform_data directly. Signed-off-by: Nizam Haider <nijamh@cdac.in> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
| * iio: light: us8152d: Add power management supportAdriana Reus2015-12-021-7/+88
| | | | | | | | | | | | | | Add power management for sleep as well as runtime pm. Signed-off-by: Adriana Reus <adriana.reus@intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>