linux-2.6-block.git
4 months agointel_th: Remove redundant initialization of pointer outp
Colin Ian King [Mon, 29 Apr 2024 13:01:12 +0000 (16:01 +0300)]
intel_th: Remove redundant initialization of pointer outp

The pointer outp is being initialized with a value that is never
read. All the reads of outp occur after outp has neen set to an
appropriate value rather than using the first value is initialized
with. The assignment is redundant and can be removed.

Cleans up clang scan warning:
drivers/hwtracing/intel_th/sth.c:73:15: warning: Value stored to
'outp' during its initialization is never read [deadcode.DeadStores]

Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20240429130119.1518073-9-alexander.shishkin@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 months agointel_th: Convert sprintf/snprintf to sysfs_emit
Li Zhijian [Mon, 29 Apr 2024 13:01:11 +0000 (16:01 +0300)]
intel_th: Convert sprintf/snprintf to sysfs_emit

Per filesystems/sysfs.rst, show() should only use sysfs_emit()
or sysfs_emit_at() when formatting the value to be returned to user space.

coccinelle complains that there are still a couple of functions that use
snprintf(). Convert them to sysfs_emit().

sprintf() will be converted as weel if they have.

Generally, this patch is generated by
make coccicheck M=<path/to/file> MODE=patch \
COCCI=scripts/coccinelle/api/device_attr_show.cocci

No functional change intended

Signed-off-by: Li Zhijian <lizhijian@fujitsu.com>
Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20240429130119.1518073-8-alexander.shishkin@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 months agointel_th: Constify the struct device_type usage
Ricardo B. Marliere [Mon, 29 Apr 2024 13:01:10 +0000 (16:01 +0300)]
intel_th: Constify the struct device_type usage

Since commit aed65af1cc2f ("drivers: make device_type const"), the driver
core can properly handle constant struct device_type. Move the
intel_th_source_device_type, intel_th_output_device_type,
intel_th_switch_device_type and intel_th_device_type variables to be
constant structures as well, placing it into read-only memory which can not
be modified at runtime.

Signed-off-by: "Ricardo B. Marliere" <ricardo@marliere.net>
Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20240429130119.1518073-7-alexander.shishkin@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 months agointel_th: Convert to platform remove callback returning void
Uwe Kleine-König [Mon, 29 Apr 2024 13:01:09 +0000 (16:01 +0300)]
intel_th: Convert to platform remove callback returning void

The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is ignored (apart
from emitting a warning) and this typically results in resource leaks.

To improve here there is a quest to make the remove callback return
void. In the first step of this quest all drivers are converted to
.remove_new(), which already returns void. Eventually after all drivers
are converted, .remove_new() will be renamed to .remove().

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20240429130119.1518073-6-alexander.shishkin@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 months agostm class: sys-t: Improve ftrace source handling
Mikhail Lappo [Mon, 29 Apr 2024 13:01:08 +0000 (16:01 +0300)]
stm class: sys-t: Improve ftrace source handling

Package messages from ftrace source with SyS-T Structured Binary Data
(later SBD) header and 64-bit ID. This provides modification-free
compatibility between ftrace and SyS-T arguments structure by applying
0xFFFF mask on message ID.

This happens due to the fact that SBD and ftrace structures have the
same principle of data storage: <header><args binary blob>.

The headers are bit-to-bit compatible and both contain event/catalog ID
with the exception, that ftrace header contains more fields within 64
bits which needs to be masked during encoding process, since SBD
standard doesn't support mask of ID field.

        0       15  16   23  24     31  32   39  40  63
ftrace: <event_id>  <flags>  <preempt>  <-pid->  <---->
SBD:    <------- msg_id ------------------------------>

Signed-off-by: Mikhail Lappo <miklelappo@gmail.com>
Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20240429130119.1518073-5-alexander.shishkin@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 months agostm class: Propagate source type to protocols
Mikhail Lappo [Mon, 29 Apr 2024 13:01:07 +0000 (16:01 +0300)]
stm class: Propagate source type to protocols

Pass stm source type via stm_write() to allow different handling on
protocol level.

The measure above should allow protocol level encoder to differentiate
and accordingly pack the messages. As an example SyS-T might get use of
ftrace message ID's and instead of applying regular header, pack them
as SyS-T catalog or SyS-T Structured Binary Data message to allow proper
decoding on the other side.

Signed-off-by: Mikhail Lappo <miklelappo@gmail.com>
Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20240429130119.1518073-4-alexander.shishkin@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 months agostm class: Add source type
Mikhail Lappo [Mon, 29 Apr 2024 13:01:06 +0000 (16:01 +0300)]
stm class: Add source type

Currently kernel HW tracing infrastrtucture and specifically its SyS-T
part treats all source data in the same way. Treating and encoding
different trace data sources differently might allow decoding software
to make use of e.g. ftrace event ids by converting them to a SyS-T
message catalog.

The solution is to keep source type stored within stm_source_data
structure to allow different handling by stm output/protocol.
Currently we only differentiate between STM_USER and STM_FTRACE sources.

Signed-off-by: Mikhail Lappo <miklelappo@gmail.com>
Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20240429130119.1518073-3-alexander.shishkin@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 months agostm class: Fix a double free in stm_register_device()
Dan Carpenter [Mon, 29 Apr 2024 13:01:05 +0000 (16:01 +0300)]
stm class: Fix a double free in stm_register_device()

The put_device(&stm->dev) call will trigger stm_device_release() which
frees "stm" so the vfree(stm) on the next line is a double free.

Fixes: 389b6699a2aa ("stm class: Fix stm device initialization order")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Reviewed-by: Amelie Delaunay <amelie.delaunay@foss.st.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Link: https://lore.kernel.org/r/20240429130119.1518073-2-alexander.shishkin@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 months agoMerge tag 'iio-for-6.10b-take2' of https://git.kernel.org/pub/scm/linux/kernel/git...
Greg Kroah-Hartman [Sat, 4 May 2024 07:48:52 +0000 (09:48 +0200)]
Merge tag 'iio-for-6.10b-take2' of https://git./linux/kernel/git/jic23/iio into char-misc-next

Jonathan writes:

IIO: 2nd set of new device support, features and cleanup for 6.10 (take 2)

The usual mixed bag from towards the end of the cycle.
Changes since take 1. Fixed the fixes tag and indeed fixed a rebase I
messed up on the same fix.

New devices support
===================

invensense,icm42600
- Support the ICM-42686-P a high range device going up to 32g and 4000 dps

New features
============

adi,ad7944
- Add support for chain mode in which many ADCs may be daisy chained and
  read out via a single long read.
adi,ad9467/backend library
- Add bus tuning related interfaces.
adi,axi-adc
- Add control for the AXI clock - seems always enabled early in boot for other
  reasons, but the driver should not rely on that..

Cleanups and minor or late breaking fixes
=========================================

Micrsoft/ACPI mount matrix handling.
- Replace several implementations of the Microsoft defined ROTM ACPI
  method with a single one.
multiple drivers
- Don't call the result of wait_for_completion() timeout as it's
  more accurate as time_left.
adi,ad7266
- Stop setting the iio_dev->masklength as it's done by the IIO core and
  should not be set from drivers.
adi,ad799x
- Some checkpatch type fixes.
adi,ad9839
- Ensure compelte MU_CNT1 is written during lock phase.
adi,axi-dac
- Fix inverted parameter.
adi,adis16475
- Drop documentation of non existent sysfs files.
avago,apds9306
- Fix an off by one error that overly restricts the range of persistence
  and adaptive thresholds that the driver accepts.
freescale,mxs-lradc
- Stop setting the iio_dev->masklength as it's done by the IIO core and
  should not be set from drivers.
invensense,timestamp library
- Fix timestamp vs interupt alignment and aovid soms glitches that
  occured when switching sampling frequency.
microchip,mcp3564
- Make use of device_for_each_child_node_scoped() to allow early release
  without manual fwnode_handle_put().
microchip,mcp9600
- Allow for negative temperatures.
microchip,pac1934
- Avoid an out of bounds array index.
richtek,rtq6056
- Use iio_device_claim_direct_scoped() to automate lock release and simplify
  the code.
sensortek,stk3110
- Drop a likely incorrect ACPI ID. No known users of this ID and it's
  not a valid ACPI ID.
ti,ads1015
- Make use of device_for_each_child_node_scoped() to allow early release
  without manual fwnode_handle_put().

* tag 'iio-for-6.10b-take2' of https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio: (41 commits)
  iio: temperature: mcp9600: Fix temperature reading for negative values
  iio: adc: PAC1934: fix accessing out of bounds array index
  iio: invensense: fix timestamp glitches when switching frequency
  iio: invensense: fix interrupt timestamp alignment
  iio: dac: ad9739a: write complete MU_CNT1 register during lock
  iio: pressure: zpa2326: use 'time_left' variable with wait_for_completion_interruptible_timeout()
  iio: adc: twl6030-gpadc: use 'time_left' variable with wait_for_completion_interruptible_timeout()
  iio: adc: stm32-dfsdm-adc: use 'time_left' variable with wait_for_completion_interruptible_timeout()
  iio: adc: stm32-adc: use 'time_left' variable with wait_for_completion_interruptible_timeout()
  iio: adc: intel_mrfld_adc: use 'time_left' variable with wait_for_completion_interruptible_timeout()
  iio: adc: fsl-imx25-gcq: use 'time_left' variable with wait_for_completion_interruptible_timeout()
  iio: adc: exynos_adc: use 'time_left' variable with wait_for_completion_timeout()
  iio: adc: ad_sigma_delta: use 'time_left' variable with wait_for_completion_timeout()
  iio: adc: ti-ads1015: use device_for_each_child_node_scoped()
  iio: adc: ad799x: Prefer to use octal permission
  iio: adc: ad799x: add blank line to avoid warning messages
  iio: adc: ad799x: change 'unsigned' to 'unsigned int' declaration
  iio: adc: mcp3564: Use device_for_each_child_node_scoped()
  iio: adc: ad9467: support digital interface calibration
  iio: adc: adi-axi-adc: support digital interface calibration
  ...

4 months agoMerge tag 'icc-6.10-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/djakov...
Greg Kroah-Hartman [Sat, 4 May 2024 07:47:38 +0000 (09:47 +0200)]
Merge tag 'icc-6.10-rc1' of git://git./linux/kernel/git/djakov/icc into char-misc-next

Georgi writes:

interconnect changes for 6.10

This pull request contains the interconnect changes for the 6.10-rc1 merge
window. It contains some small driver changes listed below:

Driver changes:
- Cleanup sm6115 QoS port numbering.
- Fix incorrect port value in qcm2290 driver.

Signed-off-by: Georgi Djakov <djakov@kernel.org>
* tag 'icc-6.10-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/djakov/icc:
  interconnect: qcom: qcm2290: Fix mas_snoc_bimc QoS port assignment
  interconnect: qcom: sm6115: Unspaghettify SNoC QoS port numbering

4 months agoiio: temperature: mcp9600: Fix temperature reading for negative values
Dimitri Fedrau [Wed, 24 Apr 2024 18:59:10 +0000 (20:59 +0200)]
iio: temperature: mcp9600: Fix temperature reading for negative values

Temperature is stored as 16bit value in two's complement format. Current
implementation ignores the sign bit. Make it aware of the sign bit by
using sign_extend32.

Fixes: 3f6b9598b6df ("iio: temperature: Add MCP9600 thermocouple EMF converter")
Signed-off-by: Dimitri Fedrau <dima.fedrau@gmail.com>
Reviewed-by: Marcelo Schmitt <marcelo.schmitt1@gmail.com>
Tested-by: Andrew Hepp <andrew.hepp@ahepp.dev>
Link: https://lore.kernel.org/r/20240424185913.1177127-1-dima.fedrau@gmail.com
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 months agoiio: adc: PAC1934: fix accessing out of bounds array index
Marius Cristea [Thu, 25 Apr 2024 11:42:32 +0000 (14:42 +0300)]
iio: adc: PAC1934: fix accessing out of bounds array index

Fix accessing out of bounds array index for average
current and voltage measurements. The device itself has
only 4 channels, but in sysfs there are "fake"
channels for the average voltages and currents too.

Fixes: 0fb528c8255b ("iio: adc: adding support for PAC193x")
Reported-by: Conor Dooley <conor.dooley@microchip.com>
Signed-off-by: Marius Cristea <marius.cristea@microchip.com>
Closes: https://lore.kernel.org/linux-iio/20240405-embellish-bonnet-ab5f10560d93@wendy/
Tested-by: Conor Dooley <conor.dooley@microchip.com>
Link: https://lore.kernel.org/r/20240425114232.81390-1-marius.cristea@microchip.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 months agoiio: invensense: fix timestamp glitches when switching frequency
Jean-Baptiste Maneyrol [Fri, 26 Apr 2024 09:48:35 +0000 (09:48 +0000)]
iio: invensense: fix timestamp glitches when switching frequency

When a sensor is running and there is a FIFO frequency change due to
another sensor turned on/off, there are glitches on timestamp. Fix that
by using only interrupt timestamp when there is the corresponding sensor
data in the FIFO.

Delete FIFO period handling and simplify internal functions.

Update integration inside inv_mpu6050 and inv_icm42600 drivers.

Fixes: 0ecc363ccea7 ("iio: make invensense timestamp module generic")
Cc: Stable@vger.kernel.org
Signed-off-by: Jean-Baptiste Maneyrol <jean-baptiste.maneyrol@tdk.com>
Link: https://lore.kernel.org/r/20240426094835.138389-1-inv.git-commit@tdk.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 months agovmci: prevent speculation leaks by sanitizing event in event_deliver()
Hagar Gamal Halim Hemdan [Tue, 30 Apr 2024 08:59:16 +0000 (08:59 +0000)]
vmci: prevent speculation leaks by sanitizing event in event_deliver()

Coverity spotted that event_msg is controlled by user-space,
event_msg->event_data.event is passed to event_deliver() and used
as an index without sanitization.

This change ensures that the event index is sanitized to mitigate any
possibility of speculative information leaks.

This bug was discovered and resolved using Coverity Static Analysis
Security Testing (SAST) by Synopsys, Inc.

Only compile tested, no access to HW.

Fixes: 1d990201f9bb ("VMCI: event handling implementation.")
Cc: stable <stable@kernel.org>
Signed-off-by: Hagar Gamal Halim Hemdan <hagarhem@amazon.com>
Link: https://lore.kernel.org/stable/20231127193533.46174-1-hagarhem%40amazon.com
Link: https://lore.kernel.org/r/20240430085916.4753-1-hagarhem@amazon.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 months agoslimbus: qcom-ctrl: fix module autoloading
Krzysztof Kozlowski [Tue, 30 Apr 2024 09:16:57 +0000 (10:16 +0100)]
slimbus: qcom-ctrl: fix module autoloading

Add MODULE_DEVICE_TABLE(), so the module could be properly autoloaded
based on the alias from of_device_id table.  Pin controllers are
considered core components, so usually they are built-in, however these

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20240430091657.35428-4-srinivas.kandagatla@linaro.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 months agoslimbus: Convert to platform remove callback returning void
Uwe Kleine-König [Tue, 30 Apr 2024 09:16:56 +0000 (10:16 +0100)]
slimbus: Convert to platform remove callback returning void

The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is ignored (apart
from emitting a warning) and this typically results in resource leaks.

To improve here there is a quest to make the remove callback return
void. In the first step of this quest all drivers are converted to
.remove_new(), which already returns void. Eventually after all drivers
are converted, .remove_new() will be renamed to .remove().

Trivially convert the slimbus drivers from always returning zero in the
remove callback to the void returning variant.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20240430091657.35428-3-srinivas.kandagatla@linaro.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 months agoslimbus: qcom-ngd-ctrl: Reduce auto suspend delay
Viken Dadhaniya [Tue, 30 Apr 2024 09:16:55 +0000 (10:16 +0100)]
slimbus: qcom-ngd-ctrl: Reduce auto suspend delay

Currently we have auto suspend delay of 1s which is
very high and it takes long time to driver for runtime
suspend after use case is done.

Hence to optimize runtime PM ops, reduce auto suspend
delay to 100ms.

Signed-off-by: Viken Dadhaniya <quic_vdadhani@quicinc.com>
Acked-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20240430091657.35428-2-srinivas.kandagatla@linaro.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 months agonvmem: meson-mx-efuse: Remove nvmem_device from efuse struct
Mukesh Ojha [Tue, 30 Apr 2024 08:49:21 +0000 (09:49 +0100)]
nvmem: meson-mx-efuse: Remove nvmem_device from efuse struct

nvmem_device is used at one place while registering nvmem
device and it is not required to be present in efuse struct
for just this purpose.

Drop nvmem_device and manage with nvmem device stack variable.

Signed-off-by: Mukesh Ojha <quic_mojha@quicinc.com>
Reviewed-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20240430084921.33387-12-srinivas.kandagatla@linaro.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 months agodt-bindings: nvmem: Add compatible for SC8280XP
Konrad Dybcio [Tue, 30 Apr 2024 08:49:20 +0000 (09:49 +0100)]
dt-bindings: nvmem: Add compatible for SC8280XP

Document the QFPROM block found on SC8280XP.

Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20240430084921.33387-11-srinivas.kandagatla@linaro.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 months agodt-bindings: nvmem: qcom,spmi-sdam: update maintainer
David Collins [Tue, 30 Apr 2024 08:49:19 +0000 (09:49 +0100)]
dt-bindings: nvmem: qcom,spmi-sdam: update maintainer

Emails to Shyam bounce (reason: 585 5.1.1 <sthella@codeaurora.org>:
Recipient address rejected: undeliverable address: No such user here.)
so change the maintainer to be me.  I work on qcom,spmi-sdam as well
as other PMIC peripheral devices.

Signed-off-by: David Collins <quic_collinsd@quicinc.com>
Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Bjorn Andersson <andersson@kernel.org>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20240430084921.33387-10-srinivas.kandagatla@linaro.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 months agodt-bindings: nvmem: Add compatible for sm8450, sm8550 and sm8650
Mukesh Ojha [Tue, 30 Apr 2024 08:49:18 +0000 (09:49 +0100)]
dt-bindings: nvmem: Add compatible for sm8450, sm8550 and sm8650

Document QFPROM compatible for sm8450, sm8550 and sm8650 SoCs.

Signed-off-by: Mukesh Ojha <quic_mojha@quicinc.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20240430084921.33387-9-srinivas.kandagatla@linaro.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 months agonvmem: lpc18xx_eeprom: Convert to platform remove callback returning void
Uwe Kleine-König [Tue, 30 Apr 2024 08:49:17 +0000 (09:49 +0100)]
nvmem: lpc18xx_eeprom: Convert to platform remove callback returning void

The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is ignored (apart
from emitting a warning) and this typically results in resource leaks.

To improve here there is a quest to make the remove callback return
void. In the first step of this quest all drivers are converted to
.remove_new(), which already returns void. Eventually after all drivers
are converted, .remove_new() will be renamed to .remove().

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Acked-by: Vladimir Zapolskiy <vz@mleia.com>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20240430084921.33387-8-srinivas.kandagatla@linaro.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 months agonvmem: core: switch to use device_add_groups()
Greg Kroah-Hartman [Tue, 30 Apr 2024 08:49:16 +0000 (09:49 +0100)]
nvmem: core: switch to use device_add_groups()

devm_device_add_groups() is being removed from the kernel, so move the
nvmem driver to use device_add_groups() instead.  The logic is
identical, when the device is removed the driver core will properly
clean up and remove the groups, and the memory used by the attribute
groups will be freed because it was created with dev_* calls, so this is
functionally identical overall.

Cc: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Link: https://lore.kernel.org/r/20240430084921.33387-7-srinivas.kandagatla@linaro.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 months agonvmem: sprd: fix module autoloading
Krzysztof Kozlowski [Tue, 30 Apr 2024 08:49:15 +0000 (09:49 +0100)]
nvmem: sprd: fix module autoloading

Add MODULE_DEVICE_TABLE(), so the module could be properly autoloaded
based on the alias from of_device_id table.

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20240430084921.33387-6-srinivas.kandagatla@linaro.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 months agonvmem: sc27xx: fix module autoloading
Krzysztof Kozlowski [Tue, 30 Apr 2024 08:49:14 +0000 (09:49 +0100)]
nvmem: sc27xx: fix module autoloading

Add MODULE_DEVICE_TABLE(), so the module could be properly autoloaded
based on the alias from of_device_id table.

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20240430084921.33387-5-srinivas.kandagatla@linaro.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 months agonvmem: layouts: sl28vpd: drop driver owner initialization
Krzysztof Kozlowski [Tue, 30 Apr 2024 08:49:13 +0000 (09:49 +0100)]
nvmem: layouts: sl28vpd: drop driver owner initialization

Core in nvmem_layout_driver_register() already sets the .owner, so
driver does not need to.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Michael Walle <mwalle@kernel.org>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20240430084921.33387-4-srinivas.kandagatla@linaro.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 months agonvmem: layouts: onie-tlv: drop driver owner initialization
Krzysztof Kozlowski [Tue, 30 Apr 2024 08:49:12 +0000 (09:49 +0100)]
nvmem: layouts: onie-tlv: drop driver owner initialization

Core in nvmem_layout_driver_register() already sets the .owner, so
driver does not need to.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Michael Walle <mwalle@kernel.org>
Acked-by: Miquel Raynal <miquel.raynal@bootlin.com>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20240430084921.33387-3-srinivas.kandagatla@linaro.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 months agonvmem: layouts: store owner from modules with nvmem_layout_driver_register()
Krzysztof Kozlowski [Tue, 30 Apr 2024 08:49:11 +0000 (09:49 +0100)]
nvmem: layouts: store owner from modules with nvmem_layout_driver_register()

Modules registering driver with nvmem_layout_driver_register() might
forget to set .owner field.  The field is used by some of other kernel
parts for reference counting (try_module_get()), so it is expected that
drivers will set it.

Solve the problem by moving this task away from the drivers to the core
code, just like we did for platform_driver in
commit 9447057eaff8 ("platform_device: use a macro instead of
platform_driver_register").

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Michael Walle <mwalle@kernel.org>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20240430084921.33387-2-srinivas.kandagatla@linaro.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 months agoVMCI: Fix an error handling path in vmci_guest_probe_device()
Christophe JAILLET [Wed, 24 Apr 2024 12:27:23 +0000 (14:27 +0200)]
VMCI: Fix an error handling path in vmci_guest_probe_device()

After a successful pci_iomap_range() call, pci_iounmap() should be called
in the error handling path, as already done in the remove function.

Add the missing call.

The corresponding call was added in the remove function in commit
5ee109828e73 ("VMCI: dma dg: allocate send and receive buffers for DMA
datagrams")

Fixes: e283a0e8b7ea ("VMCI: dma dg: add MMIO access to registers")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Acked-by: Vishnu Dasa <vishnu.dasa@broadcom.com>
Link: https://lore.kernel.org/r/a35bbc3876ae1da70e49dafde4435750e1477be3.1713961553.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 months agoMerge tag 'coresight-next-v6.10' of git://git.kernel.org/pub/scm/linux/kernel/git...
Greg Kroah-Hartman [Fri, 3 May 2024 05:13:54 +0000 (07:13 +0200)]
Merge tag 'coresight-next-v6.10' of git://git./linux/kernel/git/coresight/linux into char-misc-next

Suzuki writes:

coresight: hwtracing subsystem updates for v6.10

CoreSight/hwtracing updates for the next release includes:
 - ACPI power management support for CoreSight legacy components, via migration
   from AMBA to platform device
 - Fixes for ETE register save/restore during CPU Idle.
 - ACPI support TMC for Scatter-Gather mode.
 - his_ptt driver update to set the parent device for PMU and documentation fixes
 - Qcomm Trace component DT binding fixes
 - Miscellaneous cleanups

Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
* tag 'coresight-next-v6.10' of git://git.kernel.org/pub/scm/linux/kernel/git/coresight/linux: (28 commits)
  hwtracing: hisi_ptt: Assign parent for event_source device
  Documentation: ABI + trace: hisi_ptt: update paths to bus/event_source
  coresight: tmc: Enable SG capability on ACPI based SoC-400 TMC ETR devices
  coresight:  Docs/ABI/testing/sysfs-bus-coresight-devices: Fix spelling errors
  coresight: tpiu: Convert to platform remove callback returning void
  coresight: tmc: Convert to platform remove callback returning void
  coresight: stm: Convert to platform remove callback returning void
  coresight: debug: Convert to platform remove callback returning void
  coresight: catu: Convert to platform remove callback returning void
  coresight: Remove duplicate linux/amba/bus.h header
  coresight: stm: Remove duplicate linux/acpi.h header
  coresight: etm4x: Fix access to resource selector registers
  coresight: etm4x: Safe access for TRCQCLTR
  coresight: etm4x: Do not save/restore Data trace control registers
  coresight: etm4x: Do not hardcode IOMEM access for register restore
  coresight: debug: Move ACPI support from AMBA driver to platform driver
  coresight: stm: Move ACPI support from AMBA driver to platform driver
  coresight: tmc: Move ACPI support from AMBA driver to platform driver
  coresight: tpiu: Move ACPI support from AMBA driver to platform driver
  coresight: catu: Move ACPI support from AMBA driver to platform driver
  ...

4 months agohwtracing: hisi_ptt: Assign parent for event_source device
Jonathan Cameron [Fri, 12 Apr 2024 16:10:57 +0000 (17:10 +0100)]
hwtracing: hisi_ptt: Assign parent for event_source device

Currently the PMU device appears directly under /sys/devices/
Only root busses should appear there, so instead assign the pmu->dev
parent to be the PCI device.

Link: https://lore.kernel.org/linux-cxl/ZCLI9A40PJsyqAmq@kroah.com/
Cc: Suzuki K Poulose <suzuki.poulose@arm.com>
Reviewed-by: Yicong Yang <yangyicong@hisilicon.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Acked-by: Suzuki K Poulose <suzuki.poulose@arm.com>
Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
Link: https://lore.kernel.org/r/20240412161057.14099-31-Jonathan.Cameron@huawei.com
4 months agoDocumentation: ABI + trace: hisi_ptt: update paths to bus/event_source
Jonathan Cameron [Fri, 12 Apr 2024 16:10:56 +0000 (17:10 +0100)]
Documentation: ABI + trace: hisi_ptt: update paths to bus/event_source

To allow for assigning a suitable parent to the struct pmu device
update the documentation to describe the device via the event_source
bus where it will remain accessible.

For the ABI documention file also rename the file as it is named
after the path.

Reviewed-by: Yicong Yang <yangyicong@hisilicon.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
Link: https://lore.kernel.org/r/20240412161057.14099-30-Jonathan.Cameron@huawei.com
4 months agocoresight: tmc: Enable SG capability on ACPI based SoC-400 TMC ETR devices
Anshuman Khandual [Thu, 4 Apr 2024 07:29:34 +0000 (12:59 +0530)]
coresight: tmc: Enable SG capability on ACPI based SoC-400 TMC ETR devices

This detects and enables the scatter gather capability (SG) on ACPI based
Soc-400 TMC ETR devices via a new property called 'arm-armhc97c-sg-enable'.
The updated ACPI spec can be found below, which contains this new property.

https://developer.arm.com/documentation/den0067/latest/

This preserves current handling for the property 'arm,scatter-gather' both
on ACPI and DT based platforms i.e the presence of the property is checked
instead of the value.

Cc: Suzuki K Poulose <suzuki.poulose@arm.com>
Cc: Mike Leach <mike.leach@linaro.org>
Cc: James Clark <james.clark@arm.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: coresight@lists.linaro.org
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Anshuman Khandual <anshuman.khandual@arm.com>
Reviewed-by: James Clark <james.clark@arm.com>
Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
Link: https://lore.kernel.org/r/20240404072934.940760-1-anshuman.khandual@arm.com
4 months agoiio: invensense: fix interrupt timestamp alignment
Jean-Baptiste Maneyrol [Fri, 26 Apr 2024 13:58:14 +0000 (13:58 +0000)]
iio: invensense: fix interrupt timestamp alignment

Restrict interrupt timestamp alignment for not overflowing max/min
period thresholds.

Fixes: 0ecc363ccea7 ("iio: make invensense timestamp module generic")
Cc: stable@vger.kernel.org
Signed-off-by: Jean-Baptiste Maneyrol <jean-baptiste.maneyrol@tdk.com>
Link: https://lore.kernel.org/r/20240426135814.141837-1-inv.git-commit@tdk.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 months agoMerge tag 'mhi-for-6.10' of git://git.kernel.org/pub/scm/linux/kernel/git/mani/mhi...
Greg Kroah-Hartman [Wed, 1 May 2024 05:17:29 +0000 (07:17 +0200)]
Merge tag 'mhi-for-6.10' of git://git./linux/kernel/git/mani/mhi into char-misc-next

Manivannan writes:

MHI Host
========

- Added a new API mhi_power_down_keep_dev() to not destroy the struct dev
  associated with the MHI channels during MHI power down. This is useful in
  scenarios such as system suspend/hibernation where the probability of
  channels coming back is very high. So the PM maintainer suggested not to
  destroy the struct dev in those cases.

  This API is introduced for fixing the failure reported in the ath11k driver
  during resume from system suspend.

  NOTE: Due to the API dependency, the patch adding the API is pushed to an
  immutable branch (mhi-immutable) and merged into both mhi and ath trees. But
  the merge commit is not visible in mhi tree due to git being smart with
  'fast-forward'.

- Added an optional sysfs entry to force the MHI devices to enter the Emergency
  Download (EDL) mode to download the firmware from host.

- Added EDL mode support for Qcom SDX75/65/55 modems as per the MHI spec v1.2,
  Chapter 13.2. This involves writing a cookie to the EDL doorbell registers and
  then triggering the device reset from host.

* tag 'mhi-for-6.10' of git://git.kernel.org/pub/scm/linux/kernel/git/mani/mhi:
  bus: mhi: host: pci_generic: Add generic edl_trigger to allow devices to enter EDL mode
  bus: mhi: host: Add a new API for getting channel doorbell offset
  bus: mhi: host: Add sysfs entry to force device to enter EDL
  bus: mhi: host: Add mhi_power_down_keep_dev() API to support system suspend/hibernation

4 months agoMerge tag 'fpga-for-6.20-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/fpga...
Greg Kroah-Hartman [Tue, 30 Apr 2024 07:23:46 +0000 (09:23 +0200)]
Merge tag 'fpga-for-6.20-rc1' of git://git./linux/kernel/git/fpga/linux-fpga into char-misc-next

Xu writes:

FPGA Manager changes for 6.10-rc1

FPGA MGR core:

- Marco's change adds module owner parameter for all registration APIs.

FPGA test:

- Macro's change uses KUnit devices instead of platform devices.

DFL:

- Peter's change cleans up unused symbols.

Xlinux:

- Charles adds SelectMAP interface reprogramming support.
- Andy's header inclusion cleanup.

Altera:

- Krzysztof & Christophe's cleanup for drivers

* tag 'fpga-for-6.20-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/fpga/linux-fpga:
  fpga: region: add owner module and take its refcount
  fpga: dfl: remove unused member pdata from struct dfl_{afu,fme}
  fpga: dfl: remove unused function is_dfl_feature_present()
  fpga: ice40-spi: Don't use "proxy" headers
  fpga: tests: use KUnit devices instead of platform devices
  fpga: altera-cvp: Remove an unused field in struct altera_cvp_conf
  fpga: altera: drop driver owner assignment
  fpga: xilinx-core: add new gpio names for prog and init
  fpga: xilinx-selectmap: add new driver
  dt-bindings: fpga: xlnx,fpga-selectmap: add DT schema
  fpga: xilinx-spi: extract a common driver core
  fpga: bridge: add owner module and take its refcount
  fpga: manager: add owner module and take its refcount

4 months agoMerge tag 'counter-updates-for-6.10b' of git://git.kernel.org/pub/scm/linux/kernel...
Greg Kroah-Hartman [Tue, 30 Apr 2024 07:22:37 +0000 (09:22 +0200)]
Merge tag 'counter-updates-for-6.10b' of git://git./linux/kernel/git/wbg/counter into char-misc-next

William writes:

Second set of Counter updates for 6.10

Counter header file is updated to include only headers that are actually
use.

* tag 'counter-updates-for-6.10b' of git://git.kernel.org/pub/scm/linux/kernel/git/wbg/counter:
  counter: Don't use "proxy" headers

4 months agoiio: dac: ad9739a: write complete MU_CNT1 register during lock
Nuno Sa [Mon, 29 Apr 2024 13:54:39 +0000 (15:54 +0200)]
iio: dac: ad9739a: write complete MU_CNT1 register during lock

As specified by the datasheet we should write the value 0x3 (enable
plus tracking gain) into the MU_CNT1 register during the MU lock phase.

Currently we were only setting the enable bit (bit 0) as the tracking
gain default value is already set to 1. While we should be mostly fine
in assuming the tracking gain will have the value it should, better to
explicitly write it. On top of that the datasheet also states to
re-attempt the writes in case the lock fails which we were not doing for
the tracking gain bit.

Lastly, the recommended value for the MU phase slope lock (bit 6) is 0
but for some reason the default value is 1 and hence, we were not
changing it accordingly.

Note there was no problem with the MU lock mechanism so this is not
being treated as a fix but rather an improvement.

Signed-off-by: Nuno Sa <nuno.sa@analog.com>
Link: https://lore.kernel.org/r/20240429-ad9739a-improv-v1-1-c076a06a697d@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 months agoiio: pressure: zpa2326: use 'time_left' variable with wait_for_completion_interruptib...
Wolfram Sang [Mon, 29 Apr 2024 11:33:11 +0000 (13:33 +0200)]
iio: pressure: zpa2326: use 'time_left' variable with wait_for_completion_interruptible_timeout()

There is a confusing pattern in the kernel to use a variable named 'timeout' to
store the result of wait_for_completion_interruptible_timeout() causing patterns like:

timeout = wait_for_completion_interruptible_timeout(...)
if (!timeout) return -ETIMEDOUT;

with all kinds of permutations. Use 'time_left' as a variable to make the code
self explaining.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Link: https://lore.kernel.org/r/20240429113313.68359-9-wsa+renesas@sang-engineering.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 months agoiio: adc: twl6030-gpadc: use 'time_left' variable with wait_for_completion_interrupti...
Wolfram Sang [Mon, 29 Apr 2024 11:33:10 +0000 (13:33 +0200)]
iio: adc: twl6030-gpadc: use 'time_left' variable with wait_for_completion_interruptible_timeout()

There is a confusing pattern in the kernel to use a variable named 'timeout' to
store the result of wait_for_completion_interruptible_timeout() causing patterns like:

timeout = wait_for_completion_interruptible_timeout(...)
if (!timeout) return -ETIMEDOUT;

with all kinds of permutations. Use 'time_left' as a variable to make the code
self explaining.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Link: https://lore.kernel.org/r/20240429113313.68359-8-wsa+renesas@sang-engineering.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 months agoiio: adc: stm32-dfsdm-adc: use 'time_left' variable with wait_for_completion_interrup...
Wolfram Sang [Mon, 29 Apr 2024 11:33:09 +0000 (13:33 +0200)]
iio: adc: stm32-dfsdm-adc: use 'time_left' variable with wait_for_completion_interruptible_timeout()

There is a confusing pattern in the kernel to use a variable named 'timeout' to
store the result of wait_for_completion_interruptible_timeout() causing patterns like:

timeout = wait_for_completion_interruptible_timeout(...)
if (!timeout) return -ETIMEDOUT;

with all kinds of permutations. Use 'time_left' as a variable to make the code
self explaining.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Link: https://lore.kernel.org/r/20240429113313.68359-7-wsa+renesas@sang-engineering.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 months agoiio: adc: stm32-adc: use 'time_left' variable with wait_for_completion_interruptible_...
Wolfram Sang [Mon, 29 Apr 2024 11:33:08 +0000 (13:33 +0200)]
iio: adc: stm32-adc: use 'time_left' variable with wait_for_completion_interruptible_timeout()

There is a confusing pattern in the kernel to use a variable named 'timeout' to
store the result of wait_for_completion_interruptible_timeout() causing patterns like:

timeout = wait_for_completion_interruptible_timeout(...)
if (!timeout) return -ETIMEDOUT;

with all kinds of permutations. Use 'time_left' as a variable to make the code
self explaining.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Link: https://lore.kernel.org/r/20240429113313.68359-6-wsa+renesas@sang-engineering.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 months agoiio: adc: intel_mrfld_adc: use 'time_left' variable with wait_for_completion_interrup...
Wolfram Sang [Mon, 29 Apr 2024 11:33:07 +0000 (13:33 +0200)]
iio: adc: intel_mrfld_adc: use 'time_left' variable with wait_for_completion_interruptible_timeout()

There is a confusing pattern in the kernel to use a variable named 'timeout' to
store the result of wait_for_completion_interruptible_timeout() causing patterns like:

timeout = wait_for_completion_interruptible_timeout(...)
if (!timeout) return -ETIMEDOUT;

with all kinds of permutations. Use 'time_left' as a variable to make the code
self explaining.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Link: https://lore.kernel.org/r/20240429113313.68359-5-wsa+renesas@sang-engineering.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 months agoiio: adc: fsl-imx25-gcq: use 'time_left' variable with wait_for_completion_interrupti...
Wolfram Sang [Mon, 29 Apr 2024 11:33:06 +0000 (13:33 +0200)]
iio: adc: fsl-imx25-gcq: use 'time_left' variable with wait_for_completion_interruptible_timeout()

There is a confusing pattern in the kernel to use a variable named 'timeout' to
store the result of wait_for_completion_interruptible_timeout() causing patterns like:

timeout = wait_for_completion_interruptible_timeout(...)
if (!timeout) return -ETIMEDOUT;

with all kinds of permutations. Use 'time_left' as a variable to make the code
self explaining.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Link: https://lore.kernel.org/r/20240429113313.68359-4-wsa+renesas@sang-engineering.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 months agoiio: adc: exynos_adc: use 'time_left' variable with wait_for_completion_timeout()
Wolfram Sang [Mon, 29 Apr 2024 11:33:05 +0000 (13:33 +0200)]
iio: adc: exynos_adc: use 'time_left' variable with wait_for_completion_timeout()

There is a confusing pattern in the kernel to use a variable named 'timeout' to
store the result of wait_for_completion_timeout() causing patterns like:

timeout = wait_for_completion_timeout(...)
if (!timeout) return -ETIMEDOUT;

with all kinds of permutations. Use 'time_left' as a variable to make the code
self explaining.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Link: https://lore.kernel.org/r/20240429113313.68359-3-wsa+renesas@sang-engineering.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 months agoiio: adc: ad_sigma_delta: use 'time_left' variable with wait_for_completion_timeout()
Wolfram Sang [Mon, 29 Apr 2024 11:33:04 +0000 (13:33 +0200)]
iio: adc: ad_sigma_delta: use 'time_left' variable with wait_for_completion_timeout()

There is a confusing pattern in the kernel to use a variable named 'timeout' to
store the result of wait_for_completion_timeout() causing patterns like:

timeout = wait_for_completion_timeout(...)
if (!timeout) return -ETIMEDOUT;

with all kinds of permutations. Use 'time_left' as a variable to make the code
self explaining.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Reviewed-by: Nuno Sa <nuno.sa@analog.com>
Link: https://lore.kernel.org/r/20240429113313.68359-2-wsa+renesas@sang-engineering.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 months agoiio: adc: ti-ads1015: use device_for_each_child_node_scoped()
Lincoln Yuji [Mon, 29 Apr 2024 13:22:33 +0000 (10:22 -0300)]
iio: adc: ti-ads1015: use device_for_each_child_node_scoped()

This loop definition removes the need for manual releasing of the
fwnode_handle in early exit paths (here an error path) allow
simplification of the code and reducing the chance of future
modifications not releasing fwnode_handle correctly.

Co-developed-by: Luiza Soezima <lbrsoezima@usp.br>
Signed-off-by: Luiza Soezima <lbrsoezima@usp.br>
Co-developed-by: Sabrina Araujo <sabrinaaraujo@usp.br>
Signed-off-by: Sabrina Araujo <sabrinaaraujo@usp.br>
Signed-off-by: Lincoln Yuji <lincolnyuji@usp.br>
Reviewed-by: Marcelo Schmitt <marcelo.schmitt1@gmail.com>
Link: https://lore.kernel.org/r/20240429132233.6266-1-lincolnyuji@usp.br
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 months agoiio: adc: ad799x: Prefer to use octal permission
Gustavo Rodrigues [Sun, 28 Apr 2024 19:43:26 +0000 (16:43 -0300)]
iio: adc: ad799x: Prefer to use octal permission

Octal permissions are preferred over the symbolics ones
for readbility. This ceases warning message pointed by checkpatch.

Co-developed-by: Bruna Lopes <brunaafl@usp.br>
Signed-off-by: Bruna Lopes <brunaafl@usp.br>
Signed-off-by: Gustavo Rodrigues <ogustavo@usp.br>
Reviewed-by: Nuno Sa <nuno.sa@analog.com>
Link: https://lore.kernel.org/r/20240428194326.2836387-4-ogustavo@usp.br
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 months agoiio: adc: ad799x: add blank line to avoid warning messages
Gustavo Rodrigues [Sun, 28 Apr 2024 19:43:25 +0000 (16:43 -0300)]
iio: adc: ad799x: add blank line to avoid warning messages

Add a blank line before if statement to avoid warning messages pointed by
checkpatch.

Co-developed-by: Bruna Lopes <brunaafl@usp.br>
Signed-off-by: Bruna Lopes <brunaafl@usp.br>
Signed-off-by: Gustavo Rodrigues <ogustavo@usp.br>
Reviewed-by: Nuno Sa <nuno.sa@analog.com>
Link: https://lore.kernel.org/r/20240428194326.2836387-3-ogustavo@usp.br
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 months agoiio: adc: ad799x: change 'unsigned' to 'unsigned int' declaration
Gustavo Rodrigues [Sun, 28 Apr 2024 19:43:24 +0000 (16:43 -0300)]
iio: adc: ad799x: change 'unsigned' to 'unsigned int' declaration

Prefer 'unsigned int' instead of bare use of 'unsigned' declarations to
to improve code readbility. This ceases one of the warning messages
pointed by checkpatch.

Co-developed-by: Bruna Lopes <brunaafl@usp.br>
Signed-off-by: Bruna Lopes <brunaafl@usp.br>
Signed-off-by: Gustavo Rodrigues <ogustavo@usp.br>
Reviewed-by: Nuno Sa <nuno.sa@analog.com>
Link: https://lore.kernel.org/r/20240428194326.2836387-2-ogustavo@usp.br
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 months agoiio: adc: mcp3564: Use device_for_each_child_node_scoped()
Jonathan Cameron [Sun, 28 Apr 2024 17:40:19 +0000 (18:40 +0100)]
iio: adc: mcp3564: Use device_for_each_child_node_scoped()

Switching to the _scoped() version removes the need for manual
calling of fwnode_handle_put() in the paths where the code
exits the loop early. In this case that's all in error paths.

Reviewed-by: Marcelo Schmitt <marcelo.schmitt1@gmail.com>
Reviewed-by: Marius Cristea <marius.cristea@microchip.com>
Link: https://lore.kernel.org/r/20240428174020.1832825-2-jic23@kernel.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 months agoiio: adc: ad9467: support digital interface calibration
Nuno Sa [Fri, 26 Apr 2024 15:42:16 +0000 (17:42 +0200)]
iio: adc: ad9467: support digital interface calibration

To make sure that we have the best timings on the serial data interface
we should calibrate it. This means going through the device supported
values and see for which ones we get a successful result. To do that, we
use a prbs test pattern both in the IIO backend and in the frontend
devices. Then for each of the test points we see if there are any
errors. Note that the backend is responsible to look for those errors.

As calibrating the interface also requires that the data format is disabled
(the one thing being done in ad9467_setup()), ad9467_setup() was removed
and configuring the data fomat is now part of the calibration process.

Signed-off-by: Nuno Sa <nuno.sa@analog.com>
Link: https://lore.kernel.org/r/20240426-ad9467-new-features-v2-7-6361fc3ba1cc@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 months agoiio: adc: adi-axi-adc: support digital interface calibration
Nuno Sa [Fri, 26 Apr 2024 15:42:15 +0000 (17:42 +0200)]
iio: adc: adi-axi-adc: support digital interface calibration

Implement the new IIO backend APIs for calibrating the data
digital interfaces.

While at it, removed the tabs in 'struct adi_axi_adc_state' and used
spaces for the members.

Signed-off-by: Nuno Sa <nuno.sa@analog.com>
Link: https://lore.kernel.org/r/20240426-ad9467-new-features-v2-6-6361fc3ba1cc@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 months agoiio: adc: adi-axi-adc: remove regmap max register
Nuno Sa [Fri, 26 Apr 2024 15:42:14 +0000 (17:42 +0200)]
iio: adc: adi-axi-adc: remove regmap max register

In one of the following patches, we'll have some new functionality that
requires reads/writes on registers bigger than 0x8000. Hence, as this is
an highly flexible core, don't bother in setting 'max_register' and
remove it from regmap_config.

Signed-off-by: Nuno Sa <nuno.sa@analog.com>
Link: https://lore.kernel.org/r/20240426-ad9467-new-features-v2-5-6361fc3ba1cc@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 months agoiio: backend: add API for interface tuning
Nuno Sa [Fri, 26 Apr 2024 15:42:11 +0000 (17:42 +0200)]
iio: backend: add API for interface tuning

This is in preparation for supporting interface tuning in one for the
devices using the axi-adc backend. The new added interfaces are all
needed for that calibration:

 * iio_backend_test_pattern_set();
 * iio_backend_chan_status();
 * iio_backend_iodelay_set();
 * iio_backend_data_sample_trigger().

Interface tuning is the process of going through a set of known points
(typically by the frontend), change some clk or data delays (or both)
and send/receive some known signal (so called test patterns in this
change). The receiving end (either frontend or the backend) is
responsible for validating the signal and see if it's good or not. The
goal for all of this is to come up with ideal delays at the data
interface level so we can have a proper, more reliable data transfer.

Also note that for some devices we can change the sampling rate
(which typically means changing some reference clock) and that can
affect the data interface. In that case, it's import to run the tuning
algorithm again as the values we had before may no longer be the best (or
even valid) ones.

Signed-off-by: Nuno Sa <nuno.sa@analog.com>
Link: https://lore.kernel.org/r/20240426-ad9467-new-features-v2-2-6361fc3ba1cc@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 months agoiio: backend: change docs padding
Nuno Sa [Fri, 26 Apr 2024 15:42:10 +0000 (17:42 +0200)]
iio: backend: change docs padding

Using tabs and maintaining the start of the docs aligned is a pain and
may lead to lot's of unrelated changes when adding new members. Hence,
let#s change things now and just have a simple space after the member
name.

Signed-off-by: Nuno Sa <nuno.sa@analog.com>
Link: https://lore.kernel.org/r/20240426-ad9467-new-features-v2-1-6361fc3ba1cc@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 months agoiio: adc: axi-adc: make sure AXI clock is enabled
Nuno Sa [Fri, 26 Apr 2024 15:42:13 +0000 (17:42 +0200)]
iio: adc: axi-adc: make sure AXI clock is enabled

We can only access the IP core registers if the bus clock is enabled. As
such we need to get and enable it and not rely on anyone else to do it.

Note this clock is a very fundamental one that is typically enabled
pretty early during boot. Independently of that, we should really rely on
it to be enabled.

Fixes: ef04070692a2 ("iio: adc: adi-axi-adc: add support for AXI ADC IP core")
Signed-off-by: Nuno Sa <nuno.sa@analog.com>
Link: https://lore.kernel.org/r/20240426-ad9467-new-features-v2-4-6361fc3ba1cc@analog.com
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 months agodt-bindings: adc: axi-adc: add clocks property
Nuno Sa [Fri, 26 Apr 2024 15:42:12 +0000 (17:42 +0200)]
dt-bindings: adc: axi-adc: add clocks property

Add a required clock property as we can't access the device registers if
the AXI bus clock is not properly enabled.

Note this clock is a very fundamental one that is typically enabled
pretty early during boot. Independently of that, we should really rely on
it to be enabled.

Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Fixes: 96553a44e96d ("dt-bindings: iio: adc: add bindings doc for AXI ADC driver")
Signed-off-by: Nuno Sa <nuno.sa@analog.com>
Link: https://lore.kernel.org/r/20240426-ad9467-new-features-v2-3-6361fc3ba1cc@analog.com
Cc: <Stable@ver.kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 months agodocs: iio: ad7944: add documentation for chain mode
David Lechner [Thu, 25 Apr 2024 14:10:00 +0000 (09:10 -0500)]
docs: iio: ad7944: add documentation for chain mode

Add documentation for chain mode support that was recently added to the
AD7944 ADC driver.

Signed-off-by: David Lechner <dlechner@baylibre.com>
Link: https://lore.kernel.org/r/20240425-iio-ad7944-chain-mode-v1-2-9d9220ff21e1@baylibre.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 months agoiio: adc: ad7944: add support for chain mode
David Lechner [Thu, 25 Apr 2024 14:09:59 +0000 (09:09 -0500)]
iio: adc: ad7944: add support for chain mode

This adds support for the chain mode of the AD7944 ADC. This mode allows
multiple ADCs to be daisy-chained together. Data from all of the ADCs in
is read by reading multiple words from the first ADC in the chain.

Each chip in the chain adds an extra IIO input voltage channel to the
IIO device.

Only the wiring configuration where the SPI controller CS line is
connected to the CNV pin of all of the ADCs in the chain is supported
in this patch.

Signed-off-by: David Lechner <dlechner@baylibre.com>
Link: https://lore.kernel.org/r/20240425-iio-ad7944-chain-mode-v1-1-9d9220ff21e1@baylibre.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 months agoiio: dac: adi-axi: fix a mistake in axi_dac_ext_info_set()
Dan Carpenter [Wed, 24 Apr 2024 11:45:30 +0000 (14:45 +0300)]
iio: dac: adi-axi: fix a mistake in axi_dac_ext_info_set()

The last parameter of these axi_dac_(frequency|scale|phase)_set()
functions is supposed to be true for TONE_2 and false for TONE_1. The
bug is the last call where it passes "private - TONE_2".  That
subtraction is going to be zero/false for TONE_2 and and -1/true for
TONE_1.  Fix the bug, and re-write it as "private == TONE_2" so it's
more obvious what is happening.

Fixes: 4e3949a192e4 ("iio: dac: add support for AXI DAC IP core")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Reviewed-by: Nuno Sa <nuno.sa@analog.com>
Link: https://lore.kernel.org/r/df7c6e1b-b619-40c3-9881-838587ed15d4@moroto.mountain
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 months agoiio: imu: inv_icm42600: add support of ICM-42686-P
Jean-Baptiste Maneyrol [Mon, 22 Apr 2024 15:22:40 +0000 (15:22 +0000)]
iio: imu: inv_icm42600: add support of ICM-42686-P

Add ICM-42686-P chip supporting high FSRs (32G, 4000dps).

Create accel and gyro iio device states with dynamic scales table
set at device init.

Signed-off-by: Jean-Baptiste Maneyrol <jean-baptiste.maneyrol@tdk.com>
Link: https://lore.kernel.org/r/20240422152240.85974-3-inv.git-commit@tdk.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 months agodt-bindings: iio: imu: add icm42686 inside inv_icm42600
Jean-Baptiste Maneyrol [Mon, 22 Apr 2024 15:22:39 +0000 (15:22 +0000)]
dt-bindings: iio: imu: add icm42686 inside inv_icm42600

Add bindings for ICM-42686-P chip supporting high FSRs.

Signed-off-by: Jean-Baptiste Maneyrol <jean-baptiste.maneyrol@tdk.com>
Acked-by: Rob Herring (Arm) <robh@kernel.org>
Link: https://lore.kernel.org/r/20240422152240.85974-2-inv.git-commit@tdk.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 months agoiio: light: stk3310: Drop most likely fake ACPI ID
Andy Shevchenko [Mon, 15 Apr 2024 14:18:52 +0000 (17:18 +0300)]
iio: light: stk3310: Drop most likely fake ACPI ID

The commit in question does not proove that ACPI ID exists.
Quite likely it was a cargo cult addition while doint that
for DT-based enumeration.  Drop most likely fake ACPI ID.

Googling for STK3335 gives no useful results in regard to DSDT.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20240415141852.853490-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 months agodocs: iio: adis16475: fix device files tables
Ramona Gradinariu [Wed, 24 Apr 2024 09:41:52 +0000 (12:41 +0300)]
docs: iio: adis16475: fix device files tables

Remove in_accel_calibbias_x and in_anglvel_calibbias_x device files
description, as they do not exist and were added by mistake.
Add correct naming for in_accel_y_calibbias and in_anglvel_y_calibbias
device files and update their description.

Fixes: 8243b2877eef ("docs: iio: add documentation for adis16475 driver")
Signed-off-by: Ramona Gradinariu <ramona.gradinariu@analog.com>
Link: https://lore.kernel.org/r/20240424094152.103667-2-ramona.gradinariu@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 months agoiio: accel: mxc4005: Read orientation matrix from ACPI ROTM method
Hans de Goede [Thu, 25 Apr 2024 12:57:54 +0000 (14:57 +0200)]
iio: accel: mxc4005: Read orientation matrix from ACPI ROTM method

Some devices use the semi-standard ACPI "ROTM" method to store
the accelerometers orientation matrix.

Add support for this using the new iio_read_acpi_mount_matrix() helper, if
the helper fails to read the matrix fall back to iio_read_mount_matrix()
which will try to get it from device-properties (devicetree) and if
that fails it will fill the matrix with the identity matrix.

Link: https://bugzilla.kernel.org/show_bug.cgi?id=218578
Acked-by: Rafael J. Wysocki <rafael@kernel.org>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20240425125754.76010-5-hdegoede@redhat.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 months agoiio: bmc150-accel-core: Use iio_read_acpi_mount_matrix() helper
Hans de Goede [Thu, 25 Apr 2024 12:57:53 +0000 (14:57 +0200)]
iio: bmc150-accel-core: Use iio_read_acpi_mount_matrix() helper

Replace the duplicate ACPI "ROTM" data parsing code with the new
shared iio_read_acpi_mount_matrix() helper.

Acked-by: Rafael J. Wysocki <rafael@kernel.org>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20240425125754.76010-4-hdegoede@redhat.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 months agoiio: accel: kxcjk-1013: Use new iio_read_acpi_mount_matrix() helper
Hans de Goede [Thu, 25 Apr 2024 12:57:52 +0000 (14:57 +0200)]
iio: accel: kxcjk-1013: Use new iio_read_acpi_mount_matrix() helper

Replace the duplicate ACPI "ROTM" data parsing code with the new
shared iio_read_acpi_mount_matrix() helper.

This also removes the limiting of the "ROTM" mount matrix to only ACPI
devices with an ACPI HID (Hardware-ID) of "KIOX000A". If kxcjk-1013 ACPI
devices with another HID have a ROTM method that should still be parsed
and if the method is not there then iio_read_acpi_mount_matrix() will
fail silently.

Acked-by: Rafael J. Wysocki <rafael@kernel.org>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20240425125754.76010-3-hdegoede@redhat.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 months agoiio: core: Add iio_read_acpi_mount_matrix() helper function
Hans de Goede [Thu, 25 Apr 2024 12:57:51 +0000 (14:57 +0200)]
iio: core: Add iio_read_acpi_mount_matrix() helper function

The ACPI "ROTM" rotation matrix parsing code atm is already duplicated
between bmc150-accel-core.c and kxcjk-1013.c and a third user of this
is coming.

Add an iio_read_acpi_mount_matrix() helper function for this.
The 2 existing copies of the code are identical, except that
the kxcjk-1013.c has slightly better error logging.

To new helper is a 1:1 copy of the kxcjk-1013.c version, the only change
is the addition of a "char *acpi_method" parameter since some bmc150
dual-accel setups (360° hinges with 1 accel in kbd/base + 1 in display)
declare both accels in a single ACPI device with 2 different method names
for the 2 matrices. This new acpi_method parameter is not "const char *"
because the pathname parameter to acpi_evaluate_object() is not const.

The 2 existing copies of this function will be removed in further patches
in this series.

Acked-by: Rafael J. Wysocki <rafael@kernel.org>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20240425125754.76010-2-hdegoede@redhat.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 months agoiio: buffer: initialize masklength accumulator to 0
David Lechner [Thu, 25 Apr 2024 15:03:29 +0000 (10:03 -0500)]
iio: buffer: initialize masklength accumulator to 0

Since masklength is marked as [INTERN], no drivers should assign it and
the value will always be 0. Therefore, the local ml accumulator variable
in iio_buffers_alloc_sysfs_and_mask() will always start out as 0.

This changes the code to explicitly set ml to 0 to make it clear that
drivers should not be trying to override the masklength field.

Signed-off-by: David Lechner <dlechner@baylibre.com>
Link: https://lore.kernel.org/r/20240425-b4-iio-masklength-cleanup-v1-3-d3d16318274d@baylibre.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 months agoiio: adc: mxs-lradc-adc: don't set masklength
David Lechner [Thu, 25 Apr 2024 15:03:28 +0000 (10:03 -0500)]
iio: adc: mxs-lradc-adc: don't set masklength

The masklength field is marked as [INTERN] and should not be set by
drivers, so remove the assignment in the mxs-lradc-adc driver.

__iio_device_register() will populate this field with the correct value.

Signed-off-by: David Lechner <dlechner@baylibre.com>
Link: https://lore.kernel.org/r/20240425-b4-iio-masklength-cleanup-v1-2-d3d16318274d@baylibre.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 months agoiio: adc: ad7266: don't set masklength
David Lechner [Thu, 25 Apr 2024 15:03:27 +0000 (10:03 -0500)]
iio: adc: ad7266: don't set masklength

The masklength field is marked as [INTERN] and should not be set by
drivers, so remove the assignment in the ad7266 driver.

__iio_device_register() will populate this field with the correct value.

Signed-off-by: David Lechner <dlechner@baylibre.com>
Link: https://lore.kernel.org/r/20240425-b4-iio-masklength-cleanup-v1-1-d3d16318274d@baylibre.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 months agoiio: adc: rtq6056: Use automated cleanup for mode handling in write_raw
Gabriel Schwartz [Fri, 26 Apr 2024 20:01:14 +0000 (17:01 -0300)]
iio: adc: rtq6056: Use automated cleanup for mode handling in write_raw

Using iio_device_claim_direct_scoped() to automate mode claim and release
simplifies code flow and allows for straight-forward error handling with
direct returns on errors.

Signed-off-by: Gabriel Schwartz <gschwartz@usp.br>
Reviewed-by: Marcelo Schmitt <marcelo.schmitt1@gmail.com>
Reviewed-by: ChiYuan Huang <cy_huang@richtek.com>
Link: https://lore.kernel.org/r/20240426200118.20900-1-gschwartz@usp.br
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 months agomisc/pvpanic: add support for normal shutdowns
Thomas Weißschuh [Fri, 12 Apr 2024 06:26:40 +0000 (08:26 +0200)]
misc/pvpanic: add support for normal shutdowns

Shutdown requests are normally hardware dependent.
By extending pvpanic to also handle shutdown requests, guests can
submit such requests with an easily implementable and cross-platform
mechanism.

Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
Link: https://lore.kernel.org/r/20240412-pvpanic-shutdown-v3-1-c214e9873b3f@weissschuh.net
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 months agomisc: sgi_gru: remove default attribute of LATTICE_ECP3_CONFIG
Prasad Pandit [Fri, 12 Apr 2024 05:52:21 +0000 (11:22 +0530)]
misc: sgi_gru: remove default attribute of LATTICE_ECP3_CONFIG

Remove 'default n' attribute of 'LATTICE_ECP3_CONFIG' option
because it is redundant. 'n' is automatic default value when
one is not specified.

Suggested-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Prasad Pandit <pjp@fedoraproject.org>
Link: https://lore.kernel.org/r/20240412055221.69411-3-ppandit@redhat.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 months agomisc: sgi_gru: indent SGI_GRU option help text
Prasad Pandit [Fri, 12 Apr 2024 05:52:20 +0000 (11:22 +0530)]
misc: sgi_gru: indent SGI_GRU option help text

Fix indentation of SGI_GRU option's help text by adding
leading spaces. Generally help text is indented by two
more spaces beyond the leading tab <\t> character.
It helps Kconfig parsers to read file without error.

Signed-off-by: Prasad Pandit <pjp@fedoraproject.org>
Link: https://lore.kernel.org/r/20240412055221.69411-2-ppandit@redhat.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 months agoeeprom: 93xx46: drop unneeded MODULE_ALIAS
Krzysztof Kozlowski [Sun, 14 Apr 2024 15:49:57 +0000 (17:49 +0200)]
eeprom: 93xx46: drop unneeded MODULE_ALIAS

The ID table already has respective entry and MODULE_DEVICE_TABLE and
creates proper alias for SPI driver.  Having another MODULE_ALIAS causes
the alias to be duplicated.

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Link: https://lore.kernel.org/r/20240414154957.127113-3-krzk@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 months agoeeprom: at25: drop unneeded MODULE_ALIAS
Krzysztof Kozlowski [Sun, 14 Apr 2024 15:49:55 +0000 (17:49 +0200)]
eeprom: at25: drop unneeded MODULE_ALIAS

The ID table already has respective entry and MODULE_DEVICE_TABLE and
creates proper alias for SPI driver.  Having another MODULE_ALIAS causes
the alias to be duplicated.

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Link: https://lore.kernel.org/r/20240414154957.127113-1-krzk@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 months agomcb: lpc: Convert to platform remove callback returning void
Uwe Kleine-König [Mon, 29 Apr 2024 08:38:25 +0000 (10:38 +0200)]
mcb: lpc: Convert to platform remove callback returning void

The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is ignored (apart
from emitting a warning) and this typically results in resource leaks.

To improve here there is a quest to make the remove callback return
void. In the first step of this quest all drivers are converted to
.remove_new(), which already returns void. Eventually after all drivers
are converted, .remove_new() will be renamed to .remove().

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Johannes Thumshirn <jth@kernel.org>
Link: https://lore.kernel.org/r/cd04e21a7e2646bfe44b2304eea2b3fd0ee84018.1714379722.git.jth@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 months agoMerge tag 'w1-drv-6.10' of https://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux...
Greg Kroah-Hartman [Mon, 29 Apr 2024 08:52:15 +0000 (10:52 +0200)]
Merge tag 'w1-drv-6.10' of https://git./linux/kernel/git/krzk/linux-w1 into char-misc-next

Krzysztof writes:

1-Wire bus drivers for v6.10

Few cleanups of 1-Wire GPIO driver to make it more robust and easier to
read.

* tag 'w1-drv-6.10' of https://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux-w1:
  w1: gpio: Don't use "proxy" headers
  w1: gpio: Remove duplicate NULL checks
  w1: gpio: Use sizeof(*pointer) instead of sizeof(type)
  w1: gpio: Switch to use dev_err_probe()
  w1: gpio: Make use of device properties

4 months agocoresight: Docs/ABI/testing/sysfs-bus-coresight-devices: Fix spelling errors
Remington Brasga [Sun, 28 Apr 2024 01:14:01 +0000 (01:14 +0000)]
coresight:  Docs/ABI/testing/sysfs-bus-coresight-devices: Fix spelling errors

Fix spelling and gramatical errors

Signed-off-by: Remington Brasga <rbrasga@uci.edu>
[ Adjusted title ]
Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
Link: https://lore.kernel.org/r/20240428011401.1080-1-rbrasga@uci.edu
4 months agoiio: light: apds9306: Fix input arguments to in_range()
Subhajit Ghosh [Sat, 27 Apr 2024 09:09:14 +0000 (18:39 +0930)]
iio: light: apds9306: Fix input arguments to in_range()

Third input argument to in_range() function requires the number of
values in range, not the last value in that range. Update macro for
persistence and adaptive threshold to reflect number of values
supported instead of the maximum values supported.

Fixes: 620d1e6c7a3f ("iio: light: Add support for APDS9306 Light Sensor")
Signed-off-by: Subhajit Ghosh <subhajit.ghosh@tweaklogic.com>
Link: https://lore.kernel.org/r/20240427090914.37274-1-subhajit.ghosh@tweaklogic.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 months agobus: mhi: host: pci_generic: Add generic edl_trigger to allow devices to enter EDL...
Qiang Yu [Wed, 24 Apr 2024 03:21:55 +0000 (11:21 +0800)]
bus: mhi: host: pci_generic: Add generic edl_trigger to allow devices to enter EDL mode

Some of the MHI modems like SDX65 based ones are capable of entering the
EDL mode as per the standard triggering mechanism defined in the MHI spec
v1.2. So let's add a common mhi_pci_generic_edl_trigger() function that
triggers the EDL mode in the device when user writes to the
/sys/bus/mhi/devices/.../trigger_edl file.

As per the spec, the EDL mode can be triggered by writing a cookie to the
EDL doorbell register and then resetting the device.

Devices supporting this standard way of entering EDL mode can set the
mhi_pci_dev_info::edl_trigger flag.

Signed-off-by: Qiang Yu <quic_qianyu@quicinc.com>
Reviewed-by: Jeffrey Hugo <quic_jhugo@quicinc.com>
Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Link: https://lore.kernel.org/r/1713928915-18229-4-git-send-email-quic_qianyu@quicinc.com
[mani: reworded commit message]
Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
4 months agobus: mhi: host: Add a new API for getting channel doorbell offset
Qiang Yu [Wed, 24 Apr 2024 03:21:54 +0000 (11:21 +0800)]
bus: mhi: host: Add a new API for getting channel doorbell offset

Some controllers may want to access a specific doorbell register. Hence add
a new API that reads the CHDBOFF register and returns the offset of the
doorbell registers from MMIO base, so that the controller can calculate the
address of the specific doorbell register by adding the register offset
with doorbell offset and MMIO base address.

Signed-off-by: Qiang Yu <quic_qianyu@quicinc.com>
Reviewed-by: Jeffrey Hugo <quic_jhugo@quicinc.com>
Link: https://lore.kernel.org/r/1713928915-18229-3-git-send-email-quic_qianyu@quicinc.com
[mani: reworded commit message and Kdoc]
Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
4 months agobus: mhi: host: Add sysfs entry to force device to enter EDL
Qiang Yu [Wed, 24 Apr 2024 03:21:53 +0000 (11:21 +0800)]
bus: mhi: host: Add sysfs entry to force device to enter EDL

Add sysfs entry to allow users of MHI bus to force device to enter EDL
(Emergency Download) mode to download the device firmware. Since there is
no guarantee that all the devices will support EDL mode, the sysfs entry
is kept as an optional one and will appear only for the supported devices.

Controllers supporting the EDL mode are expected to provide edl_trigger()
callback that puts the device into EDL mode.

Signed-off-by: Qiang Yu <quic_qianyu@quicinc.com>
Reviewed-by: Jeffrey Hugo <quic_jhugo@quicinc.com>
Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Link: https://lore.kernel.org/r/1713928915-18229-2-git-send-email-quic_qianyu@quicinc.com
[mani: fixed the kernel version and reworded the commit message]
Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
4 months agocoresight: tpiu: Convert to platform remove callback returning void
Uwe Kleine-König [Tue, 23 Apr 2024 08:07:02 +0000 (10:07 +0200)]
coresight: tpiu: Convert to platform remove callback returning void

The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is ignored (apart
from emitting a warning) and this typically results in resource leaks.

To improve here there is a quest to make the remove callback return
void. In the first step of this quest all drivers are converted to
.remove_new(), which already returns void. Eventually after all drivers
are converted, .remove_new() will be renamed to .remove().

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Fixes: 3d83d4d4904a ("coresight: tpiu: Move ACPI support from AMBA driver to platform driver")
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
Link: https://lore.kernel.org/r/ad5e0d3ec081444a5ad04a7be277dde3afcb696b.1713858615.git.u.kleine-koenig@pengutronix.de
4 months agocoresight: tmc: Convert to platform remove callback returning void
Uwe Kleine-König [Tue, 23 Apr 2024 08:07:01 +0000 (10:07 +0200)]
coresight: tmc: Convert to platform remove callback returning void

The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is ignored (apart
from emitting a warning) and this typically results in resource leaks.

To improve here there is a quest to make the remove callback return
void. In the first step of this quest all drivers are converted to
.remove_new(), which already returns void. Eventually after all drivers
are converted, .remove_new() will be renamed to .remove().

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Fixes: 70750e257aab ("coresight: tmc: Move ACPI support from AMBA driver to platform driver")
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
Link: https://lore.kernel.org/r/3cf26d85a8d45f0efb07e07f3307a1b435ebf61e.1713858615.git.u.kleine-koenig@pengutronix.de
4 months agocoresight: stm: Convert to platform remove callback returning void
Uwe Kleine-König [Tue, 23 Apr 2024 08:07:00 +0000 (10:07 +0200)]
coresight: stm: Convert to platform remove callback returning void

The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is ignored (apart
from emitting a warning) and this typically results in resource leaks.

To improve here there is a quest to make the remove callback return
void. In the first step of this quest all drivers are converted to
.remove_new(), which already returns void. Eventually after all drivers
are converted, .remove_new() will be renamed to .remove().

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Fixes: 057256aaacc8 ("coresight: stm: Move ACPI support from AMBA driver to platform driver")
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
Link: https://lore.kernel.org/r/3fefa60744fc68c9c4b40aeb69e34cda22582c4b.1713858615.git.u.kleine-koenig@pengutronix.de
4 months agocoresight: debug: Convert to platform remove callback returning void
Uwe Kleine-König [Tue, 23 Apr 2024 08:06:59 +0000 (10:06 +0200)]
coresight: debug: Convert to platform remove callback returning void

The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is ignored (apart
from emitting a warning) and this typically results in resource leaks.

To improve here there is a quest to make the remove callback return
void. In the first step of this quest all drivers are converted to
.remove_new(), which already returns void. Eventually after all drivers
are converted, .remove_new() will be renamed to .remove().

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Fixes: 965edae4e6a2 ("coresight: debug: Move ACPI support from AMBA driver to platform driver")
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
Link: https://lore.kernel.org/r/fb3d7db82a2490ace41c51b16ad17ef61549e2f6.1713858615.git.u.kleine-koenig@pengutronix.de
4 months agocoresight: catu: Convert to platform remove callback returning void
Uwe Kleine-König [Tue, 23 Apr 2024 08:06:58 +0000 (10:06 +0200)]
coresight: catu: Convert to platform remove callback returning void

The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is ignored (apart
from emitting a warning) and this typically results in resource leaks.

To improve here there is a quest to make the remove callback return
void. In the first step of this quest all drivers are converted to
.remove_new(), which already returns void. Eventually after all drivers
are converted, .remove_new() will be renamed to .remove().

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Fixes: 23567323857d ("coresight: catu: Move ACPI support from AMBA driver to platform driver")
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
Link: https://lore.kernel.org/r/16a7123efa7d97ae62a02ccbf9b39d146b066860.1713858615.git.u.kleine-koenig@pengutronix.de
4 months agocoresight: Remove duplicate linux/amba/bus.h header
Jiapeng Chong [Wed, 24 Apr 2024 02:24:20 +0000 (10:24 +0800)]
coresight: Remove duplicate linux/amba/bus.h header

./include/linux/coresight.h: linux/amba/bus.h is included more than once.

Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=8869
Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
Reviewed-by: James Clark <james.clark@arm.com>
Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
Link: https://lore.kernel.org/r/20240424022420.58516-1-jiapeng.chong@linux.alibaba.com
4 months agocoresight: stm: Remove duplicate linux/acpi.h header
Jiapeng Chong [Wed, 24 Apr 2024 02:36:05 +0000 (10:36 +0800)]
coresight: stm: Remove duplicate linux/acpi.h header

./drivers/hwtracing/coresight/coresight-stm.c: linux/acpi.h is included more than once.

Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=8871
Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
Reviewed-by: James Clark <james.clark@arm.com>
Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
Link: https://lore.kernel.org/r/20240424023605.90489-1-jiapeng.chong@linux.alibaba.com
4 months agomei: bus: constify the struct mei_cl_bus_type usage
Kunwu Chan [Tue, 23 Apr 2024 02:41:33 +0000 (10:41 +0800)]
mei: bus: constify the struct mei_cl_bus_type usage

Now that the driver core can properly handle constant struct bus_type,
move the mei_cl_bus_type variable to be a constant structure as well,
placing it into read-only memory which can not be modified at runtime.

Signed-off-by: Kunwu Chan <chentao@kylinos.cn>
Acked-by: Tomas Winkler <tomas.winkler@intel.com>
Link: https://lore.kernel.org/r/20240423024133.1890455-1-chentao@kylinos.cn
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 months agoMerge tag 'peci-next-6.10-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/iwi...
Greg Kroah-Hartman [Wed, 24 Apr 2024 04:31:45 +0000 (21:31 -0700)]
Merge tag 'peci-next-6.10-rc1' of git://git./linux/kernel/git/iwi/linux into char-misc-next

Iwona writes:

Update peci-next for v6.10-rc1

- Move peci_bus_type, peci_controller_type and peci_device_type to be
  constant.

4 months agoMerge tag 'iio-for-6.10a' of https://git.kernel.org/pub/scm/linux/kernel/git/jic23...
Greg Kroah-Hartman [Wed, 24 Apr 2024 03:19:37 +0000 (20:19 -0700)]
Merge tag 'iio-for-6.10a' of https://git./linux/kernel/git/jic23/iio into char-misc-next

Jonathan writes:

IIO: 1st set of new device support, features and cleanup for 6.10

The Analog Device team (Paul Cercueil and Nuno Sa) have been working on
improving high speed device handling. They have had some support in their
own tree for many years, so it is great to see them bring it to upstream.
Some of that is seen here, with the first output device using the
IIO dmaengine infrastructure and a new DAC backend FPGA IP driver.
This makes use of a new set of interfaces to allow backend and
front end driver communication in a fashion that in theory at least
allows for a single driver for a given ADC / DAC independent of
the IP to which is being used to deal with the data bus and DMA aspects
of working with these devices. It is early days for this new
generic way of handling split devices, but as it's kernel internals only
we can merrily change anything about it as a wider diversity of devices
show up and we get a better feel for what works.

Alongside the usual set of new drivers and features we have
the automatic cleanup of fwnode_handle_put() which didn't quite make
it in last cycle. The equivalent DT version was merged by Rob Herring
via the DT binding tree and one patch using that in IIO can also be
found in this pull request. Rob has been making extensive use of that
infrastructure in the DT core which is good to see and provides more
evidence this basic approach is useful.

In some cases, the IIO driver was converted over from DT only to
using the generic firmware description handling of property.h
including using the new macros. The general preference for IIO
is to use this more generic handling where possible - a bunch of other
drivers have been converted this cycle as well.

New device support
==================

adi,ad7173
- New driver supporting AD7172-2, AD7172-4 AD7173-9, AD7175-2, AD7175-8,
  AD7176-2 and AD7177-2 ADCs.
- Follow up fix for an accidental use of logic not instead of bitwise.

adi,ad7944
- New driver supporting AD7944, AD7985 and AD7986 pin compatible ADCs.
- Later patch added use of new spi_optimize_message() to reduce overheads
  of setting up a reused message.
- Additional changes later in series reduced code duplication.

adi,ad9739a RF DAC
- New driver for this 14-bit 2.5 GSPS DAC via an LVDS interface.

adi,axi-dac
- Support for this FPGA IP used to send data to high performance DACs over
  an interface such as JESD204B/C or parallel interfaces.  Used in
  conjunction with a DAC driver. The initial user is the ad9739a.
  The dmaengine-buffer needed various changes to make it bidirectional.

avago,apds9306
- New driver for this ambient light sensor.
- Fix much later in this pull for an off by 1 error.

New device IDs
==============

For these at most an ID and a instance of chip specific data was needed.
Always nice to see manufacturers sticking to an existing software interface
for new parts.

allwinner,sun20i
- Add support for h616.
invensense,mpu6050
- Add support for ICM42688
maxim,max30102
- Add compatible for MAX30101
ti,dac5571
- Add compatible for DAC081C081

General
=======

fwnode_handle
- Support for cleanup.h based __free(fwnode_handle)
- Loop macro using this for looping over child nodes without needing to
  call fwnode_handle_put() in ever early exit from the loop.
- Used in:
  * adi,ad3552r
  * adi,ad4130
  * adi,ad5770r
  * adi,ad74413r
  * adi,ad7173
  * adi,adfm2000
  * linear,ltc2688
  * linear,ltc2983
  * maxim,max11410
  * microchip,pac1934
  * qcom,spmi-adc
  * renesas,rz2gl
  * st,ab8500
  * st,stm32 (Fix for failure to set return value precedes this patch,
    providing an example of why enabling direct returns makes bugs
    less likely)
- Conversions to fwnode also using the cleanup logic
  * adi,ad7124
  * adi,ad7292
  * freescale,fsl-imx25-gcq

- Other conversions to fwnode where the new cleanup handling isn't useful
  * adi,ad7192
  * avia,hx711
  * freescale,mma8452
  * nxp,fxls8962af
  * st,spear
  * ti,twl4030

Features
========

adi,adxl345
- Support SPI_3WIRE mode.

adi,ad9944
- Support 3-wire mode, note this isn't normal 3-wire SPI (unlike the
  adxl345 change above), but rather   a wiring scheme where the SPI
  chip select is used to trigger conversions rather than using a
  separate pin.
- Add some device specific documentation, mostly around the various wiring
  schemes.

invensense,mpu6050
- Add Wake on Motion support as an IIO event and as a wake-up source.

linear,ltc2983
- Add vdd-supply.

ti,hdc3020
- Add power management using trigger on demand mode and adding suspend and
  resume handling.
- Use reset GPIO if available.

Cleanup and fixes
================

iio core
- Use the various autocleanup and lock guards from cleanup.h to simplify
  the IIO core.
- Don't set the pointer used for iio_priv() if it is zero sized as that
  points beyond the end of the allocation. No driver actually uses it
  in that case but good to clean this up.

various drivers
- Drop unnecessary casts of other pointer types to void *

docs
- Add missing ABI entry for in_temp_input.

adi,adx345
- General cleanup prior to adding spi-3wire mode.

adi,axi-adc
- Be more flexible and allow minor version changes as these are expected
  to be backwards compatible.

avago,apds9300/9600
- Merge near identical bindings. The drivers are quite different, but
  the bindings can be shared. The apds9306 binding introduced in this
  series uses this shared binding doc as well.
- Add missing vdd-supply
- Update binding to use IRQ_TYPE_LEVEL_LOW instead of 8.

bosch,bmp280
- Organize headers

freescale,fxl-imx25-gcq
- Use devm_ for remaining probe() time setup allowing dropping
  of specific error handling and remove() functions.

infineon,dps310
- Fix handling of negative temperatures
- Bring style of other similar calls inline with the form needed
  for temperatures
- Ensure error handling of regmap calls is consistent within the driver.
- Simplify scale reading logic.

invensense,mpu6050
- Flip logic in binding to exclude devices without i2c-gate instead
  of opting in.  The list is expected to be much shorter as all recent
  devices support this feature.

honeywell,hsc030pa
- Use spi_read() instead of opening coding.

renesas,rcar
- Use device_for_each_child_of_node_scoped() to remove need to manually
  release. Left over from series the rest of which went in during 6.9.

st,ab8500
- Fix naming of function parameters in kernel-doc

* tag 'iio-for-6.10a' of https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio: (108 commits)
  iio: adc: ti-ads131e08: Use device_for_each_child_node_scoped() to simplify error paths.
  iio: adc: adi-axi-adc: only error out in major version mismatch
  iio: dac: support the ad9739a RF DAC
  iio: dac: add support for AXI DAC IP core
  iio: backend: add new functionality
  dt-bindings: iio: dac: add docs for AD9739A
  dt-bindings: iio: dac: add docs for AXI DAC IP
  iio: buffer-dmaengine: Enable write support
  iio: buffer-dmaengine: Support specifying buffer direction
  iio: buffer-dma: Enable buffer write support
  iio: buffer-dma: Rename iio_dma_buffer_data_available()
  iio: buffer-dma: add iio_dmaengine_buffer_setup()
  iio: pressure: dps310: simplify scale factor reading
  iio: pressure: dps310: consistently check return value of `regmap_read`
  iio: pressure: dps310: introduce consistent error handling
  iio: pressure: dps310: support negative temperature values
  dt-bindings: iio: adc: Add GPADC for Allwinner H616
  iio: dac: ad5755: make use of of_device_id table
  iio: imu: inv_icm42600: add support of ICM-42688-P
  dt-bindings: iio: imu: add icm42688 inside inv_icm42600
  ...

4 months agoMerge 6.9-rc5 into char-misc-next
Greg Kroah-Hartman [Tue, 23 Apr 2024 11:16:03 +0000 (13:16 +0200)]
Merge 6.9-rc5 into char-misc-next

We need the char/misc fixes in here as well to work off of.

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 months agofpga: region: add owner module and take its refcount
Marco Pagani [Fri, 19 Apr 2024 08:35:59 +0000 (10:35 +0200)]
fpga: region: add owner module and take its refcount

The current implementation of the fpga region assumes that the low-level
module registers a driver for the parent device and uses its owner pointer
to take the module's refcount. This approach is problematic since it can
lead to a null pointer dereference while attempting to get the region
during programming if the parent device does not have a driver.

To address this problem, add a module owner pointer to the fpga_region
struct and use it to take the module's refcount. Modify the functions for
registering a region to take an additional owner module parameter and
rename them to avoid conflicts. Use the old function names for helper
macros that automatically set the module that registers the region as the
owner. This ensures compatibility with existing low-level control modules
and reduces the chances of registering a region without setting the owner.

Also, update the documentation to keep it consistent with the new interface
for registering an fpga region.

Fixes: 0fa20cdfcc1f ("fpga: fpga-region: device tree control for FPGA")
Suggested-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Suggested-by: Xu Yilun <yilun.xu@intel.com>
Reviewed-by: Russ Weight <russ.weight@linux.dev>
Signed-off-by: Marco Pagani <marpagan@redhat.com>
Acked-by: Xu Yilun <yilun.xu@intel.com>
Link: https://lore.kernel.org/r/20240419083601.77403-1-marpagan@redhat.com
Signed-off-by: Xu Yilun <yilun.xu@linux.intel.com>
4 months agofpga: dfl: remove unused member pdata from struct dfl_{afu,fme}
Peter Colberg [Mon, 15 Apr 2024 23:59:37 +0000 (19:59 -0400)]
fpga: dfl: remove unused member pdata from struct dfl_{afu,fme}

The member pdata in struct dfl_{afu,fme} is set in function
{afu,fme}_dev_init(), respectively, but never used.

Fixes: 857a26222ff7 ("fpga: dfl: afu: add afu sub feature support")
Fixes: 29de76240e86 ("fpga: dfl: fme: add partial reconfiguration sub feature support")
Signed-off-by: Peter Colberg <peter.colberg@intel.com>
Reviewed-by: Matthew Gerlach <matthew.gerlach@linux.intel.com>
Acked-by: Xu Yilun <yilun.xu@intel.com>
Link: https://lore.kernel.org/r/20240415235937.3121-1-peter.colberg@intel.com
Signed-off-by: Xu Yilun <yilun.xu@linux.intel.com>
4 months agofpga: dfl: remove unused function is_dfl_feature_present()
Peter Colberg [Mon, 15 Apr 2024 23:57:43 +0000 (19:57 -0400)]
fpga: dfl: remove unused function is_dfl_feature_present()

The function is_dfl_feature_present() was added but never used.

Fixes: 5b57d02a2f94 ("fpga: dfl: add feature device infrastructure")
Signed-off-by: Peter Colberg <peter.colberg@intel.com>
Reviewed-by: Matthew Gerlach <matthew.gerlach@linux.intel.com>
Acked-by: Xu Yilun <yilun.xu@intel.com>
Link: https://lore.kernel.org/r/20240415235743.3045-1-peter.colberg@intel.com
Signed-off-by: Xu Yilun <yilun.xu@linux.intel.com>
4 months agofpga: ice40-spi: Don't use "proxy" headers
Andy Shevchenko [Mon, 15 Apr 2024 14:23:28 +0000 (17:23 +0300)]
fpga: ice40-spi: Don't use "proxy" headers

Update header inclusions to follow IWYU (Include What You Use)
principle.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: Xu Yilun <yilun.xu@intel.com>
Link: https://lore.kernel.org/r/20240415142428.853812-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Xu Yilun <yilun.xu@linux.intel.com>