aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/iio (follow)
AgeCommit message (Collapse)AuthorFilesLines
2013-07-09iio staging: fix lis3l02dq, read error handlingPeter Meerwald1-0/+2
Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-07-06staging:iio:ad7291: add missing .driver_module to struct iio_infoWei Yongjun1-0/+1
Add missing .driver_module of struct iio_info. This prevents the module from being removed from underneath its users. Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-07-06iio: mxs-lradc: Remove useless check in read_rawMarek Vasut1-7/+0
The removed check in the read_raw implementation was always true, therefore remove it. This also fixes a bug, by closely inspecting the code, one can notice the iio_validate_scan_mask_onehot() will always return 1 and therefore the subsequent condition will always succeed, therefore making the mxs_lradc_read_raw() function always return -EINVAL; . Signed-off-by: Marek Vasut <marex@denx.de> Tested-by: Otavio Salvador <otavio@ossystems.com.br> Acked-by: Hector Palacios <hector.palacios@digi.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-07-03iio: mxs-lradc: Fix misuse of iio->trigMarek Vasut1-4/+7
The struct iio_dev .trig field is to be used only by the IIO core, the driver shall not fill this field. This fixes ugly crash when the driver is compiled as a module and the module is rmmod'd. Signed-off-by: Marek Vasut <marex@denx.de> Cc: Fabio Estevam <fabio.estevam@freescale.com> Cc: Jonathan Cameron <jic23@kernel.org> Cc: Shawn Guo <shawn.guo@linaro.org> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-06-14staging:iio:ad7291: Rework regulator handlingLars-Peter Clausen2-15/+35
Add platform_data for the driver which allows to specify whether an external reference voltage is used or not. It is not possible to use the return value of regulator_get() for this since the regulator framework is able to return a dummy regulator in case no regulator has been specified. In this case the driver will always get a valid regulator, no matter if it has been specified or not. Also make the regulator non-optional if platform_data states that an external reference voltage should be used. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-06-14staging:iio:ad7291: Use sign_extend32 instead of open-coding itLars-Peter Clausen1-8/+3
This makes it a bit more obvious what is going on than open-coding it. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-06-14staging:iio:ad7291: Use i2c_smbus_{read,write}_word_swapped instead of open-coding itLars-Peter Clausen1-11/+9
No need to swap the upper and lower byte by hand if there is a helper function which already does this. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-06-14staging:iio:ad7291: Simplify threshold register lookupLars-Peter Clausen1-79/+42
The AD7291 register map is nicely uniform and we can easily compute the threshold register address for a certain channel using simple math instead of using a look-up table. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-06-14staging:iio:ad7291: Remove unnecessary dev_info() from probe()Lars-Peter Clausen1-3/+0
No need spam the log during probe if nothing went wrong. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-06-14staging:iio:ad7291: Remove userspace resetLars-Peter Clausen1-24/+0
There is no reason why userspace should want to trigger a manual reset of the device, so remove this functionality. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-06-14staging:iio:ad7291: Use IIO_VAL_FRACTIONAL_LOG2Lars-Peter Clausen1-5/+3
This is a bit more straight forward and also allows better precession when using the an in-kernel consumer. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-06-11staging:iio:adis16130: Move out of stagingLars-Peter Clausen3-218/+0
The adis16130 driver is fairly simple and it a good shape now, so move it out of staging. Remove an outdated FIXME along the way. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-06-11staging:iio:adis16130: Report scale and offsetLars-Peter Clausen1-10/+47
Report scale and offset for the temperature and voltage channels. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-06-11staging:iio:adis16130: Fix sample readingLars-Peter Clausen1-1/+0
The driver first does a proper read of the data register, but right after that it does a spi_read, which will overwrite the initial result. It looks as if the extra spi_read was accidentally introduced in commit a5e7363ca ("staging:iio:gyro:adis16130 drop control of adc resolution."), quite likely due to a bad rebase. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-06-11staging:iio:adis16130: Remove unused includesLars-Peter Clausen1-6/+0
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-06-08staging: iio: spear_adc: Add missing CONFIG_OF macroSachin Kamat1-0/+2
The data structure is required only when DT is enabled. Hence compile it conditionally. Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Acked-by: Stefan Roese <sr@denx.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-06-06staging: iio: lpc32xx_adc: Remove redundant platform_set_drvdata()Sachin Kamat1-1/+0
Commit 0998d06310 (device-core: Ensure drvdata = NULL when no driver is bound) removes the need to set driver data field to NULL. Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Tested-by: Roland Stigge <stigge@antcom.de> Acked-by: Roland Stigge <stigge@antcom.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-06-06staging: iio: spear_adc: Remove redundant platform_set_drvdata()Sachin Kamat1-1/+0
Commit 0998d06310 (device-core: Ensure drvdata = NULL when no driver is bound) removes the need to set driver data field to NULL. Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Acked-by: Stefan Roese <sr@denx.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-06-06staging: iio: ad7606_par: Remove redundant platform_set_drvdata()Sachin Kamat1-2/+0
Commit 0998d06310 (device-core: Ensure drvdata = NULL when no driver is bound) removes the need to set driver data field to NULL. Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Cc: Michael Hennerich <hennerich@blackfin.uclinux.org> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-06-04iio:triggers:interrupt trigger - move out of staging.Jonathan Cameron3-128/+0
This is now a very simple trigger indeed but useful in many common cases. Signed-off-by: Jonathan Cameron <jic23@kernel.org> Reviewed-by: Lars-Peter Clausen <lars@metafoo.de>
2013-06-04staging:iio:triggers:interrupt trigger - one per platform device.Jonathan Cameron1-76/+45
Switching from one platform device registering a lot of triggers to one for each trigger simplifies the code somewhat. It would be relatively unusual to have more than a couple of such devices registered so this change will not result in much additional overhead. Signed-off-by: Jonathan Cameron <jic23@kernel.org> Reviewed-by: Lars-Peter Clausen <lars@metafoo.de>
2013-06-04staging:iio:triggers: rename iio-trig-gpio to iio-trig-interruptJonathan Cameron3-45/+31
Also change all internal naming appropriately. This trigger is no longer just for gpio provided interrupts so change the naming to reflect this. Also drop some now missleading left over comments. Signed-off-by: Jonathan Cameron <jic23@kernel.org> Reviewed-by: Lars-Peter Clausen <lars@metafoo.de>
2013-06-04staging:iio:trigger:gpio bug in release of gpio in error pathJonathan Cameron1-2/+1
Also dropped the unneeded gpio.h header. Signed-off-by: Jonathan Cameron <jic23@kernel.org> Reviewed-by: Lars-Peter Clausen <lars@metafoo.de>
2013-05-27Merge 3.10-rc3 into staging-nextGreg Kroah-Hartman2-7/+7
We want the changes here, and we resolve the merge conflict that was happening in the nvec_kbd.c file. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-05-22iio:trigger:sysfs Move out of staging.Jonathan Cameron3-239/+0
This simple driver is rather useful. No issues about its interface have been raised for some time hence the proposal to move it out of staging. Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-05-22staging/iio/mxs-lradc: cleanup masklengthMichał Mirosław1-4/+4
We know the exact iio->masklength = LRADC_MAX_TOTAL_CHANS. Let's use it consistently. Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-05-22staging:iio:light:tsl2x7x: fix the error handling in tsl2x7x_probe()Wei Yongjun1-4/+5
Fix to return -EINVAL in the i2c device found error handling case instead of 0, as done elsewhere in this function. And also correct the fail1 and fail2 lable to do the right thing. Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-05-22staging/iio/mxs-lradc: fix preenable for multiple buffersMichał Mirosław1-3/+2
This fixes 'preenable failed: -EINVAL' error when using this driver. Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-05-13staging:iio:adc: Use kstrtol()/kstrtoul()Aida Mynzhasova5-11/+17
Replace deprecated strict_strtol()/strict_strtoul() with kstrtol()/kstrtoul(). Add missing checks for conversion return codes. Signed-off-by: Aida Mynzhasova <ai.c.c0der@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-05-09Merge tag 'gpio-for-linus' of git://git.secretlab.ca/git/linuxLinus Torvalds5-6/+6
Pull removal of GENERIC_GPIO from Grant Likely: "GENERIC_GPIO now synonymous with GPIOLIB. There are no longer any valid cases for enableing GENERIC_GPIO without GPIOLIB, even though it is possible to do so which has been causing confusion and breakage. This branch does the work to completely eliminate GENERIC_GPIO." * tag 'gpio-for-linus' of git://git.secretlab.ca/git/linux: gpio: update gpio Chinese documentation Remove GENERIC_GPIO config option Convert selectors of GENERIC_GPIO to GPIOLIB blackfin: force use of gpiolib m68k: coldfire: use gpiolib mips: pnx833x: remove requirement for GENERIC_GPIO openrisc: default GENERIC_GPIO to false avr32: default GENERIC_GPIO to false xtensa: remove explicit selection of GENERIC_GPIO sh: replace CONFIG_GENERIC_GPIO by CONFIG_GPIOLIB powerpc: remove redundant GENERIC_GPIO selection unicore32: default GENERIC_GPIO to false unicore32: remove unneeded select GENERIC_GPIO arm: plat-orion: use GPIO driver on CONFIG_GPIOLIB arm: remove redundant GENERIC_GPIO selection mips: alchemy: require gpiolib mips: txx9: change GENERIC_GPIO to GPIOLIB mips: loongson: use GPIO driver on CONFIG_GPIOLIB mips: remove redundant GENERIC_GPIO select
2013-05-02Merge tag 'cleanup-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-socLinus Torvalds1-3/+0
Pull ARM SoC cleanup from Olof Johansson: "Here is a collection of cleanup patches. Among the pieces that stand out are: - The deletion of h720x platforms - Split of at91 non-dt platforms to their own Kconfig file to keep them separate - General cleanups and refactoring of i.MX and MXS platforms - Some restructuring of clock tables for OMAP - Convertion of PMC driver for Tegra to dt-only - Some renames of sunxi -> sun4i (Allwinner A10) - ... plus a bunch of other stuff that I haven't mentioned" * tag 'cleanup-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (119 commits) ARM: i.MX: remove unused ARCH_* configs ARM i.MX53: remove platform ahci support ARM: sunxi: Rework the restart code irqchip: sunxi: Rename sunxi to sun4i irqchip: sunxi: Make use of the IRQCHIP_DECLARE macro clocksource: sunxi: Rename sunxi to sun4i clocksource: sunxi: make use of CLKSRC_OF clocksource: sunxi: Cleanup the timer code ARM: at91: remove trailing semicolon from macros ARM: at91/setup: fix trivial typos ARM: EXYNOS: remove "config EXYNOS_DEV_DRM" ARM: EXYNOS: change the name of USB ohci header ARM: SAMSUNG: Remove unnecessary code for dma ARM: S3C24XX: Remove unused GPIO drive strength register definitions ARM: OMAP4+: PM: Restore CPU power state to ON with clockdomain force wakeup method ARM: S3C24XX: Removed unneeded dependency on CPU_S3C2412 ARM: S3C24XX: Removed unneeded dependency on CPU_S3C2410 ARM: S3C24XX: Removed unneeded dependency on ARCH_S3C24XX for boards ARM: SAMSUNG: Fix typo "CONFIG_SAMSUNG_DEV_RTC" ARM: S5P64X0: Fix typo "CONFIG_S5P64X0_SETUP_SDHCI" ...
2013-04-16Convert selectors of GENERIC_GPIO to GPIOLIBAlexandre Courbot5-6/+6
GENERIC_GPIO is now equivalent to GPIOLIB and features that depended on GENERIC_GPIO can now depend on GPIOLIB to allow removal of this option. Signed-off-by: Alexandre Courbot <acourbot@nvidia.com> Acked-by: Linus Walleij <linus.walleij@linaro.org> Acked-by: Grant Likely <grant.likely@secretlab.ca>
2013-04-09staging:iio:dummy: Fix mismatch and export sysfs entryJin Feng1-2/+9
Correct the mismatch bewteen calibscale and calibbias, and export the in_accel_calibscale sysfs entry Updated to apply to current tree. Signed-off-by: Jin Feng <jin88.feng@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-04-09staging:iio:adt7316 Fix some 'interesting' string operationsLuck, Tony1-13/+13
Calling memcmp() to check the value of the first byte in a string is overkill. Just use buf[0] == '1' or buf[0] != '1' as appropriate. Signed-off-by: Tony Luck <tony.luck@intel.com> Acked-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-04-02iio:magnetometer:ak8975 move driver out of stagingJonathan Cameron3-497/+0
Issues raised in last series to propose this have now been resolved so there should be no reason this driver cannot graduate from staging. Signed-off-by: Jonathan Cameron <jic23@kernel.org> Acked-by: Laxman Dewangan <ldewangan@nvidia.com>
2013-04-02staging:iio:magnetometer:ak8975 use standard i2c_smbus read functions.Jonathan Cameron1-49/+17
Now the mysterious NOSTART flag is gone from the read, we can use the i2c_smbus_read_byte/word/i2c_block_data functions instead of the local reimplementation of these standard functions. Signed-off-by: Jonathan Cameron <jic23@kernel.org> Acked-by: Laxman Dewangan <ldewangan@nvidia.com>
2013-04-02staging:iio:magnetometer:ak8975 drop I2C_M_NOSTART flag in read_dataJonathan Cameron1-1/+0
This flag makes no sense whatsoever where it is. Documentation/i2c/i2c-protocol states: If you set the I2C_M_NOSTART variable for the first partial message, we do not generate Addr, but we do generate the startbit S. This will probably confuse all other clients on your bus, so don't try this. This is exactly what is going on here. Likelihood given that the driver never checked for this protocol mangling being available is that it wasn't present on the test boards and hence this flag was simply ignored. No indication of why it would be necessary has been found in the datasheets. Signed-off-by: Jonathan Cameron <jic23@kernel.org> Acked-by: Laxman Dewangan <ldewangan@nvidia.com>
2013-04-02staging:iio:magnetometer:ak8975 drop unused eoc_irqJonathan Cameron1-2/+0
Signed-off-by: Jonathan Cameron <jic23@kernel.org> Acked-by: Laxman Dewangan <ldewangan@nvidia.com>
2013-04-01iio: mxs-lradc: remove unneeded mach header inclusionShawn Guo1-3/+0
Headers <mach/mxs.h> and <mach/common.h> are not used in the driver at all. Removed the inclusions. Signed-off-by: Shawn Guo <shawn.guo@linaro.org> Acked-by: Jonathan Cameron <jic23@kernel.org>
2013-03-29iio: mxs-lradc: Do hardware initialization earlierAlexandre Belloni1-3/+3
We need to initialize hardware before registering the touchscreen. Else, we end up setting registers in mxs_lradc_ts_open(), getting called just after registering the touchscreen with input_register_device() and by the end of mxs_lradc_probe(), we reset the LRADC block hence losing the correct configuration. Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com> Acked-by: Marek Vasut <marex@denx.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org> Cc: Fabio Estevam <fabio.estevam@freescale.com>
2013-03-29staging:iio:ad799x: Preallocate sample bufferLars-Peter Clausen3-12/+15
Avoid allocating and freeing the sample buffer for each transfer. Instead allocate it once when we start sampling. Also pre-compute the number of bytes we need to transfer in the same way. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-03-29staging:iio:ad799x: Set IIO_CHAN_INFO_SCALE maskLars-Peter Clausen1-0/+1
The driver has support for reporting a channels scale, but none of the channels set the IIO_CHAN_INFO_SCALE mask. Add the IIO_CHAN_INFO_SCALE to all channels to indicate that the drivers supports reporting the scale. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-03-29staging:iio:ad799x: Add helper macro for channel initializationLars-Peter Clausen1-330/+56
The ad779x channels all follow the same pattern. Add a helper macro to initialize the channel spec, this allows us to drop quite a few lines. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-03-29staging:iio:ad799x: Use i2c_smbus_{read,write}_word_data_swappedLars-Peter Clausen1-3/+3
Use i2c_smbus_{read,write}_word_data_swapped instead of open-coding it. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-03-29staging:iio:ad799x: Remove internal reference supportLars-Peter Clausen2-14/+4
None of the devices supported by this driver have an internal voltage reference, so remove support for it from the driver. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-03-29staging:iio:ad799x: Remove unused ad799x_state fieldsLars-Peter Clausen1-2/+0
Remove fields from the ad799x_state struct which are not used. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-03-25iio:trigger: Use dev_{set,get}_drvdata for private data managementLars-Peter Clausen1-3/+0
Use dev_{set,get}_drvdata for managing private data attached to a trigger instead of using a custom field in the iio_trigger struct. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-03-25iio:trigger: Introduce iio_tigger_{set,get}_drvdataLars-Peter Clausen7-23/+23
Introduce iio_tigger_{set,get}_drvdata which allows to attach driver specific data to a trigger. The functions wrap access to the triggers private_data field and all current users are updated to use iio_tigger_{set,get}_drvdata instead of directly accessing the private_data field. This is the first step towards removing the private_data field from the iio_trigger struct. The following coccinelle script has been used to update the drivers: <smpl> @@ struct iio_trigger *trigger; expression priv; @@ -trigger->private_data = priv +iio_trigger_set_drv_data(trigger, priv) @@ struct iio_trigger *trigger; @@ -trigger->private_data +iio_trigger_get_drv_data(trigger) </smpl> Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-03-23hwmon: Move the IIO client driver for hwmon out of stagingJonathan Cameron3-206/+0
This driver uses channel maps, defined either through device tree or platform data, to create a hwmon driver which acts as a client for the underlying IIO device channels. Thus a general purpose IIO adc driver can be used to provide hardware monitoring using a subset of its channels. Signed-off-by: Jonathan Cameron <jic23@kernel.org> Acked-by: Guenter Roeck <linux@roeck-us.net> -- The only non move changes here concern the description and changes to the dependencies to IIO explicit and hwmon implicit. I'm proposing moving this into hwmon on the basis of placing drivers based on what they provide rather than what their underlying hardware is. drivers/hwmon/Kconfig | 9 ++ drivers/hwmon/Makefile | 1 + drivers/hwmon/iio_hwmon.c | 196 ++++++++++++++++++++++++++++++++++++++++ drivers/staging/iio/Kconfig | 8 -- drivers/staging/iio/Makefile | 2 - drivers/staging/iio/iio_hwmon.c | 196 ---------------------------------------- 6 files changed, 206 insertions(+), 206 deletions(-)
2013-03-20staging/iio: iio_hwmon: Use device tree node name for hwmon name attributeGuenter Roeck1-1/+7
So far, all instances of iio_hwmon set their hwmon name attribute to "iio_hwmon", which is not very descriptive. Set it to the device tree node name if available, and only revert to iio_hwmon otherwise. Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Jonathan Cameron <jic23@kernel.org>