summaryrefslogtreecommitdiff
path: root/drivers
AgeCommit message (Collapse)Author
2016-06-11iio: ms5637 Add Measurement Specialties explicit MS5805 and MS5837 supportMarkezana, William
Signed-off-by: William Markezana <william.markezana@meas-spec.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-06-11iio: mma8452: update Freescale company informationMartin Kepplinger
NXP took over Freescale, so add NXP to the driver descriptions Signed-off-by: Martin Kepplinger <martink@posteo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-06-11iio: mma8452: update device description in header commentsMartin Kepplinger
Signed-off-by: Martin Kepplinger <martink@posteo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-06-11iio: mma8452: update contact information for Martin KepplingerMartin Kepplinger
Signed-off-by: Martin Kepplinger <martink@posteo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-06-11iio: light: gp2ap020a00f: use iio helper function to lock direct modeAlison Schofield
Replace the code that guarantees the device stays in direct mode with iio_device_claim_direct_mode() which does same. Includes a tiny bit of refactoring (single case -> if) and simplified return flow. Also prevents a theoretical race condition by effectively taking the lock a little earlier than before. Signed-off-by: Alison Schofield <amsfield22@gmail.com> Cc: Daniel Baluta <daniel.baluta@gmail.com> Acked-by: Jacek Anaszewski <j.anaszewski@samsung.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-06-11iio: light: isl29125: use iio helper function to guarantee direct modeAlison Schofield
Replace the code that guarantees the device stays in direct mode with iio_device_claim_direct_mode() which does same. This allows removal of an unused lock in the device private global data. Signed-off-by: Alison Schofield <amsfield22@gmail.com> Cc: Daniel Baluta <daniel.baluta@gmail.com> Acked-by: Peter Meerwald-Stadler <pmeerw@pmeerw.net> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-06-11iio: light: tcs3472: use iio helper function to guarantee direct modeAlison Schofield
Replace the code that guarantees the device stays in direct mode with iio_device_claim_direct_mode() which does same. This allows removal of an unused lock in the device private global data. Also prevents a previous race condition when a buffer is enabled whilst a raw read is going on. Signed-off-by: Alison Schofield <amsfield22@gmail.com> Cc: Daniel Baluta <daniel.baluta@gmail.com> Acked-by: Peter Meerwald-Stadler <pmeerw@pmeerw.net> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-06-11iio: light: tcs3414: use iio helper function to guarantee direct modeAlison Schofield
Replace the code that guarantees the device stays in direct mode with iio_device_claim_direct_mode() which does same. This allows removal of an unused lock in the device private global data. Also prevents a possible race around a buffer being enabled whilst a read is going on. Signed-off-by: Alison Schofield <amsfield22@gmail.com> Cc: Daniel Baluta <daniel.baluta@gmail.com> Acked-by: Peter Meerwald-Stadler <pmeerw@pmeerw.net> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-06-11iio: proximity: lidar: switch to iio_device_claim_*_mode helpersMatt Ranostay
Switch from using indio_dev->mlock to the iio_device_claim_*_mode helper functions. Signed-off-by: Matt Ranostay <mranostay@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-06-03iio:trigger: Experimental kthread tight loop trigger (thread only)Jonathan Cameron
This patch is in response to that of Gregor Boirie <gregor.boirie@parrot.com> who proposed using a tight kthread within a device driver (be it with the support factored out into a helper library) in order to basically spin as fast as possible. It is meant as a talking point rather than a formal proposal of the code (though we are heading towards that I think). Also gives people some working code to mess around with. I proposed that this could be done with a trigger with a few constraints and this is the proof (be it ugly) of that. There are some constraints though, some of which we would want to relax if this were to move forward. * Will only run the thread part of the registered pollfunc. This is to avoid the overhead of jumping in and out of interrupt context. Is the overhead significant? Not certain but feels like it should be! * This limitation precludes any device that 'must' do some work in interrupt context. However, that is true of few if any drivers and I suspect that any that do will be restricted to using triggers they provide themselves. Usually we have a top half mainly to grab a timestamp as soon after the dataready type signal as possible. Signed-off-by: Jonathan Cameron <jic23@kernel.org> Acked-by: Daniel Baluta <daniel.baluta@intel.com>
2016-06-03iio: adc: ti_am335x_adc: use SIMPLE_DEV_PM_OPS helper macroAndrew F. Davis
Replace ifdefs with SIMPLE_DEV_PM_OPS helper macro. Signed-off-by: Andrew F. Davis <afd@ti.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-06-03iio: adc: ti_am335x_adc: use variable names for sizeof() operatorAndrew F. Davis
Fix the code formatting to use the kernel preferred style of using the actual variables to determize the size using the sizeof() operator. Signed-off-by: Andrew F. Davis <afd@ti.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-06-03iio: adc: ad7791: claim direct mode when writing frequencyAlison Schofield
Driver was checking for direct mode and trying to lock it, but left a gap where mode could change before the desired operation. Use iio_device_claim_direct_mode() to guarantee device stays in direct mode. Refactor function to clarify look-up followed by lock sequence. Signed-off-by: Alison Schofield <amsfield22@gmail.com> Cc: Daniel Baluta <daniel.baluta@gmail.com> Acked-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-06-03iio: adc: ad7793: claim direct mode when writing frequencyAlison Schofield
Driver was checking for direct mode and trying to lock it, but left a gap where mode could change before the desired operation. Use iio_device_claim_direct_mode() to guarantee device stays in direct mode. Refactor function to clarify look-up followed by lock sequence. Signed-off-by: Alison Schofield <amsfield22@gmail.com> Cc: Daniel Baluta <daniel.baluta@gmail.com> Acked-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-05-29iio: proximity: as3935: remove redundant MODULE_ALIASMatt Ranostay
MODULE_ALIAS isn't needed since the module name is the same as the alias defined. Signed-off-by: Matt Ranostay <mranostay@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-05-29iio: magnetometer: bmc150: Document Bosch supported chipsDaniel Baluta
bmc150 driver supports also BMC156 and BMM150 chips. Signed-off-by: Daniel Baluta <daniel.baluta@intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-05-29iio: chemical: atlas-ph-sensor: add EC featureMatt Ranostay
Signed-off-by: Matt Ranostay <mranostay@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-05-29iio: electricalconductivity: add IIO_ELECTRICALCONDUCTIVITY typeMatt Ranostay
Signed-off-by: Matt Ranostay <mranostay@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-05-29iio: chemical: atlas-ph-sensor: reorg driver to allow multiple chipsMatt Ranostay
Signed-off-by: Matt Ranostay <mranostay@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-05-29iio: adc: ad799x: use iio helper function to guarantee direct modeAlison Schofield
Replace the code that guarantees the device stays in direct mode with iio_device_claim_direct_mode() which does same. Signed-off-by: Alison Schofield <amsfield22@gmail.com> Acked-by: Daniel Baluta <daniel.baluta@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-05-29iio: adc: ad7923: use iio helper function to guarantee direct modeAlison Schofield
Replace the code that guarantees the device stays in direct mode with iio_device_claim_direct_mode() which does same. Signed-off-by: Alison Schofield <amsfield22@gmail.com> Acked-by: Daniel Baluta <daniel.baluta@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-05-29iio: adc: ad7887: use iio helper function to guarantee direct modeAlison Schofield
Replace the code that guarantees the device stays in direct mode with iio_device_claim_direct_mode() which does same. Signed-off-by: Alison Schofield <amsfield22@gmail.com> Acked-by: Daniel Baluta <daniel.baluta@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-05-29iio: adc: ad7476: use iio helper function to guarantee direct modeAlison Schofield
Replace the code that guarantees the device stays in direct mode with iio_device_claim_direct_mode() which does same. Signed-off-by: Alison Schofield <amsfield22@gmail.com> Acked-by: Daniel Baluta <daniel.baluta@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-05-29iio: adc: ad7266: claim direct mode during sensor readAlison Schofield
Driver was checking for direct mode but not locking it down. Use iio_device_claim_direct_mode() to guarantee device stays in direct mode. Signed-off-by: Alison Schofield <amsfield22@gmail.com> Acked-by: Daniel Baluta <daniel.baluta@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-05-29iio:st_sensors: fix power regulator usageGregor Boirie
Ensure failure to enable power regulators is properly handled. Signed-off-by: Gregor Boirie <gregor.boirie@parrot.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-05-29iio:st_sensors: emulate SMBus block read if neededGregor Boirie
Use SMBus "block read" protocol only when supported by adapter. Signed-off-by: Gregor Boirie <gregor.boirie@parrot.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-05-29iio:st_sensors: unexport st_sensors_get_buffer_elementGregor Boirie
Remove st_sensors_get_buffer_element symbol export since not explicitly used outside of st_sensors driver. Signed-off-by: Gregor Boirie <gregor.boirie@parrot.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-05-29iio:st_pressure:initial lps22hb sensor supportGregor Boirie
Initial support for ST LPS22HB pressure sensor. Datasheet: http://www2.st.com/resource/en/datasheet/lps22hb.pdf Features: * pressure data and timestamping channels * sampling frequency selection * interrupt based trigger * over I2C or SPI Signed-off-by: Gregor Boirie <gregor.boirie@parrot.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-05-29iio: triggers: Make trigger ops structure explicitly non optional.Jonathan Cameron
This structure has not been optional for a long time (if ever) but the code implies that it is. As we then use it later in a fashion that would crash if it was in fact NULL, it's inconsistent so fix it up by removing unnecessary checks. Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-05-28iio: adc: ti-ads1015: add datasheet namesMatt Ranostay
Add datasheet names for ADC channels to allow iio consumers access. Signed-off-by: Matt Ranostay <matt.ranostay@intel.com> Acked-by: Daniel Baluta <daniel.baluta@intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-05-21iio: pressure: bmp280: add humidity supportMatt Ranostay
Enable humidity support for the BME280 part Signed-off-by: Matt Ranostay <matt.ranostay@intel.com> Acked-by: Vlad Dogaru <vlad.dogaru@intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-05-21iio: light: jsa1212: remove unneeded i2c check functionality testAlison Schofield
This driver does not call i2c_smbus_read|write_byte_data(), so remove the corresponding functionality test. It uses regmap to handle byte transfers transparently. Signed-off-by: Alison Schofield <amsfield22@gmail.com> Reviewed-by:Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com> Reviewed-by: Matt Ranostay <matt.ranostay@intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-05-21iio: adc: nau7802: Expose possible gains in sysfsQuentin Schulz
The Nuvoton NAU7802 ADC is able to adjust its gain but prior knowledge of its possible values was required to adjust it. Users had to guess the possible gain values based on the ADC datasheet or on this driver's code. This exposes the possible values in the in_voltage_scale_available file of each nau7802 ADC device. The gain is set for the whole ADC and is therefore not configurable by channel. Thus, there exists only one in_voltage_scale_available file for each nau7802 ADC device even if it has two separate channels. Signed-off-by: Quentin Schulz <quentin.schulz@free-electrons.com> Acked-by: Alexandre Belloni <alexandre.belloni@free-electrons.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-05-21iio: max5487: Add support for Maxim digital potentiometersCristina Moraru
Add implementation for Maxim MAX5487, MAX5488, MAX5489 digital potentiometers. Datasheet: http://datasheets.maximintegrated.com/en/ds/MAX5487-MAX5489.pdf Signed-off-by: Cristina Moraru <cristina.moraru09@gmail.com> CC: Daniel Baluta <daniel.baluta@intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-05-21iio: Export I2C module alias informationJavier Martinez Canillas
The I2C drivers have an i2c_device_id array but that information isn't exported to the modules using the MODULE_DEVICE_TABLE() macro. So the modules autoloading won't work if the I2C device is registered using OF or legacy board files due missing alias information in the modules. The issue was found using Kieran Bingham's coccinelle semantic patch: https://lkml.org/lkml/2016/5/10/520 Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-05-21iio: accel: Add triggered buffer support for BMA220Tiberiu Breana
Signed-off-by: Tiberiu Breana <tiberiu.a.breana@intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-05-21iio: adc: ti-ads1015: add support for ADS1115 partMatt Ranostay
TI ADS1115 is a 16-bit resolution ADC that is register map compatible with the ADS1015 device. Signed-off-by: Matt Ranostay <matt.ranostay@intel.com> Acked-by: Daniel Baluta <daniel.baluta@intel.com> Acked-by: Crt Mori <cmo@melexis.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-05-21iio: magn: Add support for BMM150 magnetometerDaniel Baluta
BMM150 is register compatible with magnetometer part of BMC156. Datasheet is at: http://www.mouser.com/ds/2/783/BST-BMM150-DS001-01-786480.pdf Signed-off-by: Daniel Baluta <daniel.baluta@intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-05-14iio: accel: Add support for Bosch BMA220Tiberiu Breana
This commit adds basic support for the Bosch Sensortec BMA220 digital triaxial acceleration sensor. The device datasheet can be found here: http://www.mouser.com/pdfdocs/BSTBMA220DS00308.PDF Includes: - raw readings - ACPI detection - power management Signed-off-by: Tiberiu Breana <tiberiu.a.breana@intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-05-14iio: potentiometer: tpl0102: remove unneeded i2c check functionality testMatt Ranostay
Actually I2C_FUNC_SMBUS_WORD_DATA isn't need for this device, and regmap handles all single byte reads transparently. Signed-off-by: Matt Ranostay <mranostay@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-05-04iio: mma8452: add support for oversampling ratioMartin Kepplinger
This adds the following sysfs files according to the iio ABI: -rw-r--r-- 4096 in_accel_oversampling_ratio -r--r--r-- 4096 in_accel_oversampling_ratio_available Internally, the device knows about 4 different power modes that differ in oversampling ratio (and power consumption). We just show the user what oversampling ratio(s) is/are available, depending on the current frequency. The referenced table in the datasheets makes it easier to understand. Signed-off-by: Martin Kepplinger <martink@posteo.de> Signed-off-by: Christoph Muellner <christoph.muellner@theobroma-systems.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-05-04iio: dummy: Convert IIO dummy to configfsDaniel Baluta
We register a new device type named "dummy", this will create a configfs entry under: * /config/iio/devices/dummy. Creating dummy devices is now as simple as: $ mkdir /config/iio/devices/dummy/my_dummy_device Signed-off-by: Daniel Baluta <daniel.baluta@intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-05-04iio: Add support for creating IIO devices via configfsDaniel Baluta
This is similar with support for creating triggers via configfs. Devices will be hosted under: * /config/iio/devices We allow users to register "device types" under: * /config/iio/devices/<device_types>/ Signed-off-by: Daniel Baluta <daniel.baluta@intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-05-04iio: health/afe4404: ENSEPGAIN is part of CONTROL2 registerAndrew F. Davis
Rename this definition, no functional changes. Signed-off-by: Andrew F. Davis <afd@ti.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-05-04iio: health/afe440x: Remove unused definitionsAndrew F. Davis
These definitions are not currently used and if the functionality they represent is needed the values should be added back to a table for easy userspace use. Signed-off-by: Andrew F. Davis <afd@ti.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-05-04iio: health/afe440x: Match LED currents to stagesAndrew F. Davis
The current channel number for the LEDs should match the stage number that they are active during, fix this here. Signed-off-by: Andrew F. Davis <afd@ti.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-05-04iio: health/afe440x: Make gain settings a modifier for the stagesAndrew F. Davis
Currently the TIA gain settings are exported to userspace as sysfs entries that do not clearly represent their internal relation to the sampling stages. The gain settings are enabled on a per-stage basis, this can be seen in figure 24 of the current AFE4404 datasheet. These gain settings should therefore be tied to the channels that are read during these stages. Make this change here. Signed-off-by: Andrew F. Davis <afd@ti.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-05-04iio: health/afe440x: Use regmap fieldsAndrew F. Davis
These drivers can use regmap fields to access fields in registers, this allows us to remove some macros/defines and simplify code, do this here. Signed-off-by: Andrew F. Davis <afd@ti.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-05-04iio: health/afe440x: Remove channel namesAndrew F. Davis
These AFEs have 4 ADC mesuring stages (called LED2, ALED2, LED1, and ALED1 in the datasheet), we map these as channels, these stages can serve different purposes depending on the application. For instance the AFE4404 has an additional LED (LED3), this LED can be timed to be active during stage 2 (or anystage, but the datasheet describes this case and the name of the stage reflects this use). This ability is used further in upcoming parts that tie the front-end gain and the LED timings together. For these reasons we remove explicit naming the channels. Without channel names it is best that the index numbers are in order to match the stage number, reorder the channel numbers. Signed-off-by: Andrew F. Davis <afd@ti.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-05-04iio: health/afe4404: Remove LED3 input channelAndrew F. Davis
Input channel LED3 is only an alias for stage ALED2, this virtual channel does nothing for us, remove this channel. Signed-off-by: Andrew F. Davis <afd@ti.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>