Here is the large set of char/misc and other small driver subsystem
changes for 6.1-rc1. Loads of different things in here:
- IIO driver updates, additions, and changes. Probably the largest
part of the diffstat
- habanalabs driver update with support for new hardware and features,
the second largest part of the diff.
- fpga subsystem driver updates and additions
- mhi subsystem updates
- Coresight driver updates
- gnss subsystem updates
- extcon driver updates
- icc subsystem updates
- fsi subsystem updates
- nvmem subsystem and driver updates
- misc driver updates
- speakup driver additions for new features
- lots of tiny driver updates and cleanups
All of these have been in the linux-next tree for a while with no
reported issues.
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-----BEGIN PGP SIGNATURE-----
iG0EABECAC0WIQT0tgzFv3jCIUoxPcsxR9QN2y37KQUCY0GQmA8cZ3JlZ0Brcm9h
aC5jb20ACgkQMUfUDdst+ylyVQCeNJjZ3hy+Wz8WkPSY+NkehuIhyCIAnjXMOJP8
5G/JQ+rpcclr7VOXlS66
=zVkU
-----END PGP SIGNATURE-----
Merge tag 'char-misc-6.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc
Pull char/misc and other driver updates from Greg KH:
"Here is the large set of char/misc and other small driver subsystem
changes for 6.1-rc1. Loads of different things in here:
- IIO driver updates, additions, and changes. Probably the largest
part of the diffstat
- habanalabs driver update with support for new hardware and
features, the second largest part of the diff.
- fpga subsystem driver updates and additions
- mhi subsystem updates
- Coresight driver updates
- gnss subsystem updates
- extcon driver updates
- icc subsystem updates
- fsi subsystem updates
- nvmem subsystem and driver updates
- misc driver updates
- speakup driver additions for new features
- lots of tiny driver updates and cleanups
All of these have been in the linux-next tree for a while with no
reported issues"
* tag 'char-misc-6.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc: (411 commits)
w1: Split memcpy() of struct cn_msg flexible array
spmi: pmic-arb: increase SPMI transaction timeout delay
spmi: pmic-arb: block access for invalid PMIC arbiter v5 SPMI writes
spmi: pmic-arb: correct duplicate APID to PPID mapping logic
spmi: pmic-arb: add support to dispatch interrupt based on IRQ status
spmi: pmic-arb: check apid against limits before calling irq handler
spmi: pmic-arb: do not ack and clear peripheral interrupts in cleanup_irq
spmi: pmic-arb: handle spurious interrupt
spmi: pmic-arb: add a print in cleanup_irq
drivers: spmi: Directly use ida_alloc()/free()
MAINTAINERS: add TI ECAP driver info
counter: ti-ecap-capture: capture driver support for ECAP
Documentation: ABI: sysfs-bus-counter: add frequency & num_overflows items
dt-bindings: counter: add ti,am62-ecap-capture.yaml
counter: Introduce the COUNTER_COMP_ARRAY component type
counter: Consolidate Counter extension sysfs attribute creation
counter: Introduce the Count capture component
counter: 104-quad-8: Add Signal polarity component
counter: Introduce the Signal polarity component
counter: interrupt-cnt: Implement watch_validate callback
...
fixes all over the tree. Other subsystems depending on this change
have been asked to pull an immutable topic branch for this.
* new driver for Microchip PCI1xxxx switch
* heavy refactoring of the Mellanox BlueField driver
* we prefer async probe in the i801 driver now
* the rest is usual driver updates (support for more SoCs, some
refactoring, some feature additions)
-----BEGIN PGP SIGNATURE-----
iQIzBAABCgAdFiEEOZGx6rniZ1Gk92RdFA3kzBSgKbYFAmM7T3IACgkQFA3kzBSg
KbYnAxAAn2SXzpUuuJ05hhk/y89RWHhzSilU+7d+egYfQJlbXUl2WzYx/Wu1BSZM
ciyXuJFIiTywdUiX1r1VeMO80zmQQZXAUG7VygAtOSk7iPSd/qTyL+7J+k1DXADI
hGR+pZLBVfTFyY3d1qHnwKFkzByvQjc2raARv9g7kDxkSQa8xI/sXScmhGYtrLch
DUYUK1F3Sdqbk0FsudJ5Jvd7bZCSS+n+jSR+mrZaOXbkUD4JmDUauW8pAS6UI9in
CxnjZoOLMHdAmC9ADanLeDRXxKz23uNU/9vdZ1/DMYnNsF/TnyWl6Rz/3BFE3YFk
Vq7A1XAK4b3oJAgM92mdvKSkmzBIzkmj02vaVyuNPtRgHZo5MsIcEnWiBhymZY5g
W6BPrjt/8YKRKeNlP/nrZmageklepsXZbUrNQt1ws8i4bbT+CKInKbjKLnBfDgVz
5VSd8M9+y2Jd/JaJhMt9TBNmP0W2RrThxLF06Hux1ue7k4maE7Eljvkzcd4GJ6Un
HYePZMhwCx3aeYsFmFT/V3kHFsfyHUlIFy/vgXTEICsKUpyj/dX96ANWhe+tJdcX
Cknmc+XOVGPm0LPPju4M8WScMjSqNODm1yfDWUe2cRKlxzI45v6x4Oxl8rWD9hb4
KKMGXit0LOtWETlHALffwFCifs6DdaaA0IMUtMQUj8egvys0enE=
=arni
-----END PGP SIGNATURE-----
Merge tag 'i2c-for-6.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux
Pull i2c updates from Wolfram Sang:
- 'remove' callback converted to return void. Big change with trivial
fixes all over the tree. Other subsystems depending on this change
have been asked to pull an immutable topic branch for this.
- new driver for Microchip PCI1xxxx switch
- heavy refactoring of the Mellanox BlueField driver
- we prefer async probe in the i801 driver now
- the rest is usual driver updates (support for more SoCs, some
refactoring, some feature additions)
* tag 'i2c-for-6.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux: (37 commits)
i2c: pci1xxxx: prevent signed integer overflow
i2c: acpi: Replace zero-length array with DECLARE_FLEX_ARRAY() helper
i2c: i801: Prefer async probe
i2c: designware-pci: Use standard pattern for memory allocation
i2c: designware-pci: Group AMD NAVI quirk parts together
i2c: microchip: pci1xxxx: Add driver for I2C host controller in multifunction endpoint of pci1xxxx switch
docs: i2c: slave-interface: return errno when handle I2C_SLAVE_WRITE_REQUESTED
i2c: mlxbf: remove device tree support
i2c: mlxbf: support BlueField-3 SoC
i2c: cadence: Add standard bus recovery support
i2c: mlxbf: add multi slave functionality
i2c: mlxbf: support lock mechanism
macintosh/ams: Adapt declaration of ams_i2c_remove() to earlier change
i2c: riic: Use devm_platform_ioremap_resource()
i2c: mlxbf: remove IRQF_ONESHOT
dt-bindings: i2c: rockchip: add rockchip,rk3128-i2c
dt-bindings: i2c: renesas,rcar-i2c: Add r8a779g0 support
i2c: tegra: Add GPCDMA support
i2c: scmi: Convert to be a platform driver
i2c: rk3x: Add rv1126 support
...
- Rework the device tree initialization, convert the drivers to the
new API and remove the old OF code (Daniel Lezcano).
- Fix return value to -ENODEV when searching for a specific thermal
zone which does not exist (Daniel Lezcano).
- Fix the return value inspection in of_thermal_zone_find() (Dan
Carpenter).
- Fix kernel panic when KASAN is enabled as it detects use after
free when unregistering a thermal zone (Daniel Lezcano).
- Move the set_trip ops inside the therma sysfs code (Daniel Lezcano).
- Remove unnecessary error message as it is already shown in the
underlying function (Jiapeng Chong).
- Rework the monitoring path and move the locks upper in the call
stack to fix some potentials race windows (Daniel Lezcano).
- Fix lockdep_assert() warning introduced by the lock rework (Daniel
Lezcano).
- Do not lock thermal zone mutex in the user space governor (Rafael
Wysocki).
- Revert the Mellanox 'hotter thermal zone' feature because it is
already handled in the thermal framework core code (Daniel Lezcano).
- Increase maximum number of trip points in the thermal core (Sumeet
Pawnikar).
- Replace strlcpy() with unused retval with strscpy() in the core
thermal control code (Wolfram Sang).
- Use module_pci_driver() macro in the int340x processor_thermal
driver (Shang XiaoJing).
- Use get_cpu() instead of smp_processor_id() in the intel_powerclamp
thermal driver to prevent it from crashing and remove unused
accounting for IRQ wakes from it (Srinivas Pandruvada).
- Consolidate priv->data_vault checks in int340x_thermal (Rafael
Wysocki).
- Check the policy first in cpufreq_cooling_register() (Xuewen Yan).
- Drop redundant error message from da9062-thermal (zhaoxiao).
- Drop of_match_ptr() from thermal_mmio (Jean Delvare).
-----BEGIN PGP SIGNATURE-----
iQJGBAABCAAwFiEE4fcc61cGeeHD/fCwgsRv/nhiVHEFAmM7OzUSHHJqd0Byand5
c29ja2kubmV0AAoJEILEb/54YlRx8CMP/1kNnDUjtCBIvl/OJEM0yVlEGJNppNu9
dCNQwuftAJRt7dBB292clKW15ef1fFAHrW/eOy+z62k6k/tfqnMLEK38hpS4pIaL
PZRjRfpp2CDmBBVTJ0I2nNC9h0zZY4tQK+JCII1M2UmgtLaGbp3NuIu2Ga4i5bNR
IYE3QvVz/g2/pRNa/BTsJySje/q7wv231Vd5jg4czg58EyntBGO4gmWNuXyZ6OkF
ijzcu7K5Tkll6DT+Paw8bGcPCyjBtoBhv2A6HtsC3cYfc2tY9BVf3DG2HlG0qTAU
pIZsLOlUozzJScVbu8ScKj1hlP/iCKcPgVjP4l+U57EtcY/ULBqrQtkDVtGedNOZ
wa5a1VUsZDrigWRpj1u5SsDWmbAod5uK5X/3naUfH7XtomhqikfaZK7Euek6kfDN
SEhZaBycAFWlI/L5cG2sd6BBcmWlBqkaHiQ0zEv2YlALY5SkNOUQrrq2A/1LP1Ae
67xbzbWFXyR8DAq3YyfnLpqgcJcSiyGxmdKZ1u2XHudXeJHKdAB7xlcJz+hfWpYU
Rd1ZTB3ATA/IMG1rLO2dKgaMmyQCWPG6oXtJjTH0g3sXm0U6K14dwEU1ey9u/Li6
DmI4cWaXf8WoRvb3rkEcJliayUed4U/ohU+z1bInSE8EuCBuyMLRhoJdi3ZhunOC
PAyKcHg8fLy9
=Ufw7
-----END PGP SIGNATURE-----
Merge tag 'thermal-6.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm
Pull thermal control updates from Rafael Wysocki:
"The most significant part of this update is the thermal control DT
initialization rework from Daniel Lezcano and the following conversion
of drivers to use the new API introduced by it
Apart from that, the maximum number of trip points in a thermal zone
is increased and there are some fixes and code cleanups
Specifics:
- Rework the device tree initialization, convert the drivers to the
new API and remove the old OF code (Daniel Lezcano)
- Fix return value to -ENODEV when searching for a specific thermal
zone which does not exist (Daniel Lezcano)
- Fix the return value inspection in of_thermal_zone_find() (Dan
Carpenter)
- Fix kernel panic when KASAN is enabled as it detects use after free
when unregistering a thermal zone (Daniel Lezcano)
- Move the set_trip ops inside the therma sysfs code (Daniel Lezcano)
- Remove unnecessary error message as it is already shown in the
underlying function (Jiapeng Chong)
- Rework the monitoring path and move the locks upper in the call
stack to fix some potentials race windows (Daniel Lezcano)
- Fix lockdep_assert() warning introduced by the lock rework (Daniel
Lezcano)
- Do not lock thermal zone mutex in the user space governor (Rafael
Wysocki)
- Revert the Mellanox 'hotter thermal zone' feature because it is
already handled in the thermal framework core code (Daniel Lezcano)
- Increase maximum number of trip points in the thermal core (Sumeet
Pawnikar)
- Replace strlcpy() with unused retval with strscpy() in the core
thermal control code (Wolfram Sang)
- Use module_pci_driver() macro in the int340x processor_thermal
driver (Shang XiaoJing)
- Use get_cpu() instead of smp_processor_id() in the intel_powerclamp
thermal driver to prevent it from crashing and remove unused
accounting for IRQ wakes from it (Srinivas Pandruvada)
- Consolidate priv->data_vault checks in int340x_thermal (Rafael
Wysocki)
- Check the policy first in cpufreq_cooling_register() (Xuewen Yan)
- Drop redundant error message from da9062-thermal (zhaoxiao)
- Drop of_match_ptr() from thermal_mmio (Jean Delvare)"
* tag 'thermal-6.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (55 commits)
thermal: core: Increase maximum number of trip points
thermal: int340x: processor_thermal: Use module_pci_driver() macro
thermal: intel_powerclamp: Remove accounting for IRQ wakes
thermal: intel_powerclamp: Use get_cpu() instead of smp_processor_id() to avoid crash
thermal: int340x_thermal: Consolidate priv->data_vault checks
thermal: cpufreq_cooling: Check the policy first in cpufreq_cooling_register()
thermal: Drop duplicate words from comments
thermal: move from strlcpy() with unused retval to strscpy()
thermal: da9062-thermal: Drop redundant error message
thermal/drivers/thermal_mmio: Drop of_match_ptr()
thermal: gov_user_space: Do not lock thermal zone mutex
Revert "mlxsw: core: Add the hottest thermal zone detection"
thermal/core: Fix lockdep_assert() warning
thermal/core: Move the mutex inside the thermal_zone_device_update() function
thermal/core: Move the thermal zone lock out of the governors
thermal/governors: Group the thermal zone lock inside the throttle function
thermal/core: Rework the monitoring a bit
thermal/core: Rearm the monitoring only one time
thermal/drivers/qcom/spmi-adc-tm5: Remove unnecessary print function dev_err()
thermal/of: Remove old OF code
...
The chip supports oversampling ratio, so expose it to userspace.
Signed-off-by: Marcus Folkesson <marcus.folkesson@gmail.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/20220815061625.35568-9-marcus.folkesson@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Make it possible to read values upon interrupts.
Configure Data Ready Signal Output Pin to either HiZ or push-pull and
use it as interrupt source.
Signed-off-by: Marcus Folkesson <marcus.folkesson@gmail.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/20220815061625.35568-7-marcus.folkesson@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Add support for buffers to make the driver fit for more use cases.
Signed-off-by: Marcus Folkesson <marcus.folkesson@gmail.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/20220815061625.35568-6-marcus.folkesson@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Keep using managed resources as much as possible.
Signed-off-by: Marcus Folkesson <marcus.folkesson@gmail.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/20220815061625.35568-5-marcus.folkesson@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Only specific bits in this value are ever used and those are initialized,
but that is complex to reason about in a checker. Hence, initialize
the value to zero and avoid the complexity.
Smatch warning:
drivers/iio/accel/bma400_core.c:1287 bma400_tap_event_en()
error: uninitialized symbol 'field_value'.
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Jagath Jog J <jagathjog1996@gmail.com>
Cc: Alexander Potapenko <glider@google.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Acked-by: Jagath Jog J <jagathjog1996@gmail.com>
Fixes: 961db2da15 ("iio: accel: bma400: Add support for single and double tap events")
Link: https://lore.kernel.org/r/20220917131401.2815486-1-jic23@kernel.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Using this new macro removes the need to mark the callbacks
__maybe_unused. One slightly complexity in this case is that
the export will exist if CONFIG_PM is set, but only be used
if CONFIG_PM_SLEEP is also set. This is harmless.
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: Lorenzo Bianconi <lorenzo.bianconi83@gmail.com>
Link: https://lore.kernel.org/r/20220807185618.1038812-7-jic23@kernel.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
These macros allow the compiler to remove unused pm ops functions without
needing to mark them maybe unused.
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: LI Qingwu <Qing-wu.Li@leica-geosystems.com.cn>
Cc: Mike Looijmans <mike.looijmans@topic.nl>
Link: https://lore.kernel.org/r/20220807185618.1038812-6-jic23@kernel.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
If CONFIG_PM is not set, the pm_ptr() will ensure that the struct
dev_pm_ops and callbacks are removed without the need for __maybe_unused
markings.
In this case we can't simply use DEFINE_RUNTIME_DEV_PM_OPS() because
that would provide suspend and resume functions without the
checks the driver is doing before calling runtime_pm functions
(whether the necessary GPIO is provided). It may be possible to
clean that up in future by moving the checks into the callbacks.
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Andreas Klinger <ak@it-klinger.de>
Link: https://lore.kernel.org/r/20220807185618.1038812-5-jic23@kernel.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
These new macros avoid the need for marking the callbacks __maybe_unused
whilst ensuring both callbacks and structure may be dropped by the compiler
if CONFIG_PM_SLEEP is not enabled.
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: Gwendal Grignou <gwendal@chromium.org>
Link: https://lore.kernel.org/r/20220807185618.1038812-4-jic23@kernel.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
These new macros avoid the need for marking the callbacks __maybe_unused
whilst ensuring both callbacks and structure may be dropped by the compiler
if CONFIG_PM_SLEEP is not enabled.
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: Gwendal Grignou <gwendal@chromium.org>
Link: https://lore.kernel.org/r/20220807185618.1038812-3-jic23@kernel.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
These new macros avoid the need for marking the callbacks __maybe_unused
whilst ensuring both callbacks and structure may be dropped by the compiler
if CONFIG_PM_SLEEP is not enabled.
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: Gwendal Grignou <gwendal@chromium.org>
Link: https://lore.kernel.org/r/20220807185618.1038812-2-jic23@kernel.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Add an I2C driver for communicating to a BNO055 IMU via I2C bus and enable
the BNO055 core driver to work in this scenario.
Signed-off-by: Andrea Merello <andrea.merello@iit.it>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/20220907132205.28021-14-andrea.merello@iit.it
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Add a serdev driver for communicating to a BNO055 IMU via serial bus, and
enable the BNO055 core driver to work in this scenario.
Signed-off-by: Andrea Merello <andrea.merello@iit.it>
Link: https://lore.kernel.org/r/20220907132205.28021-13-andrea.merello@iit.it
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Add the core driver for the BNO055 IMU from Bosch. This IMU can be
connected via both serial and I2C busses; separate patches will add support
for them.
The driver supports "AMG" (Accelerometer, Magnetometer, Gyroscope) mode,
that provides raw data from the said internal sensors, and a couple of
"fusion" modes (i.e. the IMU also does calculations in order to provide
euler angles, quaternions, linear acceleration and gravity measurements).
In fusion modes the AMG data is still available (with some calibration
refinements done by the IMU), but certain settings such as low pass filters
cut-off frequency and sensors' ranges are fixed, while in AMG mode they can
be customized; this is why AMG mode can still be interesting.
Signed-off-by: Andrea Merello <andrea.merello@iit.it>
Link: https://lore.kernel.org/r/20220907132205.28021-9-andrea.merello@iit.it
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
When a IIO device is registered, the IIO core creates an attribute group on
its own, where it puts the channel attributes, and where it copies the
attributes in indio_dev->info->attrs.
Unfortunately it doesn't take care of binary attributes (i.e. it only
consider indio_dev->info->attrs->attrs, and it ignores
indio_dev->info->attrs->bin_attrs).
Fix this by making the IIO layer take care also of the binary attributes.
Note that while it is necessary to copy the non-binary attributes because
the IIO layer needs more room to add the channels attribute, it should be
enough to assign the bin_attrs pointer to the binary attributes pointed by
indio_dev->info->attrs->bin_attrs.
Signed-off-by: Andrea Merello <andrea.merello@iit.it>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/20220907132205.28021-8-andrea.merello@iit.it
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Add modifiers for reporting rotations as euler angles (i.e. yaw, pitch and
roll).
Signed-off-by: Andrea Merello <andrea.merello@iit.it>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/20220907132205.28021-5-andrea.merello@iit.it
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Add IIO_MOD_LINEAR_X, IIO_MOD_LINEAR_Y and IIO_MOD_LINEAR_Z modifiers to te
IIO core, which is preparatory for adding the Bosch BNO055 IMU driver.
Bosch BNO055 IMU can report raw accelerations (among x, y and z axis) as
well as the so called "linear accelerations" (again, among x, y and z axis)
which is basically the acceleration after subtracting gravity and for which
those new modifiers are for.
Signed-off-by: Andrea Merello <andrea.merello@iit.it>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/20220907132205.28021-2-andrea.merello@iit.it
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
The DPS310 chip has been observed to get "stuck" such that pressure
and temperature measurements are never indicated as "ready" in the
MEAS_CFG register. The only solution is to reset the device and try
again. In order to avoid continual failures, use a boolean flag to
only try the reset after timeout once if errors persist.
Fixes: ba6ec48e76 ("iio: Add driver for Infineon DPS310")
Cc: <stable@vger.kernel.org>
Signed-off-by: Eddie James <eajames@linux.ibm.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/20220915195719.136812-3-eajames@linux.ibm.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Move the startup procedure into a function, and correct a missing
check on the return code for writing the PRS_CFG register.
Cc: <stable@vger.kernel.org>
Signed-off-by: Eddie James <eajames@linux.ibm.com>
Reviewed-by: Joel Stanley <joel@jms.id.au>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/20220915195719.136812-2-eajames@linux.ibm.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
By default the driver was always setting the RANGE bit which means that
the analog input goes from 0 to VREF. However, we might want to have 0
to 2xVREF. This change adds a new Firmware property to allow for the
extended range while keeping the default behavior if nothing is provided.
Signed-off-by: Nuno Sá <nuno.sa@analog.com>
Link: https://lore.kernel.org/r/20220912081223.173584-3-nuno.sa@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Some of the supported devices have 4 or 2 LSB trailing bits that should
not be taken into account. Hence we need to shift these bits out which
fits perfectly on the scan type shift property. This change fixes both
raw and buffered reads.
Fixes: f2f7a44970 ("iio:adc:ad7923: Add support for the ad7904/ad7914/ad7924")
Fixes: 851644a60d ("iio: adc: ad7923: Add support for the ad7908/ad7918/ad7928")
Signed-off-by: Nuno Sá <nuno.sa@analog.com>
Link: https://lore.kernel.org/r/20220912081223.173584-2-nuno.sa@analog.com
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Add support of identification registers to STM32 ADC.
By default the ADC hardware instance number is retrieved from
the compatible configuration data. Get the available ADC number
per ADC block, from hardware configuration register,
when this register exists.
Signed-off-by: Olivier Moysan <olivier.moysan@foss.st.com>
Reviewed-by: Fabrice Gasnier <fabrice.gasnier@foss.st.com>
Link: https://lore.kernel.org/r/20220915135452.1712453-1-olivier.moysan@foss.st.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Set the iio device's name based on the chip used for the
LTC2499 only. The most common way for IIO clients to interact
with a device is to address it based on it's name. By using
the dev_name() function, the name will be set based on a
i2c_client's kobj name, which has the format i2c_instance-i2c_address
(1-0076 for example). This is not ideal, since it makes a
requirement for userspace to have knowledge about the hardware
connections of the device.
The name field is set to NULL for the LTC2497 and LTC2496, so
that the old name can kept as it is, since changing it will
result in an ABI breakage.
Signed-off-by: Ciprian Regus <ciprian.regus@analog.com>
Link: https://lore.kernel.org/r/20220916140922.2506248-6-ciprian.regus@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
After the result of the previous conversion is read the chip
automatically starts a new conversion and doesn't accept new i2c
transfers until this conversion is completed which makes the function
return failure.
So add an early return iff the programming of the new address isn't
needed. Note this will not fix the problem in general, but all cases
that are currently used. Once this changes we get the failure back, but
this can be addressed when the need arises.
Fixes: 69548b7c2c ("iio: adc: ltc2497: split protocol independent part in a separate module ")
Reported-by: Meng Li <Meng.Li@windriver.com>
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Tested-by: Denys Zagorui <dzagorui@cisco.com>
Cc: <Stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20220815091647.1523532-1-dzagorui@cisco.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Adds DMA-safe buffers to driver data struct to store raw data from sensors
The multiple buffers used thorough the driver share the same memory
allocated as part of the device data instance. The union containing
the buffers is aligned to allow safe usage with DMA operations, such
as regmap bulk read calls.
Updated measurement and calibration reading functions to use the safe
DMA buffers.
Suggested-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Angel Iglesias <ang.iglesiasg@gmail.com>
Link: https://lore.kernel.org/r/7919793f7f63224d5ce413c66d648029683c17ac.1663025017.git.ang.iglesiasg@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Simplified common initialization logic of different sensor types
unifying calibration and initial configuration recovery.
Default config param values of each sensor type are stored inside
chip_info structure and used to initialize sensor data struct instance.
The helper functions for read each sensor type calibration are converted
to a callback available on the chip_info struct.
Separated bme280 specific calibration code from bmp280 function. Dropped
the additional chip_id argument in bmp280 code as is not longer required.
Now both bmp280/bme280 calibration function use same signature as bmp180.
Suggested-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Angel Iglesias <ang.iglesiasg@gmail.com>
Link: https://lore.kernel.org/r/584c90f309e4f24bf2e4aa2b15c8577d288f978d.1663025017.git.ang.iglesiasg@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
On bmp280 and bme280, the temperature and pressure calibration parameters
are available on a contiguous memory region. Considering this arrangement,
simplified the calibration reading function by using only one buffer
to read in batch temperature and pressure registers.
Signed-off-by: Angel Iglesias <ang.iglesiasg@gmail.com>
Link: https://lore.kernel.org/r/96d81282c95006d857f4d836d2ff3ee0740a85a0.1663025017.git.ang.iglesiasg@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Make sure that the needed i2c functionality is supported during probe.
Signed-off-by: Nuno Sá <nuno.sa@analog.com>
Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
Link: https://lore.kernel.org/r/20220913073413.140475-3-nuno.sa@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
For reliable operation across the full range of supported
interface rates, the AD5593R needs a STOP condition between
address write, and data read (like show in the datasheet Figure 40)
so in turn i2c_smbus_read_word_swapped cannot be used.
While at it, a simple helper was added to make the code simpler.
Fixes: 56ca9db862 ("iio: dac: Add support for the AD5592R/AD5593R ADCs/DACs")
Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Nuno Sá <nuno.sa@analog.com>
Cc: <Stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20220913073413.140475-2-nuno.sa@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Updated links for BMP280 and BME280 datasheets on Bosch website.
Datasheet of BMP180 is no longer available on the manufacturer's website,
changed the link to a copy hosted by a third party.
Reported-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Angel Iglesias <ang.iglesiasg@gmail.com>
Link: https://lore.kernel.org/r/20220912222645.377874-1-ang.iglesiasg@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
This includes Nuno Sa's work to move the IIO core over to generic firmware
properties rather than having DT specific code paths. Combined with Andy
Shevchenko's long term work on drivers, this leaves IIO in a good state for
handling other firmware types.
New device support
- liteon,ltrf216a
* New driver and dt bindings to support this Light sensor.
- maxim,max11205
* New driver for this 16bit single channel ADC.
- memsensing,msa311
* New driver for this accelerometer. Includes a string helper for read/write.
- richtek,rtq6056
* New driver and dt binding to support this current monitor used to measure
power usage.
- yamaha,yas530
* Support the YAS537 variant (series includes several fixes for other parts
and new driver features).
Staging graduation
- adi,ad7746 CDC. Cleanup conducted against set of roadtest tests using
the posted RFC of that framework.
Features
- core
* Large rework to make all the core IIO code use generic firmware properties.
Includes switching some drivers over as well using newly provided
generic interfaces and allowing removal of DT specific ones.
* Support for gesture event types for single and double tap. Used in
bosch,bma400.
- atmel,at91-sama5d2
* Add support for temperature sensor which uses two muxed inputs to estimate
the temperature.
* Handle trackx bits of EMR register to improve temp sampling accuracy.
* Runtime PM support.
- liteon,ltrf216a
* Add a _raw channel output to allow working around an issue with
differing conversions equations that breaks some user space controls.
- mexelis,mlx90632
* Support regulator control.
- ti,tsc2046
* External reference voltage support.
Clean up and minor fixes
- Tree-wide
* devm_clk_get_enabled() replacements of opencoded equivalent.
* Remaining IIO_DMA_MINALIGN conversions (the staging/iio drivers).
* Various minor warning and similar cleanup such as missing static
markings.
* strlcpy() to strscpy() for cases where return value not checked.
* provide units.h entries for more HZ units and use them in drivers.
- dt-bindings cleanup
* Drop maintainers listss where the email address is bouncing.
* Switch spi devices over to using spi-peripheral.yaml
* Add some missing unevaluatedProperties / additionalProperties: false
entries.
- ABI docs
* Add some missing channel type specific sampling frequency entries.
* Add parameter names for callback parameters.
- MAINTAINERS
* Fix wrong ADI forum links.
- core
* lockdep class per device, to avoid an issue with nest when one IIO
device is the consumer of another.
* White space tweaks.
- asc,dlhl60d
* Use get_unaligned_be24 to avoid some unusual data manipulation and masking.
- atmel,at91-sama5d2
* Fix wrong max value.
* Improve error handling when measuring pressure and touch.
* Add locks to remove races on updating oversampling / sampling freq.
* Add missing calls in suspend and resume path to ensure state is correctly
brought up if buffered capture was in use when suspend happened.
* Error out of write_raw() callback if buffered capture enabled to avoid
unpredictable behavior.
* Handle different versions having different oversampling ratio support and
drop excess error checking.
* Cleanup magic value defines where the name is just the value and hence
hurts readability.
* Use read_avail() callback to provide info on possible oversampling ratios.
* Correctly handle variable bit depth when doing oversampling on different
supported parts. Also handle higher oversampling ratios.
- fsl,imx8qxp
* Don't ignore errors from regulator_get_voltage() so as to avoid some
very surprising scaling.
- invensense,icp10100
* Switch from UNIVERSAL to DEFINE_RUNTIME_DEV_PM_OPS. UNIVERSAL rarely made
sense and is now deprecated. In this driver we just avoid double disabling
in some paths.
- maxim,max1363
* Drop consumer channel map provision by platform data. There have been
better ways of doing this for years and there are no in tree users.
- microchip,mcp3911
* Update status to maintained.
- qcom,spmi-adc5
* Support measurement of LDO output voltage.
- qcom,spmi-adc
* Add missing channel available on SM6125 SoC.
- st,stmpe
* Drop requirement on node name in binding now that driver correctly
doesn't enforce it.
- stx104
* Move to more appropriate addac directory
- ti,am335x
* Document ti,am654-adc compatible already in use in tree.
- ti,hmc5843
* Move dev_pm_ops out of header and use new pm macros to handle export.
- yamaha,yas530
* Minor cleanups.
-----BEGIN PGP SIGNATURE-----
iQJFBAABCAAvFiEEbilms4eEBlKRJoGxVIU0mcT0FogFAmMdsjERHGppYzIzQGtl
cm5lbC5vcmcACgkQVIU0mcT0FohwYA//cDu2/UcQgXRfIvWTmAAIXNk0qQ/3VQbf
h6hjy9wESmW8728sed77bkL49WriyyXkYe3qalLph4Y+bFRwLAss/2iHlyM396+7
3qFZz8ydkU9b2pJMt9clPr24RMoPo32s5gwRLs4LG/KJdzZNPYC+AI/ZaErtKSaD
58p7RD9If11/jPo1q1CDJVSF6rsHPfd3terhgP/8eMNyPSwggCohVf+g8CL62Suf
2F0m8RjNMCC+RvPIHQ4u0LtGOtRMvw5DMOcRe/xk2xVxdR2awqmgUGyTIUe61Wuz
C9kuJlxSMovyHRyKNAhHcTDNl8vFbV/4ZaqV4PJDPT5GBiMH6TulXFX2a0oowJHB
sjMYQP2mH7ZVssdm9P3Nv/cYs3IVHtTdQsDzMIwU9A0qiObG7tisZHm51RsgBBGa
Zy4JnphOEjia4pz2V3Tf/sFJxNz1OmKFsUD18LdXIEv2f93++7+K8FJL3TMuSsBj
PdWbLjhd3ZEp5re/60RIW5AaQjBxZf90GRFNIyOu4q1xGMFbHglbWjMEtiyBr+M5
SRPnatHBLm3LXF31/Km/+VcHhIWWh3InxeORhufNVQsx600J2gpX3nvLxj2D3bWX
QRjUj76zgH37KvKca8NTgPUrzWg10K330toLF34mIq5rFonp0dI41CzApVxQsmCH
NO4fYKP+c1k=
=fUm6
-----END PGP SIGNATURE-----
Merge tag 'iio-for-6.1a' of https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into char-misc-next
Jonathan writes:
1st set of IIO new device support, features and cleanup for 6.1
This includes Nuno Sa's work to move the IIO core over to generic firmware
properties rather than having DT specific code paths. Combined with Andy
Shevchenko's long term work on drivers, this leaves IIO in a good state for
handling other firmware types.
New device support
- liteon,ltrf216a
* New driver and dt bindings to support this Light sensor.
- maxim,max11205
* New driver for this 16bit single channel ADC.
- memsensing,msa311
* New driver for this accelerometer. Includes a string helper for read/write.
- richtek,rtq6056
* New driver and dt binding to support this current monitor used to measure
power usage.
- yamaha,yas530
* Support the YAS537 variant (series includes several fixes for other parts
and new driver features).
Staging graduation
- adi,ad7746 CDC. Cleanup conducted against set of roadtest tests using
the posted RFC of that framework.
Features
- core
* Large rework to make all the core IIO code use generic firmware properties.
Includes switching some drivers over as well using newly provided
generic interfaces and allowing removal of DT specific ones.
* Support for gesture event types for single and double tap. Used in
bosch,bma400.
- atmel,at91-sama5d2
* Add support for temperature sensor which uses two muxed inputs to estimate
the temperature.
* Handle trackx bits of EMR register to improve temp sampling accuracy.
* Runtime PM support.
- liteon,ltrf216a
* Add a _raw channel output to allow working around an issue with
differing conversions equations that breaks some user space controls.
- mexelis,mlx90632
* Support regulator control.
- ti,tsc2046
* External reference voltage support.
Clean up and minor fixes
- Tree-wide
* devm_clk_get_enabled() replacements of opencoded equivalent.
* Remaining IIO_DMA_MINALIGN conversions (the staging/iio drivers).
* Various minor warning and similar cleanup such as missing static
markings.
* strlcpy() to strscpy() for cases where return value not checked.
* provide units.h entries for more HZ units and use them in drivers.
- dt-bindings cleanup
* Drop maintainers listss where the email address is bouncing.
* Switch spi devices over to using spi-peripheral.yaml
* Add some missing unevaluatedProperties / additionalProperties: false
entries.
- ABI docs
* Add some missing channel type specific sampling frequency entries.
* Add parameter names for callback parameters.
- MAINTAINERS
* Fix wrong ADI forum links.
- core
* lockdep class per device, to avoid an issue with nest when one IIO
device is the consumer of another.
* White space tweaks.
- asc,dlhl60d
* Use get_unaligned_be24 to avoid some unusual data manipulation and masking.
- atmel,at91-sama5d2
* Fix wrong max value.
* Improve error handling when measuring pressure and touch.
* Add locks to remove races on updating oversampling / sampling freq.
* Add missing calls in suspend and resume path to ensure state is correctly
brought up if buffered capture was in use when suspend happened.
* Error out of write_raw() callback if buffered capture enabled to avoid
unpredictable behavior.
* Handle different versions having different oversampling ratio support and
drop excess error checking.
* Cleanup magic value defines where the name is just the value and hence
hurts readability.
* Use read_avail() callback to provide info on possible oversampling ratios.
* Correctly handle variable bit depth when doing oversampling on different
supported parts. Also handle higher oversampling ratios.
- fsl,imx8qxp
* Don't ignore errors from regulator_get_voltage() so as to avoid some
very surprising scaling.
- invensense,icp10100
* Switch from UNIVERSAL to DEFINE_RUNTIME_DEV_PM_OPS. UNIVERSAL rarely made
sense and is now deprecated. In this driver we just avoid double disabling
in some paths.
- maxim,max1363
* Drop consumer channel map provision by platform data. There have been
better ways of doing this for years and there are no in tree users.
- microchip,mcp3911
* Update status to maintained.
- qcom,spmi-adc5
* Support measurement of LDO output voltage.
- qcom,spmi-adc
* Add missing channel available on SM6125 SoC.
- st,stmpe
* Drop requirement on node name in binding now that driver correctly
doesn't enforce it.
- stx104
* Move to more appropriate addac directory
- ti,am335x
* Document ti,am654-adc compatible already in use in tree.
- ti,hmc5843
* Move dev_pm_ops out of header and use new pm macros to handle export.
- yamaha,yas530
* Minor cleanups.
* tag 'iio-for-6.1a' of https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio: (142 commits)
iio: pressure: icp10100: Switch from UNIVERSAL to DEFINE_RUNTIME_DEV_PM_OPS().
iio: adc: max1363: Drop provision to provide an IIO channel map via platform data
iio: accel: bma400: Add support for single and double tap events
iio: Add new event type gesture and use direction for single and double tap
iio: Use per-device lockdep class for mlock
iio: adc: add max11205 adc driver
dt-bindings: iio: adc: Add max11205 documentation file
iio: magnetometer: yamaha-yas530: Use dev_err_probe()
iio: magnetometer: yamaha-yas530: Make strings const in chip info
iio: magnetometer: yamaha-yas530: Use pointers as driver data
iio: adc: tsc2046: silent spi_device_id warning
iio: adc: tsc2046: add vref support
dt-bindings: iio: adc: ti,tsc2046: add vref-supply property
iio: light: ltrf216a: Add raw attribute
dt-bindings: iio: Add missing (unevaluated|additional)Properties on child nodes
MAINTAINERS: fix Analog Devices forum links
iio/accel: fix repeated words in comments
dt-bindings: iio: accel: add dt-binding schema for msa311 accel driver
iio: add MEMSensing MSA311 3-axis accelerometer driver
dt-bindings: vendor-prefixes: add MEMSensing Microsystems Co., Ltd.
...
The suspend and resume callbacks in this driver appear to be safe
to call repeatedly, but why do so when we can use the
DEFINE_RUNTIME_DEV_PM_OPS() macro to supply callbacks that check if
we are already runtime suspended before doing unnecessary work.
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Jean-Baptiste Maneyrol <jean-baptiste.maneyrol@tdk.com>
Acked-by: Jean-Baptiste Maneyrol <jean-baptiste.maneyrol@tdk.com>
Link: https://lore.kernel.org/r/20220807190414.1039028-2-jic23@kernel.org
Back in the days of board files, platform data was used to provide
information on the mapping from ADC channel to an analog signal
from another device. We've long since moved to doing this via
device tree. Hence drop the support from the max1363 driver which is
the only driver still providing this.
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Link: https://lore.kernel.org/r/20220821161058.2207185-1-jic23@kernel.org
Add support for single and double tap events based on the tap threshold
value, minimum quiet time before and after the tap and minimum time
between the taps in the double tap. The INT1 pin is used to interrupt
and the event is pushed to userspace.
Signed-off-by: Jagath Jog J <jagathjog1996@gmail.com>
Link: https://lore.kernel.org/r/20220831063117.4141-3-jagathjog1996@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Add new event type for tap called gesture and the direction can be used
to differentiate single and double tap. This may be used by accelerometer
sensors to express single and double tap events. For directional tap,
modifiers like IIO_MOD_(X/Y/Z) can be used along with singletap and
doubletap direction.
Signed-off-by: Jagath Jog J <jagathjog1996@gmail.com>
Link: https://lore.kernel.org/r/20220831063117.4141-2-jagathjog1996@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
If an IIO driver uses callbacks from another IIO driver and calls
iio_channel_start_all_cb() from one of its buffer setup ops, then
lockdep complains due to the lock nesting, as in the below example with
lmp91000.
Since the locks are being taken on different IIO devices, there is no
actual deadlock. Fix the warning by telling lockdep to use a different
class for each iio_device.
============================================
WARNING: possible recursive locking detected
--------------------------------------------
python3/23 is trying to acquire lock:
(&indio_dev->mlock){+.+.}-{3:3}, at: iio_update_buffers
but task is already holding lock:
(&indio_dev->mlock){+.+.}-{3:3}, at: enable_store
other info that might help us debug this:
Possible unsafe locking scenario:
CPU0
----
lock(&indio_dev->mlock);
lock(&indio_dev->mlock);
*** DEADLOCK ***
May be due to missing lock nesting notation
5 locks held by python3/23:
#0: (sb_writers#5){.+.+}-{0:0}, at: ksys_write
#1: (&of->mutex){+.+.}-{3:3}, at: kernfs_fop_write_iter
#2: (kn->active#14){.+.+}-{0:0}, at: kernfs_fop_write_iter
#3: (&indio_dev->mlock){+.+.}-{3:3}, at: enable_store
#4: (&iio_dev_opaque->info_exist_lock){+.+.}-{3:3}, at: iio_update_buffers
Call Trace:
__mutex_lock
iio_update_buffers
iio_channel_start_all_cb
lmp91000_buffer_postenable
__iio_update_buffers
enable_store
Fixes: 67e17300dc ("iio: potentiostat: add LMP91000 support")
Signed-off-by: Vincent Whitchurch <vincent.whitchurch@axis.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/20220829091840.2791846-1-vincent.whitchurch@axis.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>