Alexandru Ardelean
13ca1a1be5
iio: adc: ad9467: return ENODEV vs EINVAL in ad9467_setup()
...
The proper error code should be ENODEV (vs EINVAL) in case the chip ID
isn't recognized.
Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com >
Link: https://lore.kernel.org/r/20200916082221.72851-1-alexandru.ardelean@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2020-09-16 19:15:54 +01:00
Alexandru Ardelean
6026af6a53
iio: adc: ad9467: refine mismatch vs unknown chip-id messages
...
We should probably print what the expected chip-ID is. We already have
that information available, based on the device specified via
device-tree.
Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com >
Link: https://lore.kernel.org/r/20200916083128.73729-1-alexandru.ardelean@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2020-09-16 19:14:17 +01:00
Jonathan Cameron
7b9dc60ebd
staging:iio:documentation: Drop most generic docs
...
These docs are both suffering from being out of date, and from being
superceeded by the documentation in Documentation/driver-api/iio
Note the inkern.txt drop is left for now as this is an area not
well covered by the more recent documentation outside staging.
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
Link: https://lore.kernel.org/r/20200905174721.216452-5-jic23@kernel.org
2020-09-16 19:12:00 +01:00
Jonathan Cameron
d4ca7f94ce
staging:iio:light: drop stale ABI docs
...
There are no remaining light drivers in staging/iio.
The content of this file are either included in the non staging
ABI docs, or don't seem to be used in any current driver.
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
Link: https://lore.kernel.org/r/20200905174721.216452-4-jic23@kernel.org
2020-09-16 19:12:00 +01:00
Jonathan Cameron
5999439859
staging:iio:light: Move tsl2x7x ABI docs to correct location.
...
These seem to be up to date but never moved out of staging when the driver
did. Hence let us move them out now.
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
Reviewed-by: Brian Masney <masneyb@onstation.org >
Cc: Brian Masney <masneyb@onstation.org >
Link: https://lore.kernel.org/r/20200905174721.216452-3-jic23@kernel.org
2020-09-16 19:11:59 +01:00
Jonathan Cameron
a2de31bda7
staging:iio:dac:max517 remove documentation
...
Whilst there is some useful info in here, it can be easily
obtained from datasheets. Some of the info should perhaps
be incorporated into a device tree bindings doc.
As this didn't move out of staging with the driver, I'm suggesting
we just drop it. We don't generally carry per driver documentation
with the exception of non standard ABI which is not the case here.
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
Cc: Roland Stigge <stigge@antcom.de >
Link: https://lore.kernel.org/r/20200905174721.216452-2-jic23@kernel.org
2020-09-16 19:11:59 +01:00
Liu Shixin
d4a4b78a0c
iio: adc: palmas_gpadc: use module_platform_driver to simplify the code
...
module_platform_driver() makes the code simpler by eliminating
boilerplate code.
Signed-off-by: Liu Shixin <liushixin2@huawei.com >
Link: https://lore.kernel.org/r/20200914065401.3726354-1-liushixin2@huawei.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2020-09-16 19:09:51 +01:00
Nuno Sá
d8f0cd7668
iio: adis: Drop non Managed device functions
...
Drop `adis_setup_buffer_and_trigger()`. All users were updated to use
the devm version of this function. This avoids having almost the same
code repeated.
Signed-off-by: Nuno Sá <nuno.sa@analog.com >
Link: https://lore.kernel.org/r/20200915120258.161587-11-nuno.sa@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2020-09-16 19:06:10 +01:00
Nuno Sá
9da3286673
staging: iio: adis16240: Use Managed device functions
...
Use the adis managed device functions to setup the buffer and the trigger.
The ultimate goal will be to completely drop the non devm version from
the lib.
Since we are here, drop the `.remove` callback by further using devm
functions.
Signed-off-by: Nuno Sá <nuno.sa@analog.com >
Link: https://lore.kernel.org/r/20200915120258.161587-10-nuno.sa@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2020-09-16 19:06:10 +01:00
Nuno Sá
460c7b4c1a
staging: iio: adis16203: Use Managed device functions
...
Use the adis managed device functions to setup the buffer and the trigger.
The ultimate goal will be to completely drop the non devm version from
the lib.
Since we are here, drop the `.remove` callback by further using devm
functions.
Signed-off-by: Nuno Sá <nuno.sa@analog.com >
Link: https://lore.kernel.org/r/20200915120258.161587-9-nuno.sa@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2020-09-16 19:06:10 +01:00
Nuno Sá
514f641b3b
iio: adis16480: Use Managed device functions
...
Use the adis managed device functions to setup the buffer and the trigger.
The ultimate goal will be to completely drop the non devm version from
the lib.
Since we are here, drop the `.remove` callback by further using devm
functions.
Signed-off-by: Nuno Sá <nuno.sa@analog.com >
Link: https://lore.kernel.org/r/20200915120258.161587-8-nuno.sa@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2020-09-16 19:06:09 +01:00
Nuno Sá
fa623cddc0
iio: adis16460: Use Managed device functions
...
Use the adis managed device functions to setup the buffer and the trigger.
The ultimate goal will be to completely drop the non devm version from
the lib.
Since we are here, drop the `.remove` callback by further using devm
functions.
Signed-off-by: Nuno Sá <nuno.sa@analog.com >
Link: https://lore.kernel.org/r/20200915120258.161587-7-nuno.sa@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2020-09-16 19:06:09 +01:00
Nuno Sá
f13aa06442
iio: adis16400: Use Managed device functions
...
Use the adis managed device functions to setup the buffer and the trigger.
The ultimate goal will be to completely drop the non devm version from
the lib.
Since we are here, drop the `.remove` callback by further using devm
functions.
Signed-off-by: Nuno Sá <nuno.sa@analog.com >
Link: https://lore.kernel.org/r/20200915120258.161587-6-nuno.sa@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2020-09-16 19:06:09 +01:00
Nuno Sá
5a9b7ca638
iio: adis16260: Use Managed device functions
...
Use the adis managed device functions to setup the buffer and the trigger.
The ultimate goal will be to completely drop the non devm version from
the lib.
Since we are here, drop the `.remove` callback by further using devm
functions.
Signed-off-by: Nuno Sá <nuno.sa@analog.com >
Link: https://lore.kernel.org/r/20200915120258.161587-5-nuno.sa@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2020-09-16 19:06:08 +01:00
Nuno Sá
77802e097f
iio: adis16136: Use Managed device functions
...
Use the adis managed device functions to setup the buffer and the trigger.
The ultimate goal will be to completely drop the non devm version from
the lib.
Since we are here, drop the `.remove` callback by further using devm
functions.
Signed-off-by: Nuno Sá <nuno.sa@analog.com >
Link: https://lore.kernel.org/r/20200915120258.161587-4-nuno.sa@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2020-09-16 19:06:08 +01:00
Nuno Sá
17ff204ca8
iio: adis16209: Use Managed device functions
...
Use the adis managed device functions to setup the buffer and the trigger.
The ultimate goal will be to completely drop the non devm version from
the lib.
Since we are here, drop the `.remove` callback by further using devm
functions.
Signed-off-by: Nuno Sá <nuno.sa@analog.com >
Link: https://lore.kernel.org/r/20200915120258.161587-3-nuno.sa@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2020-09-16 19:06:08 +01:00
Nuno Sá
b79a22ee37
iio: adis16201: Use Managed device functions
...
Use the adis managed device functions to setup the buffer and the trigger.
The ultimate goal will be to completely drop the non devm version from
the lib.
Since we are here, drop the `.remove` callback by further using devm
functions.
Signed-off-by: Nuno Sá <nuno.sa@analog.com >
Link: https://lore.kernel.org/r/20200915120258.161587-2-nuno.sa@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2020-09-16 19:06:07 +01:00
Krzysztof Kozlowski
3c6fe91199
dt-bindings: iio: adc: exynos-adc: do not require syscon on S5Pv210
...
The ADC in S5Pv210 does not have ADC phy registers in separate block for
which syscon would be needed. Remove this requirement to fix dtbs_check
warnings like:
arch/arm/boot/dts/s5pv210-fascinate4g.dt.yaml: adc@e1700000: 'samsung,syscon-phandle' is a required property
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org >
Acked-by: Jonathan Cameron <Jonathan.Cameron@huwei.com >
Acked-by: Rob Herring <robh@kernel.org >
Link: https://lore.kernel.org/r/20200910161933.9156-2-krzk@kernel.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2020-09-16 19:02:22 +01:00
Krzysztof Kozlowski
3b17dd2204
dt-bindings: iio: adc: exynos-adc: require second interrupt with touch screen
...
The ADC in S3C/S5P/Exynos SoCs can be used also for handling touch
screen. In such case the second interrupt is required. This second
interrupt can be anyway provided, even without touch screens. This
fixes dtbs_check warnings like:
arch/arm/boot/dts/s5pv210-aquila.dt.yaml: adc@e1700000: interrupts: [[23], [24]] is too long
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org >
Reviewed-by: Rob Herring <robh@kernel.org >
Acked-by: Jonathan Cameron <Jonathan.Cameron@huwei.com >
Link: https://lore.kernel.org/r/20200910161933.9156-1-krzk@kernel.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2020-09-16 19:02:22 +01:00
Jonathan Cameron
1bf0347a3c
dt-bindings: iio: adc: ti,ads7950 binding conversion
...
Conversion from txt to yaml. The binding documents that
as not all boards will make use of the ADC channels via a consumer
driver. It does no harm however, so we will leave it as required.
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
Reviewed-by: Rob Herring <robh@kernel.org >
Reviewed-by: David Lechner <david@lechnology.com >
Cc: David Lechner <david@lechnology.com >
Link: https://lore.kernel.org/r/20200830161154.3201-3-jic23@kernel.org
2020-09-16 18:59:18 +01:00
Jonathan Cameron
9c53adbac0
dt-bindings: iio: adc: ti,adc12138 yaml conversion.
...
Simple binding conversion from txt to yaml.
Only addition was #io-channel-cells to allow for potential consumers
of the channels on this device.
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
Reviewed-by: Rob Herring <robh@kernel.org >
Cc: Akinobu Mita <akinobu.mita@gmail.com >
Link: https://lore.kernel.org/r/20200830161154.3201-2-jic23@kernel.org
2020-09-16 18:59:18 +01:00
Sergiu Cuciurean
f0e64305cf
iio: frequency: adf4350: Replace indio_dev->mlock with own device lock
...
As part of the general cleanup of indio_dev->mlock, this change replaces
it with a local lock.
The lock protect the state of the device from potential concurrent writes.
The device is configured via a sequence of SPI writes, and this lock is
meant to prevent the start of another sequence before another one has
finished.
This is part of a bigger cleanup.
Link: https://lore.kernel.org/linux-iio/CA+U=Dsoo6YABe5ODLp+eFNPGFDjk5ZeQEceGkqjxXcVEhLWubw@mail.gmail.com/
Signed-off-by: Sergiu Cuciurean <sergiu.cuciurean@analog.com >
Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com >
Link: https://lore.kernel.org/r/20200916092731.77220-1-alexandru.ardelean@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2020-09-16 18:58:01 +01:00
Sergiu Cuciurean
20be66c193
iio: dac: ti-dac7612: Replace indio_dev->mlock with own device lock
...
As part of the general cleanup of indio_dev->mlock, this change replaces
it with a local lock on the device's state from potential concurrent write
accesses from userspace. The write operation requires an SPI write, then
toggling of a GPIO, so the lock aims to protect the sanity of the entire
sequence of operation.
This is part of a bigger cleanup.
Link: https://lore.kernel.org/linux-iio/CA+U=Dsoo6YABe5ODLp+eFNPGFDjk5ZeQEceGkqjxXcVEhLWubw@mail.gmail.com/
Signed-off-by: Sergiu Cuciurean <sergiu.cuciurean@analog.com >
Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com >
Link: https://lore.kernel.org/r/20200916092535.76527-1-alexandru.ardelean@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2020-09-16 18:56:22 +01:00
Sergiu Cuciurean
2544ea7bd0
iio: stm32-dac: Replace indio_dev->mlock with own device lock
...
As part of the general cleanup of indio_dev->mlock, this change replaces
it with a local lock. The lock protects against potential races when
reading the CR reg and then updating, so that the state of pm_runtime
is consistent between the two operations.
This is part of a bigger cleanup.
Link: https://lore.kernel.org/linux-iio/CA+U=Dsoo6YABe5ODLp+eFNPGFDjk5ZeQEceGkqjxXcVEhLWubw@mail.gmail.com/
Signed-off-by: Sergiu Cuciurean <sergiu.cuciurean@analog.com >
Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com >
Reviewed-by: Fabrice Gasnier <fabrice.gasnier@st.com >
Link: https://lore.kernel.org/r/20200916092349.75647-1-alexandru.ardelean@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2020-09-16 18:51:40 +01:00
Nishant Malpani
d3e0e14d65
iio: gyro: adxrs290: Add debugfs register access support
...
Extend support to read/write byte data from/to the device using
debugfs iio interface.
Signed-off-by: Nishant Malpani <nish.malpani25@gmail.com >
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com >
Link: https://lore.kernel.org/r/20200910180450.29696-4-nish.malpani25@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2020-09-13 10:51:46 +01:00
Nishant Malpani
85434c2ab3
dt-bindings: iio: gyro: adxrs290: Add interrupts support
...
Include 'interrupts' property and provide a suitable example for using
a GPIO interrupt line.
Signed-off-by: Nishant Malpani <nish.malpani25@gmail.com >
Link: https://lore.kernel.org/r/20200910180450.29696-3-nish.malpani25@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2020-09-13 10:51:46 +01:00
Nishant Malpani
672555807f
iio: gyro: adxrs290: Add triggered buffer support
...
Provide a way for continuous data capture by setting up buffer support. The
data ready signal exposed at the SYNC pin of the ADXRS290 is exploited as
a hardware interrupt which triggers to fill the buffer.
Triggered buffer setup was tested with both hardware trigger (DATA_RDY) and
software triggers (sysfs-trig & hrtimer).
Signed-off-by: Nishant Malpani <nish.malpani25@gmail.com >
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com >
Link: https://lore.kernel.org/r/20200910180450.29696-2-nish.malpani25@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2020-09-13 10:51:23 +01:00
Nishant Malpani
5ac65da27e
iio: gyro: adxrs290: use hook for devm resource unwinding
...
Make use of devm_add_action_or_reset() hook to switch device into STANDBY
mode during standard resource unwinding. The patch includes a helper
function, in the form of adxrs290_set_mode(), to realise driving the
device into STANDBY mode.
Signed-off-by: Nishant Malpani <nish.malpani25@gmail.com >
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com >
Link: https://lore.kernel.org/r/20200910122711.16670-1-nish.malpani25@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2020-09-13 10:45:47 +01:00
Krzysztof Kozlowski
a5c69204da
iio: adc: stm32: Fix missing return in booster error path
...
Conversion of error paths to dev_err_probe() dropped one return
statement. The driver will continue to probe if getting booster
regulator fails.
Fixes: ce30eeb613 ("iio: adc: stm32: Simplify with dev_err_probe()")
Reported-by: Stephen Rothwell <sfr@canb.auug.org.au >
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org >
Link: https://lore.kernel.org/r/1599727927-7776-1-git-send-email-krzk@kernel.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2020-09-13 10:43:55 +01:00
Christian Eggers
23e0618ca0
iio: light: as73211: Increase measurement timeout
...
We found some sensors which are much slower (20% at room temperature)
than nominal. According to the data sheet, up to 27% is possible. Now I
add 33% to the nominal time out, hopefully this is enough.
Signed-off-by: Christian Eggers <ceggers@arri.de >
Link: https://lore.kernel.org/r/20200909154439.10308-1-ceggers@arri.de
Fixes: 403e5586b5 ("iio: light: as73211: New driver")
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2020-09-13 10:37:46 +01:00
Crt Mori
dde8ceec9e
iio: temperature: mlx90632: Interface to change object ambient temperature
...
Since object temperature might be different than the sensor temperature
the infrared sensors should provide an interface to inject ambient
temperature. This was in past done via write to ambient temperature
interface (in_temp_ambient_raw), but I think most people did not know
about it. This solution introduces a new iio type of the CALIBAMBIENT
which is hopefully more descriptive and more explicit about the purpose
and capabilities of the sensors.
Signed-off-by: Crt Mori <cmo@melexis.com >
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com >
Link: https://lore.kernel.org/r/20200906210231.383976-1-cmo@melexis.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2020-09-13 10:21:37 +01:00
Krzysztof Kozlowski
d3333e21f2
MAINTAINERS: Move Hartmut Knaack to Credits
...
Hartmut Knaack was an active reviewer and contributor to the IIO
subsystem and drivers. However his last message on LKML is from
October 2015.
In thanks for Hartmut's effort, move him name to the Credits.
Suggested-by: Andy Shevchenko <andy.shevchenko@gmail.com >
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org >
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com >
Cc: Jonathan Cameron <jic23@kernel.org >
Cc: linux-iio <linux-iio@vger.kernel.org >
Link: https://lore.kernel.org/r/20200903181926.5606-2-krzk@kernel.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2020-09-06 17:02:44 +01:00
Krzysztof Kozlowski
50dd953ea0
MAINTAINERS: Consolidate Analog Devices IIO entries and remove Beniamin Bia
...
Emails to Beniamin Bia bounce with no such address so remove him from
maintainers. After this removal, many entries for Analog Devices Inc
IIO drivers look exactly the same so consolidate them.
Suggested-by: Andy Shevchenko <andy.shevchenko@gmail.com >
Suggested-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org >
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com >
Acked-by: Lars-Peter Clausen <lars@metafoo.de >
Cc: Michael Hennerich <Michael.Hennerich@analog.com >
Cc: Jonathan Cameron <jic23@kernel.org >
Cc: linux-iio <linux-iio@vger.kernel.org >
Link: https://lore.kernel.org/r/20200903181926.5606-1-krzk@kernel.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2020-09-06 17:02:31 +01:00
Douglas Anderson
52f5b683e5
iio: sx9310: Prefer async probe
...
On one board I found that:
probe of 5-0028 returned 1 after 259547 usecs
While some of this time is attributable to the pile of i2c transfers
that we do at probe time, the lion's share (over 200 ms) is sitting
waiting in the polling loop in sx9310_init_compensation() waiting for
the hardware to indicate that it's done.
There's no reason to block probe of all other devices on our probe.
Turn on async probe.
Signed-off-by: Douglas Anderson <dianders@chromium.org >
Reviewed-by: Stephen Boyd <swboyd@chromium.org >
Reviewed-by: Daniel Campello <campello@chromium.org >
Link: https://lore.kernel.org/r/20200901081920.v2.1.Id02b2f451b3eed71ddd580f4b8b44b3e33e84970@changeid
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2020-09-06 16:22:03 +01:00
Alex Dewar
aa06b6f4d8
iio: adc: rockchip_saradc: Allow compile-testing with !ARM
...
There seems no reason to allow for compile-testing on ARM only, so
remove this restriction.
Build-tested with allyesconfig on x86.
Signed-off-by: Alex Dewar <alex.dewar90@gmail.com >
Reviewed-by: Heiko Stuebner <heiko@sntech.de >
Link: https://lore.kernel.org/r/20200904170416.16061-1-alex.dewar90@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2020-09-06 16:13:40 +01:00
kernel test robot
2f0472a1f8
drivers/iio/humidity/hdc2010.c:305:2-3: Unneeded semicolon
...
Remove unneeded semicolon.
Generated by: scripts/coccinelle/misc/semicolon.cocci
Fixes: 0115a63c99 ("iio: humidity: Add TI HDC20x0 support")
CC: Eugene Zaikonnikov <ez@norphonic.com >
Signed-off-by: kernel test robot <lkp@intel.com >
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2020-09-06 16:05:56 +01:00
Andy Shevchenko
f530f88246
iio: accel: bma220: Remove unneeded blank lines
...
There are few blank lines that split structure definitions
with their users. Remove them to increase readability.
While here, update copyright year.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com >
Link: https://lore.kernel.org/r/20200831090813.78841-8-andriy.shevchenko@linux.intel.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2020-09-03 19:41:00 +01:00
Andy Shevchenko
2b09b41dba
iio: accel: bma220: Use BIT() and GENMASK() macros
...
Code is better to read when numbers of bit are explicitly used.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com >
Link: https://lore.kernel.org/r/20200831090813.78841-7-andriy.shevchenko@linux.intel.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2020-09-03 19:41:00 +01:00
Andy Shevchenko
df9f7d4c33
iio: accel: bma220: Group IIO headers together
...
Group IIO headers together and follow the common pattern of header inclusion,
i.e. more generic first.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com >
Link: https://lore.kernel.org/r/20200831090813.78841-6-andriy.shevchenko@linux.intel.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2020-09-03 19:41:00 +01:00
Andy Shevchenko
846afc1dbc
iio: accel: bma220: Drop ACPI_PTR() and accompanying ifdeffery
...
The driver is quite likely used only on ACPI based platforms and
rarely build with CONFIG_ACPI=n. Even though, the few dozens of bytes
is better than ugly ifdeffery and inclusion of heavy header.
As a result, replace acpi.h with mod_devicetable.h.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com >
Link: https://lore.kernel.org/r/20200831090813.78841-5-andriy.shevchenko@linux.intel.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2020-09-03 19:40:59 +01:00
Andy Shevchenko
4d9a167a34
iio: accel: bma220: Mark PM functions as __maybe_unused
...
Instead of using ugly ifdeffery, mark PM functions as __maybe_unused.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com >
Link: https://lore.kernel.org/r/20200831090813.78841-4-andriy.shevchenko@linux.intel.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2020-09-03 19:40:59 +01:00
Andy Shevchenko
700e63dada
iio: accel: bma220: Use dev_get_drvdata() directly
...
Instead of using to_spi_dev() + spi_get_drvdata(),
use dev_get_drvdata() to make code simpler.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com >
Link: https://lore.kernel.org/r/20200831090813.78841-3-andriy.shevchenko@linux.intel.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2020-09-03 19:40:59 +01:00
Andy Shevchenko
938d1b3873
iio: accel: bma220: Convert to use ->read_avail()
...
Convert to use ->read_avail() instead of open-coded attribute handling.
While here, fix the typo in array definition and append comma in case of
the future extension.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com >
Link: https://lore.kernel.org/r/20200831090813.78841-2-andriy.shevchenko@linux.intel.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2020-09-03 19:40:59 +01:00
Andy Shevchenko
5265b267e3
iio: accel: bma220: Fix returned codes from bma220_init(), bma220_deinit()
...
Potentially bma220_init() and bma220_deinit() may return positive codes.
Fix the logic to return proper error codes instead.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com >
Link: https://lore.kernel.org/r/20200831090813.78841-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2020-09-03 19:40:58 +01:00
Jonathan Cameron
8d7eab6207
dt-bindings: iio: adc: microchip,mcp3201 yaml conversion.
...
Drops the deprecated compatibles without the vendor name.
Whilst the driver continues to support these for old dt blobs,
any dt bindings that are actuallly verified against this document should
be fixed to add the vendor name.
Added the #io-channel-cells property to allow for consumers.
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
Reviewed-by: Rob Herring <robh@kernel.org >
Cc: Oskar Andero <oskar.andero@gmail.com >
Link: https://lore.kernel.org/r/20200809111753.156236-2-jic23@kernel.org
2020-09-03 19:40:58 +01:00
Alexandru Ardelean
65e02d0b50
iio: buffer-dmaengine: adjust bytes_used with residue info
...
A transfer may fall shorter than the bytes in the block.
This information is available in the residue from the DMA engine, so we can
compute actual `bytes_used` with that by subtracting the residue.
Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com >
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de >
Link: https://lore.kernel.org/r/20200826052011.13348-1-lars@metafoo.de
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2020-09-03 19:40:58 +01:00
Jonathan Cameron
e7b61fc4ca
dt-bindings: iio: adc: ti,tlc4541 binding conversion
...
Simple binding so easy to convert.
Dropped the stated value of maximum spi bus frequency as it does
not seem to correspond to the datasheet. The value of 200kHz
is the max sampling frequency of the ADC, not the clock frequency of
the SPI bus.
Added #io-channel-cells to allow use as a provider of channels to
other devices via the consumer binding.
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
Reviewed-by: Rob Herring <robh@kernel.org >
Reviewed-By: Phil Reid <preid@electromag.com.au >
Cc: Phil Reid <preid@electromag.com.au >
Link: https://lore.kernel.org/r/20200809111753.156236-14-jic23@kernel.org
2020-09-03 19:40:58 +01:00
Phil Reid
9e4e28ac76
dt-bindings: iio: adc: tlc4541 - recover accidentally dropped binding doc
...
JC: Seems that I messed up applying the original driver patches, and
this file never actually made it into the tree.
I have picked up original Ack and Sign-off so as to record the
history.
Signed-off-by: Phil Reid <preid@electromag.com.au >
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
Acked-by: Rob Herring <robh@kernel.org >
Link: https://lore.kernel.org/r/20200809111753.156236-13-jic23@kernel.org
2020-09-03 19:40:58 +01:00
Jonathan Cameron
9727ef55d8
dt-bindings: iio: adc: ti,ads8344 yaml conversion
...
Simple binding so easy to convert.
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
Reviewed-by: Rob Herring <robh@kernel.org >
Link: https://lore.kernel.org/r/20200809111753.156236-12-jic23@kernel.org
2020-09-03 19:40:57 +01:00
Jonathan Cameron
686b2bd9f4
dt-bindings: iio: adc: ti,adc128s052 yaml conversion.
...
Simple binding. Only addition to txt version is
as a provider of channels to other devices using the consumer
binding.
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
Reviewed-by: Rob Herring <robh@kernel.org >
Cc: Angelo Compagnucci <angelo.compagnucci@gmail.com >
Link: https://lore.kernel.org/r/20200809111753.156236-10-jic23@kernel.org
2020-09-03 19:40:57 +01:00