summaryrefslogtreecommitdiffstats
path: root/drivers
AgeCommit message (Collapse)AuthorFilesLines
2018-05-22iio: dac: fix missing of_match_table assignment in the LTC 2632 deviceSilvan Murer1-9/+10
Signed-off-by: Silvan Murer <silvan.murer@gmail.com> Reviewed-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2018-05-22iio: adc: fix spelling mistake: "Freeacale" -> "Freescale"Colin Ian King1-1/+1
Trivial fix to spelling mistake in module description text Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2018-05-22iio: amplifiers: ad8366: move channel init before iio_device_register()Alexandru Ardelean1-2/+4
Otherwise a race condition can occur, where userspace can start operations before the channels have been properly initialized. Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2018-05-20staging:iio:meter: Drop ADE7759 driverJonathan Cameron3-569/+0
I announced the intent to drop some of these meter drivers on the IIO list last cycle. This device is obsolete and not easily obtained. No one has come forward with suitable test hardware and the driver would need a lot of work to move out of staging. As such I am dropping it. We can always bring it back again if a user / tester emerges in the future. Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2018-05-20staging:iio:meter: Drop ADE7758 driverJonathan Cameron6-1439/+0
I announced the intent to drop some of these meter drivers on the IIO list last cycle. This device is obsolete and not easily obtained. No one has come forward with suitable test hardware and the driver would need a lot of work to move out of staging. As such I am dropping it. We can always bring it back again if a user / tester emerges in the future. Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2018-05-20staging:iio:meter: Drop ADE7754 driverJonathan Cameron3-676/+0
I announced the intent to drop some of these meter drivers on the IIO list last cycle. This device is obsolete and not easily obtained. No one has come forward with suitable test hardware and the driver would need a lot of work to move out of staging. As such I am dropping it. We can always bring it back again if a user / tester emerges in the future. Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2018-05-20staging:iio:meter: Drop ADE7753 driverJonathan Cameron3-641/+0
I announced the intent to drop some of these meter drivers on the IIO list last cycle. This device is obsolete and not easily obtained. No one has come forward with suitable test hardware and the driver would need a lot of work to move out of staging. As such I am dropping it. We can always bring it back again if a user / tester emerges in the future. Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2018-05-20staging: iio: ad2s1200: Move driver out of stagingDavid Veenstra7-13/+24
Move the iio driver for the ad2s1200 and ad2s1205 resolver-to-digital converter out of staging, into mainline iio subsystems. Signed-off-by: David Veenstra <davidjulianveenstra@gmail.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2018-05-20staging: iio: ad2s1200: Add copyrightDavid Veenstra1-0/+2
Add David Veenstra as a copyright holders and as an author, for all of the staging clean ups of the ad2s1200 driver. Signed-off-by: David Veenstra <davidjulianveenstra@gmail.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2018-05-20staging: iio: ad2s1200: Add scaling factor for angle channelDavid Veenstra1-0/+6
A scaling factor of approximately 2 * Pi / (2^12 -1) is added, to scale the 12-bits angular position to radians. A return type of IIO_VAL_INT_PLUS_NANO is used, so that the scale of both the angle channel and angular velocity channel has 7 significant digits. Signed-off-by: David Veenstra <davidjulianveenstra@gmail.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2018-05-20staging: iio: ad2s1200: Add scaling factor for angular velocity channelDavid Veenstra1-26/+45
The sysfs iio ABI states radians per second is expected as the unit for angular velocity, but the 12-bit angular velocity register has revolution per seconds as its unit. So a scaling factor of approximately 2 * Pi is added to the angular velocity channel. Signed-off-by: David Veenstra <davidjulianveenstra@gmail.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2018-05-20staging: iio: ad2s1200: Add dt tableDavid Veenstra1-0/+8
Add device tree table for matching with the vendor ID. Signed-off-by: David Veenstra <davidjulianveenstra@gmail.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2018-05-20staging: iio: ad2s1200: Replace platform data with dt bindingsDavid Veenstra1-17/+15
Remove usage of platform data, and replace it with device tree facilities. Signed-off-by: David Veenstra <davidjulianveenstra@gmail.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2018-05-20staging: iio: ad2s1200: Replace legacy gpio API with modern APIDavid Veenstra1-7/+8
The legacy, integer based gpio API is replaced with the modern descriptor based API. Signed-off-by: David Veenstra <davidjulianveenstra@gmail.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2018-05-20staging: iio: ad2s1200: Setup spi before iio device registerDavid Veenstra1-6/+7
The spi should be set up before the device is registered as an iio device. This patch moves the setup to before the device registration. Signed-off-by: David Veenstra <davidjulianveenstra@gmail.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2018-05-20staging: iio: ad2s1200: Add kernel docs to driver stateDavid Veenstra1-0/+8
Add missing kernel docs to the ad2s1200 driver state. Signed-off-by: David Veenstra <davidjulianveenstra@gmail.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2018-05-20staging: iio: ad2s1200: Remove unneeded initializationsDavid Veenstra1-2/+2
Remove 2 initializations which are unneeded, because the initialized values are never used. Signed-off-by: David Veenstra <davidjulianveenstra@gmail.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2018-05-20staging: iio: ad2s1200: Remove unneeded newline in licenseDavid Veenstra1-1/+0
Remove unneeded newline in license, as it does not improve readability. Signed-off-by: David Veenstra <davidjulianveenstra@gmail.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2018-05-20iio:dac:ad5686: Add AD5681R/AD5682R/AD5683/AD5683R supportStefan Popa3-8/+74
The AD5681R/AD5682R/AD5683/AD5683R are a family of one channel DACs with 12-bit, 14-bit and 16-bit precision respectively. The devices have either no built-in reference, or built-in 2.5V reference. These devices are similar to AD5691R/AD5692R/AD5693/AD5693R except with a few notable differences: * they use the SPI interface instead of I2C * in the write control register, DB18 and DB17 are used for setting the power mode, while DB16 is the REF bit. This is why a new regmap type was defined and checked accordingly. * the shift register is 24 bits wide, the first four bits are the command bits followed by the data bits. As the data comprises of 20-bit, 18-bit or 16-bit input code, this means that 4 LSB bits are don't care. This is why the data needs to be shifted on the left with four bits. Therefore, AD5683_REGMAP is checked inside a switch case in the ad5686_spi_write() function. On the other hand, similar devices such as AD5693R family, have the 4 MSB command bits followed by 4 don't care bits. Datasheet: http://www.analog.com/media/en/technical-documentation/data-sheets/AD5683R_5682R_5681R_5683.pdf Signed-off-by: Stefan Popa <stefan.popa@analog.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2018-05-20iio:dac:ad5686: Add AD5691R/AD5692R/AD5693/AD5693R supportStefan Popa3-7/+109
The AD5691R/AD5692R/AD5693/AD5693R are a family of one channel DACs with 12-bit, 14-bit and 16-bit precision respectively. The devices have either no built-in reference, or built-in 2.5V reference. These devices are pretty similar to AD5671R/AD5675R and AD5694/AD5694R/AD5695R/AD5696/AD5696R, except that they have one channel. Another difference is that they use a write control register(addr 0x04) for setting the power down modes and the internal reference instead of separate registers for each function. Datasheet: http://www.analog.com/media/en/technical-documentation/data-sheets/AD5693R_5692R_5691R_5693.pdf Signed-off-by: Stefan Popa <stefan.popa@analog.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2018-05-20iio: adc: stm32-dfsdm: include stm32-dfsdm-adc.hFabrice Gasnier1-2/+2
Fix the following sparse warnings: CHECK drivers/iio/adc/stm32-dfsdm-adc.c symbol 'stm32_dfsdm_get_buff_cb' was not declared. Should it be static? symbol 'stm32_dfsdm_release_buff_cb' was not declared. Should it be static? BTW, move interrupt.h to sort headers alphabetically. Signed-off-by: Fabrice Gasnier <fabrice.gasnier@st.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2018-05-20iio: tsl2583: correct values in integration_time_availableBrian Masney1-1/+1
The times reported by the in_illuminance_integration_time_available sysfs attribute are actually in milliseconds, not microseconds. This patch corrects the times with the correct unit. The fixes tag is inaccurate as the issue existed when the driver was still in staging. However, lots of changes occured before it graduated so this is as a good a point as any for backports. Signed-off-by: Brian Masney <masneyb@onstation.org> Fixes: f44d5c8ac399 ("staging: iio: tsl2583: move out of staging") Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2018-05-12staging: iio: tsl2x7x/tsl2772: move out of stagingBrian Masney8-123/+10
Move the tsl2772 driver out of staging and into mainline. Signed-off-by: Brian Masney <masneyb@onstation.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2018-05-12staging: iio: tsl2x7x: rename driver to tsl2772Brian Masney4-366/+368
This patch renames this driver from tsl2x7x to tsl2772 since it is highly likely that additional devices will be added to this driver that do not match that wildcard. The tsl2772 driver name was selected since that is currently the device with the most features that are supported by this driver. This patch also adds Brian Masney's copyright to tsl2772.h for all of the work that has been done to move this driver out of staging. Signed-off-by: Brian Masney <masneyb@onstation.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2018-05-12staging: iio: tsl2x7x: add range checking to tsl2x7x_write_rawBrian Masney1-1/+12
The CALIBBIAS and INT_TIME masks in tsl2x7x_write_raw did not have any range checking in place so this patch adds the appropriate range checking. The defines TSL2X7X_ALS_GAIN_TRIM_{MIN,MAX} are also introduced by this patch. Signed-off-by: Brian Masney <masneyb@onstation.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2018-05-12staging: iio: tsl2x7x: correct IIO_EV_INFO_PERIOD valuesBrian Masney2-20/+25
The thresh periods assumed an integration time of 3ms. This patch adds support for the correct integration time (2.72ms or 2.73ms). The code had the ALS filter values as going up to 15, however the values actually went up to 60 since the values scaled in increments of 5 once the persistence value went above 3. Signed-off-by: Brian Masney <masneyb@onstation.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2018-05-12staging: iio: tsl2x7x: convert to use read_availBrian Masney1-17/+76
Make the sysfs attributes in_proximity0_calibscale_available, and in_intensity0_{calibscale,integration_time}_available be created using info_mask_separate_available on the channel configuration. The driver assumed that the ALS increment was 2.72 ms, and the upper range was 696 ms. Some other supported devices use 2.73 ms - 699 ms. This patch adds support for the multiple ranges. Signed-off-by: Brian Masney <masneyb@onstation.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2018-05-12staging: iio: tsl2x7x: use macro to populate tsl2X7X_device_infoBrian Masney1-45/+16
This patch creates a macro that populates the tsl2X7X_device_info structure to reduce duplicated code in the driver. Signed-off-by: Brian Masney <masneyb@onstation.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2018-05-12staging: iio: tsl2x7x: turn chip off if IIO device registration failsBrian Masney1-1/+4
This patch turns the chip off if IIO device registration fails so that the error handling mirrors the device remove to make review easier in preparation for moving this driver out of staging. This patch also adds a missing error check in the call to tsl2x7x_chip_on() in tsl2x7x_probe(). Signed-off-by: Brian Masney <masneyb@onstation.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2018-05-12staging: iio: tsl2x7x: use direct returnsBrian Masney1-33/+16
This patch changes the functions tsl2x7x_read_event_value() and tsl2x7x_read_raw() to use direct returns to simplify the code. Signed-off-by: Brian Masney <masneyb@onstation.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2018-05-12staging: iio: tsl2x7x: remove unnecessary whitespaceBrian Masney2-12/+11
This patch removes unnecessary whitespace in preparation for moving this driver out of staging. Signed-off-by: Brian Masney <masneyb@onstation.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2018-05-12iio: accell: mma8452: Reduce sleep time when data not readyRichard Tresidder1-1/+23
Modified the sleep method when data is not ready to allow for sampling > 50sps to work. Signed-off-by: Richard Tresidder <rtresidd@electromag.com.au> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2018-05-12iio: adc: ti-ads8688: add trigger and buffer supportSean Nyekjaer1-3/+45
Signed-off-by: Sean Nyekjaer <sean.nyekjaer@prevas.dk> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2018-05-12iio: potentiostat: lmp91000: add LMP91002 supportMatt Ranostay1-0/+2
LMP91002 is register compatible so add devicetree and i2c client ids Signed-off-by: Matt Ranostay <matt.ranostay@konsulko.com> Reviewed-by: Rob Herring <robh@kernel.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2018-05-12iio: magnetometer: mag3110: Add ability to run in continuous modeRichard Tresidder1-18/+140
Adds the ability to run the Mag3110 in continuous mode to speed up the sampling rate. Depending on the sampling rate requested the device can be put in or out of continuous mode automatically. Shifting out of continuous mode requires a potential 1 / ODR wait which is also implemented. Modified the sleep method when data is not ready to allow for sampling > 50sps to work. Signed-off-by: Richard Tresidder <rtresidd@electromag.com.au> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2018-05-12iio: adc: stm32-dfsdm: Add support for stm32mp1Fabrice Gasnier1-0/+21
Add support for DFSDM (Digital Filter For Sigma Delta Modulators) to STM32MP1. This variant is close to STM32H7 DFSDM, it implements 6 filter instances. Registers map is also increased. Signed-off-by: Fabrice Gasnier <fabrice.gasnier@st.com> Reviewed-by: Rob Herring <robh@kernel.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2018-05-12iio: imu: inv_mpu6050: make loop a do-whileMartin Kelly1-2/+2
Prior to this loop, we check if fifo_count < bytes_per_datum and bail if so. This means that when we hit the loop, we know that fifo_count >= bytes_per_datum, so the check is unneeded and we can turn the loop into a do-while for a slight performance improvement. Signed-off-by: Martin Kelly <mkelly@xevo.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2018-05-11staging: wlan-ng: fix block comment alignment in p80211metastruct.hTim Collier1-44/+44
Fix checkpatch warning for misaligned * characters in the block comment at the start of p80211metastruct.h; with this change the file is checkpatch clean. Signed-off-by: Tim Collier <osdevtc@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-11staging: bcm2835: Fix mmal_port_parameter_get() signed/unsigned warnings.Eric Anholt1-3/+3
The arg is a u32 *, so switch over to that in our declarations. Signed-off-by: Eric Anholt <eric@anholt.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-11staging: bcm2835: Remove dead code related to framerate.Eric Anholt1-5/+0
Fixes a compiler warning about a set-but-not-used variable. I think this was just leftover dead code from before set_framerate_params(), since that also sets up some mmal_parameter_rational structs for fps. Signed-off-by: Eric Anholt <eric@anholt.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-11staging: bcm2835-camera: Fix warnings about string ops on v4l2 uapi.Eric Anholt1-6/+6
The v4l2 uapi uses u8[] for strings, so cast those to char * to avoid compiler warnings about unsigned vs signed with sprintf() and friends. Signed-off-by: Eric Anholt <eric@anholt.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-11staging: bcm2835-camera: Fix indentation of tablesDave Stevenson1-150/+139
As requested by Mauro Carvalho Chehab in review. Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org> Signed-off-by: Eric Anholt <eric@anholt.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-11staging: bcm2835-camera: Fix comment typos.Dave Stevenson1-1/+1
Fix a typo flagged by checkpatch, and another in the same line. Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org> Signed-off-by: Eric Anholt <eric@anholt.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-11staging: bcm2835-camera: Replace BUG_ON with return errorDave Stevenson1-3/+4
The error conditions don't warrant taking the kernel down, so remove BUG_ON. Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org> Signed-off-by: Eric Anholt <eric@anholt.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-11staging: bcm2835-camera: Move struct vchiq_mmal_rectDave Stevenson2-8/+8
struct vchiq_mmal_rect is only referenced from mmal-parameters.h, yet was defined in mmal-vchiq.h. Move it to avoid having to include multiple headers for no reason. Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org> Signed-off-by: Eric Anholt <eric@anholt.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-11staging: bcm2835-camera: Add multiple include protectionDave Stevenson1-0/+5
mmal-parameters.h didn't have the normal ... protection to stop it being included multiple times. Add it. Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org> Signed-off-by: Eric Anholt <eric@anholt.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-11staging: bcm2835-camera: Remove V4L2/MMAL buffer remappingDave Stevenson2-87/+29
The MMAL and V4L2 buffers had been disassociated, and linked on demand. Seeing as both are finite and low in number, and we now have the same number of each, link them for the duration. This removes the complexity of maintaining lists as the struct mmal_buffer context comes back from the VPU, so we can directly link back to the relevant V4L2 buffer. Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org> Signed-off-by: Eric Anholt <eric@anholt.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-11staging: bcm2835-camera: Match MMAL buffer count to V4L2.Dave Stevenson3-26/+5
For historical reasons, the number of buffers passed to the VPU over MMAL did not match that passed from V4L2. That is a silly situation as the driver has to duplicate serialisation and other functions that have already been implemented in V4L2/videobuf2. As we had more V4L2 buffers than MMAL ones, the MMAL buffer headers were returned to the VPU immediately on being filled, which is now invalid. Match the number of buffers notified in queue_setup with that used in MMAL. Return buffers only when we get them from V4L2. Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org> Signed-off-by: Eric Anholt <eric@anholt.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-11staging: bcm2835-camera: Remove bulk_mutex as it is not requiredDave Stevenson1-47/+1
There is no requirement to serialise bulk transfers as that is all done in VCHI, and if a second MMAL_MSG_TYPE_BUFFER_TO_HOST happened before the VCHI_CALLBACK_BULK_RECEIVED, then the service_callback thread is deadlocked. Remove the bulk_mutex so that multiple receives can be scheduled at a time. Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org> Signed-off-by: Eric Anholt <eric@anholt.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-11staging: bcm2835-camera: Allocate context once per bufferDave Stevenson4-13/+62
The struct mmal_msg_context was being allocated for every message being sent to the VPU, and freed when it came back. Whilst that is required behaviour for some messages (mainly the synchronous ones), it is wasteful for the video buffers that make up the majority of the traffic. Add to the buffer_init/cleanup hooks that it allocates/frees the msg_context required. v2: changes by anholt from the downstream tree: clean up indentation, pass an error value through, forward-declare the struct so we have less void * Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org> Signed-off-by: Eric Anholt <eric@anholt.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>