This patch adds IIO driver for APDS9300 ambient light sensor (ALS).
http://www.avagotech.com/docs/AV02-1077EN
The driver allows to read raw data from ADC registers or calculate
lux value. It also can handle threshold interrupt.
Signed-off-by: Oleksandr Kravchenko <o.v.kravchenko@globallogic.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Add a resource managed devm_iio_device_alloc()/devm_iio_device_free()
to automatically clean up any allocations made by IIO drivers,
thus leading to simplified IIO drivers code.
In addition, this will allow IIO drivers to use other devm_*() API
(like devm_request_irq) and don't care about the race between
iio_device_free() and the release of resources by Device core
during driver removing.
Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
Signed-off-by: Oleksandr Kravchenko <o.v.kravchenko@globallogic.com>
Tested-by: Oleksandr Kravchenko <o.v.kravchenko@globallogic.com>
Reviewed-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Keeping Makefile and Kconfig entries in alphabetical order usually works better
than just appending new entries at the end, since it reduces the amount of
conflicts. This patch adds a comment to the IIO Kconfig and Makefile files to
document that the entries should be kept in alphabetical order.
Also reorder those entries which weren't in alphabetical order yet.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Should be ssize_t and is int.
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Reported-by: Fengguan Wu <fengguang.wu@intel.com>
Acked-by: Peter Meerwald <pmeerw@pmeerw.net>
Add a MODULE_DEVICE_TABLE in order to let hotplug mechanisms automatically
load the driver.
This makes it also possible to use the usual driver name instead of
HID-SENSOR-2000xx which isn't very descriptive in kernel messages.
Signed-off-by: Alexander Holler <holler@ahsoftware.de>
Acked-by:Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Add a MODULE_DEVICE_TABLE in order to let hotplug mechanisms automatically
load the driver.
This makes it also possible to use the usual driver name instead of
HID-SENSOR-2000xx which isn't very descriptive in kernel messages.
Signed-off-by: Alexander Holler <holler@ahsoftware.de>
Acked-by:Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Add a MODULE_DEVICE_TABLE in order to let hotplug mechanisms automatically
load the driver.
This makes it also possible to use the usual driver name instead of
HID-SENSOR-2000xx which isn't very descriptive in kernel messages.
Signed-off-by: Alexander Holler <holler@ahsoftware.de>
Acked-by:Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Add a MODULE_DEVICE_TABLE in order to let hotplug mechanisms automatically
load the driver.
This makes it also possible to use the usual driver name instead of
HID-SENSOR-2000xx which isn't very descriptive in kernel messages.
Signed-off-by: Alexander Holler <holler@ahsoftware.de>
Acked-by:Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
The Nuvoton NAU7802 ADC is a 24-bit 2-channels I2C ADC, with adjustable
gain and sampling rates.
Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Reviewed-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
ring buffers are only in staging, don't mention them here
Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
I do not see why the driver requires I2C_FUNC_SMBUS_I2C_BLOCK,
actually only single bytes or words are transferred
Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
Cc: Ge Gao <ggao@invensense.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
This patch add support to redirect the DRDY interrupt on INT1 or INT2
on accelerometer and pressure sensors.
Signed-off-by: Denis Ciocca <denis.ciocca@st.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Previously we tried to read data form ADC even before ADC sequencer
finished sampling. This led to wrong samples.
We now wait on ADC status register idle bit to be set.
Signed-off-by: Patil, Rachna <rachna@ti.com>
Signed-off-by: Zubair Lutfullah <zubair.lutfullah@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
When using more than one trigger consumer it can happen that multiple threads
perform a read-modify-update cycle on 'use_count' concurrently. This can cause
updates to be lost and use_count can get stuck at non-zero value, in which case
the IIO core assumes that at least one thread is still running and will wait for
it to finish before running any trigger handlers again. This effectively renders
the trigger disabled and a reboot is necessary before it can be used again. To
fix this make use_count an atomic variable. Also set it to the number of
consumers before starting the first consumer, otherwise it might happen that
use_count drops to 0 even though not all consumers have been run yet.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Tested-by: Denis Ciocca <denis.ciocca@st.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
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.
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>
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
...
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>
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>
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>
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>
- 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.
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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!
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.19 (GNU/Linux)
iQIcBAABAgAGBQJRTYe3AAoJEFSFNJnE9BaIxfEQAJDxF7GZKG3pJhJIrN40d42y
DZD9Tf28Z5Ynd70gA8lITzwyBuj2r56/xpuewR9SH0nsV+s8zUplUoqBg1B5eIOO
WUg/ojzVjJISyrg+egfkNmwqv7LFkINj9CJfrf2xv99OwjQeCqMc9zHQ1JRK+tl/
57Z1zCZFX3B2dKDalH8sGcuGFRB+TturctvSAO2FTKcQ6/8FmubXD7+4zamn7+lH
vsD6+kRhIQ3yZJSUhLMzbueXfdF9OZe3n7MTbCtLhb76JOLmkGAqnSo0APEndBTb
PyS3DPKFxWJZTzzyKVoEW4pdU/fx2JfOZs101TFDXxh5p1hcALP8zwJQ3CqotYT6
kosGlyrPKaAiqkkGURqsUQvjjfcvNuhFQY2IMHQxFhEIRLYHZTLPJGBV1oBPQ4sQ
/OAOgu+Uut45ZeHAo1bTXcykO8GzvYxvQ18LUY1Jo/5Iqid0nRxVL6CkrA6Uw+z4
Tu4/z3ceeBAx1B34/ty58rkX+Xe6CxPPbzSgCtrV6oMpLZhQegHareItnhxbNRFN
oO9CULLXf6nyFhoYFbZRi+FStfsvdLKjfoDshHNp2kcpqsrTDyjwaTjjTQ4u30MD
VVo7lwVmm0ASpOXyVDPIw7ft/HHUDPH8xz7tPhhZHX5uvs74GCHg0WjZ48WMgv/N
Jk6lERQpZ2x6RYe4eH9+
=99m9
-----END PGP SIGNATURE-----
Merge tag 'iio-for-3.10a' of 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
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
The original info_mask is going away in favour of the broken out versions.
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
cc: Lars Poeschel <poeschel@lemonage.de>
The original info_mask is going away in favour of the broken out versions.
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
cc: Patil, Rachna <rachna@ti.com>
The original info_mask is going away in favour of the broken out versions.
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Acked-by: Thierry Reding <thierry.reding@avionic-design.de>
The original info_mask is going away in favour of the broken out versions.
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
cc: Milo(Woogyom) Kim <milo.kim@ti.com>
The original info_mask is going away in favour of the broken out versions.
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com>
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>
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>
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>
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>
This simplifies the code, removes an extensive layer of 'helper' macros
and gives us twice as much room to play with in these masks before we
have any need to be clever.
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Acked-by: Lars-Peter Clausen <lars@metafoo.de>
This patch adds New driver to support:
1. Supports ADC IF found on EXYNOS4412/EXYNOS5250
and future SoCs from Samsung
2. Add ADC driver under iio/adc framework
3. Also adds the Documentation for device tree bindings
Signed-off-by: Naveen Krishna Chatradhi <ch.naveen@samsung.com>
Reviewed-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Use the new spi_sync_transfer() helper function instead of open-coding it.
Signed-off-by: Denis Ciocca <denis.ciocca@st.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
This patch adds support for Analog Devices AD7923 ADC in the IIO Subsystem.
Signed-off-by: Patrick Vasseur <patrick.vasseur@c-s.fr>
Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
Reviewed-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Provide bindings and parse OF data during initialization.
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Reviewed-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
1) Some little fixes for the ad5064 dac driver.
2) A build warning 'fix' for a false positive in st_sensors
3) A couple of missing dependencies on IIO_BUFFER.
So nothing major and these mostly showed the advantages of the randconfig
builds various people have performed.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.19 (GNU/Linux)
iQIcBAABAgAGBQJRNjamAAoJEFSFNJnE9BaIUwMP/jed+bdUW1fYtGjv6vRmG9fj
XQK7pMIrk5STiE8UJAMf4vavtXA8lSKK32cAVeUaOXh2huxIXXG+6X/fIu0pfQ+F
CZNtnl41WVfp0sYA7Pw+on9bXMv8HajJKlbzbe9sBKKyqkpO3EvUZpWyKEBt5cQi
HMa6gmrditBzkjSXabDH/7lrQE0kN4jSFZUAdRYCVt5oxTs+OzdjH4sUjfwX4/Pg
YzdZKnqdqftuV/o7Mf1B0D7/7bc15KhNA+QAdBf7tuncvCmGFm2hdLf6DHAdHXsQ
D0ZcVo5Txg+Md4J3ZOvy45pO667l9KSETLXQq2cBMRMZt0ARCOyxGjxxmYpqUxKO
r369/tkL/LAV1BOvWZmK9j5W2KOwXtYSigtjZbVPjnYPYCPOlVwgxPZj7J9N8vb/
nM08QAV6oj9R9UZ4K06K4BoV4W4VD3xaHSTJyxMujlr7R7Eh9aUNH+xsbvkXEDnt
A8e/n2CLqBjl9M0uTydG5eX9aDzq21ykz/xF1qnz2BsB53zaxizexw2ywXIdAQvD
waFBUORnUBSZor4cUbO63njhr02NXqA87M+0C3OE/Xvfmn5ygjnPMe1fjcGHeyf+
fcE7EPzG23ChMZzoNdTDgpjGddvqCTQ95JGUKR55AETt8hv5PpUeUd3B1d5s7tGZ
LuM8g3lZhYho+RVYkLC5
=hA1D
-----END PGP SIGNATURE-----
Merge tag 'iio-fixes-for-3.9a' of git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into staging-linus
Jonathan writes:
"First round of iio fixes post the 3.9 merge window.
1) Some little fixes for the ad5064 dac driver.
2) A build warning 'fix' for a false positive in st_sensors
3) A couple of missing dependencies on IIO_BUFFER.
So nothing major and these mostly showed the advantages of the randconfig
builds various people have performed."
Fix:
drivers/iio/imu/inv_mpu6050/inv_mpu_ring.c: In function ‘inv_mpu6050_read_fifo’:
drivers/iio/imu/inv_mpu6050/inv_mpu_ring.c:176:3: error: implicit declaration of
function ‘iio_push_to_buffers’ [-Werror=implicit-function-declaration]
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Initialize the register cache to the proper mid-scale value based on the
resolution of the device.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
The DAC value range check allows values one larger than the maximum value, which
effectively results in setting the DAC value to 0. This patch fixes the issue.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
The ad5065, ad5045, ad5025 use address '3' for the second channel, so they need
their own channel spec.
Note that ad5064_sync_powerdown_mode() also needs to be slightly updated since
it was relying on the fact that chan->address always equaled chan->channel.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Here's the big staging tree merge for 3.9-rc1
Lots of cleanups and updates for drivers all through the staging tree.
We are pretty much "code neutral" here, adding just about as many lines
as we removed.
All of these have been in linux-next for a while.
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.19 (GNU/Linux)
iEUEABECAAYFAlEmW7QACgkQMUfUDdst+ymlIACXT5mv8Y5A/KJa+QLTNNsofI8u
aACgq9hNZxJzX6VQMLXUV8+2SILOqYo=
=5wIj
-----END PGP SIGNATURE-----
Merge tag 'staging-3.9-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging
Pull staging tree update from Greg Kroah-Hartman:
"Here's the big staging tree merge for 3.9-rc1
Lots of cleanups and updates for drivers all through the staging tree.
We are pretty much "code neutral" here, adding just about as many
lines as we removed.
All of these have been in linux-next for a while."
* tag 'staging-3.9-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging: (804 commits)
staging: comedi: vmk80xx: wait for URBs to complete
staging: comedi: drivers: addi-data: hwdrv_apci3200.c: Add a missing semicolon
staging: et131x: Update TODO list
staging: et131x: Remove assignment of skb->dev
staging: wlan-ng: hfa384x.h: fix for error reported by smatch
staging/zache checkpatch ERROR: spaces prohibited around that
staging/ozwpan: Mark read only parameters and structs as const
staging/ozwpan: Remove empty and unused function oz_cdev_heartbeat
staging/ozwpan: Mark local functions as static (fix sparse warnings)
staging/ozwpan: Add missing header includes
staging/usbip: Mark local functions as static (fix sparse warnings)
staging/xgifb: Remove duplicated code in loops.
staging/xgifb: Consolidate return paths
staging/xgifb: Remove code without effect
staging/xgifb: Remove unnecessary casts
staging/xgifb: Consolidate if/else if with identical code branches
staging: vt6656: replaced custom TRUE definition with true
staging: vt6656: replaced custom FALSE definition with false
staging: vt6656: replace custom BOOL definition with bool
staging/rtl8187se: Mark functions as static to silence sparse
...
This the basic functional Invensense MPU6050 Device driver.
Signed-off-by: Ge Gao <ggao@invensense.com>
Reviewed-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Partly a case of removing unused headers and partly a case
of ifdefing out the iio_trigger_ops structures. This has
come about because of an 'unusual' separation of code in this
driver.
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Reported-by: Randy Dunlap <rdunlap@infradead.org>
Acked-by: Denis Ciocca <denis.ciocca@st.com>
Use the new spi_sync_transfer() helper function instead of open-coding it.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
For iio_channel_get to work with OF based configurations, it needs the
consumer device pointer instead of the consumer device name as argument.
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Acked-by: Anton Vorontsov <anton@enomsg.org>
Acked-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Implement external reference voltage as regulator named "vref".
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
New drivers
1) A driver for ST microelectronics sensors. This driver already covers
a large set of new parts (20 gyros, accelerometer and magnetometers)
not currently covered by the existing drivers. The intent moving forward
is to merge this with the other drivers for similar parts already in tree.
The lis3l02dq driver currently in staging/iio will be trivial, the lis3
driver in misc more complex as it has a number of additional interfaces.
Any merging in of the lis3 driver will rely on the not currently
merged iio_input bridge driver and handling of freefall notifications
etc.
2) A driver for the itg3200 gyroscope.
Graduations from staging
1) Cleanup and move out of staging of the adxrs450 gyroscope driver. The
cleanup required was all minor but there were a couple of fixes hidden in
there.
Core and driver additions
1) Initial work from Guenter Roeck on device tree support for IIO's provider/
consumer code. Focuses on the iio_hwmon driver and the max1363 adc driver.
The full device tree syntax is currently under discussion but should
follow shortly.
Cleanups and fixes
1) Remove a noop function __iio_update_buffer
2) Couple of small fixes and cleanups for the max1363
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.19 (GNU/Linux)
iQIcBAABAgAGBQJRDQDyAAoJEFSFNJnE9BaIqZMP/i2fNpArDu3jXchJZJ1WuB0L
eY3JdMWOCO/ujPnjf6qWCjqZ+GWzFSSE8q+ZfUFYRv42Hcu2WV06eAeczilRJwzu
ZZAiWvWMTRV5tIAyg6guMoQvoxA5IHr5nG8JJ6OxY3ZtnnZr76kGm2/XIZCiy23d
1gFZOm9rew/lozbLdO16kcUm2WNBpX78PHStyQRUFjCGyDaM+BTFQjvZ+xRxKM9o
G3/snb/ExIIwlrIhwSZecmBhZoXvQhSIl49sKyT2EWGoNdDnC9YqTeYp3UYtBUuO
3uQ6ne1xGZRBu97CjnKEVpLFAd+xVjB8I2i5CeZWDBUQIkb0DEXV3blOaOLEks0J
bePhrlyDArdri18CQFFx2h5NwP87SjZ+U4zQkA63JWAXGC/w+vXp+MhxZpdvWXEy
jI0SKlxaeD5a1N0helc8zvibMZDsYMQSMz+BoI9Js3YpOypz6YNgaaSG8lI1rZ8W
YOsJiBWl6/jzg36QetD2Uhf8vVsA5KtDLSlLQbUBBjnvrN4XcPr/hWa2tv2GHnGh
/YMqWA1wOxNSAMaqn1bdJKDNm02+j7B8DfY+3E5m6fVTxwgHQmfPsECrY8k2i6ma
aMNDNuGnDCbpn8dKiIyQuvt+/1lktClcBcdHWUe/FGZtHdV7Kan5pDZQFLqoddCJ
mUE2y65xc4Hc2pmjWyim
=E5mK
-----END PGP SIGNATURE-----
Merge tag 'iio-for-3.9c' of git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into staging-next
Jonathan writes:
"Third set of IIO new drivers, cleanups and fixes for the 3.9 cycle
New drivers
1) A driver for ST microelectronics sensors. This driver already covers
a large set of new parts (20 gyros, accelerometer and magnetometers)
not currently covered by the existing drivers. The intent moving forward
is to merge this with the other drivers for similar parts already in tree.
The lis3l02dq driver currently in staging/iio will be trivial, the lis3
driver in misc more complex as it has a number of additional interfaces.
Any merging in of the lis3 driver will rely on the not currently
merged iio_input bridge driver and handling of freefall notifications
etc.
2) A driver for the itg3200 gyroscope.
Graduations from staging
1) Cleanup and move out of staging of the adxrs450 gyroscope driver. The
cleanup required was all minor but there were a couple of fixes hidden in
there.
Core and driver additions
1) Initial work from Guenter Roeck on device tree support for IIO's provider/
consumer code. Focuses on the iio_hwmon driver and the max1363 adc driver.
The full device tree syntax is currently under discussion but should
follow shortly.
Cleanups and fixes
1) Remove a noop function __iio_update_buffer
2) Couple of small fixes and cleanups for the max1363
"
merge commit 17cb3be61b
seems to have resulted in two functions that were removed in
4389fbec5b reappearing.
Spotted due to a build kicking out
drivers/iio/adc/max1363.c:1486:12: warning: 'max1363_register_buffered_funcs_and_init' defined but not used
drivers/iio/adc/max1363.c:1521:13: warning: 'max1363_buffer_cleanup' defined but not used
This patch just removes them again.
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Instead of requiring the map to unregister, simply unregister all map entries
associated with the given iio device. This simplifies map removal and also works
for maps generated through devicetree.
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Pass device pointer instead of device name as parameter to iio_channel_get_all
and iio_channel_get_all_cb. This will enable us to use OF information to
retrieve consumer channel information.
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
For chips with more than 8 bit ADC resolution, received data was always
masked against 0xfff, ie with a 12 bit mask. This can result in bad data
for chips with 10 bit resolution if those chips have higher bits set
(seen with MAX1139).
The receive buffer was defined as char array. This could result in
unintentional sign extensions if the upper bit in a received byte
was set. Since the chip is configured for unipolar mode, we never
have to handle negative values, and sign extensions are never needed.
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>