Robert Hancock
d5d786fb53
iio: adc: xilinx-ams: Fixed wrong sequencer register settings
...
Register settings used for the sequencer configuration register
were incorrect, causing some inputs to not be read properly.
Fixes: d5c70627a7 ("iio: adc: Add Xilinx AMS driver")
Signed-off-by: Robert Hancock <robert.hancock@calian.com >
Reviewed-by: Michael Tretter <m.tretter@pengutronix.de >
Acked-by: Michal Simek <michal.simek@xilinx.com >
Link: https://lore.kernel.org/r/20220127173450.3684318-4-robert.hancock@calian.com
Cc: <Stable@vger.kernel.org >
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2022-03-02 13:38:57 +00:00
Robert Hancock
1f21a41578
iio: adc: xilinx-ams: Fixed missing PS channels
...
The code forgot to increment num_channels for the PS channel inputs,
resulting in them not being enabled as they should.
Fixes: d5c70627a7 ("iio: adc: Add Xilinx AMS driver")
Signed-off-by: Robert Hancock <robert.hancock@calian.com >
Reviewed-by: Michael Tretter <m.tretter@pengutronix.de >
Acked-by: Michal Simek <michal.simek@xilinx.com >
Link: https://lore.kernel.org/r/20220127173450.3684318-3-robert.hancock@calian.com
Cc: <Stable@vger.kernel.org >
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2022-03-02 13:38:48 +00:00
Robert Hancock
5165102efa
dt-bindings: iio: adc: zynqmp_ams: Add clock entry
...
The AMS driver DT binding was missing the clock entry, which is actually
mandatory according to the driver implementation. Add this in.
Fixes: 39dd2d1e25 ("dt-bindings: iio: adc: Add Xilinx AMS binding documentation")
Signed-off-by: Robert Hancock <robert.hancock@calian.com >
Reviewed-by: Rob Herring <robh@kernel.org >
Acked-by: Michal Simek <michal.simek@xilinx.com >
Link: https://lore.kernel.org/r/20220127173450.3684318-2-robert.hancock@calian.com
Cc: <Stable@vger.kernel.org >
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2022-03-02 13:38:37 +00:00
Haibo Chen
c87b7b12f4
iio: accel: mma8452: use the correct logic to get mma8452_data
...
The original logic to get mma8452_data is wrong, the *dev point to
the device belong to iio_dev. we can't use this dev to find the
correct i2c_client. The original logic happen to work because it
finally use dev->driver_data to get iio_dev. Here use the API
to_i2c_client() is wrong and make reader confuse. To correct the
logic, it should be like this
struct mma8452_data *data = iio_priv(dev_get_drvdata(dev));
But after commit 8b7651f259 ("iio: iio_device_alloc(): Remove
unnecessary self drvdata"), the upper logic also can't work.
When try to show the avialable scale in userspace, will meet kernel
dump, kernel handle NULL pointer dereference.
So use dev_to_iio_dev() to correct the logic.
Dual fixes tags as the second reflects when the bug was exposed, whilst
the first reflects when the original bug was introduced.
Fixes: c3cdd6e48e ("iio: mma8452: refactor for seperating chip specific data")
Fixes: 8b7651f259 ("iio: iio_device_alloc(): Remove unnecessary self drvdata")
Signed-off-by: Haibo Chen <haibo.chen@nxp.com >
Reviewed-by: Martin Kepplinger <martink@posteo.de >
Cc: <Stable@vger.kernel.org >
Link: https://lore.kernel.org/r/1645497741-5402-1-git-send-email-haibo.chen@nxp.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2022-03-02 13:38:32 +00:00
Billy Tsai
571426631a
iio: adc: aspeed: Add divider flag to fix incorrect voltage reading.
...
The formula for the ADC sampling period in ast2400/ast2500 is:
ADC clock period = PCLK * 2 * (ADC0C[31:17] + 1) * (ADC0C[9:0])
When ADC0C[9:0] is set to 0 the sampling voltage will be lower than
expected, because the hardware may not have enough time to
charge/discharge to a stable voltage. This patch use the flag
CLK_DIVIDER_ONE_BASED which will use the raw value read from the
register, with the value of zero considered invalid to conform to the
corrected formula.
Fixes: 573803234e ("iio: Aspeed ADC")
Reported-by: Konstantin Klubnichkin <kitsok@yandex-team.ru >
Signed-off-by: Billy Tsai <billy_tsai@aspeedtech.com >
Reviewed-by: Joel Stanley <joel@jms.id.au >
Link: https://lore.kernel.org/r/20220221012705.22008-1-billy_tsai@aspeedtech.com
Cc: <Stable@vger.kernel.org >
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2022-03-02 13:38:29 +00:00
Haibo Chen
6270bf1f01
iio: imu: st_lsm6dsx: use dev_to_iio_dev() to get iio_dev struct
...
dev_get_drvdata() on iio_dev->dev no longer returns the iio_dev.
Use dev_to_iio_dev() to get iio_dev struct.
Fixes: 8b7651f259 ("iio: iio_device_alloc(): Remove unnecessary self drvdata")
Signed-off-by: Haibo Chen <haibo.chen@nxp.com >
Link: https://lore.kernel.org/r/1645702191-9400-1-git-send-email-haibo.chen@nxp.com
Cc: <Stable@vger.kernel.org >
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2022-03-02 13:38:13 +00:00
Nuno Sá
f568cbd9ae
dt-bindings: iio: Add ltc2688 documentation
...
Document the LTC2688 devicetree properties.
Signed-off-by: Nuno Sá <nuno.sa@analog.com >
Reviewed-by: Rob Herring <robh@kernel.org >
Link: https://lore.kernel.org/r/20220225130129.69-4-nuno.sa@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2022-03-01 22:13:53 +00:00
Nuno Sá
52302f87d0
iio: ABI: add ABI file for the LTC2688 DAC
...
Define the sysfs interface for toggle or dither capable channels. Dither
capable channels will have the extended interface:
* out_voltageY_dither_en
* out_voltageY_dither_raw
* out_voltageY_dither_offset
* out_voltageY_dither_raw_available
* out_voltageY_dither_frequency
* out_voltageY_dither_frequency_available
* out_voltageY_dither_phase
* out_voltageY_dither_phase_available
Toggle enabled channels will have:
* out_voltageY_toggle_en
* out_voltageY_raw0
* out_voltageY_raw1
* out_voltageY_symbol
The common interface present in all channels is:
* out_voltageY_raw (not present in toggle enabled channels)
* out_voltageY_raw_available
* out_voltageY_powerdown
* out_voltageY_scale
* out_voltageY_offset
* out_voltageY_calibbias
* out_voltageY_calibscale
Signed-off-by: Nuno Sá <nuno.sa@analog.com >
Link: https://lore.kernel.org/r/20220225130129.69-3-nuno.sa@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2022-03-01 22:13:53 +00:00
Nuno Sá
832cb9eeb9
iio: dac: add support for ltc2688
...
The LTC2688 is a 16 channel, 16 bit, +-15V DAC with an integrated
precision reference. It is guaranteed monotonic and has built in
rail-to-rail output buffers that can source or sink up to 20 mA.
Signed-off-by: Nuno Sá <nuno.sa@analog.com >
Link: https://lore.kernel.org/r/20220225130129.69-2-nuno.sa@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2022-03-01 22:13:53 +00:00
Liam Beguin
66724c31c0
dt-bindings: iio: afe: add bindings for temperature transducers
...
An ADC is often used to measure other quantities indirectly.
This binding describe one case, the measurement of a temperature
through a temperature transducer (either voltage or current).
Signed-off-by: Liam Beguin <liambeguin@gmail.com >
Reviewed-by: Rob Herring <robh@kernel.org >
Reviewed-by: Peter Rosin <peda@axentia.se >
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com >
Link: https://lore.kernel.org/r/20220213025739.2561834-11-liambeguin@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2022-02-28 10:22:25 +00:00
Liam Beguin
d065a283fe
dt-bindings: iio: afe: add bindings for temperature-sense-rtd
...
An ADC is often used to measure other quantities indirectly. This
binding describe one case, the measurement of a temperature through the
voltage across an RTD resistor such as a PT1000.
Signed-off-by: Liam Beguin <liambeguin@gmail.com >
Reviewed-by: Rob Herring <robh@kernel.org >
Reviewed-by: Peter Rosin <peda@axentia.se >
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com >
Link: https://lore.kernel.org/r/20220213025739.2561834-10-liambeguin@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2022-02-28 10:22:24 +00:00
Liam Beguin
03e7d21ee1
iio: afe: rescale: add temperature transducers
...
A temperature transducer is a device that converts a thermal quantity
into any other physical quantity. This patch adds support for
temperature to voltage (like the LTC2997) and temperature to current
(like the AD590) linear transducers.
In both cases these are assumed to be connected to a voltage ADC.
Signed-off-by: Liam Beguin <liambeguin@gmail.com >
Reviewed-by: Peter Rosin <peda@axentia.se >
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com >
Link: https://lore.kernel.org/r/20220213025739.2561834-9-liambeguin@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2022-02-28 10:22:24 +00:00
Liam Beguin
278fe1d2d3
iio: afe: rescale: add RTD temperature sensor support
...
An RTD (Resistance Temperature Detector) is a kind of temperature
sensor used to get a linear voltage to temperature reading within a
give range (usually 0 to 100 degrees Celsius). Common types of RTDs
include PT100, PT500, and PT1000.
Signed-off-by: Liam Beguin <liambeguin@gmail.com >
Reviewed-by: Peter Rosin <peda@axentia.se >
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com >
Link: https://lore.kernel.org/r/20220213025739.2561834-8-liambeguin@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2022-02-28 10:22:24 +00:00
Liam Beguin
8e74a48d17
iio: test: add basic tests for the iio-rescale driver
...
The iio-rescale driver supports various combinations of scale types and
offsets. These can often result in large integer multiplications. Make
sure these calculations are done right by adding a set of kunit test
cases that build on top of iio-test-format.
To run these tests, add the following to .kunitconfig
$ cat .kunitconfig
CONFIG_IIO=y
CONFIG_IIO_RESCALE_KUNIT_TEST=y
CONFIG_KUNIT=y
Then run:
$ ./tools/testing/kunit/kunit.py run --kunitconfig .kunitconfig
Signed-off-by: Liam Beguin <liambeguin@gmail.com >
Reviewed-by: Peter Rosin <peda@axentia.se >
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com >
Link: https://lore.kernel.org/r/20220213025739.2561834-7-liambeguin@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2022-02-28 10:22:24 +00:00
Liam Beguin
2eb30577f2
iio: afe: rescale: reduce risk of integer overflow
...
Reduce the risk of integer overflow by doing the scale calculation on
a 64-bit integer. Since the rescaling is only performed on *val, reuse
the IIO_VAL_FRACTIONAL_LOG2 case.
Signed-off-by: Liam Beguin <liambeguin@gmail.com >
Reviewed-by: Peter Rosin <peda@axentia.se >
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com >
Link: https://lore.kernel.org/r/20220213025739.2561834-6-liambeguin@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2022-02-27 13:38:22 +00:00
Liam Beguin
f5fc003d48
iio: afe: rescale: fix accuracy for small fractional scales
...
The approximation caused by integer divisions can be costly on smaller
scale values since the decimal part is significant compared to the
integer part. Switch to an IIO_VAL_INT_PLUS_NANO scale type in such
cases to maintain accuracy.
Signed-off-by: Liam Beguin <liambeguin@gmail.com >
Reviewed-by: Peter Rosin <peda@axentia.se >
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com >
Link: https://lore.kernel.org/r/20220213025739.2561834-5-liambeguin@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2022-02-27 13:38:16 +00:00
Liam Beguin
a29c328365
iio: afe: rescale: add offset support
...
This is a preparatory change required for the addition of temperature
sensing front ends.
Signed-off-by: Liam Beguin <liambeguin@gmail.com >
Reviewed-by: Peter Rosin <peda@axentia.se >
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com >
Link: https://lore.kernel.org/r/20220213025739.2561834-4-liambeguin@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2022-02-27 13:38:10 +00:00
Liam Beguin
701ee14da9
iio: afe: rescale: add INT_PLUS_{MICRO,NANO} support
...
Some ADCs use IIO_VAL_INT_PLUS_{NANO,MICRO} scale types.
Add support for these to allow using the iio-rescaler with them.
Signed-off-by: Liam Beguin <liambeguin@gmail.com >
Reviewed-by: Peter Rosin <peda@axentia.se >
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com >
Link: https://lore.kernel.org/r/20220213025739.2561834-3-liambeguin@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2022-02-27 13:38:05 +00:00
Liam Beguin
bc437f7515
iio: afe: rescale: expose scale processing function
...
In preparation for the addition of kunit tests, expose the logic
responsible for combining channel scales.
Signed-off-by: Liam Beguin <liambeguin@gmail.com >
Reviewed-by: Peter Rosin <peda@axentia.se >
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com >
Link: https://lore.kernel.org/r/20220213025739.2561834-2-liambeguin@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2022-02-27 13:37:49 +00:00
Cristian Pop
b59c041559
iio: frequency: admv4420.c: Add support for ADMV4420
...
Add support for K Band Downconverter with Integrated
Fractional-N PLL and VCO.
More info:
https://www.analog.com/en/products/admv4420.html
Signed-off-by: Cristian Pop <cristian.pop@analog.com >
Link: https://lore.kernel.org/r/20220223130808.13352-2-cristian.pop@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2022-02-27 12:16:49 +00:00
Cristian Pop
bfdf1635a2
dt-bindings: iio: frequency: Add ADMV4420 doc
...
Add device tree bindings for the ADMV4420 K band downconverter.
Signed-off-by: Cristian Pop <cristian.pop@analog.com >
Acked-by: Rob Herring <robh@kernel.org >
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com >
Link: https://lore.kernel.org/r/20220223130808.13352-1-cristian.pop@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2022-02-27 12:14:52 +00:00
Antoniu Miclaus
56853f7db0
MAINTAINERS: add maintainer for ADA4250 driver
...
Add myself as maintainer for the ADA4250 driver.
Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com >
Link: https://lore.kernel.org/r/20220223120112.8067-3-antoniu.miclaus@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2022-02-27 12:06:25 +00:00
Antoniu Miclaus
28b4c30bfa
iio: amplifiers: ada4250: add support for ADA4250
...
The ADA4250 is an instrumentation amplifier with SPI/pin-strap
progammable gains that is optimized for ultra-low power systems.
With a minimum supply voltage of 1.7V, 26uA of quiescent current,
a shutdown mode, a sleep mode, and a fast wake up settling time,
ADA4250 can be power cycled on a battery powered system for even
futher savings.
Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com >
Link: https://lore.kernel.org/r/20220223120112.8067-2-antoniu.miclaus@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2022-02-27 12:06:25 +00:00
Antoniu Miclaus
602744fa9f
dt-bindings: iio: amplifiers: add ada4250 doc
...
Add device tree bindings for the ADA4250 driver.
Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com >
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com >
Reviewed-by: Rob Herring <robh@kernel.org >
Link: https://lore.kernel.org/r/20220223120112.8067-1-antoniu.miclaus@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2022-02-27 12:06:25 +00:00
Andy Shevchenko
4781f3e0e6
iio: accel: adxl345: Remove unneeded blank lines
...
Remove unneeded blank lines where they separate the data type definitions
and the macros which are using them.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com >
Tested-by: Kai-Heng Feng <kai.heng.feng@canonical.com >
Link: https://lore.kernel.org/r/20220222090009.2060-8-andriy.shevchenko@linux.intel.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2022-02-26 19:11:39 +00:00
Andy Shevchenko
b8f83abdd2
iio: accel: adxl345: Drop comma in terminator entries
...
Terminator entries are by definition should terminate the array.
Dropping comma make this enforced at compile time.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com >
Tested-by: Kai-Heng Feng <kai.heng.feng@canonical.com >
Link: https://lore.kernel.org/r/20220222090009.2060-7-andriy.shevchenko@linux.intel.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2022-02-26 19:11:32 +00:00
Andy Shevchenko
5b4c63f691
iio: accel: adxl345: Extract adxl345_powerup() helper
...
For the sake of symmetry and possible reuse in the future
extract adxl435_powerup() helper.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com >
Tested-by: Kai-Heng Feng <kai.heng.feng@canonical.com >
Link: https://lore.kernel.org/r/20220222090009.2060-6-andriy.shevchenko@linux.intel.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2022-02-26 19:11:26 +00:00
Kai-Heng Feng
b9493d5952
iio: accel: adxl345: Add ACPI HID table
...
x86 boards may use ACPI HID "ADS0345" for adxl345 device.
Analog replied:
"ADS034X is not a valid PNP ID. ADS0345 would be.
I'm not aware that this ID is already taken.
Feel free to submit a mainline Linux input mailing list patch."
So add an ACPI match table for that accordingly.
Since ACPI device may not match to any I2C ID, use the name and type
directly from ACPI ID table in absence of I2C ID.
Suggested-by: Andy Shevchenko <andy.shevchenko@gmail.com >
Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com >
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com >
Link: https://lore.kernel.org/r/20220222090009.2060-5-andriy.shevchenko@linux.intel.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2022-02-26 19:11:20 +00:00
Andy Shevchenko
266be7cb11
iio: accel: adxl345: Make use of device properties
...
Convert the module to be property provider agnostic and allow
it to be used on non-OF platforms.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com >
Tested-by: Kai-Heng Feng <kai.heng.feng@canonical.com >
Link: https://lore.kernel.org/r/20220222090009.2060-4-andriy.shevchenko@linux.intel.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2022-02-26 19:11:13 +00:00
Andy Shevchenko
c1db3d5cab
iio: accel: adxl345: Get rid of name parameter in adxl345_core_probe()
...
As a preparation to switch to use device properties, get rid of name
parameter in adxl345_core_probe(). Instead, choose it based on the type.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com >
Tested-by: Kai-Heng Feng <kai.heng.feng@canonical.com >
Link: https://lore.kernel.org/r/20220222090009.2060-3-andriy.shevchenko@linux.intel.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2022-02-26 19:11:05 +00:00
Andy Shevchenko
024f5d4f0a
iio: accel: adxl345: Set driver_data for OF enumeration
...
In order to enable this driver on mode platforms, assign driver_data
field in the OF device ID table.
While at it, make sure that device type is not 0 which may be wrongly
interpreted by device property APIs in the future.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com >
Tested-by: Kai-Heng Feng <kai.heng.feng@canonical.com >
Link: https://lore.kernel.org/r/20220222090009.2060-2-andriy.shevchenko@linux.intel.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2022-02-26 19:10:56 +00:00
Andy Shevchenko
01676b0f3b
iio: accel: adxl345: Convert to use dev_err_probe()
...
It's fine to call dev_err_probe() in ->probe() when error code is known.
Convert the driver to use dev_err_probe().
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com >
Tested-by: Kai-Heng Feng <kai.heng.feng@canonical.com >
Link: https://lore.kernel.org/r/20220222090009.2060-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2022-02-26 19:10:40 +00:00
Jiasheng Jiang
b30537a4ce
iio: adc: Add check for devm_request_threaded_irq
...
As the potential failure of the devm_request_threaded_irq(),
it should be better to check the return value and return
error if fails.
Fixes: fa659a40b8 ("iio: adc: twl6030-gpadc: Use devm_* API family")
Signed-off-by: Jiasheng Jiang <jiasheng@iscas.ac.cn >
Link: https://lore.kernel.org/r/20220224062849.3280966-1-jiasheng@iscas.ac.cn
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2022-02-26 18:43:59 +00:00
Jagath Jog J
10dce8deab
dt-bindings: iio: potentiometer: Add Maxim DS3502 in trivial-devices
...
Maxim DS3502 is a 7 bit nonvolatile digital potentiometer.
Add DS3502 binding into trivial-devices.yaml.
Signed-off-by: Jagath Jog J <jagathjog1996@gmail.com >
Acked-by: Rob Herring <robh@kernel.org >
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com >
Link: https://lore.kernel.org/r/20220223163525.13399-8-jagathjog1996@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2022-02-26 18:39:27 +00:00
Jagath Jog J
73c169857c
iio: potentiometer: ds1803: Add support for Maxim DS3502
...
The DS3502 is a 7-bit, nonvolatile digital potentiometer featuring
an output voltage range of up to 15.5V. DS3502 support is added
into existing DS1803 driver.
Datasheet: https://datasheets.maximintegrated.com/en/ds/DS3502.pdf
Signed-off-by: Jagath Jog J <jagathjog1996@gmail.com >
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com >
Link: https://lore.kernel.org/r/20220223163525.13399-7-jagathjog1996@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2022-02-26 18:39:27 +00:00
Jagath Jog J
9b68725e90
iio: potentiometer: ds1803: Add device specific read_raw function
...
Added function pointer in the device specific structure to
call the appropriate device read_raw function, so that the
other type of devices with different read method can be
handled.
Signed-off-by: Jagath Jog J <jagathjog1996@gmail.com >
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com >
Link: https://lore.kernel.org/r/20220223163525.13399-6-jagathjog1996@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2022-02-26 18:39:24 +00:00
Jagath Jog J
6450b62cb2
iio: potentiometer: ds1803: Change to firmware provided data
...
Using firmware provided data to get the device specific
structure if not available fall back to id->driver_data.
Signed-off-by: Jagath Jog J <jagathjog1996@gmail.com >
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com >
Link: https://lore.kernel.org/r/20220223163525.13399-5-jagathjog1996@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2022-02-26 18:38:00 +00:00
Jagath Jog J
a98d2b029b
iio: potentiometer: ds1803: Add channel information in device data
...
Adding each device wiper count and channel information into
device private data.
Utilizing addr member of struct iio_chan_spec to get the
wiper register address so that the value can be read or write
to the same address.
Signed-off-by: Jagath Jog J <jagathjog1996@gmail.com >
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com >
Link: https://lore.kernel.org/r/20220223163525.13399-4-jagathjog1996@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2022-02-26 18:38:00 +00:00
Jagath Jog J
4a68b32611
iio: potentiometer: ds1803: Add available functionality
...
Adding available functionality for DS1803 driver which
will show the minimum, step and maximum values that the
driver can accepts through sysfs entry.
Now using the max value present in avail array instead of chip
type specific macro to make the driver flexible to add other
type of potentiometer with different max position value.
Signed-off-by: Jagath Jog J <jagathjog1996@gmail.com >
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com >
Link: https://lore.kernel.org/r/20220223163525.13399-3-jagathjog1996@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2022-02-26 18:38:00 +00:00
Jagath Jog J
d3616e09ba
iio: potentiometer: ds1803: Alignment to match the open parenthesis
...
Fix following checkpatch.pl check by removing blank space.
CHECK: Alignment should match open parenthesis.
Signed-off-by: Jagath Jog J <jagathjog1996@gmail.com >
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com >
Link: https://lore.kernel.org/r/20220223163525.13399-2-jagathjog1996@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2022-02-26 18:37:50 +00:00
Nathan Chancellor
185897d03c
iio: accel: adxl367: Fix handled initialization in adxl367_irq_handler()
...
Clang warns:
drivers/iio/accel/adxl367.c:887:2: error: variable 'handled' is uninitialized when used here [-Werror,-Wuninitialized]
handled |= adxl367_push_event(indio_dev, status);
^~~~~~~
drivers/iio/accel/adxl367.c:879:14: note: initialize the variable 'handled' to silence this warning
bool handled;
^
= 0
1 error generated.
This should have used '=' instead of '|='; make that change to resolve
the warning.
Fixes: cbab791c5e ("iio: accel: add ADXL367 driver")
Link: https://github.com/ClangBuiltLinux/linux/issues/1605
Reported-by: kernel test robot <lkp@intel.com >
Reported-by: Colin Ian King <colin.i.king@gmail.com >
Signed-off-by: Nathan Chancellor <nathan@kernel.org >
Link: https://lore.kernel.org/r/20220224211034.625130-1-nathan@kernel.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2022-02-26 18:07:10 +00:00
Dan Carpenter
7948d301c2
iio: accel: adxl367: unlock on error in adxl367_buffer_predisable()
...
This error path needs to call the mutex_unlock(&st->lock) before
returning.
Fixes: cbab791c5e ("iio: accel: add ADXL367 driver")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com >
Reviewed-by: Cosmin Tanislav <cosmin.tanislav@analog.com >
Link: https://lore.kernel.org/r/20220224150228.GB6856@kili
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2022-02-26 18:06:08 +00:00
Christophe JAILLET
2c43265516
iio: adc: xilinx-ams: Use devm_delayed_work_autocancel() to simplify code
...
Use devm_delayed_work_autocancel() instead of hand writing it. This is
less verbose and saves a few lines of code.
devm_delayed_work_autocancel() uses devm_add_action() instead of
devm_add_action_or_reset(). This is fine, because if the underlying memory
allocation fails, no work has been scheduled yet. So there is nothing to
undo.
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr >
Acked-by: Michal Simek <michal.simek@xilinx.com >
Link: https://lore.kernel.org/r/2626e6a057e40cd2271ef0e5f81d12e607bad5b4.1644776929.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2022-02-26 16:40:29 +00:00
Antoniu Miclaus
2be8795a60
MAINTAINERS: add maintainer for ADMV1014 driver
...
Add myself as maintainer for the ADMV1014 driver.
Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com >
Link: https://lore.kernel.org/r/20220215081216.67706-4-antoniu.miclaus@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2022-02-21 19:33:06 +00:00
Antoniu Miclaus
0ac02bf5bd
Documentation: ABI: testing: admv1014: add ABI docs
...
Add documentation for the use of the Digital Attenuator gain.
Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com >
Link: https://lore.kernel.org/r/20220215081216.67706-3-antoniu.miclaus@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2022-02-21 19:33:06 +00:00
Antoniu Miclaus
b4112083b1
dt-bindings: iio: frequency: add admv1014 binding
...
Add device tree bindings for the ADMV1014 Upconverter.
Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com >
Reviewed-by: Rob Herring <robh@kernel.org >
Link: https://lore.kernel.org/r/20220215081216.67706-2-antoniu.miclaus@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2022-02-21 19:33:06 +00:00
Antoniu Miclaus
f4eb9ac784
iio: frequency: admv1014: add support for ADMV1014
...
The ADMV1014 is a silicon germanium (SiGe), wideband,
microwave downconverter optimized for point to point microwave
radio designs operating in the 24 GHz to 44 GHz frequency range.
Datasheet: https://www.analog.com/media/en/technical-documentation/data-sheets/ADMV1014.pdf
Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com >
Link: https://lore.kernel.org/r/20220215081216.67706-1-antoniu.miclaus@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2022-02-21 19:33:06 +00:00
Cosmin Tanislav
cbab791c5e
iio: accel: add ADXL367 driver
...
The ADXL367 is an ultralow power, 3-axis MEMS accelerometer.
The ADXL367 does not alias input signals to achieve ultralow power
consumption, it samples the full bandwidth of the sensor at all
data rates. Measurement ranges of +-2g, +-4g, and +-8g are available,
with a resolution of 0.25mg/LSB on the +-2 g range.
In addition to its ultralow power consumption, the ADXL367
has many features to enable true system level power reduction.
It includes a deep multimode output FIFO, a built-in micropower
temperature sensor, and an internal ADC for synchronous conversion
of an additional analog input.
Signed-off-by: Cosmin Tanislav <cosmin.tanislav@analog.com >
Link: https://lore.kernel.org/r/20220214073810.781016-6-cosmin.tanislav@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2022-02-21 19:33:06 +00:00
Cosmin Tanislav
27ae7f9d92
dt-bindings: iio: accel: add ADXL367
...
The ADXL367 is an ultralow power, 3-axis MEMS accelerometer.
The ADXL367 does not alias input signals to achieve ultralow power
consumption, it samples the full bandwidth of the sensor at all
data rates. Measurement ranges of +-2g, +-4g, and +-8g are available,
with a resolution of 0.25mg/LSB on the +-2 g range.
In addition to its ultralow power consumption, the ADXL367
has many features to enable true system level power reduction.
It includes a deep multimode output FIFO, a built-in micropower
temperature sensor, and an internal ADC for synchronous conversion
of an additional analog input.
Signed-off-by: Cosmin Tanislav <cosmin.tanislav@analog.com >
Reviewed-by: Rob Herring <robh@kernel.org >
Link: https://lore.kernel.org/r/20220214073810.781016-5-cosmin.tanislav@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2022-02-21 19:33:06 +00:00
Cosmin Tanislav
06a4a0cf69
iio: ABI: add note about configuring other attributes during buffer capture
...
It might be impossible to configure other attributes (e.g.: events, scale,
sampling rate) if they impact the currently active buffer capture session.
On ADXL367, writing to register before 0x2E requires the device to be
placed in standby mode, otherwise the changes might be effective for
only part of a measurement.
To ensure this requirement, the configuration attributes of the IIO
device try to claim direct mode before switching to standby mode.
During a buffer capture, direct mode cannot be claimed, and the
attribute write callback returns -EBUSY.
Describe this behavior in the buffer/enable attribute description.
Signed-off-by: Cosmin Tanislav <cosmin.tanislav@analog.com >
Link: https://lore.kernel.org/r/20220214073810.781016-4-cosmin.tanislav@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2022-02-21 19:33:05 +00:00