Commit Graph

320 Commits

Author SHA1 Message Date
Greg Kroah-Hartman 78077256bc The first round of IIO fixes for the 3.11 cycle.
This set is larger than I would like, partly due to my lack of review
 time in the weeks before the merge window and partly because a
 couple of large drivers and the subsystem as a whole seem to be
 getting a lot more exposure and testing recently.
 
 1) A long term bug in trigger handling gave a double free of the device.
 
 2) Wrong return value handling means offsets are ignored in
    iio_convert_raw_to_processed_unlocked.
 
 3) The iio_channel_has_info utility function was incorrectly updated
    during the recent info_mask split, this is now fixed.
 
 4) mxs-lradc has a couple of little fixes.
 
 5) A couple of missing .driver_module entries meant that drivers
    could be removed from underneath their users.
 
 6) Error path fixes for ad7303 and lis3l02dq.
 
 7) The scale value for presure in the lps331ap driver was out by
    a factor of 100.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.20 (GNU/Linux)
 
 iQIcBAABAgAGBQJR5QAJAAoJEFSFNJnE9BaIG2oP/1kV33gxoFwoKMblG7J1paHU
 h8XdffT93XJTHnCMykCgI9KjohKtr0UmtDLXLXuZD9mkq6T9e6qh6xwpap68Nmwn
 bCPdaYfqU8cmJ794JV3uK2MUqQphTvV5WhjH4U7qJU8jDesSinPYxEH04DXVnCLC
 600PHw8bbl4DGCYLgpDKeq0zZ/4joKFhItVNaRPCpJJB/MYbLkOXE8CLhSoGslKo
 IfpcBvuN7oYS4CbLqvnkMOmrSaI4a4eI3L6vG42zNuOQLPyL2dNZK3/ViJCJFbqX
 FbYbYvgApn04liyVkSDQAgW3fkQivF0Lh9R2kkHQ/meTqDMr+r6uvyQ6KDYgw6Px
 Xh79hwHn/mjT3xRWqtMeMJ85v/9I2dGpKeX2EUm4a8o3+5/gq/oyHR2eF2OZfvBn
 b3X1PYk29TkGN2K42JKwMJUqHFnVc4w91A9/TWTqz/cqFvBWvdJb8IJmijSug4NG
 /MN9U07QJgsH5sgRjhkorRe68dXvvBNAhka5ZX3TzrxUO74AdmJ/FscoFulevPgs
 MTpP8/OxRs4ez94SMNiudK6o6ycNCJYsyKEaF9utDhsJf3W04bXMIP2HvEmZRz14
 DCh6v33/vqVjSnrHt95XVa37ahoGUClzAyqvJ+AbnlCXH9yvLjtvP6zLL2p014Zu
 UcK4x2wZrEhCH6RHPK1y
 =ratf
 -----END PGP SIGNATURE-----

Merge tag 'iio-fixes-for-3.11a' of git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into staging-linus

Jonathan writes:

The first round of IIO fixes for the 3.11 cycle.

This set is larger than I would like, partly due to my lack of review
time in the weeks before the merge window and partly because a
couple of large drivers and the subsystem as a whole seem to be
getting a lot more exposure and testing recently.

1) A long term bug in trigger handling gave a double free of the device.

2) Wrong return value handling means offsets are ignored in
   iio_convert_raw_to_processed_unlocked.

3) The iio_channel_has_info utility function was incorrectly updated
   during the recent info_mask split, this is now fixed.

4) mxs-lradc has a couple of little fixes.

5) A couple of missing .driver_module entries meant that drivers
   could be removed from underneath their users.

6) Error path fixes for ad7303 and lis3l02dq.

7) The scale value for presure in the lps331ap driver was out by
   a factor of 100.
2013-07-16 22:41:38 -07:00
Jacek Anaszewski 67dbf54a3b iio: lps331ap: Fix wrong in_pressure_scale output value
This patch fixes improper in_pressure_scale output that is
returned by the lps331ap barometer sensor driver. According
to the documentation the pressure after applying the scale has to
be expressed in kilopascal units. With erroneous implementation
the scale value larger by two orders of magnitude is returned -
2441410 instead of 24414.

Signed-off-by: Jacek Anaszewski <j.anaszewski@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Acked-by: Denis Ciocca <denis.ciocca@st.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-07-16 08:51:57 +01:00
Linus Torvalds 3aa78e0cb5 For the 3.11 merge we only have one new MFD driver for the Kontron PLD.
But we also have:
 
 - Support for the TPS659038 PMIC from the palmas driver.
 
 - Intel's Coleto Creek and Avoton SoCs support from the lpc_ich driver.
 
 - RTL8411B support from the rtsx driver.
 
 - More DT support for the Arizona, max8998, twl4030-power and the
   ti_am335x_tsadc drivers.
 
 - The SSBI driver move under MFD.
 
 - A conversion to the devm_* API for most of the MFD drivers.
 
 - The twl4030-power got split from twl-core into its own module.
 
 - A major ti_am335x_adc cleanup, leading to a proper DT support.
 
 - Our regular arizona and wm* updates and cleanups from the Wolfson
   folks.
 
 - A better error handling and initialization, and a regulator subdevice
   addition for the 88pm80x driver.
 
 - A bulk platform_set_drvdata() call removal that's no longer need since
   commit 0998d063.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.12 (GNU/Linux)
 
 iQIcBAABAgAGBQJR2zCaAAoJEIqAPN1PVmxK29EP/ieZf7Z7z7bg/0lEOvtOzACy
 WoCdSGFu5XcHOnlv0Fl1Rr/1AJFQoh4KugkGnVyrlztYVOFymj5VDdd8B43cxMLt
 7ymK/3crIH7uJuOoeDoDr3glLuo0TGB9f5Kv4ITdVD3/+AuqY4VIAisEDb0aWghW
 +v0I3fYeGdwRv+IqO5wacvddSoLa4rmOhnpbVMB2O1Y/LCm/yHI6tAFx1+AfH7y8
 zMHbGFc+gHg1xupJBCnRel0v8J+KNc02G/B1zNom/avL8b/mNXNI8JFxs3bMA0r8
 NpTHJ49OVPbhBQTA4U+BPoG4nzOiAOj0czf9dkGa5cyR8t4C9mmK+s8QHwepzrSG
 qbhCgTqp4bomB1m0RAO+z4F6BHTpmoChpho2btrwN9ZmhMHQeTWnGjjhEwZngpBq
 F22DC6k5ipV0k4962ZHfZ76v2Vot1gfd6zQ5r+2oHMMfWaKgS4L5efP2/wsU9H58
 BxMm84C7OWbgcTRmNn9jl4L9phBD31wvNANfUeMhLMyshnwPK5ZuUdX/+K2rq6h9
 w26Hg62HtKZFv/TEsCBQqpB6zSZa4u/KZzvwEahllQSQGKxIHaNYGtLGzJj9sCM+
 baT/82DFKuEvKfJpUKSBMznImp4WNGEz+8s2w4m/Ssuf30GN2GHjM9Q4gcHJu2mk
 7fTrsSHWYN+EHVzh1Zb8
 =RqMp
 -----END PGP SIGNATURE-----

Merge tag 'mfd-3.11-1' of git://git.kernel.org/pub/scm/linux/kernel/git/sameo/mfd-next

Pull MFD update from Samuel Ortiz:
 "For the 3.11 merge we only have one new MFD driver for the Kontron
  PLD.

  But we also have:
   - Support for the TPS659038 PMIC from the palmas driver.
   - Intel's Coleto Creek and Avoton SoCs support from the lpc_ich
     driver.
   - RTL8411B support from the rtsx driver.
   - More DT support for the Arizona, max8998, twl4030-power and the
     ti_am335x_tsadc drivers.
   - The SSBI driver move under MFD.
   - A conversion to the devm_* API for most of the MFD drivers.
   - The twl4030-power got split from twl-core into its own module.
   - A major ti_am335x_adc cleanup, leading to a proper DT support.
   - Our regular arizona and wm* updates and cleanups from the Wolfson
     folks.
   - A better error handling and initialization, and a regulator
     subdevice addition for the 88pm80x driver.
   - A bulk platform_set_drvdata() call removal that's no longer need
     since commit 0998d06310 ("device-core: Ensure drvdata = NULL when
     no driver is bound")

* tag 'mfd-3.11-1' of git://git.kernel.org/pub/scm/linux/kernel/git/sameo/mfd-next: (102 commits)
  mfd: sec: Provide max_register to regmap
  mfd: wm8994: Remove duplicate check for active JACKDET
  MAINTAINERS: Add include directory to MFD file patterns
  mfd: sec: Remove fields not used since regmap conversion
  watchdog: Kontron PLD watchdog timer driver
  mfd: max8998: Add support for Device Tree
  regulator: max8998: Use arrays for specifying voltages in platform data
  mfd: max8998: Add irq domain support
  regulator: palmas: Add TPS659038 support
  mfd: Kontron PLD mfd driver
  mfd: palmas: Add TPS659038 PMIC support
  mfd: palmas: Add SMPS10_BOOST feature
  mfd: palmas: Check if irq is valid
  mfd: lpc_ich: iTCO_wdt patch for Intel Coleto Creek DeviceIDs
  mfd: twl-core: Change TWL6025 references to TWL6032
  mfd: davinci_voicecodec: Fix build breakage
  mfd: vexpress: Make the driver optional for arm and arm64
  mfd: htc-egpio: Use devm_ioremap_nocache() instead of ioremap_nocache()
  mfd: davinci_voicecodec: Convert to use devm_* APIs
  mfd: twl4030-power: Fix relocking on error
  ...
2013-07-10 11:10:27 -07:00
Wei Yongjun bc93aa7640 iio: ti_am335x_adc: add missing .driver_module to struct iio_info
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-06 10:37:21 +01:00
Alexandre Belloni f91d1b63a4 iio: inkern: fix iio_convert_raw_to_processed_unlocked
When reading IIO_CHAN_INFO_OFFSET, the return value of iio_channel_read() for
success will be IIO_VAL*, checking for 0 is not correct.

Without this fix the offset applied by iio drivers will be ignored when
converting a raw value to one in appropriate base units (e.g mV) in
a IIO client drivers that use iio_convert_raw_to_processed including
iio-hwmon.

Cc: <stable@vger.kernel.org> # 3.10.x
Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-07-03 20:30:52 +01:00
Jonathan Cameron 8bade40664 iio:trigger: device_unregister->device_del to avoid double free
iio_trigger unregistration and freeing has been separated in this
code for some time, but it looks like the calls to the device
handling were not appropriately updated.

Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Reported-by: Otavio Salvador <otavio@ossystems.com.br>
Tested-by: Otavio Salvador <otavio@ossystems.com.br>
Reviewed-by: Lars-Peter Clausen <lars@metafoo.de>
2013-06-29 13:26:11 +01:00
Wei Yongjun 94fccb7841 iio: dac: ad7303: fix error return code in ad7303_probe()
Fix to return a negative error code from the error handling
case instead of 0, as done elsewhere in this function.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Acked-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-06-29 10:18:21 +01:00
Samuel Ortiz d8c5d658f4 A complete refurbished series inclunding:
- DT support for the MFD, TSC and ADC driver & platform device support,
   which has no users, has been killed.
 - iio_map from last series is gone and replaced by proper nodes in the
   device tree.
 - suspend fixes which means correct data structs are taken and no
   interrupt storm
 - fifo split which should problem with TSC & ADC beeing used at the same
   time
 - The ADC channels are now checked before blindly applied. That means the
   touch part reads X, Y and Z coordinates and does not mix them up. Same
   goes for the IIO ADC driver.
 - The IIO ADC driver now creates files named in_voltageX_raw where X
   represents the ADC line instead of a number starting at 0. A read from
   this file can return -EBUSY in case touch is busy and the ADC didn't
   collect a value.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.12 (GNU/Linux)
 
 iQIcBAABAgAGBQJRuKbeAAoJEHuW6BYqjPXR7D4QAMCjJsNQiUceUG6mNSXVeSx2
 BkRvltixFHEzQTdMyEF4yQ8P3u8fo58R6cThMJ/1dphMKMhDf7rMVGd8wwdKsiCf
 1Vz1QrBUI47Pm2upGBEa40UpqeeL6uZc4ENOG1bqpeeUTEfgao3Iefk8pHNQVpOO
 UE7hj8xrdgJ8Hp4fjdXmjLmlTU6ek+s7BeeqAVsaz/eJZv+kkHPPwoJ9zyAx5sAi
 KBjO8Fch38jcU8rKGl8iZUAn8skGVckJnsljys6RP+1KwqxB7y2jU3uhLgU6ciBc
 zZl3IpsYrsG0vHTl72DmJrtPu7YIQLiydMyFe+zSiA+dKkzI3GnxtzRr4SKGTZbj
 u3wk8JbQCh3K2LW9gaHFOR+0FJMfF3w62MM19XjcfIGow7ZKnHZJJC0HeOLeUW7V
 TPFu3jFNCqYTMq2shC7VaUNI6fYiswtAuXLzEQJ0PBaeRMamyrdXyq3EB71zMCJ6
 BWW1ifz3R/Xusv7g1QYQpaLJCfD+bu+zWK1LbWO9knkLYZFJahnicmkJiImQPL8t
 3aH+quz+hmgZg6Agvf0EVf9y4sFCtJD0qsFeL+SlZxL/vJNnjiGPTzIMP078j61m
 RzQ3XYOq0AvhXBcU9+dHTM/UsmIM7mE8lz9W7NHnvE9NUuT4z6VE6w9p75YgtSTW
 yDHv8csxNba5XKi3JfH0
 =VGdP
 -----END PGP SIGNATURE-----

Merge tag 'am335x_tsc-adc' of git://breakpoint.cc/bigeasy/linux

A complete refurbished series inclunding:
- DT support for the MFD, TSC and ADC driver & platform device support,
  which has no users, has been killed.
- iio_map from last series is gone and replaced by proper nodes in the
  device tree.
- suspend fixes which means correct data structs are taken and no
  interrupt storm
- fifo split which should problem with TSC & ADC beeing used at the same
  time
- The ADC channels are now checked before blindly applied. That means the
  touch part reads X, Y and Z coordinates and does not mix them up. Same
  goes for the IIO ADC driver.
- The IIO ADC driver now creates files named in_voltageX_raw where X
  represents the ADC line instead of a number starting at 0. A read from
  this file can return -EBUSY in case touch is busy and the ADC didn't
  collect a value.
2013-06-13 12:14:59 +02:00
Sebastian Andrzej Siewior 1460c152c5 iio: ti_am335x_adc: check if we found the value
Usually we get all the values we wanted but it is possible, that te ADC
unit is busy performing the conversation for the HW events. In that case
-EBUSY is returned and the user may re-call the function.

Acked-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
2013-06-12 18:50:23 +02:00
Sebastian Andrzej Siewior 18926edebc iio: ti_am335x_adc: Allow to specify input line
The TSC part allows to specify the input lines. The IIO part assumes
that it usues always the last few, that means if IIO has adc-channels
set to 2 it will use channel 6 and 7. However it might make sense to use
only 6.
This patch changes the device property (which was introduced recently
and was never in an official release) in a way that the user can specify
which of the AIN lines should be used. In Addition to this, the name is
now AINx where x is the channel number i.e. for AIN6 we would have 6.
Prior this, it always started counting at 0 which is confusing. In
addition to this, it also checks for correct step number during reading
and does not rely on proper FIFO depth.

Acked-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
2013-06-12 18:50:23 +02:00
Sebastian Andrzej Siewior 8c896308fe input: ti_am335x_adc: use only FIFO0 and clean up a little
The driver programs a threshold of "coordinate_readouts" say 5. The
REG_FIFO0THR registers says it should it be programmed to "threshold
minus one". The driver does not expect just 5 coordinates but 5 * 2 + 2.
Multiplied by two because 5 for X and 5 for Y and plus 2 because we have
two Z.
The whole thing kind of works because It reads the 5 coordinates for X
and Y from FIFO0 and FIFO1 and the last element in each FIFO is ignored
within the loop and read later.
Nothing guaranties that FIFO1 is ready by the time it is read. In fact I
could see that that FIFO1 reaturns for Y channels 8,9, 10, 12, 6 and for
Y channel 7 for Z. The problem is that channel 7 and channel 12 got
somehow mixed up.
The other Problem is that FIFO1 is also used by the IIO part leading to
wrong results if both (tsc & adc) are used.

The patch tries to clean up the whole thing a little:
- Remove the +1 and -1 in REG_STEPCONFIG, REG_STEPDELAY and its counter
  part in the for loop. This is just confusing.

- Use only FIFO0 in TSC. The fifo has space for 64 entries so should be
  fine.

- Read the whole FIFO in one function and check the channel.

- in case we dawdle around, make sure we only read a multiple of our
  coordinate set. On the second interrupt we will cleanup the remaining
  enties.

Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
2013-06-12 18:50:22 +02:00
Sebastian Andrzej Siewior 9f99928fe0 mfd: iio: ti_am335x_adc: rename device from tiadc to TI-am335x-adc
TI-adc reads a little better compared to tiadc. And if we add am335x to
it then we have the same naming scheme as the tsc side.

Acked-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
2013-06-12 18:50:21 +02:00
Pantelis Antoniou c80df483f6 iio: ti_tscadc: provide datasheet_name and scan_type
This patch provides the members "datasheet_name" and scan_type. This is
the remaining part of the earlier patch where I (bigeasy) removed iio_map
because it is now supplied by the device tree. It also static names as
suggested by Jonathan.

Acked-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Pantelis Antoniou <panto@antoniou-consulting.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
2013-06-12 18:50:20 +02:00
Sebastian Andrzej Siewior 0ead4fb22a iio: ti_am335x_adc: remove platform_data support
This patch removes access to platform data mfd_tscadc_board because the
platform is DT only.

Acked-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
2013-06-12 18:36:31 +02:00
Patil, Rachna 6f39ac4e20 iio: ti_am335x_adc: Add DT support
Add DT support for client ADC driver.

Acked-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Patil, Rachna <rachna@ti.com>
Signed-off-by: Pantelis Antoniou <panto@antoniou-consulting.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
2013-06-12 18:36:31 +02:00
Patil, Rachna abeccee403 input: ti_am33x_tsc: Step enable bits made configurable
Current code has hard coded value written to
step enable bits. Now the bits are updated based
on how many steps are needed to be configured got
from platform data.

The user needs to take care not to exceed
the count more than 16. While using ADC and TSC
one should take care to set this parameter correctly.

Sebastian added the common lock and moved the code, that manipulates the
steps, from into the mfd module.

Signed-off-by: Patil, Rachna <rachna@ti.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
2013-06-12 18:03:55 +02:00
Sebastian Andrzej Siewior a9bce1b03c mfd: input: iio: ti_am335x_adc: use one structure for ti_tscadc_dev
The mfd driver creates platform data for the child devices and it is the
ti_tscadc_dev struct. This struct is copied for the two devices.
The copy of the structure makes a common lock in this structure a little
less usefull. Therefore the platform data is not a pointer to the
structure and the same structure is used.
While doing the change I noticed that the suspend/resume code assumes
the wrong pointer for ti_tscadc_dev and this has been fixed as well.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
2013-06-12 17:58:59 +02:00
Lars-Peter Clausen 32341859f0 staging:iio:adis16130: Move out of staging
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-11 20:34:36 +01:00
Lars-Peter Clausen f83478240e iio:dac: Add support for the AD7303
This patch adds support for the AD7303. The AD7303 is a simple 2 channel 8 bit
DAC with an SPI interface.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-06-11 20:25:58 +01:00
Michael Hennerich e764df6796 iio: frequency: adf4350: Add support for dt bindings
Per review feedback from Lars-Peter Clausen <lars@metafoo.de>
Changes since V1:
	Fix return value handling of adf4350_parse_dt()
	Use of_get_gpio
	Avoid abbreviations in devicetree properties
	Fix typo in docs

Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
Reviewed-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-06-09 19:15:43 +01:00
Michael Hennerich 9404fa15f2 iio: frequency: adf4350: Add support for clock consumer framework
Preferably get clkin (PLL reference clock) from clock framework

Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
Reviewed-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-06-09 18:43:55 +01:00
Greg Kroah-Hartman b37668d080 Merge 3.10-rc5 into staging-next 2013-06-08 21:18:09 -07:00
Jonathan Cameron 78f304d06c iio:trigger:interrupt fix formatting of rsize variable in name
The name includes irq_res->start which of type resource_size_t not integer.
We could in theory use %pa for this but then it would be in hex and also
that causes a warning about incorrect types anyway.  Hence just
use the irq local variable we assigned the line above.

Reported-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-06-08 10:00:58 +01:00
Denis CIOCCA 217494e5b7 iio:pressure: Add STMicroelectronics pressures driver
This patch adds a generic pressure driver for STMicroelectronics
pressure sensors, currently it supports: LPS331AP.

Signed-off-by: Denis Ciocca <denis.ciocca@st.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-06-05 18:41:23 +01:00
Denis CIOCCA 607a568ab6 iio:common: Removed stuff macros, added num_data_channels on st_sensors struct and added support on one-shot sysfs reads to 3 byte channel
This patch introduce num_data_channels variable on st_sensors struct
to manage different type of channels (size or number) in
st_sensors_get_buffer_element function.
Removed ST_SENSORS_NUMBER_DATA_CHANNELS and ST_SENSORS_BYTE_FOR_CHANNEL
and used struct iio_chan_spec const *ch to catch data.
Added 3 byte channel data support on one-shot reads.

Signed-off-by: Denis Ciocca <denis.ciocca@st.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-06-05 18:41:23 +01:00
Denis CIOCCA 762011d619 iio:common: ST_SENSORS_LSM_CHANNELS macro changed
Signed-off-by: Denis Ciocca <denis.ciocca@st.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-06-04 18:53:56 +01:00
Michael Hennerich 6c5d4c96f9 iio:inkern: Fix typo/bug in convert raw to processed.
Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-06-04 18:46:45 +01:00
Michael Hennerich 2eb3a81eef iio: frequency: ad4350: Fix bug / typo in mask
Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
Reviewed-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-06-04 18:35:26 +01:00
Jonathan Cameron c7a8be08da iio:triggers:interrupt trigger - move out of staging.
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-04 18:33:19 +01:00
Sachin Kamat 00738ff666 iio: at91_adc: Add missing CONFIG_OF macro
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: Maxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-06-04 18:29:49 +01:00
Jingoo Han ddeb64f36d iio: replace strict_strtoul() with kstrtoul()
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>
2013-06-04 18:29:49 +01:00
Joe Perches e916b80d2b inkern: iio_device_put after incorrect return/goto
The code uses

    return foo;
    goto err_type;

when instead the form should have been

    ret = foo;
    goto err_type;

Here this causes a useful iio_device_put to be skipped.

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-06-04 18:28:21 +01:00
Jonathan Cameron 702df9f181 iio:callback buffer: free the scan_mask
Reported-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-06-04 18:19:30 +01:00
Greg Kroah-Hartman 829455bb0e Merge 3.10-rc3 into staging-next
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-27 10:54:33 +09:00
Sachin Kamat c619653d77 adc: exynos_adc: Convert to devm_ioremap_resource()
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>
2013-05-22 22:18:22 +01:00
Alexandre Relange 39441078f7 iio: Correct HID light sensor name in comments
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>
2013-05-22 22:16:49 +01:00
Paul Bolle 00a8d4234c iio: STMicroelectronics: remove three useless selects
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>
2013-05-22 22:16:49 +01:00
Jacek Anaszewski 94a6d5cf7c iio:ak8975 Implement data ready interrupt handling
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>
2013-05-22 22:16:49 +01:00
Jacek Anaszewski f4b7f751c6 iio:ak8975 Add support for gpios DT property
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>
2013-05-22 22:16:48 +01:00
Jonathan Cameron e64e7d5c8c iio:trigger:sysfs Move out of staging.
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-22 22:16:48 +01:00
Michał Mirosław bec1889d24 iio: buffer: cleanup messages in iio_update_buffers()
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>
2013-05-22 22:16:47 +01:00
Oskar Andero f5ce4a7a92 iio: adc: add driver for MCP3204/08 12-bit ADC
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>
2013-05-22 22:16:47 +01:00
Naveen Krishna Chatradhi 927b4dc3e4 iio: exynos_adc: fix wrong structure extration in suspend and resume
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>
2013-05-22 22:15:20 +01:00
Denis CIOCCA d61a04dc14 iio:common:st: added disable function after read info raw data
Signed-off-by: Denis Ciocca <denis.ciocca@st.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-05-22 22:14:58 +01:00
Axel Lin 0ae5fb6fd3 iio: dac: Fix build error when CONFIG_SPI_MASTER=y && CONFIG_I2C=m
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>
2013-05-22 22:14:58 +01:00
Jean-Christophe PLAGNIOL-VILLARD beca9e767e iio: at91_adc: fix missing Sample and Hold time
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>
2013-04-02 19:22:16 +01:00
Jean-Christophe PLAGNIOL-VILLARD e748783c55 iio: at91_adc: add sleep mode support
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>
2013-04-02 19:17:39 +01:00
Ludovic Desroches 47be16b668 iio: at91_adc: add low and high res support
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>
2013-04-02 19:17:26 +01:00
Jonathan Cameron 2fc72cd835 iio:magnetometer:ak8975 move driver out of staging
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-02 18:36:47 +01:00
Sachin Kamat 1ba0686b2b iio: exynos_adc: Remove redundant of_match_ptr macro
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>
2013-03-29 09:24:49 +00:00