mfd: 88pm886: Constify struct regmap_irq_chip and some other structures
'struct regmap_irq_chip' is not modified in this driver.
Constifying this structure moves some data to a read-only section, so
increase overall security, especially when the structure holds some
function pointers.
While at it, also constify some other structures.
On a x86_64, with allmodconfig, as an example:
Before:
======
text data bss dec hex filename
5032 3304 64 8400 20d0 drivers/mfd/88pm886.o
After:
=====
text data bss dec hex filename
5800 2536 64 8400 20d0 drivers/mfd/88pm886.o
The register space described by DT node of compatible
mediatek,mt8365-infracfg-nao exposes a variety of unrelated registers,
including registers for controlling bus protection on the MT8365 SoC,
which is used by the power domain controller through a syscon.
dt-bindings: mfd: Correct indentation and style in DTS example
DTS example in the bindings should be indented with 2- or 4-spaces and
aligned with opening '- |', so correct any differences like 3-spaces or
mixtures 2- and 4-spaces in one binding. While re-indenting, drop
unused labels.
No functional changes here, but saves some comments during reviews of
new patches built on existing code.
Frank Wunderlich [Tue, 22 Apr 2025 13:24:28 +0000 (15:24 +0200)]
dt-bindings: mfd: syscon: Add mt7988-topmisc
Add compatible for Mediatek mt7988 topmisc syscon.
This hardware block contains 2 functional blocks
- a powercontroller which is not needed (switched by atf)
- a multiplexer for high-speed Combo-Phy
This compatible is only for the multiplexer part.
Signed-off-by: Frank Wunderlich <frank-w@public-files.de> Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Link: https://lore.kernel.org/r/20250422132438.15735-6-linux@fw-web.de Signed-off-by: Lee Jones <lee@kernel.org>
André Draszik [Wed, 9 Apr 2025 20:37:53 +0000 (21:37 +0100)]
MAINTAINERS: add myself as reviewer for Samsung S2M MFD
I'm working on a Samsung device which includes this MFD and would like
to be Cc'ed to further contributions and help on reviewing them. Add me
as reviewer.
André Draszik [Wed, 9 Apr 2025 20:37:41 +0000 (21:37 +0100)]
mfd: sec-common: Use sizeof(*var), not sizeof(struct type_of_var)
Using sizeof(*var) is generally preferred over using the size of its
open-coded type when allocating memory.
This helps avoiding bugs when the variable type changes but the memory
allocation isn't updated, and it simplifies renaming of the struct if
ever necessary.
André Draszik [Wed, 9 Apr 2025 20:37:38 +0000 (21:37 +0100)]
mfd: sec-i2c: Rework platform data and regmap instantiating
Instead of a large open-coded switch statement, just add both regmap
config and device type to the OF match data. This allows us to have all
related information in one place, and avoids a long switch() statement.
André Draszik [Wed, 9 Apr 2025 20:37:36 +0000 (21:37 +0100)]
mfd: sec-irq: s2dos05 doesn't support interrupts
The commit bf231e5febcf ("mfd: sec-core: Add support for the Samsung
s2dos05") adding s2dos05 support didn't add anything related to IRQ
support, so I assume this works without IRQs.
Rather than printing a warning message in sec_irq_init() due to the
missing IRQ number, or returning an error due to a missing irq chip
regmap, just return early explicitly.
This will become particularly important once errors from sec_irq_init()
aren't ignored anymore in an upcoming patch and helps the reader of
this code while reasoning about what the intention might be here.
André Draszik [Wed, 9 Apr 2025 20:37:35 +0000 (21:37 +0100)]
mfd: sec-i2c: s2dos05/s2mpu05: Use explicit regmap config and drop default
When support for PMICs without compatibles was removed in
commit f736d2c0caa8 ("mfd: sec: Remove PMICs without compatibles"),
sec_regmap_config effectively became an orphan, because S5M8763X was
the only user left of it before removal, using the default: case of the
switch statement.
When s2dos05 and s2mpu05 support was added in commit bf231e5febcf
("mfd: sec-core: Add support for the Samsung s2dos05") and commit ed33479b7beb ("mfd: sec: Add support for S2MPU05 PMIC"), they ended up
using that orphaned regmap_config in a non-obvious way due to the
default: case of the device type switch matching statement taking
effect again.
To make things more obvious, and to help the reader of this code while
reasoning about what the intention might be here, and to ensure future
additions to support new devices in this driver don't forget to add a
regmap config, add an explicit regmap config for these two devices, and
completely remove the generic regmap config as it becomes an orphan
again that shouldn't be used by any device.
Note that this commit doesn't fix the issue that s2dos05_regmap_config
ands2mpu05_regmap_config really are incomplete, but I have no
documentation on them.
André Draszik [Wed, 9 Apr 2025 20:37:33 +0000 (21:37 +0100)]
mfd: sec-i2c: Sort struct of_device_id entries and the device type switch
Sort struct of_device_id entries and the device type switch in _probe()
alphabetically, which makes it easier to find the right place where to
insert new entries in the future.
André Draszik [Wed, 9 Apr 2025 20:37:31 +0000 (21:37 +0100)]
mfd: sec: Merge separate core and irq modules
There is no reason to have these two kernel modules separate. Having
them merged into one kernel module also slightly reduces memory
consumption and module load times a little.
André Draszik [Wed, 9 Apr 2025 20:37:30 +0000 (21:37 +0100)]
mfd: sec: Add support for S2MPG10 PMIC
Add support for Samsung's S2MPG10 PMIC, which is a Power Management IC
for mobile applications with buck converters, various LDOs, power
meters, RTC, clock outputs, and additional GPIOs interfaces.
Contrary to existing Samsung S2M series PMICs supported, communication
is not via I2C, but via the Samsung ACPM firmware.
André Draszik [Wed, 9 Apr 2025 20:37:29 +0000 (21:37 +0100)]
mfd: sec: Split into core and transport (i2c) drivers
As a preparation for adding support for Samsung's S2MPG10, which is
connected via SPEEDY / ACPM rather than I2C, split out (move) all
I2C-specific driver code into its own kernel module, sec-i2c, and
make the existing sec-core module be just the transport-agnostic core
driver kernel module.
At the same time, update all defconfigs that reference the old kconfig
symbol name.
While at it, also update file header comments and module description(s)
to drop references to 'mfd', and update comments to be C-style, not
C++.
André Draszik [Wed, 9 Apr 2025 20:37:28 +0000 (21:37 +0100)]
mfd: sec: Move private internal API to internal header
sec_irq_init() is an internal API for the core driver, and doesn't
belong into the public header.
Due to an upcoming split of the driver into a core and i2c driver,
we'll also be adding more internal APIs, which again shouldn't be in
the public header.
André Draszik [Wed, 9 Apr 2025 20:37:27 +0000 (21:37 +0100)]
mfd: sec: Update includes to add missing and remove superfluous ones
This driver misses to include some of the respective headers of some of
the APIs used. It also includes headers that aren't needed (e.g. due to
previous driver rework where includes weren't updated).
It is good practice to directly include all headers used, which avoids
implicit dependencies and spurious build breakage if someone rearranged
headers, as this could cause the implicit includes to be dropped.
Include the relevant headers explicitly and drop superfluous ones.
André Draszik [Wed, 9 Apr 2025 20:37:25 +0000 (21:37 +0100)]
mfd: sec-core: Drop non-existing forward declarations
sec_irq_resume() was removed in commit 6445b84abf91 ("mfd: Add s2mps11
irq driver") and sec_irq_exit() in commit 3dc6f4aaafbe ("mfd: sec: Use
devm_mfd_add_devices and devm_regmap_add_irq_chip") while the
prototypes were left. They should be removed.
André Draszik [Wed, 9 Apr 2025 20:37:22 +0000 (21:37 +0100)]
dt-bindings: mfd: samsung,s2mps11: add s2mpg10
The Samsung S2MPG10 PMIC is similar to the existing PMICs supported by
this binding.
It is a Power Management IC for mobile applications with buck
converters, various LDOs, power meters, RTC, clock outputs, and
additional GPIOs interfaces.
Unlike other Samsung PMICs, communication is not via I2C, but via the
Samsung ACPM firmware, it therefore doesn't need a 'reg' property but
needs to be a child of the ACPM firmware node instead.
S2MPG10 can also act as a system power controller allowing
implementation of a true cold-reset of the system.
Support for the other components like regulators and power meters will
be added in subsequent future patches.
Artur Weber [Sun, 16 Mar 2025 18:18:52 +0000 (19:18 +0100)]
mfd: bcm590xx: Drop unused "id" member of bcm590xx struct
The "id" member of the bcm590xx struct is unused and will be confusing
once we add an actual PMU ID storage value. Drop it; a replacement
will be introduced in a future commit.
Lukas Bulwahn [Tue, 25 Mar 2025 09:21:59 +0000 (10:21 +0100)]
MAINTAINERS: Adjust the file entry in SIEMENS IPC LED DRIVERS
Commit 835a0c10d33b ("leds: Rename simple directory to simatic") renames
the driver's directory to drivers/leds/simatic, but misses to adjust the
SIEMENS IPC LED DRIVERS section in MAINTAINERS.
Hence, ./scripts/get_maintainer.pl --self-test=patterns complains about a
broken reference. Adjust the file entry to this renaming.
Wolfram Sang [Tue, 18 Mar 2025 09:12:12 +0000 (10:12 +0100)]
mfd: tps65010: Use per-client debugfs directory
The I2C core now provides a debugfs entry for each client. Let this
driver use it instead of the root directory. Further improvements by
this change: automatic support of multiple instances.
Wolfram Sang [Tue, 18 Mar 2025 09:13:41 +0000 (10:13 +0100)]
mfd: aat2870: Use per-client debugfs directory
The I2C core now provides a debugfs entry for each client. Let this
driver use it instead of the custom directory in debugfs root. Further
improvements by this change: automatic clean up on removal, support of
multiple instances.
Lee Jones [Thu, 22 May 2025 14:49:34 +0000 (15:49 +0100)]
Merge branches 'ib-firmware-mfd-6.16', 'ib-mfd-clocksource-pwm-6.16', 'ib-mfd-gpio-nvmem-6.16', 'ib-mfd-regulator-6.16' and 'ib-mfd-regulator-6.16-1' into ibs-for-mfd-merged
Artur Weber [Thu, 15 May 2025 14:16:35 +0000 (16:16 +0200)]
regulator: bcm590xx: Add support for BCM59054 regulators
The BCM59056 and BCM59054 are very similar in terms of regulators. Add
the register definitions for the BCM59054 and enable support for it in
the driver.
Artur Weber [Thu, 15 May 2025 14:16:34 +0000 (16:16 +0200)]
regulator: bcm590xx: Rename BCM59056-specific data as such
Previously, the driver used the BCM590XX prefix for register data
specific to the BCM59056. As we will be introducing other regulators
to this driver as well, make the BCM59056-specific values use the
BCM59056 prefix.
Artur Weber [Thu, 15 May 2025 14:16:33 +0000 (16:16 +0200)]
regulator: bcm590xx: Store regulator descriptions in table
Instead of filling in the regulator description programatically,
store the data in a struct. This will make it a bit nicer to
introduce support for other BCM590xx chips besides the BCM59056.
To do this, add a new struct type, bcm590xx_reg_data, to store
all of the necessary information. Drop the old IS_LDO, IS_GPLDO...
macros in favor of the "type" field in this struct. Adapt the
old bcm590xx_reg struct to the new types.
Artur Weber [Thu, 15 May 2025 14:16:31 +0000 (16:16 +0200)]
mfd: bcm590xx: Add PMU ID/revision parsing function
The BCM590xx PMUs have two I2C registers for reading the PMU ID
and revision. The revision is useful for subdevice drivers, since
different revisions may have slight differences in behavior (for
example - BCM59054 has different regulator configurations for
revision A0 and A1).
Check the PMU ID register and make sure it matches the DT compatible.
Fetch the digital and analog revision from the PMUREV register
so that it can be used in subdevice drivers.
Also add some known revision values to bcm590xx.h, for convenience
when writing subdevice drivers.
Artur Weber [Thu, 15 May 2025 14:16:30 +0000 (16:16 +0200)]
mfd: bcm590xx: Add support for multiple device types + BCM59054 compatible
The BCM59054 is another chip from the BCM590xx line of PMUs, commonly
used on devices with the BCM21664/BCM23550 chipsets.
Prepare the BCM590xx driver for supporting other devices by adding the
PMUID register values for supported chip types and store them in the
MFD data struct as "pmu_id". (These will be checked against the actual
PMUID register values in a later commit.)
Then, add a DT compatible for the BCM59054, and provide the PMU ID as
OF match data.
Artur Weber [Thu, 15 May 2025 14:16:28 +0000 (16:16 +0200)]
dt-bindings: mfd: brcm,bcm59056: Convert to YAML
Convert devicetree bindings for the Broadcom BCM59056 PMU MFD from
TXT to YAML format. This patch does not change any functionality;
the bindings remain the same.
The bindings have been split into two parts: the MFD binding and
a separate binding for the regulator node, to simplify the addition
of other models later (which have different regulators).
Add support for STM32MP25 SoC. A new compatible has been added to the
dt-bindings. It represents handle new features, registers and bits
diversity.
It isn't used currently in the driver, as matching is done by retrieving
MFD parent data.
New dedicated capture/compare channels has been added: e.g. a new compare
register for channel 2. Some controls (polarity / cc channel enable) are
handled in CCMR register on this new variant (instead of wavepol bit).
So, Low-power timer can now have up to two PWM outputs. Use device data
from the MFD parent to configure the number of PWM channels e.g. 'npwm'.
Update current get_state() and apply() ops to support either:
- one PWM channel (as on older revision, or LPTIM5 on STM32MP25)
- two PWM channels (e.g. LPTIM1/2/3/4 on STM32MP25 that has the full
feature set)
Introduce new routines to manage common prescaler, reload register and
global enable bit.
clocksource/drivers/stm32-lptimer: Add support for stm32mp25
On stm32mp25, DIER (former IER) must only be modified when the lptimer
is enabled. On earlier SoCs, it must be only be modified when it is
disabled. There's also a new DIEROK flag, to ensure register access
has completed.
Add a new "set_evt" routine to be used on stm32mp25, called depending
on the version register, read by the MFD core (LPTIM_VERR).
Add support for STM32MP25 SoC.
A new hardware configuration register (HWCFGR2) has been added, to gather
number of capture/compare channels, autonomous mode and input capture
capability. The full feature set is implemented in LPTIM1/2/3/4. LPTIM5
supports a smaller set of features. This can now be read from HWCFGR
registers.
Add new registers to the stm32-lptimer.h: CCMR1, CCR2, HWCFGR1/2 and VERR.
Update the stm32_lptimer data struct so signal the number of
capture/compare channels to the child devices.
Also Remove some unused bit masks (CMPOK_ARROK / CMPOKCF_ARROKCF).
dt-bindings: mfd: stm32-lptimer: Add support for stm32mp25
Add a new stm32mp25 compatible to stm32-lptimer dt-bindings, to support
STM32MP25 SoC. Some features has been updated or added to the low-power
timer:
- new capture compare channels
- up to two PWM channels
- PWM input capture
- peripheral interconnect in stm32mp25 has been updated (new triggers).
- registers/bits has been added or revisited (IER access).
So introduce a new compatible to handle this diversity.
André Draszik [Fri, 9 May 2025 13:22:41 +0000 (14:22 +0100)]
nvmem: max77759: Add Maxim MAX77759 NVMEM driver
The Maxim MAX77759 is a companion PMIC for USB Type-C applications and
includes Battery Charger, Fuel Gauge, temperature sensors, USB Type-C
Port Controller (TCPC), NVMEM, and a GPIO expander.
This driver exposes the non volatile memory using the platform device
registered by the core MFD driver.
André Draszik [Fri, 9 May 2025 13:22:40 +0000 (14:22 +0100)]
gpio: max77759: Add Maxim MAX77759 gpio driver
The Maxim MAX77759 is a companion PMIC for USB Type-C applications and
includes Battery Charger, Fuel Gauge, temperature sensors, USB Type-C
Port Controller (TCPC), NVMEM, and a GPIO expander.
This driver supports the GPIO functions using the platform device
registered by the core MFD driver.
André Draszik [Fri, 9 May 2025 13:22:39 +0000 (14:22 +0100)]
mfd: max77759: Add Maxim MAX77759 core driver
The Maxim MAX77759 is a companion PMIC for USB Type-C applications and
includes Battery Charger, Fuel Gauge, temperature sensors, USB Type-C
Port Controller (TCPC), NVMEM, and a GPIO expander.
Fuel Gauge and TCPC have separate and independent I2C addresses,
register maps, and interrupt lines and are therefore excluded from the
MFD core device driver here.
The GPIO and NVMEM interfaces are accessed via specific commands to the
built-in microprocessor. This driver implements an API that client
drivers can use for accessing those.
André Draszik [Tue, 25 Mar 2025 08:27:04 +0000 (08:27 +0000)]
dt-bindings: mfd: Add max77759 binding
The Maxim MAX77759 is a companion PMIC for USB Type-C applications and
includes Battery Charger, Fuel Gauge, temperature sensors, USB Type-C
Port Controller (TCPC), NVMEM, and a GPIO expander.
André Draszik [Tue, 25 Mar 2025 08:27:03 +0000 (08:27 +0000)]
dt-bindings: nvmem: Add max77759 binding
The Maxim MAX77759 is a companion PMIC for USB Type-C applications and
includes Battery Charger, Fuel Gauge, temperature sensors, USB Type-C
Port Controller (TCPC), NVMEM, and a GPIO expander.
André Draszik [Tue, 25 Mar 2025 08:27:02 +0000 (08:27 +0000)]
dt-bindings: gpio: Add max77759 binding
The Maxim MAX77759 is a companion PMIC for USB Type-C applications and
includes Battery Charger, Fuel Gauge, temperature sensors, USB Type-C
Port Controller (TCPC), NVMEM, and a GPIO expander.
Lee Jones [Thu, 1 May 2025 11:42:38 +0000 (12:42 +0100)]
Merge tag 'samsung-drivers-6.16' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/krzk/linux into ib-firmware-mfd-6.16
Samsung SoC drivers for v6.16
Several improvements to Exynos ACPM (Alive Clock and Power Manager)
driver:
1. Handle communication timeous better.
2. Avoid sleeping, so users (PMIC) can still transfer during system
shutdown.
3. Fix reading longer messages from them firmware.
4. Deferred probe improvements.
5. Model the user of ACPM - PMIC - a as child device and export
devm_acpm_get_by_node() for such use case.
firmware: exynos-acpm: Correct kerneldoc and use typical np argument name
Correct kerneldoc warnings after commit a8dc26a0ec43 ("firmware:
exynos-acpm: introduce devm_acpm_get_by_node()") changed the function
prototype:
exynos-acpm.c:672: warning: Function parameter or struct member 'acpm_np' not described in 'acpm_get_by_node'
exynos-acpm.c:672: warning: expecting prototype for acpm_get_by_phandle(). Prototype was for acpm_get_by_node() instead
While touching the lines, change the name of device_node pointer to
'np' to match convention.
The ROHM BD96806 is from the software perspective almost identical to
the ROHM BD96802. The main difference is different voltage tuning
ranges. Add support differentiating these PMICs based on the compatible,
and invoking the regulator driver with correct IC type.
The ROHM BD96805 is from the software perspective almost identical to
the ROHM BD96801. The main difference is different voltage tuning
ranges. Add support differentiating these PMICs based on the compatible,
and invoking the regulator driver with correct IC type.
The ROHM BD96802 PMIC is primarily intended to be used as a companion
PMIC extending the capabilities of the BD96802 but it can be used on
it's own as well. When used as a companion PMIC, the start-up and
shut-down sequences are usually intitiated by the master PMIC using IF
pins.
The BD96802 looks from the digital interface point of view pretty much
like a reduced version of BD96801. It includes only 2 BUCKs and provides
the same error protection/detection mechanisms as the BD96801. Also, the
voltage control logic is same up to the register addresses.
Add support for controlling BD96802 using the BD96801 driver.
The ROHM BD96802 PMIC looks from software point of view a lot like ROHM BD96801 PMIC. Just with reduced number of voltage rails. Both PMICs
provide two physical IRQ lines referred as INTB and ERRB and contain
blocks implementing regulator controls and a weatchdog. Hence it makes
sense to use same MFD core for both PMICs.
Add support for ROHM BD96802 scalable companion PMIC to the BD96801
core driver.
Matti Vaittinen [Tue, 8 Apr 2025 08:45:34 +0000 (11:45 +0300)]
regulator: bd96801: Drop IC name from the IRQ resources
The resources generated in the BD96801 MFD driver are only visible to
the sub-drivers whose resource fields they are added. This makes
abbreviating the resource name with the IC name pointless. It just adds
confusion in those sub-drivers which do not really care the exact model
that generates the IRQ but just want to know the purpose IRQ was
generated for. Thus, as a preparatory fix to simplify adding support for
ROHM BD96802 PMIC the IC name "bd96801-" prefix was dropped from the IRQ
resource names. Adapt the regulator driver to this change.
Matti Vaittinen [Tue, 8 Apr 2025 08:45:16 +0000 (11:45 +0300)]
mfd: bd96801: Drop IC name from the regulator IRQ resources
The resources generated in the BD96801 MFD driver are only visible to
the sub-drivers whose resource fields they are added. This makes
abbreviating the resource name with the IC name pointless. It just adds
confusion in those sub-drivers which do not really care the exact model
that generates the IRQ but just want to know the purpose IRQ was
generated for. This is a preparatory fix to simplify adding support for
ROHM BD96802 PMIC.
Prepare for adding support for BD96802 which is very similar to BD96801.
Separate chip specific data into own structure which can be picked based
on the type of the IC.
BD96802Qxx-C is an automotive grade configurable Power Management
Integrated Circuit supporting Functional Safety features for application
processors, SoCs and FPGAs. BD96802 is controlled via I2C, provides two
interrupt lines and has two controllable buck regulators.
BD96802Qxx-C is an automotive grade configurable Power Management
Integrated Circuit supporting Functional Safety features for application
processors, SoCs and FPGAs. BD96802 is controlled via I2C, provides two
interrupt lines and has two controllable buck regulators.
The BD96802 belongs to the family of ROHM Scalable PMICs and is intended
to be used as a companion PMIC for the BD96801.
To allow ACPM clients to simply be children of the ACPM node in DT,
they need to be able to get the ACPM handle based on that ACPM node
directly.
Add an API to allow them to do so, devm_acpm_get_by_node().
At the same time, the previous approach of acquiring the ACPM handle
via a DT phandle is now obsolete and we can remove
devm_acpm_get_by_phandle(), which was there to facilitate that. There
are no existing or anticipated upcoming users of that API, because all
clients should be children of the ACPM node going forward.
Note that no DTs have been merged that use the old approach, so doing
this API change in this driver now will not affect any existing DTs or
client drivers.
André Draszik [Wed, 19 Mar 2025 05:38:24 +0000 (05:38 +0000)]
firmware: exynos-acpm: silence EPROBE_DEFER error on boot
This driver emits error messages when client drivers are trying to get
an interface handle to this driver here before this driver has
completed _probe().
Given this driver returns -EPROBE_DEFER in that case, this is not an
error and shouldn't be emitted to the log, similar to how
dev_err_probe() behaves, so just remove them.
This change also allows us to simplify the logic around releasing of
the acpm_np handle.
André Draszik [Wed, 19 Mar 2025 05:38:23 +0000 (05:38 +0000)]
firmware: exynos-acpm: fix reading longer results
ACPM commands that return more than 8 bytes currently don't work
correctly, as this driver ignores any such returned bytes.
This is evident in at least acpm_pmic_bulk_read(), where up to 8
registers can be read back and those 8 register values are placed
starting at &xfer->rxd[8].
The reason is that xfter->rxlen is initialized with the size of a
pointer (8 bytes), rather than the size of the byte array that pointer
points to (16 bytes)
Update the code such that we set the number of bytes expected to be the
size of the rx buffer.
Note1: While different commands have different lengths rx buffers, we
have to specify the same length for all rx buffers since acpm_get_rx()
assumes they're all the same length.
Note2: The different commands also have different lengths tx buffers,
but before switching the code to use the minimum possible length, some
more testing would have to be done to ensure this works correctly in
all situations. It seems wiser to just apply this fix here without
additional logic changes for now.
André Draszik [Tue, 25 Mar 2025 09:46:07 +0000 (09:46 +0000)]
firmware: exynos-acpm: use ktime APIs for timeout detection
acpm_dequeue_by_polling() uses a loop counter and assumes that each
iteration of the loop takes 20us. It may take longer, though, because
usleep_range() may sleep a different amount.
Switch to using ktime_get() / ktime_before() to detect the timeout
condition more reliably.
This change also makes the code easier to follow and it allows us to
adjust the sleep if necessary, without having to adjust the loop
counter exit condition.
tools/include: make uapi/linux/types.h usable from assembly
The "real" linux/types.h UAPI header gracefully degrades to a NOOP when
included from assembly code.
Mirror this behaviour in the tools/ variant.
Test for __ASSEMBLER__ over __ASSEMBLY__ as the former is provided by the
toolchain automatically.
Reported-by: Mark Brown <broonie@kernel.org> Closes: https://lore.kernel.org/lkml/af553c62-ca2f-4956-932c-dd6e3a126f58@sirena.org.uk/ Fixes: c9fbaa879508 ("selftests: vDSO: parse_vdso: Use UAPI headers instead of libc headers") Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de> Link: https://patch.msgid.link/20250321-uapi-consistency-v1-1-439070118dc0@linutronix.de Signed-off-by: Mark Brown <broonie@kernel.org> Reviewed-by: Mark Brown <broonie@kernel.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>