Uwe Kleine-König [Tue, 12 Nov 2024 08:35:20 +0000 (09:35 +0100)]
firmware: Switch back to struct platform_driver::remove()
After commit 0edb555a65d1 ("platform: Make platform_driver::remove()
return void") .remove() is (again) the right callback to implement for
platform drivers.
Convert all platform drivers below drivers/firmware to use .remove(),
with the eventual goal to drop struct platform_driver::remove_new(). As
.remove() and .remove_new() have the same prototypes, conversion is done
by just changing the structure member name in the driver initializer.
Greg Kroah-Hartman [Mon, 11 Nov 2024 14:34:11 +0000 (15:34 +0100)]
Merge tag 'icc-6.13-rc1' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/djakov/icc into char-misc-next
Georgi writes:
interconnect changes for 6.13
This pull request contains the interconnect changes for the 6.13-rc1 merge
window. It contains new drivers and clean-ups with the following highlights:
Core changes:
- Remove a useless kfree_const() usage
- Switch back to struct platform_driver::remove()
- Use of_property_present() for non-boolean properties
Driver changes:
- New driver for QCS615 platforms
- New driver for SAR2130P platforms
- New driver for QCS8300 platforms
- Probe defer incase of missing QoS clock dependency in rpmh driver
- Rename qos_clks_required flag to qos_requires_clocks in rpmh driver
- Constify pointers to qcom_icc_node in msm8937 driver
Signed-off-by: Georgi Djakov <djakov@kernel.org>
* tag 'icc-6.13-rc1' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/djakov/icc:
interconnect: Use of_property_present() for non-boolean properties
dt-bindings: interconnect: qcom-bwmon: Document QCS8300 bwmon compatibles
interconnect: qcom: add QCS8300 interconnect provider driver
interconnect: Switch back to struct platform_driver::remove()
interconnect: qcom: add support for SAR2130P
dt-bindings: interconnect: qcom: document SAR2130P NoC
interconnect: qcom: add QCS615 interconnect provider driver
dt-bindings: interconnect: document the RPMh Network-On-Chip interconnect in QCS615 SoC
dt-bindings: interconnect: document the RPMh Network-On-Chip interconnect in QCS8300 SoC
interconnect: Remove a useless kfree_const() usage
interconnect: qcom: msm8937: constify pointer to qcom_icc_node
interconnect: qcom: icc-rpmh: rename qos_clks_required flag
interconnect: qcom: icc-rpmh: probe defer incase of missing QoS clock dependency
Greg Kroah-Hartman [Mon, 11 Nov 2024 14:33:11 +0000 (15:33 +0100)]
Merge tag 'fpga-for-6.13-rc1' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/fpga/linux-fpga into char-misc-next
Xu writes:
FPGA Manager changes for 6.12-rc1
- Uwe's change switch back to use platform_driver::remove()
All patches have been reviewed on the mailing list, and have been in the
last linux-next releases (as part of our for-next branch).
Signed-off-by: Xu Yilun <yilun.xu@intel.com>
* tag 'fpga-for-6.13-rc1' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/fpga/linux-fpga:
fpga: Switch back to struct platform_driver::remove()
Uwe Kleine-König [Fri, 8 Nov 2024 16:00:02 +0000 (17:00 +0100)]
fpga: Switch back to struct platform_driver::remove()
After commit 0edb555a65d1 ("platform: Make platform_driver::remove()
return void") .remove() is (again) the right callback to implement for
platform drivers.
Convert all platform drivers below drivers/fpga to use .remove(), with
the eventual goal to drop struct platform_driver::remove_new(). As
.remove() and .remove_new() have the same prototypes, conversion is done
by just changing the structure member name in the driver initializer.
A few white space changes are included to make indention consistent.
Hans de Goede [Fri, 8 Nov 2024 15:12:34 +0000 (16:12 +0100)]
mei: vsc: Improve error logging in vsc_identify_silicon()
vsc_identify_silicon() returns -EINVAL in various places without logging
what is going on.
And there are several bug reports about mei_vsc_hw_reset() failing with
-EINVAL before the "silicon stepping version is %u:%u" message get logged,
indicating this is coming from vsc_identify_silicon():
Hans de Goede [Wed, 6 Nov 2024 22:01:02 +0000 (23:01 +0100)]
mei: vsc: Do not re-enable interrupt from vsc_tp_reset()
The only 2 callers of vsc_tp_reset() are:
1. mei_vsc_hw_reset(), which immediataly calls vsc_tp_intr_disable()
afterwards.
2. vsc_tp_shutdown() which immediately calls free_irq() afterwards.
So neither actually wants the interrupt to be enabled after resetting
the chip and having the interrupt enabled for a short time afer
the reset is undesirable.
Drop the enable_irq() call from vsc_tp_reset(), so that the interrupt
is left disabled after vsc_tp_reset().
Fei Shao [Sat, 9 Nov 2024 00:28:27 +0000 (16:28 -0800)]
dt-bindings: spmi: spmi-mtk-pmif: Add compatible for MT8188
Add compatible string for the SPMI block on MT8188 SoC, which is
compatible with the one used on MT8195.
Acked-by: Rob Herring (Arm) <robh@kernel.org> Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Signed-off-by: Fei Shao <fshao@chromium.org> Link: https://lore.kernel.org/r/20240911143429.850071-2-fshao@chromium.org Signed-off-by: Stephen Boyd <sboyd@kernel.org> Acked-by: Stephen Boyd <sboyd@kernel.org> Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.dleregno@collabora.com> Link: https://lore.kernel.org/r/20241109002829.160973-3-sboyd@kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Javier Carrasco [Sat, 9 Nov 2024 00:28:26 +0000 (16:28 -0800)]
spmi: pmic-arb: fix return path in for_each_available_child_of_node()
This loop requires explicit calls to of_node_put() upon early exits
(break, goto, return) to decrement the child refcounter and avoid memory
leaks if the child is not required out of the loop.
A more robust solution is using the scoped variant of the macro, which
automatically calls of_node_put() when the child goes out of scope.
Greg Kroah-Hartman [Sat, 9 Nov 2024 13:34:48 +0000 (14:34 +0100)]
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
...
Julien Stephan [Wed, 30 Oct 2024 13:44:29 +0000 (14:44 +0100)]
docs: iio: ad7380: add adaq4370-4 and adaq4380-4
Adding documentation for adaq4370-4 and adaq4380-4 supported devices. In
particular, document the reference voltage mechanism and the gain
parameter that are specific to adaq devices.
Julien Stephan [Wed, 30 Oct 2024 13:44:28 +0000 (14:44 +0100)]
iio: adc: ad7380: add support for adaq4370-4 and adaq4380-4
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.
Julien Stephan [Wed, 30 Oct 2024 13:44:26 +0000 (14:44 +0100)]
iio: adc: ad7380: fix oversampling formula
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.
Julien Stephan [Wed, 30 Oct 2024 13:44:25 +0000 (14:44 +0100)]
dt-bindings: iio: adc: ad7380: add adaq4370-4 and adaq4380-4 compatible parts
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
To select the gain a new patternProperties is added to describe each
channel. It is restricted to adaq devices.
Greg Kroah-Hartman [Fri, 8 Nov 2024 15:56:23 +0000 (16:56 +0100)]
Merge tag 'mhi-for-v6.13' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/mani/mhi into char-misc-next
Manivannan writes:
MHI Host
========
- Fixed typo in the comments section
- Fixed the sparse warning in MHI trace by converting the inputs to native
endian instead of passing little endian fields.
- Used pcim_iomap_region() API to request and map the MHI BAR. This removes the
usage of deprecated pcim_iomap_regions() and pcim_iomap_table() APIs.
* tag 'mhi-for-v6.13' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/mani/mhi:
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
bus: mhi: host: Fix typos in the comments
Greg Kroah-Hartman [Fri, 8 Nov 2024 15:46:34 +0000 (16:46 +0100)]
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
Manivannan Sadhasivam [Fri, 4 Oct 2024 02:33:51 +0000 (08:03 +0530)]
bus: mhi: host: pci_generic: Use pcim_iomap_region() to request and map MHI BAR
Use of both pcim_iomap_regions() and pcim_iomap_table() APIs are
deprecated. Hence, switch to pcim_iomap_region() API which handles both the
request and map of the MHI BAR region.
Carl Vanderlip [Fri, 4 Oct 2024 17:03:20 +0000 (10:03 -0700)]
bus: mhi: host: Switch trace_mhi_gen_tre fields to native endian
Each of the __field() macros were triggering sparse warnings similar to:
trace.h:87:1: sparse: sparse: cast to restricted __le64
trace.h:87:1: sparse: sparse: restricted __le64 degrades to integer
trace.h:87:1: sparse: sparse: restricted __le64 degrades to integer
Change each little endian type to its similarly sized native integer.
Convert inputs into native endian.
Greg Kroah-Hartman [Thu, 7 Nov 2024 07:25:08 +0000 (08:25 +0100)]
Merge tag 'counter-fixes-for-6.12' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/wbg/counter into char-misc-next
William writes:
Counter fixes for 6.12
Fix device_node handling in stm32-timer-cnt by calling required
of_node_put() after device node is no longer needed. Check and handle
clk_enable() failures in stm32-timer-cnt and ti-ecap-capture.
Signed-off-by: William Breathitt Gray <wbg@kernel.org>
* tag 'counter-fixes-for-6.12' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/wbg/counter:
counter: ti-ecap-capture: Add check for clk_enable()
counter: stm32-timer-cnt: Add check for clk_enable()
counter: stm32-timer-cnt: fix device_node handling in probe_encoder()
Greg Kroah-Hartman [Thu, 7 Nov 2024 07:00:55 +0000 (08:00 +0100)]
Merge tag 'counter-updates-for-6.13' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/wbg/counter into char-misc-next
William writes:
Counter updates for 6.13
Add MODULE_DEVICE_TABLE() for ftm-quaddec to autoload based on the alias
from of_device_id table. Replace deprecated pcim_iomap_regions() and
pcim_iomap_table() calls with pcim_iomap_region() in intel-eqp.
* tag 'counter-updates-for-6.13' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/wbg/counter:
counter: intel-qep: Replace deprecated PCI functions
counter: ftm-quaddec: Enable module autoloading
Marek Vasut [Wed, 30 Oct 2024 14:02:53 +0000 (14:02 +0000)]
nvmem: core: Check read_only flag for force_ro in bin_attr_nvmem_write()
The bin_attr_nvmem_write() must check the read_only flag and block
writes on read-only devices, now that a nvmem device can be switched
between read-write and read-only mode at runtime using the force_ro
attribute. Add the missing check.
Jann Horn [Thu, 17 Oct 2024 19:07:45 +0000 (21:07 +0200)]
comedi: Flush partial mappings in error case
If some remap_pfn_range() calls succeeded before one failed, we still have
buffer pages mapped into the userspace page tables when we drop the buffer
reference with comedi_buf_map_put(bm). The userspace mappings are only
cleaned up later in the mmap error path.
Fix it by explicitly flushing all mappings in our VMA on the error path.
See commit 79a61cc3fc04 ("mm: avoid leaving partial pfn mappings around in
error case").
Uwe Kleine-König [Mon, 21 Oct 2024 10:45:10 +0000 (12:45 +0200)]
char: Switch back to struct platform_driver::remove()
After commit 0edb555a65d1 ("platform: Make platform_driver::remove()
return void") .remove() is (again) the right callback to implement for
platform drivers.
Convert all platform drivers matched by the "CHAR and MISC DRIVERS"
maintainer's entry to use .remove(), with the eventual goal to drop
struct platform_driver::remove_new(). As .remove() and .remove_new()
have the same prototypes, conversion is done by just changing the
structure member name in the driver initializer.
Costa Shulyupin [Fri, 25 Oct 2024 13:03:16 +0000 (16:03 +0300)]
scripts/tags.sh: Fix warnings "null expansion of name pattern"
Warnings such as
ctags: Warning: include/linux/wait_bit.h:59: null expansion of name pattern "\1"
are triggered when parsing DECLARE_BITMAP() inside comments,
resulting in an empty token.
Shen Lichuan [Wed, 30 Oct 2024 14:03:12 +0000 (14:03 +0000)]
nvmem: imx-iim: Convert comma to semicolon
To ensure code clarity and prevent potential errors, it's advisable
to employ the ';' as a statement separator, except when ',' are
intentionally used for specific purposes.
Geert Uytterhoeven [Wed, 30 Oct 2024 14:03:10 +0000 (14:03 +0000)]
nvmem: Add R-Car E-FUSE driver
R-Car Gen4 SoCs contain fuses indicating hardware support or hardware
(e.g. tuning) parameters. Add a driver to access the state of the
fuses. This supports two types of hardware fuse providers:
1. E-FUSE non-volatile memory accessible through the Pin Function
Controller on R-Car V3U and S4-8,
2. E-FUSE non-volatile memory accessible through OTP_MEM on R-Car V4H
and V4M.
The state of the cells can be read using the NVMEM framework, either
from kernel space (e.g. by the Renesas UFSHCD driver), or from
userspace.
Geert Uytterhoeven [Wed, 30 Oct 2024 14:03:09 +0000 (14:03 +0000)]
dt-bindings: fuse: Move renesas,rcar-{efuse,otp} to nvmem
The R-Car E-FUSE blocks can be modelled better using the nvmem
framework.
Replace the R-Car V3U example by an R-Car S4-8 ES1.2 example, to show
the definition of nvmem cells. While at it, drop unneeded labels from
the examples, and fix indentation.
drivers/platform/goldfish/goldfish_pipe.c:925:36: warning:
‘goldfish_pipe_acpi_match’ defined but not used
[-Wunused-const-variable=]
925 | static const struct acpi_device_id goldfish_pipe_acpi_match[] = {
The complexity of config guards needed for ACPI_PTR() is not worthwhile
for the small amount of saved data. So remove the use of ACPI_PTR instead
and drop now unneeded linux/acpi.h include.
Desnes Nunes [Thu, 31 Oct 2024 14:28:00 +0000 (11:28 -0300)]
misc: rtsx: Cleanup on DRV_NAME cardreader variables
The rtsx_pci_ms memstick driver has been dropped, thus there is no more
need for DRV_NAME_RTSX_PCI_MS variable. Additionally, this also stand-
arizes DRV_NAME variables on alcor_pci and rtsx_usb drivers.
Wedson Almeida Filho [Tue, 22 Oct 2024 21:31:45 +0000 (23:31 +0200)]
rust: add `dev_*` print macros.
Implement `dev_*` print macros for `device::Device`.
They behave like the macros with the same names in C, i.e., they print
messages to the kernel ring buffer with the given level, prefixing the
messages with corresponding device information.
Wedson Almeida Filho [Tue, 22 Oct 2024 21:31:39 +0000 (23:31 +0200)]
rust: introduce `InPlaceModule`
This allows modules to be initialised in-place in pinned memory, which
enables the usage of pinned types (e.g., mutexes, spinlocks, driver
registrations, etc.) in modules without any extra allocations.
Signed-off-by: Wedson Almeida Filho <walmeida@microsoft.com> Signed-off-by: Danilo Krummrich <dakr@kernel.org> Acked-by: Miguel Ojeda <ojeda@kernel.org> Link: https://lore.kernel.org/r/20241022213221.2383-3-dakr@kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Vasileios Amoiridis [Sat, 2 Nov 2024 13:13:08 +0000 (14:13 +0100)]
iio: chemical: bme680: Add support for preheat current
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.
Vasileios Amoiridis [Sat, 2 Nov 2024 13:13:07 +0000 (14:13 +0100)]
iio: chemical: bme680: Add triggered buffer support
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.
Vasileios Amoiridis [Sat, 2 Nov 2024 13:13:06 +0000 (14:13 +0100)]
iio: chemical: bme680: Add SCALE and RAW channels
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.
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.
David Lechner [Fri, 1 Nov 2024 22:17:10 +0000 (17:17 -0500)]
iio: events: make IIO_EVENT_CODE macro private
Make IIO_EVENT_CODE "private" by adding a leading underscore.
There are no more users of this macro in the kernel so we can make it
"private" and encourage developers to use the specialized versions of
the macro instead.
Julien Stephan [Mon, 28 Oct 2024 16:38:12 +0000 (17:38 +0100)]
iio: adc: ad7280a: use IIO_DIFF_EVENT_CODE macro helper
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.
Julien Stephan [Mon, 28 Oct 2024 16:38:11 +0000 (17:38 +0100)]
iio: events.h: add event identifier macros for differential channel
Currently, there are 3 helper macros in iio/events.h to create event
identifiers:
- IIO_EVENT_CODE : create generic event identifier for differential and non
differential channels
- IIO_MOD_EVENT_CODE : create event identifier for modified (non
differential) channels
- IIO_UNMOD_EVENT_CODE : create event identifier for unmodified (non
differential) channels
For differential channels, drivers are expected to use IIO_EVENT_CODE.
However, only one driver in drivers/iio currently uses it correctly,
leading to inconsistent event identifiers for differential channels that
don’t match the intended attributes (such as max1363.c that supports
differential channels, but only uses IIO_UNMOD_EVENT_CODE).
To prevent such issues in future drivers, a new helper macro,
IIO_DIFF_EVENT_CODE, is introduced to specifically create event identifiers
for differential channels. Only one helper is needed for differential
channels since they cannot have modifiers.
Additionally, the descriptions for IIO_MOD_EVENT_CODE and
IIO_UNMOD_EVENT_CODE have been updated to clarify that they are intended
for non-differential channels,
Neil Armstrong [Wed, 30 Oct 2024 15:30:24 +0000 (16:30 +0100)]
iio: magnetometer: add Allegro MicroSystems ALS31300 3-D Linear Hall Effect driver
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.
Neil Armstrong [Wed, 30 Oct 2024 15:30:23 +0000 (16:30 +0100)]
dt-bindings: iio: magnetometer: document the Allegro MicroSystems ALS31300 3-D Linear Hall Effect Sensor
Document the bindings for the Allegro MicroSystems ALS31300 3-D Linear
Hall Effect Sensor controller by an I2C interface, mainly used in 3D
head-on motion sensing applications.
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.
Julien Stephan [Thu, 31 Oct 2024 15:27:03 +0000 (16:27 +0100)]
iio: accel: mma9551: use bool for event state
Since the write_event_config callback now uses a bool for the state
parameter, update the signature of the function it calls accordingly,
and use a bool array for event_enabled.
Julien Stephan [Thu, 31 Oct 2024 15:27:02 +0000 (16:27 +0100)]
iio: fix write_event_config signature
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:
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.
Julien Stephan [Thu, 31 Oct 2024 15:27:01 +0000 (16:27 +0100)]
iio: light: adux1020: write_event_config: use local variable for interrupt value
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.
Ricardo Ribalda [Fri, 1 Nov 2024 07:46:30 +0000 (07:46 +0000)]
iio: hid-sensors-prox: Make proximity channel indexed
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.
Ricardo Ribalda [Fri, 1 Nov 2024 07:46:27 +0000 (07:46 +0000)]
iio: hid-sensors: Add proximity and attention IDs
The HID Usage Table at https://usb.org/sites/default/files/hut1_5.pdf
reserves:
- 0x4b2 for Human Proximity Range
Distance between a human and the computer. Default unit of
measure is meters;
https://www.usb.org/sites/default/files/hutrr39b_0.pdf
- 0x4bd for Human Attention Detected
Human-Presence sensors detect the presence of humans in the sensor’s
field-of-view using diverse and evolving technologies. Some presence
sensors are implemented with low resolution video cameras, which can
additionally track a subject’s attention (i.e. if the
user is ‘looking’ at the system with the integrated sensor).
A Human-Presence sensor, providing a Host with the user’s attention
state, allows the Host to optimize its behavior. For example, to
brighten/dim the system display, based on the user’s attention to the
system (potentially prolonging battery life). Default unit is
true/false;
https://www.usb.org/sites/default/files/hutrr107-humanpresenceattention_1.pdf
Javier Carrasco [Wed, 30 Oct 2024 23:09:58 +0000 (00:09 +0100)]
iio: light: veml6070: add support for integration time
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.
Axel Haslam [Thu, 31 Oct 2024 07:17:46 +0000 (08:17 +0100)]
iio: dac: ad5791: Use devm_iio_device_register
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>
Axel Haslam [Thu, 31 Oct 2024 07:17:45 +0000 (08:17 +0100)]
iio: dac: ad5791: Use devm_regulator_get_enable_read_voltage
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>
Axel Haslam [Thu, 31 Oct 2024 07:17:44 +0000 (08:17 +0100)]
iio: dac: ad5791: Add reset, clr and ldac gpios
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.
Axel Haslam [Thu, 31 Oct 2024 07:17:43 +0000 (08:17 +0100)]
iio: dac: ad5791: Include chip_info in device match tables
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>
Axel Haslam [Thu, 31 Oct 2024 07:17:42 +0000 (08:17 +0100)]
dt-bindings: iio: dac: ad5791: Add required voltage supplies
Vcc, iovcc, vrefp, and vrefn are needed for the DAC to work.
Add them as required bindings for ad5791.
Reviewed-by: David Lechner <dlechner@baylibre.com> Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Signed-off-by: Axel Haslam <ahaslam@baylibre.com> Link: https://patch.msgid.link/20241031071746.848694-3-ahaslam@baylibre.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Depending on board layout, the ad57xx may need control of reset, clear,
and ldac pins by the host driver. Add optional bindings for these gpios.
Reviewed-by: David Lechner <dlechner@baylibre.com> Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Signed-off-by: Axel Haslam <ahaslam@baylibre.com> Link: https://patch.msgid.link/20241031071746.848694-2-ahaslam@baylibre.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Angelo Dureghello [Mon, 28 Oct 2024 21:45:34 +0000 (22:45 +0100)]
iio: dac: ad3552r: add high-speed platform driver
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.
Linus Torvalds [Sun, 3 Nov 2024 20:25:05 +0000 (10:25 -1000)]
Merge tag 'mm-hotfixes-stable-2024-11-03-10-50' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
Pull misc fixes from Andrew Morton:
"17 hotfixes. 9 are cc:stable. 13 are MM and 4 are non-MM.
The usual collection of singletons - please see the changelogs"
* tag 'mm-hotfixes-stable-2024-11-03-10-50' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm:
mm: multi-gen LRU: use {ptep,pmdp}_clear_young_notify()
mm: multi-gen LRU: remove MM_LEAF_OLD and MM_NONLEAF_TOTAL stats
mm, mmap: limit THP alignment of anonymous mappings to PMD-aligned sizes
mm: shrinker: avoid memleak in alloc_shrinker_info
.mailmap: update e-mail address for Eugen Hristev
vmscan,migrate: fix page count imbalance on node stats when demoting pages
mailmap: update Jarkko's email addresses
mm: allow set/clear page_type again
nilfs2: fix potential deadlock with newly created symlinks
Squashfs: fix variable overflow in squashfs_readpage_block
kasan: remove vmalloc_percpu test
tools/mm: -Werror fixes in page-types/slabinfo
mm, swap: avoid over reclaim of full clusters
mm: fix PSWPIN counter for large folios swap-in
mm: avoid VM_BUG_ON when try to map an anon large folio to zero page.
mm/codetag: fix null pointer check logic for ref and tag
mm/gup: stop leaking pinned pages in low memory conditions