summaryrefslogtreecommitdiffstats
path: root/drivers/iio
Commit message (Collapse)AuthorAgeFilesLines
* iio: replace strict_strtoul() with kstrtoul()Jingoo Han2013-06-042-3/+3
| | | | | | | | | The usage of strict_strtoul() is not preferred, because strict_strtoul() is obsolete. Thus, kstrtoul() should be used. Signed-off-by: Jingoo Han <jg1.han@samsung.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* Merge 3.10-rc3 into staging-nextGreg Kroah-Hartman2013-05-273-7/+9
|\ | | | | | | | | | | | | 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>
| * iio: exynos_adc: fix wrong structure extration in suspend and resumeNaveen Krishna Chatradhi2013-05-221-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The exynos_adc device structure was wrongly extracted from the dev* correcting the same. Using the regular conversion of struct device* -> struct platform_device* -> struct exynos_adc* seems wrong. Instead we should be doing struct device* -> struct iio_dev* -> struct exynos_adc* Signed-off-by: Naveen Krishna Chatradhi <ch.naveen@samsung.com> Reviewed-by: Doug Anderson <dianders@chromium.org> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
| * iio:common:st: added disable function after read info raw dataDenis CIOCCA2013-05-221-0/+2
| | | | | | | | | | Signed-off-by: Denis Ciocca <denis.ciocca@st.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
| * iio: dac: Fix build error when CONFIG_SPI_MASTER=y && CONFIG_I2C=mAxel Lin2013-05-221-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch fixes below build error when CONFIG_SPI_MASTER=y && CONFIG_I2C=m: drivers/built-in.o: In function `ad5064_i2c_write': drivers/iio/dac/ad5064.c:608: undefined reference to `i2c_master_send' drivers/built-in.o: In function `ad5064_i2c_register_driver': drivers/iio/dac/ad5064.c:646: undefined reference to `i2c_register_driver' drivers/built-in.o: In function `ad5064_i2c_unregister_driver': drivers/iio/dac/ad5064.c:651: undefined reference to `i2c_del_driver' make: *** [vmlinux] Error 1 When CONFIG_I2C=m, meaning we can't build the drivers in with I2C support. Thus don't allow the drivers to be compiled as built-in when CONFIG_I2C=m. The real fix though is to break the driver apart into a SPI part, an I2C part and a common part. But that's something for 3.11 while this is something for 3.10/stable. Reported-by: Wu Fengguang <fengguang.wu@intel.com> Reported-by: Randy Dunlap <rdunlap@infradead.org> Signed-off-by: Axel Lin <axel.lin@ingics.com> Acked-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* | adc: exynos_adc: Convert to devm_ioremap_resource()Sachin Kamat2013-05-221-6/+6
| | | | | | | | | | | | | | | | Use the newly introduced devm_ioremap_resource() instead of devm_request_and_ioremap() which provides more consistent error handling. Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* | iio: Correct HID light sensor name in commentsAlexandre Relange2013-05-221-1/+1
| | | | | | | | | | | | | | | | The original driver was pasted from accelerometer driver, but the name of the ID was not changed. This patch fixes this comment. Signed-off-by: Alexandre Relange <alexandre@relange.org> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* | iio: STMicroelectronics: remove three useless selectsPaul Bolle2013-05-223-3/+0
| | | | | | | | | | | | | | | | | | | | | | Drivers for STMicroelectronics accelerometers, gyroscopes, and magnetometers were added in v3.9. They all have a (similar) select statement in their Kconfig files for a non-existant Kconfig symbol. These select statements can safely be removed. Signed-off-by: Paul Bolle <pebolle@tiscali.nl> Acked-by: Denis Ciocca <denis.ciocca@st.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* | iio:ak8975 Implement data ready interrupt handlingJacek Anaszewski2013-05-221-2/+89
| | | | | | | | | | | | | | | | | | | | Implement "data ready" interrupt handling in addition to the two existing read modes - DRDY GPIO polling and ST1 register DRDY bit polling. Signed-off-by: Jacek Anaszewski <j.anaszewski@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* | iio:ak8975 Add support for gpios DT propertyJacek Anaszewski2013-05-221-3/+9
| | | | | | | | | | | | | | | | | | | | Add support for parsing 'gpios' property when initializing from oftree. This patch adds also the binding documentation file. Signed-off-by: Jacek Anaszewski <j.anaszewski@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* | iio:trigger:sysfs Move out of staging.Jonathan Cameron2013-05-225-0/+253
| | | | | | | | | | | | | | | | 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>
* | iio: buffer: cleanup messages in iio_update_buffers()Michał Mirosław2013-05-221-6/+4
| | | | | | | | | | | | | | | | 1. make messages grepable (in one line) 2. include returned errno in them Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* | iio: adc: add driver for MCP3204/08 12-bit ADCOskar Andero2013-05-223-0/+268
|/ | | | | | | | | | This adds support for Microchip's 12 bit AD converters MCP3204 and MCP3208. These chips communicates over SPI and supports single-ended and pseudo-differential configurations. Signed-off-by: Oskar Andero <oskar.andero@gmail.com> Reviewed-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* iio: at91_adc: fix missing Sample and Hold timeJean-Christophe PLAGNIOL-VILLARD2013-04-021-1/+14
| | | | | | | | | | | On the at91_adc a minimal Sample and Hold Time is necessary for the ADC to guarantee the best converted final value between two channels selection. This time has to be programmed through the bitfield SHTIM in the Mode Register ADC_MR. Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Ludovic Desroches <ludovic.desroches@atmel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* iio: at91_adc: add sleep mode supportJean-Christophe PLAGNIOL-VILLARD2013-04-021-9/+10
| | | | | | | | | The sleep mode will allow to put the adc in sleep between conversion. Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Ludovic Desroches <ludovic.desroches@atmel.com> Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* iio: at91_adc: add low and high res supportLudovic Desroches2013-04-021-4/+70
| | | | | | | | | | | at91 adc offers the choice between two resolutions: low and high. The low and high resolution values depends on adc IP version, as many IP properties have been exposed through device tree, these settings have also been added to the dt bindings. Signed-off-by: Ludovic Desroches <ludovic.desroches@atmel.com> Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* iio:magnetometer:ak8975 move driver out of stagingJonathan Cameron2013-04-023-0/+497
| | | | | | | | 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>
* iio: exynos_adc: Remove redundant of_match_ptr macroSachin Kamat2013-03-291-1/+1
| | | | | | | | exynos_adc is a DT only driver and exynos_adc_match table is always compiled in. Hence remove the macro. Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* iio:trigger: Introduce iio_tigger_{set,get}_drvdataLars-Peter Clausen2013-03-259-14/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Merge tag 'iio-for-3.10a' of ↵Greg Kroah-Hartman2013-03-2552-253/+1292
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into staging-next Jonathan writes: First set of IIO new drivers and cleanup for the 3.10 cycle. New stuff 1) Add OF support for specifying mappings between iio devices and their in kernel consumers. 2) Driver for AD7923 (extra functionality and support for ad7904, ad7914 and ad7924 added later in series) 3) Driver for Exynos adc (dt suppor for phy added later in series). 4) Make iio_push_event save IRQ context - necessary if it is to be used within an interrupt handler. Users of this functionality to follow. 5) For iio use the device tree node name to provide the hwmon name attribute if available. Removal and moves out of staging 1) Drop the adt7410 driver from IIO now that there is a hmwon driver with equivalent support. This device is very much targeted at hardware monitoring so hwmon is a more appropriate host for the driver. 2) Move iio_hwmon driver to drivers/hwmon. Cleanups 1) Minor cleanup in ST common library. 2) Large set of patches to break the info_mask element which previously used odd and even bits to specify if a channel attribute was either shared across similar channels or specific to only one. Now we have two bitmaps, one for those parameters that are specific to this channel and one for those shared by all channels with the same type as this one. This has no effect on the userspace abi. It simplifies the core code and provides more space for new channel parameters. It has been on the todo list for a long time! Conflicts: drivers/iio/dac/ad5064.c
| * iio: adc: Add dt support for turning on the phy in exynos-adcDoug Anderson2013-03-171-1/+13
| | | | | | | | | | | | | | | | | | | | Without this change the exynos adc controller needed to have its phy enabled in some out-of-driver C code. Add support for specifying the phy enable register by listing it in the reg list. Signed-off-by: Doug Anderson <dianders@chromium.org> Tested-by: Naveen Krishna Chatradhi <ch.naveen@samsung.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
| * iio:adc:ad7923: Add support for the ad7904/ad7914/ad7924Lars-Peter Clausen2013-03-172-16/+53
| | | | | | | | | | | | | | | | | | | | | | | | | | The ad7924 is software compatible with the ad7923. The ad7904 and ad7914 are the 8 and 10 bit version of the ad7924. While we are at it also drop the "with temperature sensor" from the Kconfig entry, since the chips do not have a temperature sensor. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Cc: Patrick Vasseur <patrick.vasseur@c-s.fr> Cc: Christophe Leroy <christophe.leroy@c-s.fr> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
| * iio:ad7923: Implement scale reportingLars-Peter Clausen2013-03-171-7/+53
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The driver already claims to support scale reporting in its channel spec, but doesn't actually implement this yet. This patch uses the regulator API to get the reference voltage and calculates the scale based on that. The patch also moves the global configuration bits into a field in the ad7923_state struct, since depending on the RANGE bit, the range goes either from 0 to VREF or from 0 to 2 * VREF. So we need to know the setting of the RANGE bit when calculating the scale. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Cc: Patrick Vasseur <patrick.vasseur@c-s.fr> Cc: Christophe Leroy <christophe.leroy@c-s.fr> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
| * iio:ad7923: Return error if we didn't get the expected resultLars-Peter Clausen2013-03-171-0/+2
| | | | | | | | | | | | | | | | | | | | Instead of leaving 'val' uninitialized return an error if the result's address did not match that of the channel we were trying to read. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Cc: Patrick Vasseur <patrick.vasseur@c-s.fr> Cc: Christophe Leroy <christophe.leroy@c-s.fr> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
| * using kfifo_in_spinlocked instead of separate code.Ge Gao2013-03-171-3/+2
| | | | | | | | | | Signed-off-by: Ge Gao <ggao@invensense.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
| * iio: adc: Kconfig: exynos_adc depends on CONFIG_OFNaveen Krishna Chatradhi2013-03-171-0/+1
| | | | | | | | | | | | | | | | | | | | | | As the exynos_adc driver only supports device tree registration. Making driver depend on CONFIG_OF solves possible errors during probe. Signed-off-by: Naveen Krishna Chatradhi <ch.naveen@samsung.com> Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Reviewed-by: Doug Anderson <dianders@chromium.org> Cc: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
| * iio: events: Make iio_push_event() IRQ context saveLars-Peter Clausen2013-03-171-14/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently it is not save to call iio_push_event() from hard IRQ context since the IIO event code uses spin_lock()/spin_unlock() and it is not save to mix calls to spin_lock()/spin_unlock() from different contexts on the same lock. E.g. if the lock is being held in iio_event_chrdev_read() and an interrupts kicks in and the interrupt handler calls iio_push_event() we end uo with a deadlock. This patch updates iio_push_event() to use spin_lock_irqsave()/ spin_unlock_irqstrestore(), since it can be called from both IRQ and non-IRQ context. All other other users of the lock, which are always run in non-IRQ context, are updated to spin_lock_irq()/spin_unlock_irq(). Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
| * iio:core drop info_mask from struct iio_infoJonathan Cameron2013-03-171-17/+0
| | | | | | | | | | | | | | | | This has been replaced by the pair of masks info_mask_separate and info_mask_shared_by_type. Other variants may follow. Signed-off-by: Jonathan Cameron <jic23@kernel.org> Acked-by: Lars-Peter Clausen <lars@metafoo.de>
| * iio:adc:ad7923 move to info_mask_(shared_by_type/separate)Jonathan Cameron2013-03-171-2/+2
| | | | | | | | | | | | | | | | | | 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> cc: Patrick Vasseur <patrick.vasseur@c-s.fr> cc: Christophe Leroy <christophe.leroy@c-s.fr>
| * iio:adc:exynos move to info_mask_(shared_by_type/separate)Jonathan Cameron2013-03-171-1/+1
| | | | | | | | | | | | | | The original info_mask is going away in favour of the broken out versions. Signed-off-by: Jonathan Cameron <jic23@kernel.org> Acked-by: Naveen Krishna Chatradhi <ch.naveen@samsung.com>
| * iio:light:vcnl4000 move to info_mask_(shared_by_type/separate)Jonathan Cameron2013-03-171-3/+3
| | | | | | | | | | | | | | The original info_mask is going away in favour of the broken out versions. Signed-off-by: Jonathan Cameron <jic23@kernel.org> cc: Peter Meerwald <pmeerw@pmeerw.net>
| * iio:light:tsl2563 move to info_mask_(shared_by_type/separate)Jonathan Cameron2013-03-171-5/+5
| | | | | | | | | | | | | | 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 <jbrenner@taosinc.com>
| * iio:light:lm3533 move to info_mask_(shared_by_type/separate)Jonathan Cameron2013-03-171-3/+3
| | | | | | | | | | | | | | The original info_mask is going away in favour of the broken out versions. Signed-off-by: Jonathan Cameron <jic23@kernel.org> cc: Johan Hovold <jhovold@gmail.com>
| * iio:light:adjd_s311 move to info_mask_(shared_by_type/separate)Jonathan Cameron2013-03-171-2/+2
| | | | | | | | | | | | | | The original info_mask is going away in favour of the broken out versions. Signed-off-by: Jonathan Cameron <jic23@kernel.org> cc: Peter Meerwald <pmeerw@pmeerw.net>
| * iio:imu:mpu6050 move to info_mask_(shared_by_type/separate)Jonathan Cameron2013-03-171-5/+5
| | | | | | | | | | | | | | The original info_mask is going away in favour of the broken out versions. Signed-off-by: Jonathan Cameron <jic23@kernel.org> cc: Ge Gao <ggao@invensense.com>
| * iio:imu:adis16480 move to info_mask_(shared_by_type/separate)Jonathan Cameron2013-03-171-16/+16
| | | | | | | | | | | | | | 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>
| * iio:imu:adis16400 move to info_mask_(shared_by_type/separate)Jonathan Cameron2013-03-171-24/+25
| | | | | | | | | | | | | | 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>
| * iio:gyro:itg3200_core move to info_mask_(shared_by_type/separate)Jonathan Cameron2013-03-171-8/+5
| | | | | | | | | | | | | | The original info_mask is going away in favour of the broken out versions. Signed-off-by: Jonathan Cameron <jic23@kernel.org> cc: Manuel Stahl <manuel.stahl@iis.fraunhofer.de>
| * iio:gyro:adxrs450 move to info_mask_(shared_by_type/separate)Jonathan Cameron2013-03-171-11/+11
| | | | | | | | | | | | | | 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>
| * iio:gyro:adis16136 move to info_mask_(shared_by_type/separate)Jonathan Cameron2013-03-171-6/+7
| | | | | | | | | | | | | | 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>
| * iio:gyro:adis16080 move to info_mask_(shared_by_type/separate)Jonathan Cameron2013-03-171-11/+11
| | | | | | | | | | | | | | 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>
| * iio:freq:ad9523 move to info_mask_(shared_by_type/separate)Jonathan Cameron2013-03-171-4/+4
| | | | | | | | | | | | | | 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>
| * iio:dac:mcp4725 move to info_mask_(shared_by_type/separate)Jonathan Cameron2013-03-171-2/+2
| | | | | | | | | | | | | | The original info_mask is going away in favour of the broken out versions. Signed-off-by: Jonathan Cameron <jic23@kernel.org> cc: Peter Meerwald <pmeerw@pmeerw.net>
| * iio:dac:max517 move to info_mask_(shared_by_type/separate)Jonathan Cameron2013-03-171-2/+2
| | | | | | | | | | | | | | 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>
| * iio:dac:ad5791 move to info_mask_(shared_by_type/separate)Jonathan Cameron2013-03-171-3/+3
| | | | | | | | | | | | | | 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>
| * iio:dac:ad5764 move to info_mask_(shared_by_type/separate)Jonathan Cameron2013-03-171-5/+5
| | | | | | | | | | | | | | 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>
| * iio:dac:ad5755 move to info_mask_(shared_by_type/separate)Jonathan Cameron2013-03-171-5/+5
| | | | | | | | | | | | | | 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>
| * iio:dac:ad5686 move to info_mask_(shared_by_type/separate)Jonathan Cameron2013-03-171-3/+3
| | | | | | | | | | | | | | 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>
| * iio:dac:ad5624r move to info_mask_(shared_by_type/separate)Jonathan Cameron2013-03-171-2/+2
| | | | | | | | | | | | | | 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>
| * iio:dac:ad5504 move to info_mask_(shared_by_type/separate)Jonathan Cameron2013-03-171-2/+2
| | | | | | | | | | | | | | 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>
OpenPOWER on IntegriCloud