Currently driver reports device bandwidth list as available
sampling frequency. But sampling frequency is actually twice
the device bandwidth. This patch fixes this issue.
Signed-off-by: Sathyanarayanan Kuppuswamy <sathyanarayanan.kuppuswamy@intel.com>
Signed-off-by: Octavian Purdila <octavian.purdila@intel.com>
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Bring the Kconfig entry up to date with parts supported by
the driver.
Signed-off-by: Soeren Andersen <san@rosetechnology.dk>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
The defined registers only make sense when used for accessing RAM. Make
MLX90614_OP_RAM part of the symbol definition to avoid accidental access
to the wrong register.
Signed-off-by: Vianney le Clément de Saint-Marcq <vianney.leclement@essensium.com>
Cc: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Unless we put the device to sleep when not it use, it wastes
6mA.
If the device is asleep on probe, the 'id' register
sometimes mis-reads - so reset first. If the device responds
at all a command sent to the address, it is almost certainly
the correct device already.
Acked-by: Manuel Stahl <manuel.stahl@iis.fraunhofer.de>
Acked-by: Hartmut Knaack <knaack.h@gmx.de>
Signed-off-by: NeilBrown <neil@brown.name>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
The return value of gpiod_to_irq should be checked before giving
it to devm_request_threaded_irq in order to not pass an error
code in case it fails.
Signed-off-by: Roberta Dobrescu <roberta.dobrescu@gmail.com>
Reviewed-by: Vlad Dogaru <vlad.dogaru@intel.com>
Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
This patch fix spelling typo in MODULE_DESCRIPTION
Signed-off-by: Masanari Iida <standby24x7@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
If the in-kernel push interface is used we may have a different masks
on the device buffer and the kernel buffer and in this case the device
should generate data for the reunion of the buffers, which is
available at indio_dev->active_scan_mask.
Compiled tested only except for bmc150-accel which was tested at
runtime with the hardware.
Signed-off-by: Octavian Purdila <octavian.purdila@intel.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
These are fixes for patches in the recent merge window and are in a separate
branch to avoid rebasing the main fixes-togreg branch.
* jsa1212 - select missing REGMAP_I2C
* ssp_common - build warning fix for PM functions when PM not in use.
* ak8975 - the addition of a utility library for this driver (as part of
adding new device support) led to a dependency not being inforced
for the original driver (I2C and GPIOLIB).
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2
iQIcBAABCAAGBQJU8adVAAoJEFSFNJnE9BaIaqgP/RQyW2soUGQApXPhhWbf7X8i
FIx2Mq07dAtOFXdsmNRrU6U3IpfhtUtTlzxFQJg30eqHoAAHvDwcfi+hqs/Nvq99
wqOC1u8Y9om35OWpqMJIrBV4AYpXcZ5QM/L4VVsPtUIXas7GCHkar2Nk6dLf2azc
Lee4/qnYmOvRaJ4PxEhs6NtLLUkXWV/AXA1UUxnkwsstlfgRVCY/Xuge+d93JgSd
ETdyxUbEjBom1+3FyKuFh0/hJ+Vhb3eXKlvYRp5yhJspZZUOFP42OCzyQd1FqY4A
PjzHoV4iKQzKYiY9RTfhOdG4EViYNAndS4y+QYRAcylsOuMZtbrODGRC3PS0icMy
yY/I5Tng//bgchraKXbB92L2P+FaxiVcd1JCm51vPWlHVrsv+CZiO0+Xg4FXN28L
C5I7EZ6KgkBGYqWkXUfr813NsC4AI86YMjv3eNs3/9HVJokDOxU9mk3H20SY1Bsm
/KWnOVJnLCMvcztkhIvBO/FzzTzlIgCH+4HK7Qm2cFxCNibyTNBs4bJXB9I1SM+F
s3+JMZCEEir4EiVQKeO2gUpM0cdxYW1UR4Fr2WT9/HLPYkjsX2cF2s3WLr7Tvbzs
9ON1GsIzt5aMQXCrYKBY8tQU7tHSo9Xicz4z1JmhElZPkafbgnnt/9B/0N7Xovvn
SpAlX/t+/gSzy4FFLzWF
=KRES
-----END PGP SIGNATURE-----
Merge tag 'iio-fixes-for-4.0b' of git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into staging-linus
Jonathan writes:
Second round of IIO fixes for the 4.0 cycle (or round one part two really!)
These are fixes for patches in the recent merge window and are in a separate
branch to avoid rebasing the main fixes-togreg branch.
* jsa1212 - select missing REGMAP_I2C
* ssp_common - build warning fix for PM functions when PM not in use.
* ak8975 - the addition of a utility library for this driver (as part of
adding new device support) led to a dependency not being inforced
for the original driver (I2C and GPIOLIB).
set dependent on patches in the recent merge windows will follow shortly.
* dht11 - fix a read off the end of an array, add some locking to prevent
the read function being interrupted and make sure gpio/irq lines
are not enabled for irqs during output.
* iadc - timeout should be in jiffies not msecs
* mpu6050 - avoid a null id from ACPI emumeration being dereferenced.
* mxs-lradc - fix up some interaction issues between the touchscreen driver
and iio driver. Mostly about making sure that the adc driver
only affects channels that are not being used for the
touchscreen.
* ad2s1200 - sign extension fix for a result of c type promotion.
* adis16400 - sign extension fix for a result of c type promotion.
* mcp3422 - scale table was transposed.
* ad5686 - use _optional regulator get to avoid a dummy reg being allocate
which would cause the driver to fail to initialize.
* gp2ap020a00f - select REGMAP_I2C
* si7020 - revert an incorrect cleanup up and then fix the issue that made
that cleanup seem like a good idea.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2
iQIcBAABCAAGBQJU8aP7AAoJEFSFNJnE9BaIr7oQAKUtw6ScwBnCGDV+3ttEvUAl
8oSNVNKoWdBiuQK5XZHJVVVm7/n7Okt6rT8X+LjY5JsVP6lZRItAtOkwNibyyS5Q
MZk3on8E7qEaASTOPPb+Izb+d2azevUaZptqTlQSaFJgs8HuBm89DwJ9H6SKZKAy
kqZdjiDLx95XNAMSKiM7531Dv+TKU0BGPP8Zc0vIviUQbAcFQ6hHtfaFwU2m/hlx
Cyn4UB3i2jbZmuvfL5zwHZBIjTpczlLuihQFpNAMq73pwROgbwVuQ6azBz5ib0dE
gHE5AG/c/uLXO0IFvPlUmkLqQyPoTJ8dsgrjozOi+GPqWGfaBf1Iet0zfqVcJWjE
jCpJqlNfcukvBnAsSMwQM/mHGVdGXd07alKjCoZsQkm0aG/DQxLn2QRWVAUno8eL
zbuDCpk3rH8c5U9Ytb0likBRurM8UyTTkUhCJOpdS1iyNRe+pK8Krp/STMhc3a96
YWQxpO3p127yyc8EXdEl5N5kJwtWaV0W09vGV4oSk8A9fF7MTR2fe31pw7Si+sb3
gTsRMC1bPqF2f8UMcjxqd72IKz5GKvaIOh+J6hdN0UaITsQr+dWbPj1oAkgRQgdJ
EC57hqVLJTl3S1AYtev98+LgemOARbsBYbc/FVlhTpaZPhxXOLyMsvaQ93Fa7jFr
HXPJZailkvt7TgLiuoW6
=iNyv
-----END PGP SIGNATURE-----
Merge tag 'iio-fixes-for-4.0a' of git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into staging-linus
Jonathan writes:
First round of fixes for IIO in the 4.0 cycle. Note a followup
set dependent on patches in the recent merge windows will follow shortly.
* dht11 - fix a read off the end of an array, add some locking to prevent
the read function being interrupted and make sure gpio/irq lines
are not enabled for irqs during output.
* iadc - timeout should be in jiffies not msecs
* mpu6050 - avoid a null id from ACPI emumeration being dereferenced.
* mxs-lradc - fix up some interaction issues between the touchscreen driver
and iio driver. Mostly about making sure that the adc driver
only affects channels that are not being used for the
touchscreen.
* ad2s1200 - sign extension fix for a result of c type promotion.
* adis16400 - sign extension fix for a result of c type promotion.
* mcp3422 - scale table was transposed.
* ad5686 - use _optional regulator get to avoid a dummy reg being allocate
which would cause the driver to fail to initialize.
* gp2ap020a00f - select REGMAP_I2C
* si7020 - revert an incorrect cleanup up and then fix the issue that made
that cleanup seem like a good idea.
ak8975 depends on I2C and GPIOLIB, so any symbols that selects
ak8975 must have the same dependency, or we get build errors:
drivers/iio/magnetometer/ak8975.c: In function 'ak8975_who_i_am':
drivers/iio/magnetometer/ak8975.c:393:2: error: implicit declaration of function 'i2c_smbus_read_i2c_block_data' [-Werror=implicit-function-declaration]
ret = i2c_smbus_read_i2c_block_data(client, AK09912_REG_WIA1,
^
drivers/iio/magnetometer/ak8975.c: In function 'ak8975_set_mode':
drivers/iio/magnetometer/ak8975.c:431:2: error: implicit declaration of function 'i2c_smbus_write_byte_data' [-Werror=implicit-function-declaration]
ret = i2c_smbus_write_byte_data(data->client,
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Fixes: 57e73a423b ("iio: ak8975: add ak09911 and ak09912 support")
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
This patch adds support for DA9150 Charger & Fuel-Gauge IC GPADC.
Signed-off-by: Adam Thomson <Adam.Thomson.Opensource@diasemi.com>
Reviewed-by: Hartmut Knaack <knaack.h@gmx.de>
Acked-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Sebastian Reichel <sre@kernel.org>
This is a follow up patches after adding i2c mux adapter for bypass
mode. Potentially many different types of sensor can be attached to
INVMPU6XXX device, which can be connected to main cpu i2c bus in
bypass mode.
Why do we need this?
The system ACPI table entry will consist of only one device for
INV6XXX, assuming that this driver will handle all connected sensors.
That is not true for the Linux driver. There are bunch of IIO drivers
for each sensors, hence we created a mux on this device. So to load
these additional drivers, we need to create i2c devices for them
in this driver using this mux adapter.
There are multiple options:
1. Use the auto detect feature, this needs a new i2c class for the
adapter as the existing HWMON class is not acceptable. Also the
autodetect has overhead of executing detect method for each
matching class of adapters.
This is a simple implementation. This option was previously submitted
with not a happy feedback.
2. Option is use ACPI magic and parse the configuration data. What
we need to create a i2c device at a minimum is address and a name.
Address can be obtained for secondary device in more or less in a
standard way from using _CRS element. But there is no name. To get
name we need to process proprietary vendor data. Not having name is
not fun, as you have to create device using the device name of
INVN6XXXX, respecting driver duplicate name space restriction.
Also each client driver needs to have this name in the id table.
Since multiple driver can be loaded, the driver should be able to
detect its presence and gracefully exit for the other client driver
to take it over.
So we use two step process:
- Use DMI to id platform and parse propritery data. This is not uncommon
for many x86 platform specific driver. We will get both name and address.
The change created necessary infrastructure to add more properitery vendor
data parsing.
- If DMI match fails, then create device on INV6XXX-client (we can't
create with same name as INV6XXX as it will cause duplicate name and driver
model will reject.) With this each client sensor driver which needs to get
attached via INV6XXXX, need this name in the id table and detect the
physical presence of sensor in probe and exit if not found.
Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
The regmap_config struct may be const because it is not modified by the
driver and regmap_init() accepts pointer to const.
Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Current API only allows setting one offset in the field. This API
is extended to set multiple offsets in the field report.
Also update parameters in the users of this API.
Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Reviewed-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Some hid sensor feature report can contain more than one reports.
This API can now support receiving multiple values from the feature
report.
Also update the parameters in the users of this API.
Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Acked-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Add additional flag to read in async mode. In this mode the caller will get
reply via registered callback for capture_sample. Callbacks can be registered
using sensor_hub_register_callback function. The usage id parameter of the
capture_sample can be matched with the usage id of the requested attribute.
Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Acked-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Since 39b2bbe3d7 (gpio: add flags argument to gpiod_get*() functions)
which appeared in v3.17-rc1, the gpiod_get* functions take an additional
parameter that allows to specify direction and initial value for
outputs.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Reviewed-by: Alexandre Courbot <acourbot@nvidia.com>
Reviewed-by: Daniel Baluta <daniel.baluta@intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
If CONFIG_PM_SLEEP=n:
drivers/iio/common/ssp_sensors/ssp_dev.c:644: warning: ‘ssp_suspend’ defined but not used
drivers/iio/common/ssp_sensors/ssp_dev.c:669: warning: ‘ssp_resume’ defined but not used
Protect the unused functions by #ifdef CONFIG_PM_SLEEP to fix this.
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Acked-by: Karol Wrona <k.wrona@samsung.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Pull kconfig updates from Michal Marek:
"Yann E Morin was supposed to take over kconfig maintainership, but
this hasn't happened. So I'm sending a few kconfig patches that I
collected:
- Fix for missing va_end in kconfig
- merge_config.sh displays used if given too few arguments
- s/boolean/bool/ in Kconfig files for consistency, with the plan to
only support bool in the future"
* 'kconfig' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild:
kconfig: use va_end to match corresponding va_start
merge_config.sh: Display usage if given too few arguments
kconfig: use bool instead of boolean for type definition attributes
Here's the big staging driver tree update for 3.20-rc1. Lots of little
things in here, adding up to lots of overall cleanups. The IIO driver
updates are also in here as they cross the staging tree boundry a lot.
I2O has moved into staging as well, as a plan to drop it from the tree
eventually as that's a dead subsystem.
All of this has been in linux-next with no reported issues for a while.
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2
iEYEABECAAYFAlTgtVQACgkQMUfUDdst+yk4mACgshYZ1fOQDoPR+BXd+QD1HXfh
GosAoICXkSjDQjwVo13W6QHIVMsUezY+
=4jHr
-----END PGP SIGNATURE-----
Merge tag 'staging-3.20-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging
Pull staging drivers patches from Greg KH:
"Here's the big staging driver tree update for 3.20-rc1.
Lots of little things in here, adding up to lots of overall cleanups.
The IIO driver updates are also in here as they cross the staging tree
boundry a lot. I2O has moved into staging as well, as a plan to drop
it from the tree eventually as that's a dead subsystem.
All of this has been in linux-next with no reported issues for a
while"
* tag 'staging-3.20-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging: (740 commits)
staging: lustre: lustre: libcfs: define symbols as static
staging: rtl8712: Do coding style cleanup
staging: lustre: make obd_updatemax_lock static
staging: rtl8188eu: core: switch with redundant cases
staging: rtl8188eu: odm: conditional setting with no effect
staging: rtl8188eu: odm: condition with no effect
staging: ft1000: fix braces warning
staging: sm7xxfb: fix remaining CamelCase
staging: sm7xxfb: fix CamelCase
staging: rtl8723au: multiple condition with no effect - if identical to else
staging: sm7xxfb: make smtc_scr_info static
staging/lustre/mdc: Initialize req in mdc_enqueue for !it case
staging/lustre/clio: Do not allow group locks with gid 0
staging/lustre/llite: don't add to page cache upon failure
staging/lustre/llite: Add exception entry check after radix_tree
staging/lustre/libcfs: protect kkuc_groups from write access
staging/lustre/fld: refer to MDT0 for fld lookup in some cases
staging/lustre/llite: Solve a race to access lli_has_smd in read case
staging/lustre/ptlrpc: hold rq_lock when modify rq_flags
staging/lustre/lnet: portal spreading rotor should be unsigned
...
This patch introduces the use of function put_unaligned_le32.
This is done using Coccinelle and semantic patch used is as follows:
@@ identifier tmp; expression ptr; expression y,e; type T; @@
- tmp = cpu_to_le32(y);
<+... when != tmp
- memcpy(ptr, (T)&tmp, ...);
+ put_unaligned_le32(y,ptr);
...+>
? tmp = e
@@ type T; identifier tmp; @@
- T tmp;
...when != tmp
Signed-off-by: Vaishali Thakkar <vthakkar1994@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Since only a pointer to struct i2c_client is stored in a private area
of IIO device created by the driver there's no need to allocate
sizeof(struct i2c_client) worth of storage.
Pushed to stable as this is linked to the revert patch previously.
Without this followup the original patch looks sensible.
Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Cc: Stable@vger.kernel.org
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
This reverts commit e0922e5e3c.
Requested by Andrey Smirnov.
It incorrectly assumes that the level of indirection is not needed
which is not true(probably because the driver incorrectly allocates
sizeof(*client) instead of sizeof(*data) via devm_iio_device_alloc).
If you look at the code of the probe function(see below) it is easy to
see that what is being stored in the private memory of the IIO device
instance is not a copy of a 'struct i2c_client' but a pointer to an
instance passed as an argument to the probe function.
struct i2c_client **data;
int ret;
< Some code skipped >
indio_dev = devm_iio_device_alloc(&client->dev, sizeof(*client));
if (!indio_dev)
return -ENOMEM;
data = iio_priv(indio_dev);
*data = client;
Without reverting this change any read of a raw value of this sensor
leads to a kernel oops due to a NULL pointer de-reference on my
hardware setup.
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Cc: Stable@vger.kernel.org
This patch adds missing 'select' statement for gp2ap020a00f driver.
Without regmap_i2c, we get the following error when loading the module:
Unknown symbol devm_regmap_init_i2c.
Signed-off-by: Roberta Dobrescu <roberta.dobrescu@gmail.com>
Reviewed-by: Daniel Baluta <daniel.baluta@intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
This patch adds missing 'select' statement for jsa1212 driver.
Without regmap_i2c, we get the following error when loading the module:
Unknown symbol devm_regmap_init_i2c.
Signed-off-by: Roberta Dobrescu <roberta.dobrescu@gmail.com>
Reviewed-by: Daniel Baluta <daniel.baluta@intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Pull input updates from Dmitry Torokhov:
"The first round of updates for the input subsystem.
A few new drivers (power button handler for AXP20x PMIC, tps65218
power button driver, sun4i keys driver, regulator haptic driver, NI
Ettus Research USRP E3x0 button, Alwinner A10/A20 PS/2 controller).
Updates to Synaptics and ALPS touchpad drivers (with more to come
later), brand new Focaltech PS/2 support, update to Cypress driver to
handle Gen5 (in addition to Gen3) devices, and number of other fixups
to various drivers as well as input core"
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input: (54 commits)
Input: elan_i2c - fix wrong %p extension
Input: evdev - do not queue SYN_DROPPED if queue is empty
Input: gscps2 - fix MODULE_DEVICE_TABLE invocation
Input: synaptics - use dmax in input_mt_assign_slots
Input: pxa27x_keypad - remove unnecessary ARM includes
Input: ti_am335x_tsc - replace delta filtering with median filtering
ARM: dts: AM335x: Make charge delay a DT parameter for TSC
Input: ti_am335x_tsc - read charge delay from DT
Input: ti_am335x_tsc - remove udelay in interrupt handler
Input: ti_am335x_tsc - interchange touchscreen and ADC steps
Input: MT - add support for balanced slot assignment
Input: drv2667 - remove wrong and unneeded drv2667-haptics modalias
Input: drv260x - remove wrong and unneeded drv260x-haptics modalias
Input: cap11xx - remove wrong and unneeded cap11xx modalias
Input: sun4i-ts - add support for touchpanel controller on A31
Input: serio - add support for Alwinner A10/A20 PS/2 controller
Input: gtco - use sign_extend32() for sign extension
Input: elan_i2c - verify firmware signature applying it
Input: elantech - remove stale comment from Kconfig
Input: cyapa - off by one in cyapa_update_fw_store()
...
Previous of this patch the check was only done if we enabled the event
and it was already enabled. We can do the same if the event is
disabled and we want to disable it.
The patch also adds the same check on the trigger code.
Signed-off-by: Octavian Purdila <octavian.purdila@intel.com>
Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
This patch combines the any motion and new data interrupts function
into a single, generic, interrupt enable function. On top of this, we
can later refactor triggers to make it easier to add new triggers.
Signed-off-by: Octavian Purdila <octavian.purdila@intel.com>
Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Move the slope duration and threshold update in a separate function to
reduce code duplicate between chip init and motion interrupt setup.
Also move the slope update code from the interrupt setup function to
the trigger set state function so that we can later refactor the
interrupt code.
Signed-off-by: Octavian Purdila <octavian.purdila@intel.com>
Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Move all core (non-custom) buffer attributes to a vector to make it
easier to add more of them in the future.
Signed-off-by: Octavian Purdila <octavian.purdila@intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
return type of wait_for_completion_timeout is unsigned long not int, this
patch only fixes up the return handling.
Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
When not using the "_optional" function, a dummy regulator is returned
and the driver fails to initialize.
Signed-off-by: Urs Fässler <urs.fassler@bytesatwork.ch>
Acked-by: Lars-Peter Clausen <lars@metafoo.de>
Cc: stable@vger.kernel.org
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
This patch fixes uncorrect order of mcp3422_scales table, the values
was erroneously transposed.
It removes also an unused array and a wrong comment.
Signed-off-by: Angelo Compagnucci <angelo.compagnucci@gmail.com>
Cc: Stable@vger.kernel.org
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
odr_bits values are between 0 and 11, so we can use the index
in kmx61_samp_freq_table instead of odr_bits structure member.
Signed-off-by: Daniel Baluta <daniel.baluta@intel.com>
Reviewed-by: Hartmut Knaack <knaack.h@gmx.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
This patch makes the initial changes required to workaround TSC-false
pen-up interrupts. It is required to implement these changes in order to
remove udelay in the TSC interrupt handler and false pen-up events. The
charge step is to be executed immediately after sampling X+. Hence TSC is
made to use higher numbered steps (steps 5 to 16 for 5 co-ordinate
readouts, 4 wire TSC configuration) and ADC to use lower ones. Further X
co-ordinate readouts must be the last to be sampled, thus co-ordinates are
sampled in the order Y-Z-X.
Signed-off-by: Brad Griffis <bgriffis@ti.com>
[vigneshr@ti.com: Ported the patch from v3.12 to v3.19rc1]
Signed-off-by: Vignesh R <vigneshr@ti.com>
Acked-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Also change to div64_u64 in one place to avoid loss of precision
(was dividing a 32 bit number by a 64 bit number, but casting this
to 64 bit divided by 32 bit) Those divide functions certainly have
esoteric naming!
Fixes warnings with asm-generic/div64.h do_div such as:
In file included from drivers/iio/common/ssp_sensors/ssp_iio.c:20:0:
drivers/iio/common/ssp_sensors/ssp_iio_sensor.h: In function 'ssp_convert_to_freq':
>> drivers/iio/common/ssp_sensors/ssp_iio_sensor.h:56:16: warning: comparison of distinct pointer types lacks a cast [enabled by default]
drivers/iio/common/ssp_sensors/ssp_iio_sensor.h:56:2: warning: right shift count >= width of type [enabled by default]
>> drivers/iio/common/ssp_sensors/ssp_iio_sensor.h:56:2: warning: passing argument 1 of '__div64_32' from incompatible pointer type [enabled by default]
include/asm-generic/div64.h:35:17: note: expected 'uint64_t *' but argument is of type 'int *'
drivers/iio/common/ssp_sensors/ssp_iio.c: In function 'ssp_common_process_data':
include/linux/iio/buffer.h:142:32: warning: 'calculated_time' may be used uninitialized in this function [-Wuninitialized]
drivers/iio/common/ssp_sensors/ssp_iio.c:83:10: note: 'calculated_time' was declared here
Fixed by using straight coded version as per the description in the
div64.h header, thus ensuring no issue with 32 bit integers.
Reported-by: kbuild test robot <fengguang.wu@intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Add support for Freescale MMA9553L Intelligent Pedometer Platform.
The following functionalities are supported:
- step counter (counts the number of steps using a HW register)
- step detector (generates an iio event at every step the user takes)
- activity recognition (rest, walking, jogging, running)
- speed
- calories
- distance
To get accurate pedometer results, the user's height, weight and gender
need to be configured.
The specifications can be downloaded from:
http://www.freescale.com/files/sensors/doc/ref_manual/MMA955xLSWRM.pdfhttp://www.freescale.com/files/sensors/doc/ref_manual/MMA9553LSWRM.pdf
Signed-off-by: Irina Tirdea <irina.tirdea@intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
The pedometer needs to filter out false steps that might be generated by
tapping the foot, sitting, etc. To do that it computes the number of
steps that occur in a given time and decides the user is moving only
if this value is over a threshold. E.g.: the user starts moving only
if he takes 4 steps in 3 seconds. This filter is applied only when
the user starts moving.
A device that has such pedometer functionality is Freescale's MMA9553L:
http://www.freescale.com/files/sensors/doc/ref_manual/MMA9553LSWRM.pdf.
To export this feature, this patch introduces IIO_CHAN_INFO_DEBOUNCE_COUNT
and IIO_CHAN_INFO_DEBOUNCE_TIME. For the pedometer, in_steps_debounce_count
will specify the number of steps that need to occur in
in_steps_debounce_time seconds so that the pedometer decides the user is
moving.
Signed-off-by: Irina Tirdea <irina.tirdea@intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
This patch adds gyroscope iio driver which uses sensorhub as data
provider.
Signed-off-by: Karol Wrona <k.wrona@samsung.com>
Acked-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
This patch adds accelerometer iio driver which uses sensorhub as data
provider.
Signed-off-by: Karol Wrona <k.wrona@samsung.com>
Acked-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
This patch adds common library for sensorhub iio drivers.
Signed-off-by: Karol Wrona <k.wrona@samsung.com>
Acked-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Sensorhub is MCU dedicated to collect data and manage several sensors.
Sensorhub is a spi device which provides a layer for IIO devices. It provides
some data parsing and common mechanism for sensorhub sensors.
Adds common sensorhub library for sensorhub driver and iio drivers
which uses sensorhub MCU to communicate with sensors.
Signed-off-by: Karol Wrona <k.wrona@samsung.com>
Acked-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
The voltage ADC is peripheral of Qualcomm SPMI PMIC chips. It has
15bits resolution and register space inside PMIC accessible across
SPMI bus.
The vadc driver registers itself through IIO interface.
Signed-off-by: Stanimir Varbanov <svarbanov@mm-sol.com>
Signed-off-by: Ivan T. Ivanov <iivanov@mm-sol.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Added AK8963 in the id table. Unfortunately some commercial devices
using caps version ak8963.
Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Freescale has the MMA955xL family of devices that use the
same communication protocol (based on i2c messages):
http://www.freescale.com/files/sensors/doc/data_sheet/MMA955xL.pdf.
To support more devices from this family, we need to split the
mma9551 driver so we can export the common functions that will
be used by other mma955x drivers.
Signed-off-by: Irina Tirdea <irina.tirdea@intel.com>
Reviewed-by: Vlad Dogaru <vlad.dogaru@intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Add support for runtime pm to reduce the power consumed by the device
when not used.
If CONFIG_PM is not enabled, the device will be powered on at
init and only powered off on system suspend.
If CONFIG_PM is enabled, runtime pm autosuspend is used:
- for raw reads will keep the device on for a specified time
- for events it will keep the device on as long as we have at least
one event active
Signed-off-by: Irina Tirdea <irina.tirdea@intel.com>
Reviewed-by: Vlad Dogaru <vlad.dogaru@intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
By introducing IIO_EV_TYPE_CHANGE, IIO_EV_TYPE_INSTANCE becomes redundant.
The effect of IIO_EV_TYPE_INSTANCE can be obtained by using IIO_EV_TYPE_CHANGE
with IIO_EV_INFO_VALUE set to 1.
Remove all instances of IIO_EV_TYPE_INSTANCE and replace them with
IIO_EV_TYPE_CHANGE where needed.
Signed-off-by: Irina Tirdea <irina.tirdea@intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
A step detector will generate an interrupt each time N step are detected.
A device that has such pedometer functionality is Freescale's MMA9553L:
http://www.freescale.com/files/sensors/doc/ref_manual/MMA9553LSWRM.pdf.
Introduce IIO_EV_TYPE_CHANGE event type for events that are generated
when the channel passes a threshold on the absolute change in value.
Signed-off-by: Irina Tirdea <irina.tirdea@intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Some devices need the weight of the user to compute other
parameters. One of this devices is Freescale's MMA9553L
(http://www.freescale.com/files/sensors/doc/ref_manual/MMA9553LSWRM.pdf)
that needs the weight of the user to compute the number of calories burnt.
Signed-off-by: Irina Tirdea <irina.tirdea@intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Some devices export the current speed value of the user.
One of this devices is Freescale's MMA9553L
(http://www.freescale.com/files/sensors/doc/ref_manual/MMA9553LSWRM.pdf)
that computes the speed of the user based on the number of steps and
stride length.
Introduce a new channel type VELOCITY and a modifier for the magniture or
norm of the velocity vector, IIO_MOD_ROOT_SUM_SQUARED_X_Y_Z.
Signed-off-by: Irina Tirdea <irina.tirdea@intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Some devices export an estimation of the distance the user has covered
since the last reset.
One of this devices is Freescale's MMA9553L
(http://www.freescale.com/files/sensors/doc/ref_manual/MMA9553LSWRM.pdf)
that computes the distance based on the stride length and step rate.
Introduce a new channel type DISTANCE to export these values.
Signed-off-by: Irina Tirdea <irina.tirdea@intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Human activity sensors report the energy burnt by the user.
One of this devices is Freescale's MMA9553L
(http://www.freescale.com/files/sensors/doc/ref_manual/MMA9553LSWRM.pdf)
that computes the number of calories based on weight and step rate.
Introduce a new channel type ENERGY to export these values.
Signed-off-by: Irina Tirdea <irina.tirdea@intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Switch from the legacy suspend/resume callbacks to device pm ops.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
CM3232 is an advanced ambient light sensor with I2C protocol interface.
The I2C slave address is internally hardwired as 0x10 (7-bit). Writing
to configure register is byte mode, but reading ALS register requests to
use word mode for 16-bit resolution.
Signed-off-by: Kevin Tsai <ktsai@capellamicro.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
The intention is obviously to sign-extend a 12 bit quantity. But
because of C's promotion rules, the assignment is equivalent to "val16
&= 0xfff;". Use the proper API for this.
Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Acked-by: Lars-Peter Clausen <lars@metafoo.de>
Cc: Stable@vger.kernel.org
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Use common hid sensor iio pm functions. Also the poll time read and
wait is part of power up function of hid sensor iio pm function, so
remove from the client drivers.
Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Use common hid sensor iio pm functions. Also the poll time read and
wait is part of power up function of hid sensor iio pm function, so
remove from the client drivers.
Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Use common hid sensor iio pm functions. Also the poll time read and
wait is part of power up function of hid sensor iio pm function, so
remove from the client drivers.
Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Use common hid sensor iio pm functions. Also the poll time read and
wait is part of power up function of hid sensor iio pm function, so
remove from the client drivers.
Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Use common hid sensor iio pm functions. Also the poll time read and
wait is part of power up function of hid sensor iio pm function, so
remove from the client drivers.
Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Use common hid sensor iio pm functions. Also the poll time read and
wait is part of power up function of hid sensor iio pm function, so
remove from the client drivers.
Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Use common hid sensor iio pm functions. Also the poll time read and
wait is part of power up function of hid sensor iio pm function, so
remove from the client drivers.
Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
To improvement power and performance, both regular and run time callbacks
are introduced. Because of auto suspend delay, two consecutive read
don't have to go through full power on/off procedure. The auto suspend
time can be adjusted using regular power attributes of PM sysfs.
Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Roberta Dobrescu <roberta.dobrescu@gmail.com>
Reviewed-by: Daniel Baluta <daniel.baluta@intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Roberta Dobrescu <roberta.dobrescu@gmail.com>
Reviewed-by: Daniel Baluta <daniel.baluta@intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Roberta Dobrescu <roberta.dobrescu@gmail.com>
Reviewed-by: Daniel Baluta <daniel.baluta@intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
There was a need for non triggered software buffer type. It can be used when
triggered model does not fit and INDIO_BUFFER_HARDWARE causes confusion because
the data stream can be obtained not directly form hardware backend.
Suggested-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Karol Wrona <k.wrona@samsung.com>
Reviewed-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
iio kfifo can be used without trigger support so there is no need to build it.
Signed-off-by: Karol Wrona <k.wrona@samsung.com>
Reviewed-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Updated pull request with Daniel's fix on top for the power management
Kconfig changes that had snuck in since last update of the IIO tree
worked it's way through from mainline.
Original pull message
New device support
* jsa1212 proxmity / ambient light sensor
* SM08500 supported added to the kxcjk-1013 accelerometer driver
* KMX61 Accelerometer/Magnetometer. This took a somewhat rocky path
being first merged, then reverted for a rewrite after a discussion of
how to support additional functionality and finally being merged prior
to some last reviews coming in, with resultant follow up patches.
* Freescale mma9551l driver (minor follow up warning supression patch).
* Semtech SX9500 proximity device driver.
* ak8975 gains support for ak09911 and ak09912 and drop the standalone driver
for the ak09911.
New functionality
* Dummy driver gains some virtual registers making it more flexible.
* IIO_ACTIVITY channel types, with modifiers running, walking etc. This is
to support on chip motion clasifiers. As such it is in the form of a
confidence percentage. The only devices so far only do binary decisions
but this gives us room when other devices give more nuanced clasification.
* IIO_EV_DIR_NONE type for events where there is no obvious direction.
First case is step detection.
* IIO_STEPS channel type for pedometers.
* ENABLE mask element used to control turning on counting types such as
the pedometer that need a 'start point'.
* INSTANCE event type to support things that happen once.
* info element for height calibration (used in various motion estimation
algorithms). Note heigh tof use
* dummy driver demonstration of the use of all the new bits above.
* event monitor support for the new events.
* inv_mpu6050 gains an i2c mux to allow bypassing the device to access
additional devices connected on the other side of it. Note that in
Windows these are handled by firmware on the device and not exposed
directly.
* inv_mpu6050 gains ACPI enumeration.
* inkern interface gains iio_write_channel_raw to allow in kernel users
of DAC functionality via a simple wrapper.
* Document input current readings in the ABI docs.
* Add an error message when we get an out of range error in device tree
processing for the in kernel interfaces. Basically a device tree debugging
aid.
* Add a sanity check that a scan index for a channel is unique during
registration. There to help catch bugs as this should never happen
in a bug free driver.
Cleanups and fixlets
A rework of buffer registration from Lars - a precursor to some other
upcoming new stuff (a few patches from others rolled in here as well).
* Ensure all drivers register the same channels for the device and buffer.
* Move buffer registration into the core rather than using the old
two step approach. Now we have simple ways of using a unified set channels
for both without requiring channels be exposed by both interface, this
removes a fair bit of boilerplate.
* Stop sca3000 and ad5933 (both in staging) enabling buffer channels by
default. It has long be convention in IIO to startup with no channels
enabled and leave it up to userspace to say what goes in the buffer.
Getting rid of these allows us to drop export of iio_scan_mask_set.
* Drop get_bytes_per_datum from iio_buffer_access_funcs as not been used
for a while.
* Allocate standard buffer attributes in the core rather than in every
driver with a buffer.
* Make the length attribute read only when a driver is not able to set
the length.
* Drop the get_length callback for buffers as it is already available in
struct iio_buffer.
* Drop an unused arguement form iio_kfifo_allocate and add devm allocator
for it.
* some kconfig entries gain anotation with the resulting module name.
* Fix a resulting compile issue in dummy driver due to a stub taking
wrong parameters as a result of the above rework.
* Fix an off by 2 error in copying the core assigned buffer attributes.
Other cleanups,
* Trivial space before comma fixups.
* ak8975 fixlets - none critical. Rework to allow more device support.
* Drop unnecessary sizeof(u8) calls.
* bmp280 - refactor the compensation code to reduce copy operations and
code length. A second patch futher optimized this and performed some
other minor cleanups.
* kxcjk-1013 - various power control cleanups to avoid unnecessary enable
/ disable of device. Make sure it is only controlled at all if CONFIG_PM
is enabled. Also som cleanups of error paths.
* Small cleanups in adf4530 driver - pointless message and unnecessary braces.
* Clarifiy the proximity ABI docs to make it clear it should get bigger
as we move futher away.
* Drop a misleading comment form industrialio-core.c
* Trivial white space cleanups.
* sca3000 looses an unused debug function.
* Fix char unsigned ordering in ad8366
* Increase the sleep time in ad9523 to make it predictable (value didn't
really matter so make it more than 20 msecs)
* mxs-lradc touchscreen property cleanups in device tree are fixed to ensure
the meet all the 'interesting' documentation.
* A couple of cleanups for the staging ad5933 driver to avoid unnecessary
conversion to a processed temperature vlaue in kernel and remove
platform data form the state structure as not needed after probe.
* Fix a wrong scale factor in the docs.
Misc
* Add IIO include files to the maintainers entry.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2
iQIcBAABCAAGBQJUvtDlAAoJEFSFNJnE9BaIaNMQAI9ZYOrOmvSpxPV4ab71it9z
gi03VG8+iJl0dPgwcSHeFZvSDiNAOWSX/XdWLoxFAdpjpsnytIp01s9+c3ogz58j
pYbjxuOT2Qcf+36REuaFkQPFV2ppXMvwDwFUUNeFVupu+bVUKeZuNafBDp00aN1c
o4MPDwoS1EcTHL+77iCg06exL8LozOwLabfUTRVIRkhIqikemghcmubQHH06m+dk
EMddtNcXTVR4cJLX076nkKsNDHgmfoBYL9Hy/OvQbjWYAxoZg+q90ZX8yCy0Z5oW
otChj5XpoYRIa7X6xvP5kTebD4iiR/COWer83EyqFosXhmQ/27rWasST42j1K3q/
mU40skbscDef4F6COMlgBtVh1FhKUm9AHPAGk5swW792Qjpd4xdt+GShU5bJCa4O
OOZYk8ulraELeWVz2IK+CrOvJYeTSrNQR6VA6sBjWRHeqxtB0yOJkhxX9NUcSIgJ
GwM8qNTrQUkvI7OGvFGvf8hp9cboJTKEfzC+yspj+OJSjgJgNWw2pOjzJjsexxaL
nT2rKhPg46hC+FR4IvPPjhGihCtMSgBWkwbHSeXH+TgRfbbTUh6y6sqEUZraVhnQ
LKde54G0aH1XBFIM6fwWIPgdWBWsI3b3pFuBRMzhORdcCuAUOvDSyc5hVcaA8qb5
UZghapUruB556xjoMV3n
=LlJD
-----END PGP SIGNATURE-----
Merge tag 'iio-for-3.20a_take2' of git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into staging-testing
Jonathan writes:
First round of IIO new drivers, cleanups and functionality for the 3.20 cycle take 2
Updated pull request with Daniel's fix on top for the power management
Kconfig changes that had snuck in since last update of the IIO tree
worked it's way through from mainline.
Original pull message
New device support
* jsa1212 proxmity / ambient light sensor
* SM08500 supported added to the kxcjk-1013 accelerometer driver
* KMX61 Accelerometer/Magnetometer. This took a somewhat rocky path
being first merged, then reverted for a rewrite after a discussion of
how to support additional functionality and finally being merged prior
to some last reviews coming in, with resultant follow up patches.
* Freescale mma9551l driver (minor follow up warning supression patch).
* Semtech SX9500 proximity device driver.
* ak8975 gains support for ak09911 and ak09912 and drop the standalone driver
for the ak09911.
New functionality
* Dummy driver gains some virtual registers making it more flexible.
* IIO_ACTIVITY channel types, with modifiers running, walking etc. This is
to support on chip motion clasifiers. As such it is in the form of a
confidence percentage. The only devices so far only do binary decisions
but this gives us room when other devices give more nuanced clasification.
* IIO_EV_DIR_NONE type for events where there is no obvious direction.
First case is step detection.
* IIO_STEPS channel type for pedometers.
* ENABLE mask element used to control turning on counting types such as
the pedometer that need a 'start point'.
* INSTANCE event type to support things that happen once.
* info element for height calibration (used in various motion estimation
algorithms). Note heigh tof use
* dummy driver demonstration of the use of all the new bits above.
* event monitor support for the new events.
* inv_mpu6050 gains an i2c mux to allow bypassing the device to access
additional devices connected on the other side of it. Note that in
Windows these are handled by firmware on the device and not exposed
directly.
* inv_mpu6050 gains ACPI enumeration.
* inkern interface gains iio_write_channel_raw to allow in kernel users
of DAC functionality via a simple wrapper.
* Document input current readings in the ABI docs.
* Add an error message when we get an out of range error in device tree
processing for the in kernel interfaces. Basically a device tree debugging
aid.
* Add a sanity check that a scan index for a channel is unique during
registration. There to help catch bugs as this should never happen
in a bug free driver.
Cleanups and fixlets
A rework of buffer registration from Lars - a precursor to some other
upcoming new stuff (a few patches from others rolled in here as well).
* Ensure all drivers register the same channels for the device and buffer.
* Move buffer registration into the core rather than using the old
two step approach. Now we have simple ways of using a unified set channels
for both without requiring channels be exposed by both interface, this
removes a fair bit of boilerplate.
* Stop sca3000 and ad5933 (both in staging) enabling buffer channels by
default. It has long be convention in IIO to startup with no channels
enabled and leave it up to userspace to say what goes in the buffer.
Getting rid of these allows us to drop export of iio_scan_mask_set.
* Drop get_bytes_per_datum from iio_buffer_access_funcs as not been used
for a while.
* Allocate standard buffer attributes in the core rather than in every
driver with a buffer.
* Make the length attribute read only when a driver is not able to set
the length.
* Drop the get_length callback for buffers as it is already available in
struct iio_buffer.
* Drop an unused arguement form iio_kfifo_allocate and add devm allocator
for it.
* some kconfig entries gain anotation with the resulting module name.
* Fix a resulting compile issue in dummy driver due to a stub taking
wrong parameters as a result of the above rework.
* Fix an off by 2 error in copying the core assigned buffer attributes.
Other cleanups,
* Trivial space before comma fixups.
* ak8975 fixlets - none critical. Rework to allow more device support.
* Drop unnecessary sizeof(u8) calls.
* bmp280 - refactor the compensation code to reduce copy operations and
code length. A second patch futher optimized this and performed some
other minor cleanups.
* kxcjk-1013 - various power control cleanups to avoid unnecessary enable
/ disable of device. Make sure it is only controlled at all if CONFIG_PM
is enabled. Also som cleanups of error paths.
* Small cleanups in adf4530 driver - pointless message and unnecessary braces.
* Clarifiy the proximity ABI docs to make it clear it should get bigger
as we move futher away.
* Drop a misleading comment form industrialio-core.c
* Trivial white space cleanups.
* sca3000 looses an unused debug function.
* Fix char unsigned ordering in ad8366
* Increase the sleep time in ad9523 to make it predictable (value didn't
really matter so make it more than 20 msecs)
* mxs-lradc touchscreen property cleanups in device tree are fixed to ensure
the meet all the 'interesting' documentation.
* A couple of cleanups for the staging ad5933 driver to avoid unnecessary
conversion to a processed temperature vlaue in kernel and remove
platform data form the state structure as not needed after probe.
* Fix a wrong scale factor in the docs.
Misc
* Add IIO include files to the maintainers entry.
After commit b2b49ccbdd (PM: Kconfig: Set PM_RUNTIME if PM_SLEEP is
selected) PM_RUNTIME is always set if PM is set, so #ifdef blocks
depending on CONFIG_PM_RUNTIME may now be changed to depend on
CONFIG_PM.
Replace CONFIG_PM_RUNTIME with CONFIG_PM everywhere under
drivers/iio/imu/kmx61.c
Signed-off-by: Daniel Baluta <daniel.baluta@intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
When id is null, with ACPI enumeration, don't dereference it.
Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
The timeout value to wait_for_completion_timeout is in jiffies but
the value being passed seems like it was intended to by microseconds
Note that the timeout was extremely long thus it might be too short
now. In any case it probably should be passed through usecs_to_jiffies()
or msecs_to_jiffies()
patch is against linux-next 3.19.0-rc1 -next-20141226
patch was only compile-tested x86_64_defcofnig + CONFIG_SPMI=m
CONFIG_IIO=m, CONFIG_QCOM_SPMI_IADC=m
Signed-off-by: Nicholas Mc Guire <der.herr@hofr.at>
Acked-by: Ivan T. Ivanov <iivanov@mm-sol.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Since setting irq-enabled GPIOs into output state is not supported
by all GPIO controllers, we need to disable the irq while requesting
sensor data. As side effect we lose a tiny bit of functionality:
Some wiring problems can't be concluded from log messages anymore.
Signed-off-by: Richard Weinberger <richard@nod.at>
Signed-off-by: Harald Geyer <harald@ccbib.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Make sure that the read function is not interrupted...
Signed-off-by: Richard Weinberger <richard@nod.at>
Acked-by: Harald Geyer <harald@ccbib.org>
Reviewed-by: Sanjeev Sharma <sanjeev_sharma@mentor.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
As we access i-1 we must not start with i=0.
Signed-off-by: Richard Weinberger <richard@nod.at>
Acked-by: Hartmut Knaack <knaack.h@gmx.de>
Acked-by: Harald Geyer <harald@ccbib.org>
Reviewed-by: Sanjeev Sharma <sanjeev_sharma@mentor.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* ad799x fix ad7991/ad7995/ad7999 setup as they do not have a configuration
register to write to. It is written during the convesion sequence. As
such we don't want to write to it at other times.
* Fix iio_channel_read utility function to return to ensure it is apparent
if the relevant element is not there. This avoids using a wrong value
if some channels have the element and others do not.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2
iQIcBAABCAAGBQJUqvMpAAoJEFSFNJnE9BaIuCMP+gIEdqqtPZAs7TH/tkQx0aqN
DerVFgVwDrXFwAPKWYdwinE/u7qyRI77tNAo2f/QR4NBG1sjHc6FHhpgDCK2jPbh
6QMQ64WH8svXlacStZTb45il2sh419tUj8BQeld8MjpqdpWK4RW8Ca4q8XjlmehG
S4EyEHvYj/MQWpDy84RZEYEYlmeWhghxo2FGIWG2gKJ63Ejyo6kwjlxTJiNafj9/
YN+J+C6J9r7o2mLuDtucslnGg6rTedLW7UijLAHGxfzAJFqjaMDGD0RZXgpEpfkx
wRca7M0537psXuBy3onGXQTEKy72GP3Km9A/0yojbCWMj2OKI0LPSW7oTnWQ6gCw
+V1ius+wPWSJ8PdRLZvp2hsWgZK9jE0zUSHsuB41ZJARTpsbExW56y8QOHSM1oX1
3cmrhz6410qx8qe+qn8UwLIzJZCTbA71B4kdh6OiBmIUfV6CZBcwYOvrGKd9hGj/
zmNl427NwhzgxO/OXeD5+lQR1tL2wVaKlrGFcwcMghCHno/c7o8aP8QuIYHkpNmq
7f7ebIXpNHZHskGVacLFECRrZMEkVmq49b3PMIH+4zCgFTLtIBX8MS7VzGutThWw
5ok1iUaG6aXh2jY8USYt3nCRi8DQoOSjJ5SXI1U3X6gS2tworeqmtMw9yTuc1juK
s+XDwVFMJao56MdrzDyO
=7f+n
-----END PGP SIGNATURE-----
Merge tag 'iio-fixes-for-3.19a' of git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into staging-linus
Jonathan writes:
First round of IIO fixes for the 3.19 cycle.
* ad799x fix ad7991/ad7995/ad7999 setup as they do not have a configuration
register to write to. It is written during the convesion sequence. As
such we don't want to write to it at other times.
* Fix iio_channel_read utility function to return to ensure it is apparent
if the relevant element is not there. This avoids using a wrong value
if some channels have the element and others do not.
Support for keyword 'boolean' will be dropped later on.
No functional change.
Reference: http://lkml.kernel.org/r/cover.1418003065.git.cj@linux.com
Signed-off-by: Christoph Jaeger <cj@linux.com>
Signed-off-by: Michal Marek <mmarek@suse.cz>
Having two or more channels with the same positive scan_index field
makes no sense if the device supports buffering. Prevent this situation
by failing to register such a device.
Signed-off-by: Vlad Dogaru <vlad.dogaru@intel.com>
Reviewed-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
We have two IIO devices and we need to adjust the base
when reading data.
Signed-off-by: Daniel Baluta <daniel.baluta@intel.com>
Reviewed-by: Hartmut Knaack <knaack.h@gmx.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Useful in the debugging phase, not needed now.
Signed-off-by: Daniel Baluta <daniel.baluta@intel.com>
Acked-by: Hartmut Knaack <knaack.h@gmx.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
This fixes parts of kmx61 error handling to make code easier to read and to be
more consistent with IIO coding conventions:
* prefer as single point for error handling instead of duplicating code
for each function
* directly return a value from a case branch instead of breaking
* fix error message for writing REG_CTRL1
Also, add separate error paths for kmx61_trigger_setup/iio_triggered_buffer_setup
calls.
Signed-off-by: Daniel Baluta <daniel.baluta@intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
..except while in an error handler, where there is nothing
to be done anyway.
Signed-off-by: Daniel Baluta <daniel.baluta@intel.com>
Reviewed-by: Hartmut Knaack <knaack.h@gmx.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
If the DT contains an invalid channel specifier then the probe of
iio_hwmon fails with the following message:
iio_hwmon: probe of iio_hwmon failed with error -22
So it's better to print out the relevant channel specifier in
error case to locate the problem.
Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
When xilinx-xadc is used with hwmon driver to read voltage, offset used
for temperature is always applied whatever the channel.
iio_channel_read must return an error to avoid offset for channel
without IIO_CHAN_INFO_OFFSET property.
Signed-off-by: Fabien Proriol <fabien.proriol@jdsu.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
This patch increases sleep time in ad9523_store_eeprom to 20ms since
it isn't timing critical. It fixes the following checkpatch.pl warning:
WARNING: msleep < 20ms can sleep for up to 20ms
Signed-off-by: Roberta Dobrescu <roberta.dobrescu@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
This patch fixes the following checkpatch.pl warning:
WARNING: type 'char unsigned' should be specified in [[un]signed]
[short|int|long|long long] order
Signed-off-by: Roberta Dobrescu <roberta.dobrescu@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
This patch fixes the following checkpatch.pl error:
ERROR: space prohibited before that ',' (ctx:WxW)
Signed-off-by: Roberta Dobrescu <roberta.dobrescu@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>