aboutsummaryrefslogtreecommitdiff
path: root/drivers/staging/iio
AgeCommit message (Collapse)Author
2013-09-26iio: mxs-lradc: Remove useless check in read_rawMarek Vasut
commit 2a961d0995cdadbfba565b28beada59c5ae7ebae upstream. 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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-09-26iio: mxs-lradc: Fix misuse of iio->trigMarek Vasut
commit e1b1fa66a0398f0b52ae79a2bdc7de87c205d074 upstream. 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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-05-22staging:iio:light:tsl2x7x: fix the error handling in tsl2x7x_probe()Wei Yongjun
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ław
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-09Merge tag 'gpio-for-linus' of git://git.secretlab.ca/git/linuxLinus Torvalds
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 ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc 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 Courbot
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 Feng
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, Tony
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 Cameron
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 Cameron
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 Cameron
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 Cameron
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 Guo
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 Belloni
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 Clausen
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 Clausen
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 Clausen
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 Clausen
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 Clausen
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 Clausen
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 Clausen
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 Clausen
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 Cameron
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 Roeck
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>
2013-03-17staging:iio:adc:lpc32xx move to info_mask_(shared_by_type/separate)Jonathan Cameron
The original info_mask is going away in favour of the broken out versions. Signed-off-by: Jonathan Cameron <jic23@kernel.org> cc: Roland Stigge <stigge@antcom.de>
2013-03-17staging:iio:adc:mxs move to info_mask_(shared_by_type/separate)Jonathan Cameron
The original info_mask is going away in favour of the broken out versions. Signed-off-by: Jonathan Cameron <jic23@kernel.org> Reviewed-by: Marek Vasut <marex@denx.de>
2013-03-17staging:iio:adc:spear move to info_mask_(shared_by_type/separate)Jonathan Cameron
The original info_mask is going away in favour of the broken out versions. Signed-off-by: Jonathan Cameron <jic23@kernel.org> Acked-by: Stefan Roese <sr@denx.de>
2013-03-17staging:iio:resolver:ad2s90 move to info_mask_(shared_by_type/separate)Jonathan Cameron
The original info_mask is going away in favour of the broken out versions. Signed-off-by: Jonathan Cameron <jic23@kernel.org> Acked-by: Michael Hennerich <michael.hennerich@analog.com>
2013-03-17staging:iio:resolver:ad2s1210 move to info_mask_(shared_by_type/separate)Jonathan Cameron
The original info_mask is going away in favour of the broken out versions. Signed-off-by: Jonathan Cameron <jic23@kernel.org> Acked-by: Michael Hennerich <michael.hennerich@analog.com>
2013-03-17staging:iio:resolver:ad2s1200 move to info_mask_(shared_by_type/separate)Jonathan Cameron
The original info_mask is going away in favour of the broken out versions. Signed-off-by: Jonathan Cameron <jic23@kernel.org> Acked-by: Michael Hennerich <michael.hennerich@analog.com>
2013-03-17staging:iio:meter:ade7758 move to info_mask_(shared_by_type/separate)Jonathan Cameron
The original info_mask is going away in favour of the broken out versions. Signed-off-by: Jonathan Cameron <jic23@kernel.org> Acked-by: Lars-Peter Clausen <lars@metafoo.de>
2013-03-17staging:iio:magnetometer:hmc5843 move to info_mask_(shared_by_type/separate)Jonathan Cameron
The original info_mask is going away in favour of the broken out versions. Signed-off-by: Jonathan Cameron <jic23@kernel.org> cc: Shubhrajyoti D <shubhrajyoti@ti.com>
2013-03-17staging:iio:mag:ak8975 move to info_mask_(shared_by_type/separate)Jonathan Cameron
The original info_mask is going away in favour of the broken out versions. Signed-off-by: Jonathan Cameron <jic23@kernel.org> cc: Andrew Chew <achew@nvidia.com>
2013-03-17staging:iio:light:tsl2x7x move to info_mask_(shared_by_type/separate)Jonathan Cameron
The original info_mask is going away in favour of the broken out versions. Signed-off-by: Jonathan Cameron <jic23@kernel.org> cc: Jon Brenner <jon.brenner@ams.com>
2013-03-17staging:iio:light:isl29028 move to info_mask_(shared_by_type/separate)Jonathan Cameron
The original info_mask is going away in favour of the broken out versions. Signed-off-by: Jonathan Cameron <jic23@kernel.org> Acked-by: Laxman Dewangan <ldewangan@nvidia.com>
2013-03-17staging:iio:light:isl29018 move to info_mask_(shared_by_type/separate)Jonathan Cameron
The original info_mask is going away in favour of the broken out versions. Signed-off-by: Jonathan Cameron <jic23@kernel.org> Acked-by: Rhyland Klein <rklein@nvidia.com>
2013-03-17staging:iio:impedance:ad5933 move to info_mask_(shared_by_type/separate)Jonathan Cameron
The original info_mask is going away in favour of the broken out versions. Signed-off-by: Jonathan Cameron <jic23@kernel.org> Acked-by: Michael Hennerich <michael.hennerich@analog.com> Acked-by: Lars-Peter Clausen <lars@metafoo.de>
2013-03-17staging:iio:gyro:adis16130 move to info_mask_(shared_by_type/separate)Jonathan Cameron
The original info_mask is going away in favour of the broken out versions. Signed-off-by: Jonathan Cameron <jic23@kernel.org> Acked-by: Michael Hennerich <michael.hennerich@analog.com> Acked-by: Lars-Peter Clausen <lars@metafoo.de>
2013-03-17staging:iio:gyro:adis16060 move to info_mask_(shared_by_type/separate)Jonathan Cameron
The original info_mask is going away in favour of the broken out versions. Signed-off-by: Jonathan Cameron <jic23@kernel.org> Acked-by: Michael Hennerich <michael.hennerich@analog.com> Acked-by: Lars-Peter Clausen <lars@metafoo.de>
2013-03-17staging:iio:cdc:ad7746 move to info_mask_(shared_by_type/separate)Jonathan Cameron
The original info_mask is going away in favour of the broken out versions. Signed-off-by: Jonathan Cameron <jic23@kernel.org> Acked-by: Michael Hennerich <michael.hennerich@analog.com> Acked-by: Lars-Peter Clausen <lars@metafoo.de>
2013-03-17staging:iio:cdc:ad7152 move to info_mask_(shared_by_type/separate)Jonathan Cameron
The original info_mask is going away in favour of the broken out versions. Signed-off-by: Jonathan Cameron <jic23@kernel.org> Acked-by: Michael Hennerich <michael.hennerich@analog.com> Acked-by: Lars-Peter Clausen <lars@metafoo.de>
2013-03-17staging:iio:cdc:ad7150 move to info_mask_(shared_by_type/separate)Jonathan Cameron
The original info_mask is going away in favour of the broken out versions. Signed-off-by: Jonathan Cameron <jic23@kernel.org> Acked-by: Lars-Peter Clausen <lars@metafoo.de>
2013-03-17staging:iio:adc:ad799x move to info_mask_(shared_by_type/separate)Jonathan Cameron
The original info_mask is going away in favour of the broken out versions. Signed-off-by: Jonathan Cameron <jic23@kernel.org> Acked-by: Lars-Peter Clausen <lars@metafoo.de>
2013-03-17staging:iio:adc:ad7606 move to info_mask_(shared_by_type/separate)Jonathan Cameron
The original info_mask is going away in favour of the broken out versions. Signed-off-by: Jonathan Cameron <jic23@kernel.org> Acked-by: Lars-Peter Clausen <lars@metafoo.de>
2013-03-17staging:iio:adc:ad7291 move to info_mask_(shared_by_type/separate)Jonathan Cameron
The original info_mask is going away in favour of the broken out versions. Signed-off-by: Jonathan Cameron <jic23@kernel.org> Acked-by: Lars-Peter Clausen <lars@metafoo.de>
2013-03-17staging:iio:adc:ad7280a move to info_mask_(shared_by_type/separate)Jonathan Cameron
The original info_mask is going away in favour of the broken out versions. Signed-off-by: Jonathan Cameron <jic23@kernel.org> Acked-by: Lars-Peter Clausen <lars@metafoo.de>
2013-03-17staging:iio:accel:sca3000 move to info_mask_(shared_by_type/separate)Jonathan Cameron
The original info_mask is going away in favour of the broken out versions. Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-03-17staging:iio:accel:lis3l02dq move to info_mask_(shared_by_type/separate)Jonathan Cameron
The original info_mask is going away in favour of the broken out versions. Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-03-17staging:iio:accel:adis16220 move to info_mask_(shared_by_type/separate)Jonathan Cameron
The original info_mask is going away in favour of the broken out versions. Signed-off-by: Jonathan Cameron <jic23@kernel.org> Acked-by: Lars-Peter Clausen <lars@metafoo.de>