The usual bunch of singletons - please see the relevant changelogs for
details.
-----BEGIN PGP SIGNATURE-----
iHUEABYKAB0WIQTTMBEPP41GrTpTJgfdBJ7gKXxAjgUCZ1U/QwAKCRDdBJ7gKXxA
jnE7AQC0eyNNvaL5pLCIxN/Vmr8YeuWP1dldgI29TjrH/JKjSQEAihZNqVZYjoIT
Gf7Y+IKnc4LbfAXcTe+MfJFeDexM5AU=
=U5LQ
-----END PGP SIGNATURE-----
Merge tag 'mm-hotfixes-stable-2024-12-07-22-39' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
Pull misc fixes from Andrew Morton:
"24 hotfixes. 17 are cc:stable. 15 are MM and 9 are non-MM.
The usual bunch of singletons - please see the relevant changelogs for
details"
* tag 'mm-hotfixes-stable-2024-12-07-22-39' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm: (24 commits)
iio: magnetometer: yas530: use signed integer type for clamp limits
sched/numa: fix memory leak due to the overwritten vma->numab_state
mm/damon: fix order of arguments in damos_before_apply tracepoint
lib: stackinit: hide never-taken branch from compiler
mm/filemap: don't call folio_test_locked() without a reference in next_uptodate_folio()
scatterlist: fix incorrect func name in kernel-doc
mm: correct typo in MMAP_STATE() macro
mm: respect mmap hint address when aligning for THP
mm: memcg: declare do_memsw_account inline
mm/codetag: swap tags when migrate pages
ocfs2: update seq_file index in ocfs2_dlm_seq_next
stackdepot: fix stack_depot_save_flags() in NMI context
mm: open-code page_folio() in dump_page()
mm: open-code PageTail in folio_flags() and const_folio_flags()
mm: fix vrealloc()'s KASAN poisoning logic
Revert "readahead: properly shorten readahead when falling back to do_page_cache_ra()"
selftests/damon: add _damon_sysfs.py to TEST_FILES
selftest: hugetlb_dio: fix test naming
ocfs2: free inode when ocfs2_get_init_inode() fails
nilfs2: fix potential out-of-bounds memory access in nilfs_find_entry()
...
In the function yas537_measure() there is a clamp_val() with limits of
-BIT(13) and BIT(13) - 1. The input clamp value h[] is of type s32. The
BIT() is of type unsigned long integer due to its define in
include/vdso/bits.h. The lower limit -BIT(13) is recognized as -8192 but
expressed as an unsigned long integer. The size of an unsigned long
integer differs between 32-bit and 64-bit architectures. Converting this
to type s32 may lead to undesired behavior.
Additionally, in the calculation lines h[0], h[1] and h[2] the unsigned
long integer divisor BIT(13) causes an unsigned division, shifting the
left-hand side of the equation back and forth, possibly ending up in large
positive values instead of negative values on 32-bit architectures.
To solve those two issues, declare a signed integer with a value of
BIT(13).
There is another omission in the clamp line: clamp_val() returns a value
and it's going nowhere here. Self-assign it to h[i] to make use of the
clamp macro.
Finally, replace clamp_val() macro by clamp() because after changing the
limits from type unsigned long integer to signed integer it's fine that
way.
Link: https://lkml.kernel.org/r/11609b2243c295d65ab4d47e78c239d61ad6be75.1732914810.git.jahau@rocketmail.com
Fixes: 65f79b5010 ("iio: magnetometer: yas530: Add YAS537 variant")
Signed-off-by: Jakob Hauser <jahau@rocketmail.com>
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202411230458.dhZwh3TT-lkp@intel.com/
Closes: https://lore.kernel.org/oe-kbuild-all/202411282222.oF0B4110-lkp@intel.com/
Reviewed-by: David Laight <david.laight@aculab.com>
Acked-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Lars-Peter Clausen <lars@metafoo.de>
Cc: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Here is the "big and hairy" char/misc/iio and other small driver
subsystem updates for 6.13-rc1. Sorry for doing this at the end of the
merge window, conference and holiday travel got in the way on my side
(hence the 5am pull request emails...)
Loads of things in here, and even a fun merge conflict!
- rust misc driver bindings and other rust changes to make misc
drivers actually possible. I think this is the tipping point,
expect to see way more rust drivers going forward now that these
bindings are present. Next merge window hopefully we will have pci
and platform drivers working, which will fully enable almost all
driver subsystems to start accepting (or at least getting) rust
drivers. This is the end result of a lot of work from a lot of
people, congrats to all of them for getting this far, you've proved
many of us wrong in the best way possible, working code :)
- IIO driver updates, too many to list individually, that subsystem
keeps growing and growing...
- Interconnect driver updates
- nvmem driver updates
- pwm driver updates
- platform_driver::remove() fixups, loads of them
- counter driver updates
- misc driver updates (keba?)
- binder driver updates and fixes
- loads of other small char/misc/etc driver updates and additions,
full details in the shortlog.
Note, there is a semi-hairy rust merge conflict when pulling this. The
resolution has been in linux-next for a while and can be seen here:
https://lore.kernel.org/all/20241111173459.2646d4af@canb.auug.org.au/
All of these have been in linux-next for a while, with no other reported
issues other than that merge conflict.
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-----BEGIN PGP SIGNATURE-----
iG0EABECAC0WIQT0tgzFv3jCIUoxPcsxR9QN2y37KQUCZ0lGpg8cZ3JlZ0Brcm9h
aC5jb20ACgkQMUfUDdst+ykKHQCgvI4Muu2tpdINBVe24Zc8S3ozg0AAnRNg3F7r
ikneftUDYtuviSGU/Rs8
=CW+i
-----END PGP SIGNATURE-----
Merge tag 'char-misc-6.13-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc
Pull char/misc/IIO/whatever driver subsystem updates from Greg KH:
"Here is the 'big and hairy' char/misc/iio and other small driver
subsystem updates for 6.13-rc1.
Loads of things in here, and even a fun merge conflict!
- rust misc driver bindings and other rust changes to make misc
drivers actually possible.
I think this is the tipping point, expect to see way more rust
drivers going forward now that these bindings are present. Next
merge window hopefully we will have pci and platform drivers
working, which will fully enable almost all driver subsystems to
start accepting (or at least getting) rust drivers.
This is the end result of a lot of work from a lot of people,
congrats to all of them for getting this far, you've proved many of
us wrong in the best way possible, working code :)
- IIO driver updates, too many to list individually, that subsystem
keeps growing and growing...
- Interconnect driver updates
- nvmem driver updates
- pwm driver updates
- platform_driver::remove() fixups, loads of them
- counter driver updates
- misc driver updates (keba?)
- binder driver updates and fixes
- loads of other small char/misc/etc driver updates and additions,
full details in the shortlog.
All of these have been in linux-next for a while, with no other
reported issues other than that merge conflict"
* tag 'char-misc-6.13-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc: (401 commits)
mei: vsc: Fix typo "maintstepping" -> "mainstepping"
firmware: Switch back to struct platform_driver::remove()
misc: isl29020: Fix the wrong format specifier
scripts/tags.sh: Don't tag usages of DEFINE_MUTEX
fpga: Switch back to struct platform_driver::remove()
mei: vsc: Improve error logging in vsc_identify_silicon()
mei: vsc: Do not re-enable interrupt from vsc_tp_reset()
dt-bindings: spmi: qcom,x1e80100-spmi-pmic-arb: Add SAR2130P compatible
dt-bindings: spmi: spmi-mtk-pmif: Add compatible for MT8188
spmi: pmic-arb: fix return path in for_each_available_child_of_node()
iio: Move __private marking before struct element priv in struct iio_dev
docs: iio: ad7380: add adaq4370-4 and adaq4380-4
iio: adc: ad7380: add support for adaq4370-4 and adaq4380-4
iio: adc: ad7380: use local dev variable to shorten long lines
iio: adc: ad7380: fix oversampling formula
dt-bindings: iio: adc: ad7380: add adaq4370-4 and adaq4380-4 compatible parts
bus: mhi: host: pci_generic: Use pcim_iomap_region() to request and map MHI BAR
bus: mhi: host: Switch trace_mhi_gen_tre fields to native endian
misc: atmel-ssc: Use of_property_present() for non-boolean properties
misc: keba: Add hardware dependency
...
Add mising braces after an if condition that contains scoped_guard().
This style is both preferred and necessary here, to fix warning after
scoped_guard() change in commit fcc22ac5ba ("cleanup: Adjust
scoped_guard() macros to avoid potential warning") to have if-else inside
of the macro. Current (no braces) use in af8133j_set_scale() yields
the following warnings:
af8133j.c:315:12: warning: suggest explicit braces to avoid ambiguous 'else' [-Wdangling-else]
af8133j.c:316:3: warning: add explicit braces to avoid dangling else [-Wdangling-else]
Fixes: fcc22ac5ba ("cleanup: Adjust scoped_guard() macros to avoid potential warning")
Closes: https://lore.kernel.org/oe-kbuild-all/202409270848.tTpyEAR7-lkp@intel.com/
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Przemek Kitszel <przemyslaw.kitszel@intel.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Acked-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Link: https://lore.kernel.org/r/20241108154258.21411-1-przemyslaw.kitszel@intel.com
Alongside new drivers and device support there are several large
cleanups going on across the IIO tree and we see part of some of those
in this pull request.
Merged char-misc-next at point of 6.12-rc6 merge to avoid a
conflict with a fix for the ad7380 merged earlier this cycle.
Note that I previously messed this merge up and had to reconstruct
it this morning so a coherent pull request was possible. The new
stuff is all the same as has been in linux-next for some time with
the exception of the kernel-doc related __private ordering fix
that went in yesterday.
New device support
==================
adi,ad7380
- Support for adaq4370-4 and adaq4370 quad channel ADCs.
adi,ad7606
- Various cleanups preceeding support of AD7607, AD7608 and AD7609 ADCs.
adi,ad7779
- New driver supproting AD7770, AD7771 and AD7779 ADCs.
allegro,als31300
- New driver for this 3D Linear Hall Effect sensor.
bosch,bmi270
- Add support BMI260 which is similar but requires a different firmware image.
bosch,smi240
- New driver for this IMU.
ti,opt3001
- Add support opt3002 light sensor which has a wider spectral range than
the opt3001.
vishay,veml3235
- New driver for this ambient light sensor.
Features
========
hid-sensors
- Add support Human Proximity Range and Attention detection (requiring
a new classification style channel type)
adi,ad3552r
- Add backend support and related platform driver to support use
with an FPGA IP to allow QSPI + DDR bus operation and much higher
data aquisition rates. (various rework preceeded this feature)
adi,ad7606
- Various cleanup prior to enabling use with an IIO Backend and PWM trigger
enabling much higher speed data capture.
bosch,bme680
- Support control of preheat current
- Support triggered buffer capture
- Add SCALE and RAW channels (needed to enable the buffered capture).
bosch,bmp280
- Enable sleeping to save power.
- Add interrupt support for bmp3xx and bmp5xx devices. Also update bmp085
to new approach.
- Enable data ready trigger.
bosch,bmi270
- Add triggered buffer support
- Add scale and sampling frequency control.
vishay,veml6070
- Support integration time via DT binding for an external resistor value.
Cleanup and minor fixes
=======================
core
- Fix a longstanding issue with event codes for differential channels.
Note that not all drivers are yet fixed, but macros have been added
to avoid potential repeats of this in future.
- Tidy up handling in iio_read_acpi_mount matrix.
- Mark iio_dev::priv with __private. Later move the marking before the
field name to avoid a kernel-doc issue.
treewide
- Drop some pointless default n entries in Kconfig.
- Add an iio_get_acpi_device_name_and_data() handler to replace some
commonly repeated code.
- simplify use of 'state' in write_event_config() callback as it is
effectively a boolean. Once done make it a boolean (lots of drivers
were updated to enable this)
- some more use of devm_regulator_get_enable_read_voltage( to replace
open coded versions. Where this enables it convert all of remove
handling to devm based and drop the remove callback.
- check returns from devm_mutex_init()
accel drivers
- Use aligned_s64 instead of s64 __aligned(8)
adi,ad5791
- Add some missing GPIOs and power supplies that presumably were always
hard wired on previous boards.
- Refactor to use chip_info in device id tables.
- Convert probe entirely to devm based simplify code and allowing remove()
callback to be dropped.
adi,ad7192
- Check return from spi_get_device_match_data()
adi,ad74413r
- Don't keep an unnecessary copy of the gpio after probe.
- Use devm_regulator_get_enable_read_voltage() instead of open coding.
- Apply cleanup.h approach to reduce complexity.
adi,dac8460
- Fix a wrong compaitble ID due to a stray space.
- Add an spi_device_id table.
bosch,bmc150
- Drop some likely false ACPI IDs.
- Drop left over unused ACPI specific code.
bosch,bme680
- Add mising regmap.h include.
- Reduce excessive sleep on startup.
- Drop some cammelcase usage.
- Use fsleep
- Generalize read functions to allow for reuse.
- Use s16 variable to avoid some incorrect casting
bosch,bmg150
- Drop some likely false ACPI IDs.
bosch,bmi270
- Drop unused FREQUENCY and SCALE attributes that always returned an
error (they wil be back impelmented correctly).
- Factor out the chip specific data into a structure to enable simple
support for additional devices.
isil,isl29018
- Drop ACPI_PTR() and CONFIG_ACPI guards as not worth the trouble for very
minor saving.
invensense,mpu6050
- Use much simpler test for ACPI firmware.
kionix,kxcjk-1013
- Drop unnecessary ACPI entry in the i2c_device_id table.
- Drop support KX022-1020 to fix a bug that was introduced with that change.
Hopefully a fixed version will replace it soon.
- Drop CONFIG guards for PM in favor of pm_ptr() and the compiler removing
dead code.
- Switch from enum to chip_info structure and add ODR times to that structure.
- Deduplicate one of those ODR structures
- Drop ACPI_PTR() and move ID table out of config guards.
- Minor additional cleanup.
liteon,ltr401
- Drop some likely false ACPI Ids and add LTER0303 which is know to be in use.
microchip,pac1934
- Use much simpler test for ACPI firmware.
vishay,veml6070
- Use unsigned int instead of just unsigned.
- Use FIELD_PREP to make setting of field value explicit.
Various other minor fixes to documentation
-----BEGIN PGP SIGNATURE-----
iQJFBAABCAAvFiEEbilms4eEBlKRJoGxVIU0mcT0FogFAmcvP28RHGppYzIzQGtl
cm5lbC5vcmcACgkQVIU0mcT0Fogomg//T0m278O+R8YWTeYjlU8iLBxLcahOR9Zz
lB9XKp48lrqjy8ziWu7NilHMkWyTaoof+V5rAYqs8KjVzTZniAFEs2FMy05bDCIP
iXxEolVGDjY3qXFbN/dUXXte4T6u5rZIzzdJGzRySduW2hGYNjmcQ7tMsGSJ1Jo8
tCi5NBxZuhZ7Bqk1UJvy8o9I9oloQqvLLv0japFVwZuNsSRgbjHLKC0o8gY9UOuY
sCDSneBlhUxZRHRr1E6aswYJltNQZYTVNRJikwg+Iogbwix+ltFjKMKWdledoXqE
Fu00B9YgHIpdw/g/QUYgBKJmY0vIAPq26O8vYIf4jcVN9sf9uVkFMKUtB81LL52B
T73G/Plz7iGzJX/UpnuHWzbG1rax+qHwxcNgShrwumYmXZTaHyxJ42zH4R+zQ8gZ
vBw8jVfOfXwkD+CRw8pvVrwflyro4E+fSExjbEmxvyFh281tr1Rj8z4y3ROOdEUb
W8iRGWuanMTfFvCicBfUiTYJMG8zYhM290g85ayWVOVhTvEgTwA/fwLt6GPM6szG
xL4KRo1RYaR2GmYxkibJ+cyrZIUeAgjPaHl3jtjkCAGUfmlKvKEeKuuAGHfZ+0fa
GpK/pljddg3HM3UaRKBSBcqasaytpwkYW/xibQkLNNkzE1X4/7HQyxdtNoxzLt4J
Sx9d+IN0pmM=
=tB/u
-----END PGP SIGNATURE-----
Merge tag 'iio-for-6.13b' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/jic23/iio into char-misc-next
Jonathan writes:
IIO: 2nd set of new device support, features and cleanup for 6.13
Alongside new drivers and device support there are several large
cleanups going on across the IIO tree and we see part of some of those
in this pull request.
Merged char-misc-next at point of 6.12-rc6 merge to avoid a
conflict with a fix for the ad7380 merged earlier this cycle.
Note that I previously messed this merge up and had to reconstruct
it this morning so a coherent pull request was possible. The new
stuff is all the same as has been in linux-next for some time with
the exception of the kernel-doc related __private ordering fix
that went in yesterday.
New device support
==================
adi,ad7380
- Support for adaq4370-4 and adaq4370 quad channel ADCs.
adi,ad7606
- Various cleanups preceeding support of AD7607, AD7608 and AD7609 ADCs.
adi,ad7779
- New driver supproting AD7770, AD7771 and AD7779 ADCs.
allegro,als31300
- New driver for this 3D Linear Hall Effect sensor.
bosch,bmi270
- Add support BMI260 which is similar but requires a different firmware image.
bosch,smi240
- New driver for this IMU.
ti,opt3001
- Add support opt3002 light sensor which has a wider spectral range than
the opt3001.
vishay,veml3235
- New driver for this ambient light sensor.
Features
========
hid-sensors
- Add support Human Proximity Range and Attention detection (requiring
a new classification style channel type)
adi,ad3552r
- Add backend support and related platform driver to support use
with an FPGA IP to allow QSPI + DDR bus operation and much higher
data aquisition rates. (various rework preceeded this feature)
adi,ad7606
- Various cleanup prior to enabling use with an IIO Backend and PWM trigger
enabling much higher speed data capture.
bosch,bme680
- Support control of preheat current
- Support triggered buffer capture
- Add SCALE and RAW channels (needed to enable the buffered capture).
bosch,bmp280
- Enable sleeping to save power.
- Add interrupt support for bmp3xx and bmp5xx devices. Also update bmp085
to new approach.
- Enable data ready trigger.
bosch,bmi270
- Add triggered buffer support
- Add scale and sampling frequency control.
vishay,veml6070
- Support integration time via DT binding for an external resistor value.
Cleanup and minor fixes
=======================
core
- Fix a longstanding issue with event codes for differential channels.
Note that not all drivers are yet fixed, but macros have been added
to avoid potential repeats of this in future.
- Tidy up handling in iio_read_acpi_mount matrix.
- Mark iio_dev::priv with __private. Later move the marking before the
field name to avoid a kernel-doc issue.
treewide
- Drop some pointless default n entries in Kconfig.
- Add an iio_get_acpi_device_name_and_data() handler to replace some
commonly repeated code.
- simplify use of 'state' in write_event_config() callback as it is
effectively a boolean. Once done make it a boolean (lots of drivers
were updated to enable this)
- some more use of devm_regulator_get_enable_read_voltage( to replace
open coded versions. Where this enables it convert all of remove
handling to devm based and drop the remove callback.
- check returns from devm_mutex_init()
accel drivers
- Use aligned_s64 instead of s64 __aligned(8)
adi,ad5791
- Add some missing GPIOs and power supplies that presumably were always
hard wired on previous boards.
- Refactor to use chip_info in device id tables.
- Convert probe entirely to devm based simplify code and allowing remove()
callback to be dropped.
adi,ad7192
- Check return from spi_get_device_match_data()
adi,ad74413r
- Don't keep an unnecessary copy of the gpio after probe.
- Use devm_regulator_get_enable_read_voltage() instead of open coding.
- Apply cleanup.h approach to reduce complexity.
adi,dac8460
- Fix a wrong compaitble ID due to a stray space.
- Add an spi_device_id table.
bosch,bmc150
- Drop some likely false ACPI IDs.
- Drop left over unused ACPI specific code.
bosch,bme680
- Add mising regmap.h include.
- Reduce excessive sleep on startup.
- Drop some cammelcase usage.
- Use fsleep
- Generalize read functions to allow for reuse.
- Use s16 variable to avoid some incorrect casting
bosch,bmg150
- Drop some likely false ACPI IDs.
bosch,bmi270
- Drop unused FREQUENCY and SCALE attributes that always returned an
error (they wil be back impelmented correctly).
- Factor out the chip specific data into a structure to enable simple
support for additional devices.
isil,isl29018
- Drop ACPI_PTR() and CONFIG_ACPI guards as not worth the trouble for very
minor saving.
invensense,mpu6050
- Use much simpler test for ACPI firmware.
kionix,kxcjk-1013
- Drop unnecessary ACPI entry in the i2c_device_id table.
- Drop support KX022-1020 to fix a bug that was introduced with that change.
Hopefully a fixed version will replace it soon.
- Drop CONFIG guards for PM in favor of pm_ptr() and the compiler removing
dead code.
- Switch from enum to chip_info structure and add ODR times to that structure.
- Deduplicate one of those ODR structures
- Drop ACPI_PTR() and move ID table out of config guards.
- Minor additional cleanup.
liteon,ltr401
- Drop some likely false ACPI Ids and add LTER0303 which is know to be in use.
microchip,pac1934
- Use much simpler test for ACPI firmware.
vishay,veml6070
- Use unsigned int instead of just unsigned.
- Use FIELD_PREP to make setting of field value explicit.
Various other minor fixes to documentation
* tag 'iio-for-6.13b' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/jic23/iio: (153 commits)
iio: Move __private marking before struct element priv in struct iio_dev
docs: iio: ad7380: add adaq4370-4 and adaq4380-4
iio: adc: ad7380: add support for adaq4370-4 and adaq4380-4
iio: adc: ad7380: use local dev variable to shorten long lines
iio: adc: ad7380: fix oversampling formula
dt-bindings: iio: adc: ad7380: add adaq4370-4 and adaq4380-4 compatible parts
iio: chemical: bme680: Add support for preheat current
iio: chemical: bme680: Add triggered buffer support
iio: chemical: bme680: Add SCALE and RAW channels
iio: chemical: bme680: refactorize set_mode() mode
iio: events: make IIO_EVENT_CODE macro private
iio: accel: mma9553: use specialized event code macros
iio: dummy: use specialized event code macros
iio: adc: ad7280a: use IIO_DIFF_EVENT_CODE macro helper
iio: events.h: add event identifier macros for differential channel
iio: magnetometer: add Allegro MicroSystems ALS31300 3-D Linear Hall Effect driver
dt-bindings: iio: magnetometer: document the Allegro MicroSystems ALS31300 3-D Linear Hall Effect Sensor
dt-bindings: vendor-prefixes: Add Allegro MicroSystems, Inc
iio: light: apds9960: remove useless return
iio: light: apds9960: convert als_int and pxs_int to bool
...
adaq4370-4 (2MSPS) and adaq4380-4 (4MSPS) are quad-channel precision data
acquisition signal chain μModule solutions compatible with the ad738x
family, with the following differences:
- pin selectable gain in front of each 4 adc
- internal reference is 3V derived from refin-supply (5V)
- additional supplies
This implies that IIO_CHAN_INFO_SCALE can not be shared by type for
these new devices.
Signed-off-by: Julien Stephan <jstephan@baylibre.com>
Reviewed-by: David Lechner <dlechner@baylibre.com>
Link: https://patch.msgid.link/20241030-ad7380-add-adaq4380-4-support-v4-4-864ff02babae@baylibre.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
The formula in the datasheet for oversampling time conversion seems to
be valid when device is at full speed using the maximum number of SDO
lines. The driver currently support only 1 SDO line. The correct formula
is: t_convert = T_CONVERT_0_NS + T_CONVERT_X_NS*(x -
1)*num_channel/number_of_sdo_lines.
It will produce larger delays than what is currently set, but some devices
actually require it.
Signed-off-by: Julien Stephan <jstephan@baylibre.com>
Reviewed-by: David Lechner <dlechner@baylibre.com>
Link: https://patch.msgid.link/20241030-ad7380-add-adaq4380-4-support-v4-2-864ff02babae@baylibre.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Usual mixed bag of new issues from this cycle and ancient bugs
recently noticed.
core
- Fix wrong fwnode handle if __fwnode_iio_channel_get_by_name()
looks at parents of the provider node.
core,backend
- Fix a wrong pointer error check.
gts library
- Fix plausible corner case where the value returned was not set.
- Avoid near infinite loop if the size of the table is 0.
(neither are an issue for current drivers).
adi,ad4000
- Fix reading of unsigned channels that were returning garbage.
adi,ad7780
- Prevent a division by zero.
adi,ad7923
- Fix buffer overflows in arrays that were not resized when devices
with more channels were added to the driver.
adi,adxl380
- Check only for negative error codes rather than including the
positive channel read values in an error check.
invense,common
- Fix an issue where changing the sampling rate to another value and
back again whilst the FIFO was off would not update things correctly.
kionix,kx022a
- Fix failure to sign extend value read from device.
-----BEGIN PGP SIGNATURE-----
iQJFBAABCAAvFiEEbilms4eEBlKRJoGxVIU0mcT0FogFAmctBygRHGppYzIzQGtl
cm5lbC5vcmcACgkQVIU0mcT0Fog9gQ/8CdpYJWoK2qnXiWkNQdLR4vqd3RKnQ8ch
046D26kNoQNDEdT/lSKKvZdGaZmcMg2SqK3VpCJCPc08uuqIZoRbMcv6WkhdP5iK
besdoaqkyEQaCnR+o0annbDq+hADN0uwe398WbIKMmKxU6nUPTwLkJTTroCnP8pn
juAi4Elvhz93LhgVPuDtzuMxFAI4gRz8LPfv1WdIIyMitwO8j7ILjjab3Jy+1Rfr
8n8HwZolS74iSY9qLc7kaipCRb4He+Q6/+c011ym9g8E8ge8KO1huxOn0FnIsWXv
g/qLsmnEMy56ypguf0uStNHN9f7AXHlqC1xiScnkZXsbP4CFakaL3M8hBbOiw13S
u/ylhYkxSqCsjZ/oNlTaDtnZrL/ZaHlSTBcsqEu3JRHkG9bJCgLQl2IfTS5Px65Y
JEj5OGu9nEDi5lPGOUqgJgmLuxSNEMtHqqvqTAp0kk4McM/BocW0ldEaZy7cokCb
Tb/auEK4sGssdhJM8Nq+wH6mHfjn0IL38sBHNyP640kFNRMG1WnVDICzFGsC3ldL
TLsczCulnVdr8xhK5vl2irqjnVKzjSFgXZg5jB/29N0V4re/b6pOh8LWm3Ze5hQZ
sR0rkXI7FkDaNk7Ifb/Pe2XCbU2IjgAvf3dyZxO/E1UuLAz+spa0WjImghHCT5P8
e9WcX1hoKbg=
=4pCM
-----END PGP SIGNATURE-----
Merge tag 'iio-fixes-for-6.12c' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/jic23/iio into char-misc-next
Jonathan writes:
IIO: 3rd set of fixes for the 6.12 cycle
Usual mixed bag of new issues from this cycle and ancient bugs
recently noticed.
core
- Fix wrong fwnode handle if __fwnode_iio_channel_get_by_name()
looks at parents of the provider node.
core,backend
- Fix a wrong pointer error check.
gts library
- Fix plausible corner case where the value returned was not set.
- Avoid near infinite loop if the size of the table is 0.
(neither are an issue for current drivers).
adi,ad4000
- Fix reading of unsigned channels that were returning garbage.
adi,ad7780
- Prevent a division by zero.
adi,ad7923
- Fix buffer overflows in arrays that were not resized when devices
with more channels were added to the driver.
adi,adxl380
- Check only for negative error codes rather than including the
positive channel read values in an error check.
invense,common
- Fix an issue where changing the sampling rate to another value and
back again whilst the FIFO was off would not update things correctly.
kionix,kx022a
- Fix failure to sign extend value read from device.
* tag 'iio-fixes-for-6.12c' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/jic23/iio:
iio: Fix fwnode_handle in __fwnode_iio_channel_get_by_name()
iio: accel: adxl380: fix raw sample read
iio: accel: kx022a: Fix raw read format
iio: gts: fix infinite loop for gain_to_scaletables()
iio: gts: Fix uninitialized symbol 'ret'
iio: adc: ad4000: fix reading unsigned data
ad7780: fix division by zero in ad7780_write_raw()
iio: adc: ad7923: Fix buffer overflow for tx_buf and ring_xfer
iio: backend: fix wrong pointer passed to IS_ERR()
iio: invensense: fix multiple odr switch when FIFO is off
Add functionality to inject a specified amount of current to the heating
plate before the start of the gas measurement to allow the sensor to reach
faster to the requested temperature.
Signed-off-by: Vasileios Amoiridis <vassilisamir@gmail.com>
Link: https://patch.msgid.link/20241102131311.36210-5-vassilisamir@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Add triggered buffer and soft timestamp support. The available scan mask
enables all the channels of the sensor in order to follow the operation of
the sensor. The sensor basically starts to capture from all channels
as long as it enters into FORCED mode.
The bulk read, reads a total of 15 registers from the sensor, 0x1D..0x2B.
Even though some of those registers are not reported in the register map
of the device, this is how the BME680 Sensor API [1] proposes to do it.
This allows to have one bulk read instead of multiple ones.
Link: https://github.com/boschsensortec/BME68x_SensorAPI/blob/v4.4.8/bme68x.c#L1200
Signed-off-by: Vasileios Amoiridis <vassilisamir@gmail.com>
Link: https://patch.msgid.link/20241102131311.36210-4-vassilisamir@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Add SCALE,RAW channels to the device. Even though PROCESSED should be
kept for backwards compatibility add comment to avoid using it if the
value is not actually reported in IIO values.
Signed-off-by: Vasileios Amoiridis <vassilisamir@gmail.com>
Link: https://patch.msgid.link/20241102131311.36210-3-vassilisamir@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Refactorize the set_mode() function to use an external enum that
describes the possible modes of the BME680 device instead of using
true/false variables for selecting SLEEPING/FORCED mode.
Signed-off-by: Vasileios Amoiridis <vassilisamir@gmail.com>
Link: https://patch.msgid.link/20241102131311.36210-2-vassilisamir@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
The IIO_DIFF_EVENT_CODE macro helper was introduced to provide a more
specific alternative to the generic IIO_EVENT_CODE macro for handling
differential channels. This commit updates the code to use
IIO_DIFF_EVENT_CODE for better clarity and maintainability.
However, the current implementation incorrectly sets both chan1 and
chan2 to 0. To maintain compatibility and avoid breaking existing
user space applications, this behavior is preserved for now.
Signed-off-by: Julien Stephan <jstephan@baylibre.com>
Reviewed-by: David Lechner <dlechner@baylibre.com>
Link: https://patch.msgid.link/20241028-iio-add-macro-for-even-identifier-for-differential-channels-v1-2-b452c90f7ea6@baylibre.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
The Allegro MicroSystems ALS31300 is a 3-D Linear Hall Effect Sensor
mainly used for 3D head-on motion sensing applications.
The device is configured over I2C, and as part of the Sensor data the
temperature core is also provided.
While the device provides an IRQ gpio, it depends on a configuration
programmed into the internal EEPROM, thus only the default mode is
supported and buffered input via trigger is also supported to allow
streaming values with the same sensing timestamp.
The device can be configured with different sensitivities in factory,
but the sensitivity value used to calculate value into the Gauss
unit is not available from registers, thus the sensitivity is provided
by the compatible/device-id string which is based on the part number
as described in the datasheet page 2.
Reviewed-by: Andy Shevchenko <andy@kernel.org>
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://patch.msgid.link/20241030-topic-input-upstream-als31300-v4-3-494297c9e50a@linaro.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Since the write_event_config callback now uses a bool for the state
parameter, update apds9300_set_intr_state accordingly and change intr_en
to bool.
Also update apds9300_set_power_state and power_state for consistency.
Signed-off-by: Julien Stephan <jstephan@baylibre.com>
Link: https://patch.msgid.link/20241031-iio-fix-write-event-config-signature-v2-12-2bcacbb517a2@baylibre.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
write_event_config callback use an int for state, but it is actually a
boolean. iio_ev_state_store is actually using kstrtobool to check user
input, then gives the converted boolean value to write_event_config.
Fix signature and update all iio drivers to use the new signature.
This patch has been partially written using coccinelle with the
following script:
$ cat iio-bool.cocci
// Options: --all-includes
virtual patch
@c1@
identifier iioinfo;
identifier wecfunc;
@@
static const struct iio_info iioinfo = {
...,
.write_event_config =
(
wecfunc
|
&wecfunc
),
...,
};
@@
identifier c1.wecfunc;
identifier indio_dev, chan, type, dir, state;
@@
int wecfunc(struct iio_dev *indio_dev, const struct iio_chan_spec *chan, enum iio_event_type type, enum iio_event_direction dir,
-int
+bool
state) {
...
}
make coccicheck MODE=patch COCCI=iio-bool.cocci M=drivers/iio
Unfortunately, this script didn't match all files:
* all write_event_config callbacks using iio_device_claim_direct_scoped
were not detected and not patched.
* all files that do not assign and declare the write_event_config
callback in the same file.
iio.h was also manually updated.
The patch was build tested using allmodconfig config.
cc: Julia Lawall <julia.lawall@inria.fr>
Signed-off-by: Julien Stephan <jstephan@baylibre.com>
Link: https://patch.msgid.link/20241031-iio-fix-write-event-config-signature-v2-7-2bcacbb517a2@baylibre.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
state parameter is currently an int, but it is actually a boolean.
iio_ev_state_store is actually using kstrtobool to check user input,
then gives the converted boolean value to write_event_config. The code
in adux1020_write_event_config re-uses state parameter to store an
integer value. To prepare for updating the write_event_config signature
to use a boolean for state, introduce a new local int variable.
Signed-off-by: Julien Stephan <jstephan@baylibre.com>
Link: https://patch.msgid.link/20241031-iio-fix-write-event-config-signature-v2-6-2bcacbb517a2@baylibre.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
iio_ev_state_store is actually using kstrtobool to check user
input, then gives the converted boolean value to the write_event_config
callback.
Remove useless code in write_event_config callback.
Signed-off-by: Julien Stephan <jstephan@baylibre.com>
Link: https://patch.msgid.link/20241031-iio-fix-write-event-config-signature-v2-5-2bcacbb517a2@baylibre.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
iio_ev_state_store is actually using kstrtobool to check user
input, then gives the converted boolean value to the write_event_config
callback.
Remove useless code in write_event_config callback.
Signed-off-by: Julien Stephan <jstephan@baylibre.com>
Link: https://patch.msgid.link/20241031-iio-fix-write-event-config-signature-v2-4-2bcacbb517a2@baylibre.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
iio_ev_state_store is actually using kstrtobool to check user
input, then gives the converted boolean value to the write_event_config
callback.
Remove useless code in write_event_config callback.
Signed-off-by: Julien Stephan <jstephan@baylibre.com>
Link: https://patch.msgid.link/20241031-iio-fix-write-event-config-signature-v2-3-2bcacbb517a2@baylibre.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
iio_ev_state_store is actually using kstrtobool to check user
input, then gives the converted boolean value to the write_event_config
callback.
Remove useless code in write_event_config callback.
Signed-off-by: Julien Stephan <jstephan@baylibre.com>
Link: https://patch.msgid.link/20241031-iio-fix-write-event-config-signature-v2-2-2bcacbb517a2@baylibre.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
iio_ev_state_store is actually using kstrtobool to check user
input, then gives the converted boolean value to the write_event_config
callback.
Remove useless code in write_event_config callback.
Signed-off-by: Julien Stephan <jstephan@baylibre.com>
Link: https://patch.msgid.link/20241031-iio-fix-write-event-config-signature-v2-1-2bcacbb517a2@baylibre.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Egis620 supports 3 channels: presense, proximity and attention.
Modify the driver so it can read those channels as well.
Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>
Link: https://patch.msgid.link/20241101-hpd-v3-5-e9c80b7c7164@chromium.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
We are going to introduce more proximity channels. Make proximity a
indexed channel now, in a simple patch, so the change can be easily
bisected if there are any issues.
Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>
Link: https://patch.msgid.link/20241101-hpd-v3-4-e9c80b7c7164@chromium.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Add a new channel type representing if the user's attention state to the
the system. This usually means if the user is looking at the screen or
not.
Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>
Link: https://patch.msgid.link/20241101-hpd-v3-3-e9c80b7c7164@chromium.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
The integration time of the veml6070 depends on an external resistor
(called Rset in the datasheet) and the value configured in the IT
field of the command register, whose supported values are 1/2x, 1x,
2x and 4x.
Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
Link: https://patch.msgid.link/20241031-veml6070-integration-time-v4-2-c66da6788256@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Use devm_iio_device_register to automatically free the iio device.
since this is the last remaining resource that was not automatically
freed, we can drop the ".remove" callback.
Suggested-by: David Lechner <dlechner@baylibre.com>
Reviewed-by: David Lechner <dlechner@baylibre.com>
Signed-off-by: Axel Haslam <ahaslam@baylibre.com>
Link: https://patch.msgid.link/20241031071746.848694-7-ahaslam@baylibre.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Simplify probe by using of the devm_regulator_get_enable_read_voltage.
Suggested-by: David Lechner <dlechner@baylibre.com>
Reviewed-by: David Lechner <dlechner@baylibre.com>
Signed-off-by: Axel Haslam <ahaslam@baylibre.com>
Link: https://patch.msgid.link/20241031071746.848694-6-ahaslam@baylibre.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
The ad7591 has reset, clr and ldac gpios. For the DAC to output data
continuously written to the data register the state of these gpios needs
to be set by the driver.
Add these gpios to the driver making them optional in case they are fixed
on the pcb.
Reviewed-by: David Lechner <dlechner@baylibre.com>
Signed-off-by: Axel Haslam <ahaslam@baylibre.com>
Link: https://patch.msgid.link/20241031071746.848694-5-ahaslam@baylibre.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Include a chip info struct in device SPI and device OF match tables to
provide channel definitions for each particular ADC model and drop
device enum.
Suggested-by: Nuno Sa <nuno.sa@analog.com>
Reviewed-by: David Lechner <dlechner@baylibre.com>
Signed-off-by: Axel Haslam <ahaslam@baylibre.com>
Link: https://patch.msgid.link/20241031071746.848694-4-ahaslam@baylibre.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Change to obtain the fdt use case as reported in the
adi,ad3552r.yaml file in this patchset.
The DAC device is defined as a child node of the backend.
Registering the child fdt node as a platform devices.
Reviewed-by: Nuno Sa <nuno.sa@analog.com>
Signed-off-by: Angelo Dureghello <adureghello@baylibre.com>
Reviewed-by: David Lechner <dlechner@baylibre.com>
Link: https://patch.msgid.link/20241028-wip-bl-ad3552r-axi-v0-iio-testing-v9-8-f6960b4f9719@kernel-space.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Add High Speed ad3552r platform driver.
The ad3552r DAC is controlled by a custom (fpga-based) DAC IP
through the current AXI backend, or similar alternative IIO backend.
Compared to the existing driver (ad3552r.c), that is a simple SPI
driver, this driver is coupled with a DAC IIO backend that finally
controls the ad3552r by a fpga-based "QSPI+DDR" interface, to reach
maximum transfer rate of 33MUPS using dma stream capabilities.
All commands involving QSPI bus read/write are delegated to the backend
through the provided APIs for bus read/write.
Reviewed-by: Nuno Sa <nuno.sa@analog.com>
Signed-off-by: Angelo Dureghello <adureghello@baylibre.com>
Reviewed-by: David Lechner <dlechner@baylibre.com>
Link: https://patch.msgid.link/20241028-wip-bl-ad3552r-axi-v0-iio-testing-v9-7-f6960b4f9719@kernel-space.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
In the fwnode_iio_channel_get_by_name(), iterating over parent nodes to
acquire IIO channels via fwnode_for_each_parent_node(). The variable
chan was mistakenly attempted on the original node instead of the
current parent node. This patch corrects the logic to ensure that
__fwnode_iio_channel_get_by_name() is called with the correct parent
node.
Cc: stable@vger.kernel.org # v6.6+
Fixes: 1e64b9c5f9 ("iio: inkern: move to fwnode properties")
Signed-off-by: Zicheng Qu <quzicheng@huawei.com>
Link: https://patch.msgid.link/20241102092525.2389952-1-quzicheng@huawei.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>