linux-2.6-block.git
6 months agochar: xilinx_hwicap: Fix NULL vs IS_ERR() bug
Dan Carpenter [Tue, 20 Feb 2024 09:02:31 +0000 (12:02 +0300)]
char: xilinx_hwicap: Fix NULL vs IS_ERR() bug

The devm_platform_ioremap_resource() function returns error pointers.
It never returns NULL.  Update the check accordingly.

Fixes: 672371832193 ("char: xilinx_hwicap: Modernize driver probe")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Acked-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/ef647a9c-b1b7-4338-9bc0-28165ec2a367@moroto.mountain
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 months agohpet: remove hpets::hp_clocksource
Jiri Slaby (SUSE) [Tue, 13 Feb 2024 11:15:27 +0000 (12:15 +0100)]
hpet: remove hpets::hp_clocksource

Commit cf8e8658100d (arch: Remove Itanium (IA-64) architecture) removed
the last user of hpets::hp_clocksource. Drop the member.

Found by https://github.com/jirislaby/clang-struct.

Signed-off-by: "Jiri Slaby (SUSE)" <jirislaby@kernel.org>
Cc: Clemens Ladisch <clemens@ladisch.de>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Link: https://lore.kernel.org/r/20240213111527.25218-1-jirislaby@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 months agoplatform: goldfish: move the separate 'default' propery for CONFIG_GOLDFISH
Masahiro Yamada [Sun, 4 Feb 2024 08:10:04 +0000 (17:10 +0900)]
platform: goldfish: move the separate 'default' propery for CONFIG_GOLDFISH

Currently, there are two entries for CONFIG_GOLDFISH.

In arch/x86/Kconfig:

  config GOLDFISH
          def_bool y
          depends on X86_GOLDFISH

In drivers/platform/goldfish/Kconfig:

  menuconfig GOLDFISH
          bool "Platform support for Goldfish virtual devices"
          depends on HAS_IOMEM && HAS_DMA

While Kconfig allows multiple entries, it generally leads to tricky
code.

Prior to commit bd2f348db503 ("goldfish: refactor goldfish platform
configs"), CONFIG_GOLDFISH was an alias of CONFIG_X86_GOLDFISH.

After the mentioned commit added the second entry with a user prompt,
the former provides the 'default' property that is effective only when
X86_GOLDFISH=y.

Merge them tegether to clarify how it has worked in the past 8 years.

Cc: Greg Hackmann <ghackmann@google.com>
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Link: https://lore.kernel.org/r/20240204081004.33871-1-masahiroy@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 months agochar: xilinx_hwicap: drop casting to void in dev_set_drvdata
Javier Carrasco [Sun, 3 Mar 2024 22:34:39 +0000 (23:34 +0100)]
char: xilinx_hwicap: drop casting to void in dev_set_drvdata

The C standard specifies that there is no need to cast from a pointer to
void [1]. Therefore, it can be safely dropped.

[1] C Standard Committee: https://c0x.shape-of-code.com/6.3.2.3.html

Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
Link: https://lore.kernel.org/r/20240303-void_in_dev_set_drvdata-v1-1-ae39027d740b@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 months agogreybus: move is_gb_* functions out of greybus.h
Ricardo B. Marliere [Mon, 26 Feb 2024 21:05:19 +0000 (18:05 -0300)]
greybus: move is_gb_* functions out of greybus.h

The functions below are only used within the context of
drivers/greybus/core.c, so move them all into core and drop their 'inline'
specifiers:

is_gb_host_device(), is_gb_module(), is_gb_interface(), is_gb_control(),
is_gb_bundle() and is_gb_svc().

Suggested-by: Alex Elder <elder@ieee.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: "Ricardo B. Marliere" <ricardo@marliere.net>
Reviewed-by: Alex Elder <elder@linaro.org>
Link: https://lore.kernel.org/r/20240226-device_cleanup-greybus2-v1-1-5f7d1161e684@marliere.net
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 months agogreybus: Remove usage of the deprecated ida_simple_xx() API
Christophe JAILLET [Sun, 14 Jan 2024 09:57:02 +0000 (10:57 +0100)]
greybus: Remove usage of the deprecated ida_simple_xx() API

ida_alloc() and ida_free() should be preferred to the deprecated
ida_simple_get() and ida_simple_remove().

Note that the upper limit of ida_simple_get() is exclusive, but the one of
ida_alloc_range()/ida_alloc_max() is inclusive. So a -1 has been added when
needed.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Reviewed-by: Alex Elder <elder@linaro.org>
Link: https://lore.kernel.org/r/26425379d3eb9ba1b9af44468576ee20c77eb248.1705226208.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 months agosiox: make siox_bus_type const
Ricardo B. Marliere [Sun, 4 Feb 2024 22:26:42 +0000 (19:26 -0300)]
siox: make siox_bus_type const

Since commit d492cc2573a0 ("driver core: device.h: make struct bus_type
a const *"), the driver core can properly handle constant struct
bus_type. Move the siox_bus_type variable to be a constant structure as
well, placing it into read-only memory which can not be modified at
runtime.

Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Suggested-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: "Ricardo B. Marliere" <ricardo@marliere.net>
Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Acked-by: Thorsten Scherer <t.scherer@eckelmann.de>
Link: https://lore.kernel.org/r/20240204-bus_cleanup-siox-v2-1-3813a6a55dcc@marliere.net
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 months agomcb: constify the struct device_type usage
Ricardo B. Marliere [Mon, 19 Feb 2024 19:52:00 +0000 (16:52 -0300)]
mcb: 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
mcb_carrier_device_type variable to be a constant structure as well,
placing it into read-only memory which can not be modified at runtime.

Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: "Ricardo B. Marliere" <ricardo@marliere.net>
Link: https://lore.kernel.org/r/20240219-device_cleanup-mcb-v1-1-dc930e7dc11c@marliere.net
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 months agomcb: make mcb_bus_type const
Ricardo B. Marliere [Tue, 27 Feb 2024 11:40:29 +0000 (12:40 +0100)]
mcb: make mcb_bus_type const

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

Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Suggested-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: "Ricardo B. Marliere" <ricardo@marliere.net>
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Reviewed-by: Johannes Thumshirn <jth@kernel.org>
Signed-off-by: Johannes Thumshirn <jth@kernel.org>
Link: https://lore.kernel.org/r/20240227114029.22319-2-jth@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 months agotifm: make tifm_adapter_class constant
Ricardo B. Marliere [Fri, 1 Mar 2024 21:21:38 +0000 (18:21 -0300)]
tifm: make tifm_adapter_class constant

Since commit 43a7206b0963 ("driver core: class: make class_register() take
a const *"), the driver core allows for struct class to be in read-only
memory, so move the tifm_adapter_class structure to be declared at build
time placing it into read-only memory, instead of having to be dynamically
allocated at boot time.

Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Suggested-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: "Ricardo B. Marliere" <ricardo@marliere.net>
Link: https://lore.kernel.org/r/20240301-class_cleanup-char-misc-v1-1-4e2a41bef8cc@marliere.net
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 months agosiox: constify the struct device_type usage
Ricardo B. Marliere [Mon, 19 Feb 2024 19:49:30 +0000 (16:49 -0300)]
siox: 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
siox_device_type and siox_master_type variables to be constant structures
as well, placing it into read-only memory which can not be modified at
runtime.

Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: "Ricardo B. Marliere" <ricardo@marliere.net>
Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Acked-by: Thorsten Scherer <t.scherer@eckelmann.de>
Link: https://lore.kernel.org/r/20240219-device_cleanup-siox-v1-1-eb32ca2b0113@marliere.net
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 months agodio: make dio_bus_type const
Ricardo B. Marliere [Mon, 12 Feb 2024 11:41:01 +0000 (08:41 -0300)]
dio: make dio_bus_type const

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

Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Suggested-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: "Ricardo B. Marliere" <ricardo@marliere.net>
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Link: https://lore.kernel.org/r/20240212-bus_cleanup-dio-v2-1-3b1ba4c0547d@marliere.net
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 months agoipack: make ipack_bus_type const
Ricardo B. Marliere [Sun, 4 Feb 2024 20:00:13 +0000 (17:00 -0300)]
ipack: make ipack_bus_type const

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

Suggested-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: "Ricardo B. Marliere" <ricardo@marliere.net>
Acked-by: Vaibhav Gupta <vaibhavgupta40@gmail.com>
Link: https://lore.kernel.org/r/20240204-bus_cleanup-ipack-v1-1-aef5e8f84d01@marliere.net
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 months agomost: core: make mostbus const
Ricardo B. Marliere [Sun, 4 Feb 2024 20:13:16 +0000 (17:13 -0300)]
most: core: make mostbus const

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

Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Suggested-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: "Ricardo B. Marliere" <ricardo@marliere.net>
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Link: https://lore.kernel.org/r/20240204-bus_cleanup-most-v1-1-f5cd9a06e13f@marliere.net
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 months agonvmem: core: Print error on wrong bits DT property
Markus Schneider-Pargmann [Sat, 24 Feb 2024 11:45:16 +0000 (11:45 +0000)]
nvmem: core: Print error on wrong bits DT property

The algorithms in nvmem core are built with the constraint that
bit_offset < 8. If bit_offset is greater the results are wrong. Print an
error if the devicetree 'bits' property is outside of the valid range
and abort parsing.

Signed-off-by: Markus Schneider-Pargmann <msp@baylibre.com>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20240224114516.86365-12-srinivas.kandagatla@linaro.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 months agonvmem: core: make nvmem_layout_bus_type const
Ricardo B. Marliere [Sat, 24 Feb 2024 11:45:15 +0000 (11:45 +0000)]
nvmem: core: make nvmem_layout_bus_type const

Since commit d492cc2573a0 ("driver core: device.h: make struct bus_type
a const *"), the driver core can properly handle constant struct
bus_type, move the nvmem_layout_bus_type variable to be a constant
structure as well, placing it into read-only memory which can not be
modified at runtime.

Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Suggested-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: "Ricardo B. Marliere" <ricardo@marliere.net>
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20240224114516.86365-11-srinivas.kandagatla@linaro.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 months agonvmem: mtk-efuse: Drop NVMEM device name
Chen-Yu Tsai [Sat, 24 Feb 2024 11:45:14 +0000 (11:45 +0000)]
nvmem: mtk-efuse: Drop NVMEM device name

The MT8183 has not one but two efuse devices. The static name and ID
causes the second efuse device to fail to probe, due to duplicate sysfs
entries.

With the rework of the mtk-socinfo driver, lookup by name is no longer
necessary. The custom name can simply be dropped.

Signed-off-by: Chen-Yu Tsai <wenst@chromium.org>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Tested-by: "Nícolas F. R. A. Prado" <nfraprado@collabora.com>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20240224114516.86365-10-srinivas.kandagatla@linaro.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 months agoMAINTAINERS: Add maintainers for ZynqMP NVMEM driver
Praveen Teja Kundanala [Sat, 24 Feb 2024 11:45:13 +0000 (11:45 +0000)]
MAINTAINERS: Add maintainers for ZynqMP NVMEM driver

Add maintainers for ZynqMP NVMEM driver and driver document.

Signed-off-by: Praveen Teja Kundanala <praveen.teja.kundanala@amd.com>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20240224114516.86365-9-srinivas.kandagatla@linaro.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 months agonvmem: zynqmp_nvmem: Add support to access efuse
Praveen Teja Kundanala [Sat, 24 Feb 2024 11:45:12 +0000 (11:45 +0000)]
nvmem: zynqmp_nvmem: Add support to access efuse

Add support to read/write efuse memory map of ZynqMP.
Below are the offsets of ZynqMP efuse memory map
0 - SOC version(read only)
0xC - 0xFC -ZynqMP specific purpose efuses
0x100 - 0x17F - Physical Unclonable Function(PUF)
                efuses repurposed as user efuses

Signed-off-by: Praveen Teja Kundanala <praveen.teja.kundanala@amd.com>
Acked-by: Kalyani Akula <Kalyani.akula@amd.com>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20240224114516.86365-8-srinivas.kandagatla@linaro.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 months agonvmem: zynqmp_nvmem: zynqmp_nvmem_probe cleanup
Praveen Teja Kundanala [Sat, 24 Feb 2024 11:45:11 +0000 (11:45 +0000)]
nvmem: zynqmp_nvmem: zynqmp_nvmem_probe cleanup

- Remove static nvmem_config declaration
- Remove zynqmp_nvmem_data

Signed-off-by: Praveen Teja Kundanala <praveen.teja.kundanala@amd.com>
Acked-by: Kalyani Akula <Kalyani.akula@amd.com>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20240224114516.86365-7-srinivas.kandagatla@linaro.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 months agofirmware: xilinx: Add ZynqMP efuse access API
Praveen Teja Kundanala [Sat, 24 Feb 2024 11:45:10 +0000 (11:45 +0000)]
firmware: xilinx: Add ZynqMP efuse access API

Add zynqmp_pm_efuse_access API in the ZynqMP
firmware for read/write access of efuse memory.

Signed-off-by: Praveen Teja Kundanala <praveen.teja.kundanala@amd.com>
Acked-by: Michal Simek <michal.simek@amd.com>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20240224114516.86365-6-srinivas.kandagatla@linaro.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 months agodt-bindings: nvmem: add common definition of nvmem-cell-cells
Krzysztof Kozlowski [Sat, 24 Feb 2024 11:45:09 +0000 (11:45 +0000)]
dt-bindings: nvmem: add common definition of nvmem-cell-cells

Linux kernel NVMEM consumer bindings define phandle to NVMEM cells
("nvmem-cells"), thus we also want the common definition of property
defining number of cells encoding that specifier, so the

Suggested-by: Rob Herring <robh@kernel.org>
Reported-by: Michael Walle <michael@walle.cc>
Closes: https://github.com/devicetree-org/dt-schema/pull/89
Reported-by: Rafał Miłecki <zajec5@gmail.com>
Closes: https://lore.kernel.org/linux-arm-kernel/20221121105830.7411-1-zajec5@gmail.com/#r
Closes: https://lore.kernel.org/all/bdf7751b-0421-485d-8382-26c084f09d7d@gmail.com/
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20240224114516.86365-5-srinivas.kandagatla@linaro.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 months agodt-bindings: nvmem: Convert xlnx,zynqmp-nvmem.txt to yaml
Praveen Teja Kundanala [Sat, 24 Feb 2024 11:45:08 +0000 (11:45 +0000)]
dt-bindings: nvmem: Convert xlnx,zynqmp-nvmem.txt to yaml

Convert the xlnx,zynqmp-nvmem.txt to yaml.

Signed-off-by: Praveen Teja Kundanala <praveen.teja.kundanala@amd.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20240224114516.86365-4-srinivas.kandagatla@linaro.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 months agonvmem: mtk-efuse: Register MediaTek socinfo driver from efuse
William-tw Lin [Sat, 24 Feb 2024 11:45:07 +0000 (11:45 +0000)]
nvmem: mtk-efuse: Register MediaTek socinfo driver from efuse

The socinfo driver reads chip information from eFuses and does not need
any devicetree node. Register it from mtk-efuse.

While at it, also add the name for this driver's nvmem_config.

Signed-off-by: William-tw Lin <william-tw.lin@mediatek.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20240224114516.86365-3-srinivas.kandagatla@linaro.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 months agonvmem: fixed-cell: Simplify nested if/then schema
Rob Herring [Sat, 24 Feb 2024 11:45:06 +0000 (11:45 +0000)]
nvmem: fixed-cell: Simplify nested if/then schema

There's no reason to have a nested if/then schema as checking for compatible
being present and containing 'mac-base' can all be done in one 'if' schema.

Signed-off-by: Rob Herring <robh@kernel.org>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20240224114516.86365-2-srinivas.kandagatla@linaro.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 months agoslimbus: core: make slimbus_bus const
Ricardo B. Marliere [Sat, 24 Feb 2024 11:44:03 +0000 (11:44 +0000)]
slimbus: core: make slimbus_bus const

Since commit d492cc2573a0 ("driver core: device.h: make struct
bus_type a const *"), the driver core can properly handle constant
struct bus_type, move the slimbus_bus variable to be a constant
structure as well, placing it into read-only memory which can not be
modified at runtime.

Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Suggested-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: "Ricardo B. Marliere" <ricardo@marliere.net>
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20240224114403.86230-3-srinivas.kandagatla@linaro.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 months agoslimbus: qcom-ngd-ctrl: Make QMI message rules const
Jeff Johnson [Sat, 24 Feb 2024 11:44:02 +0000 (11:44 +0000)]
slimbus: qcom-ngd-ctrl: Make QMI message rules const

Commit ff6d365898d4 ("soc: qcom: qmi: use const for struct
qmi_elem_info") allows QMI message encoding/decoding rules
to be const, so do that for qcom-ngd-ctrl.c.

Signed-off-by: Jeff Johnson <quic_jjohnson@quicinc.com>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20240224114403.86230-2-srinivas.kandagatla@linaro.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 months agoslimbus: core: Remove usage of the deprecated ida_simple_xx() API
Christophe JAILLET [Sat, 24 Feb 2024 11:41:37 +0000 (11:41 +0000)]
slimbus: core: Remove usage of the deprecated ida_simple_xx() API

ida_alloc() and ida_free() should be preferred to the deprecated
ida_simple_get() and ida_simple_remove().

Note that the upper limit of ida_simple_get() is exclusive, but the one of
ida_alloc_range() is inclusive. So change this change allows one more
device. Previously address 0xFE was never used.

Fixes: 46a2bb5a7f7e ("slimbus: core: Add slim controllers support")
Cc: Stable@vger.kernel.org
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20240224114137.85781-2-srinivas.kandagatla@linaro.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 months agonvmem: meson-efuse: fix function pointer type mismatch
Jerome Brunet [Sat, 24 Feb 2024 11:40:23 +0000 (11:40 +0000)]
nvmem: meson-efuse: fix function pointer type mismatch

clang-16 warns about casting functions to incompatible types, as is done
here to call clk_disable_unprepare:

drivers/nvmem/meson-efuse.c:78:12: error: cast from 'void (*)(struct clk *)' to 'void (*)(void *)' converts to incompatible function type [-Werror,-Wcast-function-type-strict]
   78 |                                        (void(*)(void *))clk_disable_unprepare,

The pattern of getting, enabling and setting a disable callback for a
clock can be replaced with devm_clk_get_enabled(), which also fixes
this warning.

Fixes: 611fbca1c861 ("nvmem: meson-efuse: add peripheral clock")
Cc: Stable@vger.kernel.org
Reported-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
Reviewed-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Justin Stitt <justinstitt@google.com>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20240224114023.85535-2-srinivas.kandagatla@linaro.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 months agogreybus: constify the struct device_type usage
Ricardo B. Marliere [Mon, 19 Feb 2024 12:40:50 +0000 (09:40 -0300)]
greybus: 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
greybus_hd_type, greybus_module_type, greybus_interface_type,
greybus_control_type, greybus_bundle_type and greybus_svc_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>
Reviewed-by: Alex Elder <elder@linaro.org>
Link: https://lore.kernel.org/r/20240219-device_cleanup-greybus-v1-1-babb3f65e8cc@marliere.net
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 months agogreybus: make greybus_bus_type const
Greg Kroah-Hartman [Fri, 5 Jan 2024 10:16:17 +0000 (11:16 +0100)]
greybus: make greybus_bus_type const

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

Cc: Alex Elder <elder@kernel.org>
Cc: greybus-dev@lists.linaro.org
Reviewed-by: Johan Hovold <johan@kernel.org>
Link: https://lore.kernel.org/r/2024010517-handgun-scoreless-05e7@gregkh
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 months agoMerge tag 'icc-6.9-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/djakov/icc...
Greg Kroah-Hartman [Wed, 6 Mar 2024 14:03:31 +0000 (14:03 +0000)]
Merge tag 'icc-6.9-rc1' of git://git./linux/kernel/git/djakov/icc into char-misc-next

Georgi writes:

interconnect changes for 6.9

This pull request contains the interconnect changes for the 6.9-rc1 merge
window. The highlights are below:

Core changes:
- Constify the of_phandle_args in xlate functions.

Driver changes:
- New interconnect driver for the MSM8909 platform.
- New interconnect driver for the SM7150 platform.
- Clean-up and removal of unused resources in drivers.
- Constify some pointers to structs.

Signed-off-by: Georgi Djakov <djakov@kernel.org>
* tag 'icc-6.9-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/djakov/icc:
  interconnect: qcom: Add SM7150 driver support
  dt-bindings: interconnect: Add Qualcomm SM7150 DT bindings
  interconnect: constify of_phandle_args in xlate
  dt-bindings: interconnect: qcom,rpmh: Fix bouncing @codeaurora address
  interconnect: qcom: x1e80100: constify pointer to qcom_icc_bcm
  interconnect: qcom: sa8775p: constify pointer to qcom_icc_bcm
  interconnect: qcom: sm6115: constify pointer to qcom_icc_node
  interconnect: qcom: sm8250: constify pointer to qcom_icc_node
  interconnect: qcom: sa8775p: constify pointer to qcom_icc_node
  interconnect: qcom: msm8909: constify pointer to qcom_icc_node
  interconnect: qcom: x1e80100: Remove bogus per-RSC BCMs and nodes
  dt-bindings: interconnect: Remove bogus interconnect nodes
  interconnect: qcom: sm8550: Remove bogus per-RSC BCMs and nodes
  interconnect: qcom: Add MSM8909 interconnect provider driver
  dt-bindings: interconnect: Add Qualcomm MSM8909 DT bindings

6 months agomisc: xilinx_tmr_inject: Convert to platform remove callback returning void
Uwe Kleine-König [Wed, 21 Feb 2024 09:53:55 +0000 (10:53 +0100)]
misc: xilinx_tmr_inject: 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: Arnd Bergmann <arnd@arndb.de>
Link: https://lore.kernel.org/r/198112757eac0fc004677a4757ce48ae7c7194ab.1708508896.git.u.kleine-koenig@pengutronix.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 months agomisc: xilinx_sdfec: Convert to platform remove callback returning void
Uwe Kleine-König [Wed, 21 Feb 2024 09:53:54 +0000 (10:53 +0100)]
misc: xilinx_sdfec: 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: Arnd Bergmann <arnd@arndb.de>
Link: https://lore.kernel.org/r/705b89c3cd7c0a42ce3f482f202204f5e3377aa2.1708508896.git.u.kleine-koenig@pengutronix.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 months agomisc: vcpu_stall_detector: Convert to platform remove callback returning void
Uwe Kleine-König [Wed, 21 Feb 2024 09:53:53 +0000 (10:53 +0100)]
misc: vcpu_stall_detector: 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: Arnd Bergmann <arnd@arndb.de>
Link: https://lore.kernel.org/r/4b964bd133f5af11cabd51a4d8ed95025583eb93.1708508896.git.u.kleine-koenig@pengutronix.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 months agomisc: ti-st: st_kim: Convert to platform remove callback returning void
Uwe Kleine-König [Wed, 21 Feb 2024 09:53:52 +0000 (10:53 +0100)]
misc: ti-st: st_kim: 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: Arnd Bergmann <arnd@arndb.de>
Link: https://lore.kernel.org/r/250337c967bdb5019a3c9fe8e0d082cd65400227.1708508896.git.u.kleine-koenig@pengutronix.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 months agomisc: sram: Convert to platform remove callback returning void
Uwe Kleine-König [Wed, 21 Feb 2024 09:53:51 +0000 (10:53 +0100)]
misc: sram: 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: Arnd Bergmann <arnd@arndb.de>
Link: https://lore.kernel.org/r/946ebc33a01bf700171257cd219fbe8626bc0c99.1708508896.git.u.kleine-koenig@pengutronix.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 months agomisc: open-dice: Convert to platform remove callback returning void
Uwe Kleine-König [Wed, 21 Feb 2024 09:53:50 +0000 (10:53 +0100)]
misc: open-dice: 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: Arnd Bergmann <arnd@arndb.de>
Link: https://lore.kernel.org/r/8e7179794ffbcaa4ad3d0db50cc4aa03f377fc8c.1708508896.git.u.kleine-koenig@pengutronix.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 months agomei: vsc: Convert to platform remove callback returning void
Uwe Kleine-König [Wed, 21 Feb 2024 09:53:49 +0000 (10:53 +0100)]
mei: vsc: 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: Arnd Bergmann <arnd@arndb.de>
Link: https://lore.kernel.org/r/8e14f0b1cea107e613fa0075b3379a9f1e7ef63f.1708508896.git.u.kleine-koenig@pengutronix.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 months agomisc: hisi_hikey_usb: Convert to platform remove callback returning void
Uwe Kleine-König [Wed, 21 Feb 2024 09:53:48 +0000 (10:53 +0100)]
misc: hisi_hikey_usb: 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: John Stultz <jstultz@google.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Link: https://lore.kernel.org/r/8775e9573fec55c5fc04151800829e9aeafc5dda.1708508896.git.u.kleine-koenig@pengutronix.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 months agomisc: fastrpc: Convert to platform remove callback returning void
Uwe Kleine-König [Wed, 21 Feb 2024 09:53:47 +0000 (10:53 +0100)]
misc: fastrpc: 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: Arnd Bergmann <arnd@arndb.de>
Link: https://lore.kernel.org/r/d138bc7f6ec39038d2b5a23478fc036a41988bde.1708508896.git.u.kleine-koenig@pengutronix.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 months agocxl: Convert to platform remove callback returning void
Uwe Kleine-König [Wed, 21 Feb 2024 09:53:46 +0000 (10:53 +0100)]
cxl: 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: Andrew Donnellan <ajd@linux.ibm.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Link: https://lore.kernel.org/r/add08320eef9ea20ceca78648370590a4bd447b0.1708508896.git.u.kleine-koenig@pengutronix.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 months agomisc: atmel-ssc: Convert to platform remove callback returning void
Uwe Kleine-König [Wed, 21 Feb 2024 09:53:45 +0000 (10:53 +0100)]
misc: atmel-ssc: 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: Nicolas Ferre <nicolas.ferre@microchip.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Link: https://lore.kernel.org/r/45719fc31bb893bb9ab1450057e9cb7f399e9ee2.1708508896.git.u.kleine-koenig@pengutronix.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 months agomisc: hisi_hikey_usb: Remove unused of_gpio.h
Andy Shevchenko [Mon, 4 Mar 2024 18:08:29 +0000 (20:08 +0200)]
misc: hisi_hikey_usb: Remove unused of_gpio.h

of_gpio.h is deprecated and subject to remove.
The driver doesn't use it, simply remove the unused header.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: John Stultz <jstultz@google.com>
Link: https://lore.kernel.org/r/20240304180829.1201726-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 months agomisc: hi6421-spmi-pmic: Remove unused of_gpio.h
Andy Shevchenko [Mon, 4 Mar 2024 18:07:37 +0000 (20:07 +0200)]
misc: hi6421-spmi-pmic: Remove unused of_gpio.h

of_gpio.h is deprecated and subject to remove.
The driver doesn't use it, simply remove the unused header.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20240304180737.1201566-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 months agomisc: eeprom_93xx46: Remove unused of_gpio.h
Andy Shevchenko [Mon, 4 Mar 2024 18:06:43 +0000 (20:06 +0200)]
misc: eeprom_93xx46: Remove unused of_gpio.h

of_gpio.h is deprecated and subject to remove.
The driver doesn't use it, simply remove the unused header.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20240304180643.1201319-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 months agomei: vsc: Assign pinfo fields in variable declaration
Sakari Ailus [Mon, 19 Feb 2024 19:58:07 +0000 (21:58 +0200)]
mei: vsc: Assign pinfo fields in variable declaration

Assign all possible fields of pinfo in variable declaration, instead of
just zeroing it there.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Tested-and-Reviewed-by: Wentong Wu <wentong.wu@intel.com>
Link: https://lore.kernel.org/r/20240219195807.517742-4-sakari.ailus@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 months agomei: vsc: Don't use sleeping condition in wait_event_timeout()
Sakari Ailus [Mon, 19 Feb 2024 19:58:06 +0000 (21:58 +0200)]
mei: vsc: Don't use sleeping condition in wait_event_timeout()

vsc_tp_wakeup_request() called wait_event_timeout() with
gpiod_get_value_cansleep() which may sleep, and does so as the
implementation is that of gpio-ljca.

Move the GPIO state check outside the call.

Fixes: 566f5ca97680 ("mei: Add transport driver for IVSC device")
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Tested-and-Reviewed-by: Wentong Wu <wentong.wu@intel.com>
Link: https://lore.kernel.org/r/20240219195807.517742-3-sakari.ailus@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 months agomei: vsc: Call wake_up() in the threaded IRQ handler
Sakari Ailus [Mon, 19 Feb 2024 19:58:05 +0000 (21:58 +0200)]
mei: vsc: Call wake_up() in the threaded IRQ handler

The hard IRQ handler vsc_tp_irq() is called with a raw spinlock taken.
wake_up() acquires a spinlock, a sleeping lock on PREEMPT_RT. This leads
to sleeping in atomic context.

Move the wake_up() call to the threaded IRQ handler vsc_tp_thread_isr()
where it can be safely called.

Fixes: 566f5ca97680 ("mei: Add transport driver for IVSC device")
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Tested-and-Reviewed-by: Wentong Wu <wentong.wu@intel.com>
Link: https://lore.kernel.org/r/20240219195807.517742-2-sakari.ailus@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 months agomei: me: remove unnecessary NULL pointer checks
Bjorn Helgaas [Thu, 29 Feb 2024 18:13:00 +0000 (12:13 -0600)]
mei: me: remove unnecessary NULL pointer checks

The .shutdown(), .remove(), and power management callbacks are never called
unless .probe() has already returned success, which means it has set
drvdata to a non-NULL pointer, so "dev" can never be NULL in the other
callbacks.

Remove the unnecessary checks.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Link: https://lore.kernel.org/r/20240229181300.352077-4-helgaas@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 months agomei: txe: remove unnecessary NULL pointer checks
Bjorn Helgaas [Thu, 29 Feb 2024 18:12:59 +0000 (12:12 -0600)]
mei: txe: remove unnecessary NULL pointer checks

The .shutdown(), .remove(), and power management callbacks are never called
unless .probe() has already returned success, which means it has set
drvdata to a non-NULL pointer, so "dev" can never be NULL in the other
callbacks.

Remove the unnecessary checks.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Link: https://lore.kernel.org/r/20240229181300.352077-3-helgaas@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 months agomei: gsc: remove unnecessary NULL pointer checks
Bjorn Helgaas [Thu, 29 Feb 2024 18:12:58 +0000 (12:12 -0600)]
mei: gsc: remove unnecessary NULL pointer checks

The .remove() and power management callbacks are never called unless
.probe() has already returned success, which means it has set drvdata to a
non-NULL pointer, so "dev" can never be NULL in the other callbacks.

Remove the unnecessary checks.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Link: https://lore.kernel.org/r/20240229181300.352077-2-helgaas@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 months agoMerge tag 'iio-for-6.9b' of https://git.kernel.org/pub/scm/linux/kernel/git/jic23...
Greg Kroah-Hartman [Sat, 2 Mar 2024 19:02:18 +0000 (20:02 +0100)]
Merge tag 'iio-for-6.9b' of https://git./linux/kernel/git/jic23/iio into char-misc-next

Jonathan writes:

IIO: 2nd set of new device support, cleanups and features for 6.9

New device support
=================
adi,hmc425a
- Add support for LTC6373 Instrumentation Amplifier.
microchip,pac1934
- New driver supporting PAC1931, PAC1932, PAC1933 and PAC1934 power monitoring
chips with accumulators.
voltafield,af8133j
- New driver for the AF8133J 3 axis magnetometer.

Docs
====

New general documentation of device buffers, and a specific section on
the adi,adis16475 IMU

Features
========

kionix,kxcjk-1013
 - Add support for ACPI ROTM (Microsoft defined ACPI method) to get rotation
   matrix.
ti,tmp117
- Add missing vcc-supply control and binding.

Cleanups and minor fixes
========================

Tree-wide
- Corrected headers to remove linux/of.h from a bunch of drivers
  that only had it to get to linux/mod_devicetable.h
- dt binding cleanup to drop redundant type from label properties.

adi,hmc425a
- Fix constraints on GPIO array sizes for different devices.
adi,ltc2983
- Use spi_get_device_match_data instead of open coding similar.
- Update naming of fw parsing function to reflect that it is not longer
  dt only.
- Set the chip name explicitly to reduce fragility resulting from different
  entries in the various ID tables.
bosch,bmg160
- Add spi-max-frequency property and limit to dt-binding.
microchip,mcp320x
- Use devm_* to simplify device removal and error handling.
nxp,imx93
- Drop a non existent 4th interrupt from bindings.
qcom,mp8xxx-xoadc
- Drop unused kerneldoc
renesas,isl29501
- Actually use the of_match table.
rockchip,saradc
- Fix channel bitmask
- Fix write masks
- Replace custom handling of optional reset control with how it should be
  done.
ti,ads1298
- Fix error code to not return a successfully obtained regulator.
- Avoid a divide by zero when setting frequency.
ti,hdc2010
- Add missing interrupts dt binding property
vishay,veml6075
- Make vdd-supply required in the dt-binding.

* tag 'iio-for-6.9b' of https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio: (42 commits)
  dt-bindings: iio: gyroscope: bosch,bmg160: add spi-max-frequency
  dt-bindings: iio: adc: imx93: drop the 4th interrupt
  iio: proximity: isl29501: make use of of_device_id table
  iio: adc: qcom-pm8xxx-xoadc: drop unused kerneldoc struct pm8xxx_chan_info member
  dt-bindings: iio: adc: drop redundant type from label
  dt-bindings: iio: ti,tmp117: add optional label property
  MAINTAINERS: Add an entry for AF8133J driver
  iio: magnetometer: add a driver for Voltafield AF8133J magnetometer
  dt-bindings: iio: magnetometer: Add Voltafield AF8133J
  dt-bindings: vendor-prefix: Add prefix for Voltafield
  iio: adc: rockchip_saradc: replace custom logic with devm_reset_control_get_optional_exclusive
  iio: adc: rockchip_saradc: use mask for write_enable bitfield
  iio: adc: rockchip_saradc: fix bitmask for channels on SARADCv2
  dt-bindings: iio: light: vishay,veml6075: make vdd-supply required
  iio: adc: adding support for PAC193x
  dt-bindings: iio: adc: adding support for PAC193X
  iio: temperature: ltc2983: explicitly set the name in chip_info
  iio: temperature: ltc2983: rename ltc2983_parse_dt()
  iio: temperature: ltc2983: make use of spi_get_device_match_data()
  iio: adc: ti-ads1298: prevent divide by zero in ads1298_set_samp_freq()
  ...

6 months agoMerge tag 'fpga-for-6.9-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/fpga...
Greg Kroah-Hartman [Sat, 2 Mar 2024 19:01:17 +0000 (20:01 +0100)]
Merge tag 'fpga-for-6.9-rc1' of git://git./linux/kernel/git/fpga/linux-fpga into char-misc-next

Xu writes:

FPGA Manager changes for 6.9-rc1

DFL:

- Ricardo's change makes dfl_bus_type const.

FPGA MGR core:

- Marco's change removes redundant checks for bridge ops.

All patches have been reviewed on the mailing list, and have been in the
last linux-next releases (as part of our for-next branch).

Signed-off-by: Xu Yilun <yilun.xu@intel.com>
* tag 'fpga-for-6.9-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/fpga/linux-fpga:
  fpga: remove redundant checks for bridge ops
  fpga: dfl: make dfl_bus_type const

6 months agoMerge tag 'coresight-next-v6.9' of git://git.kernel.org/pub/scm/linux/kernel/git...
Greg Kroah-Hartman [Sat, 2 Mar 2024 18:58:26 +0000 (19:58 +0100)]
Merge tag 'coresight-next-v6.9' of git://git./linux/kernel/git/coresight/linux into char-misc-next

Suzuki writes:

coresight: hwtracing subsystem updates for v6.9

Changes targeting Linux v6.9 include:
 - CoreSight: Enable W=1 warnings as default
 - CoreSight: Clean up sysfs/perf mode handling for tracing
 - Support for Qualcomm TPDM CMB Dataset
 - Miscellaneous fixes to the CoreSight subsystem
 - Fix for hisi_ptt PMU to reject events targeting other PMUs

Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
* tag 'coresight-next-v6.9' of git://git.kernel.org/pub/scm/linux/kernel/git/coresight/linux: (32 commits)
  coresight-tpda: Change qcom,dsb-element-size to qcom,dsb-elem-bits
  dt-bindings: arm: qcom,coresight-tpdm: Rename qcom,dsb-element-size
  hwtracing: hisi_ptt: Move type check to the beginning of hisi_ptt_pmu_event_init()
  coresight: tpdm: Fix build break due to uninitialised field
  coresight: etm4x: Set skip_power_up in etm4_init_arch_data function
  coresight-tpdm: Add msr register support for CMB
  dt-bindings: arm: qcom,coresight-tpdm: Add support for TPDM CMB MSR register
  coresight-tpdm: Add timestamp control register support for the CMB
  coresight-tpdm: Add pattern registers support for CMB
  coresight-tpdm: Add support to configure CMB
  coresight-tpda: Add support to configure CMB element
  coresight-tpdm: Add CMB dataset support
  dt-bindings: arm: qcom,coresight-tpdm: Add support for CMB element size
  coresight-tpdm: Optimize the useage of tpdm_has_dsb_dataset
  coresight-tpdm: Optimize the store function of tpdm simple dataset
  coresight: Add helper for setting csdev->mode
  coresight: Add a helper for getting csdev->mode
  coresight: Add helper for atomically taking the device
  coresight: Add explicit member initializers to coresight_dev_type
  coresight: Remove unused stubs
  ...

6 months agoMerge tag 'mhi-for-v6.9' of git://git.kernel.org/pub/scm/linux/kernel/git/mani/mhi...
Greg Kroah-Hartman [Sat, 2 Mar 2024 18:57:35 +0000 (19:57 +0100)]
Merge tag 'mhi-for-v6.9' of git://git./linux/kernel/git/mani/mhi into char-misc-next

Manivannan writes:

MHI Host
========

- Added new MHI_PM_SYS_ERR_FAIL state to the MHI state machine to properly
  cleanup the channel state if the device fails to respond to the MHI reset
  during SYS_ERR handling. This issue was discovered with the Qualcomm AIC100 AI
  accelerator device.

- Modified the code that reads and exposes the OEM_PK_HASH registers through
  sysfs to read them on-demand instead of reading once during boot. Qualcomm
  AIC100 devices support provisioning the keys dynamically, so this allows the
  users to know the upto date information.

- Added tracepoint support to expose the debug information over tracefs.

- Reverted the commit that reads the MHI device revision from the device during
  boot. This is done because the read info was not used anywhere (dead code) and
  also it is not possible to read the revision info from all the devices.

- Constified the modem config for Telit FN980 modem as required by the MHI core.

MHI Endpoint
============

- Replaced kzalloc() with kcalloc() in an effort to avoid integer overflows
  during multiplication. Even though there is no potential overflow in the
  endpoint code, this is done for the sake of uniformity and best practice.

- Fixed the kmem_cache_create() failure check to use the correct variable.

* tag 'mhi-for-v6.9' of git://git.kernel.org/pub/scm/linux/kernel/git/mani/mhi:
  bus: mhi: host: pci_generic: constify modem_telit_fn980_hw_v1_config
  bus: mhi: host: Change the trace string for the userspace tools mapping
  bus: mhi: ep: check the correct variable in mhi_ep_register_controller()
  Revert "bus: mhi: core: Add support for reading MHI info from device"
  bus: mhi: host: Add tracing support
  bus: mhi: ep: Use kcalloc() instead of kzalloc()
  bus: mhi: host: Read PK HASH dynamically
  bus: mhi: host: Add MHI_PM_SYS_ERR_FAIL state

6 months agoMerge branch 'icc-sm7150' into icc-next
Georgi Djakov [Thu, 29 Feb 2024 20:43:01 +0000 (22:43 +0200)]
Merge branch 'icc-sm7150' into icc-next

Add dt-bindings and interconnect driver support for the Qualcomm SM7150 SoC.

* icc-sm7150
  dt-bindings: interconnect: Add Qualcomm SM7150 DT bindings
  interconnect: qcom: Add SM7150 driver support

Link: https://lore.kernel.org/r/20240222174250.80493-1-danila@jiaxyga.com
Signed-off-by: Georgi Djakov <djakov@kernel.org>
6 months agointerconnect: qcom: Add SM7150 driver support
Danila Tikhonov [Thu, 22 Feb 2024 17:42:50 +0000 (20:42 +0300)]
interconnect: qcom: Add SM7150 driver support

Add a driver that handles the different NoCs found on SM7150, based on the
downstream dtb.

Signed-off-by: Danila Tikhonov <danila@jiaxyga.com>
Link: https://lore.kernel.org/r/20240222174250.80493-3-danila@jiaxyga.com
Signed-off-by: Georgi Djakov <djakov@kernel.org>
6 months agodt-bindings: interconnect: Add Qualcomm SM7150 DT bindings
Danila Tikhonov [Thu, 22 Feb 2024 17:42:49 +0000 (20:42 +0300)]
dt-bindings: interconnect: Add Qualcomm SM7150 DT bindings

The Qualcomm SM7150 platform has several bus fabrics that could be
controlled and tuned dynamically according to the bandwidth demand.

Signed-off-by: Danila Tikhonov <danila@jiaxyga.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20240222174250.80493-2-danila@jiaxyga.com
Signed-off-by: Georgi Djakov <djakov@kernel.org>
6 months agodt-bindings: iio: gyroscope: bosch,bmg160: add spi-max-frequency
Marco Felsch [Wed, 21 Feb 2024 17:43:05 +0000 (18:43 +0100)]
dt-bindings: iio: gyroscope: bosch,bmg160: add spi-max-frequency

Make use of the common spi-peripheral-props.yaml to pull in the common
spi device properties and limit the spi-max-frequency to 10 MHz as this
is the max. frequency if VDDIO >= 1.62V.

Note all listed devices can either operate in I2C or in SPI mode.

Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20240221174305.3423039-1-m.felsch@pengutronix.de
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
6 months agodt-bindings: iio: adc: imx93: drop the 4th interrupt
Peng Fan [Mon, 26 Feb 2024 13:08:25 +0000 (21:08 +0800)]
dt-bindings: iio: adc: imx93: drop the 4th interrupt

Per i.MX93 Reference Mannual Rev.4, 12/2013, there is no interrupt 268,
so drop it.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Acked-by: Conor Dooley <conor.dooley@microchip.com>
Link: https://lore.kernel.org/r/20240226130826.3824251-1-peng.fan@oss.nxp.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
6 months agoiio: proximity: isl29501: make use of of_device_id table
Krzysztof Kozlowski [Sun, 25 Feb 2024 20:16:54 +0000 (21:16 +0100)]
iio: proximity: isl29501: make use of of_device_id table

Reference the of_device_id table in the driver structure, so it will be
used for module autoloading and device matching.  This fixes clang W=1
warning:

  isl29501.c:999:34: error: unused variable 'isl29501_i2c_matches' [-Werror,-Wunused-const-variable]

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20240225201654.49450-2-krzysztof.kozlowski@linaro.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
6 months agoiio: adc: qcom-pm8xxx-xoadc: drop unused kerneldoc struct pm8xxx_chan_info member
Krzysztof Kozlowski [Sun, 25 Feb 2024 20:27:44 +0000 (21:27 +0100)]
iio: adc: qcom-pm8xxx-xoadc: drop unused kerneldoc struct pm8xxx_chan_info member

Drop description of non-existing 'struct pm8xxx_chan_info' member:

  qcom-pm8xxx-xoadc.c:386: warning: Excess struct member 'scale_fn_type' description in 'pm8xxx_chan_info'

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Link: https://lore.kernel.org/r/20240225202744.60500-1-krzysztof.kozlowski@linaro.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
6 months agodt-bindings: iio: adc: drop redundant type from label
Krzysztof Kozlowski [Mon, 26 Feb 2024 12:30:04 +0000 (13:30 +0100)]
dt-bindings: iio: adc: drop redundant type from label

dtschema defines label as string, so $ref in other bindings is
redundant.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20240226123004.91061-1-krzysztof.kozlowski@linaro.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
6 months agodt-bindings: iio: ti,tmp117: add optional label property
Marco Felsch [Mon, 26 Feb 2024 12:12:33 +0000 (13:12 +0100)]
dt-bindings: iio: ti,tmp117: add optional label property

Add the support to provide an optional label like we do for ADC
channels to identify the device more easily.

Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20240226121234.545662-1-m.felsch@pengutronix.de
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
6 months agoMAINTAINERS: Add an entry for AF8133J driver
Ondrej Jirman [Thu, 22 Feb 2024 01:13:38 +0000 (02:13 +0100)]
MAINTAINERS: Add an entry for AF8133J driver

As I am submitting the driver and have the device to test. I'll maintain
the driver.

Signed-off-by: Ondrej Jirman <megi@xff.cz>
Link: https://lore.kernel.org/r/20240222011341.3232645-5-megi@xff.cz
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
6 months agoiio: magnetometer: add a driver for Voltafield AF8133J magnetometer
Icenowy Zheng [Thu, 22 Feb 2024 01:13:37 +0000 (02:13 +0100)]
iio: magnetometer: add a driver for Voltafield AF8133J magnetometer

AF8133J is a simple I2C-connected magnetometer, without interrupts.

Add a simple IIO driver for it.

Signed-off-by: Icenowy Zheng <icenowy@aosc.io>
Signed-off-by: Dalton Durst <dalton@ubports.com>
Signed-off-by: Shoji Keita <awaittrot@shjk.jp>
Co-developed-by: Ondrej Jirman <megi@xff.cz>
Signed-off-by: Ondrej Jirman <megi@xff.cz>
Reviewed-by: Andrey Skvortsov <andrej.skvortzov@gmail.com>
Tested-by: Andrey Skvortsov <andrej.skvortzov@gmail.com>
Link: https://lore.kernel.org/r/20240222011341.3232645-4-megi@xff.cz
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
6 months agodt-bindings: iio: magnetometer: Add Voltafield AF8133J
Icenowy Zheng [Thu, 22 Feb 2024 01:13:36 +0000 (02:13 +0100)]
dt-bindings: iio: magnetometer: Add Voltafield AF8133J

Voltafield AF8133J is a simple magnetometer sensor produced by Voltafield
Technology Corp, with dual power supplies (one for core and one for I/O)
and active-low reset pin.

The sensor has configurable range 1.2 - 2.2 mT and a software controlled
standby mode.

Add a device tree binding for it.

Signed-off-by: Icenowy Zheng <icenowy@aosc.io>
Signed-off-by: Ondřej Jirman <megi@xff.cz>
Reviewed-by: Conor Dooley <conor.dooley@microchip.com>
Link: https://lore.kernel.org/r/20240222011341.3232645-3-megi@xff.cz
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
6 months agodt-bindings: vendor-prefix: Add prefix for Voltafield
Icenowy Zheng [Thu, 22 Feb 2024 01:13:35 +0000 (02:13 +0100)]
dt-bindings: vendor-prefix: Add prefix for Voltafield

Voltafile Technology Corp. is a company that produces MEMS sensors.

Add a DT vendor prefix for it.

Signed-off-by: Icenowy Zheng <icenowy@aosc.io>
Signed-off-by: Ondřej Jirman <megi@xff.cz>
Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20240222011341.3232645-2-megi@xff.cz
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
6 months agoiio: adc: rockchip_saradc: replace custom logic with devm_reset_control_get_optional_...
Quentin Schulz [Fri, 23 Feb 2024 12:45:23 +0000 (13:45 +0100)]
iio: adc: rockchip_saradc: replace custom logic with devm_reset_control_get_optional_exclusive

devm_reset_control_get_optional_exclusive does what this driver is
trying to do in its probe function, therefore let's switch over to that
subsystem function.

Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
Reviewed-by: Heiko Stuebner <heiko@sntech.de>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/20240223-saradcv2-chan-mask-v1-3-84b06a0f623a@theobroma-systems.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
6 months agoiio: adc: rockchip_saradc: use mask for write_enable bitfield
Quentin Schulz [Fri, 23 Feb 2024 12:45:22 +0000 (13:45 +0100)]
iio: adc: rockchip_saradc: use mask for write_enable bitfield

Some of the registers on the SARADCv2 have bits write protected except
if another bit is set. This is usually done by having the lowest 16 bits
store the data to write and the highest 16 bits specify which of the 16
lowest bits should have their value written to the hardware block.

The write_enable mask for the channel selection was incorrect because it
was just the value shifted by 16 bits, which means it would only ever
write bits and never clear them. So e.g. if someone starts a conversion
on channel 5, the lowest 4 bits would be 0x5, then starts a conversion
on channel 0, it would still be 5.

Instead of shifting the value by 16 as the mask, let's use the OR'ing of
the appropriate masks shifted by 16.

Note that this is not an issue currently because the only SARADCv2
currently supported has a reset defined in its Device Tree, that reset
resets the SARADC controller before starting a conversion on a channel.
However, this reset is handled as optional by the probe function and
thus proper masking should be used in the event an SARADCv2 without a
reset ever makes it upstream.

Fixes: 757953f8ec69 ("iio: adc: rockchip_saradc: Add support for RK3588")
Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
Reviewed-by: Heiko Stuebner <heiko@sntech.de>
Link: https://lore.kernel.org/r/20240223-saradcv2-chan-mask-v1-2-84b06a0f623a@theobroma-systems.com
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
6 months agoiio: adc: rockchip_saradc: fix bitmask for channels on SARADCv2
Quentin Schulz [Fri, 23 Feb 2024 12:45:21 +0000 (13:45 +0100)]
iio: adc: rockchip_saradc: fix bitmask for channels on SARADCv2

The SARADCv2 on RK3588 (the only SoC currently supported that has an
SARADCv2) selects the channel through the channel_sel bitfield which is
the 4 lowest bits, therefore the mask should be GENMASK(3, 0) and not
GENMASK(15, 0).

Fixes: 757953f8ec69 ("iio: adc: rockchip_saradc: Add support for RK3588")
Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
Reviewed-by: Heiko Stuebner <heiko@sntech.de>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/20240223-saradcv2-chan-mask-v1-1-84b06a0f623a@theobroma-systems.com
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
6 months agodt-bindings: iio: light: vishay,veml6075: make vdd-supply required
Javier Carrasco [Fri, 23 Feb 2024 13:01:33 +0000 (14:01 +0100)]
dt-bindings: iio: light: vishay,veml6075: make vdd-supply required

The VEML6075 requires a single supply to operate. The property already
exists in the bindings and it is used in the example, but it is still
not on the list of required properties.

Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
Acked-by: Conor Dooley <conor.dooley@microchip.com>
Link: https://lore.kernel.org/r/20240223-veml6075_vdd-v1-1-ac76509b1998@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
6 months agoiio: adc: adding support for PAC193x
Marius Cristea [Thu, 22 Feb 2024 16:42:06 +0000 (18:42 +0200)]
iio: adc: adding support for PAC193x

This is the iio driver for Microchip
PAC193X series of Power Monitor with Accumulator chip family.

Signed-off-by: Marius Cristea <marius.cristea@microchip.com>
Link: https://lore.kernel.org/r/20240222164206.65700-3-marius.cristea@microchip.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
6 months agodt-bindings: iio: adc: adding support for PAC193X
Marius Cristea [Thu, 22 Feb 2024 16:42:05 +0000 (18:42 +0200)]
dt-bindings: iio: adc: adding support for PAC193X

This is the device tree schema for iio driver for
Microchip PAC193X series of Power Monitors with Accumulator.

Signed-off-by: Marius Cristea <marius.cristea@microchip.com>
Reviewed-by: Conor Dooley <conor.dooley@microchip.com>
Link: https://lore.kernel.org/r/20240222164206.65700-2-marius.cristea@microchip.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
6 months agoiio: temperature: ltc2983: explicitly set the name in chip_info
Nuno Sa [Thu, 22 Feb 2024 12:55:55 +0000 (13:55 +0100)]
iio: temperature: ltc2983: explicitly set the name in chip_info

Getting the part name with 'spi_get_device_id(spi)->name' is not a very
good pattern. Hence, explicitly add the name in the struct chip_info and
use that instead.

Signed-off-by: Nuno Sa <nuno.sa@analog.com>
Link: https://lore.kernel.org/r/20240222-ltc2983-misc-improv-v1-4-cf7d4457e98c@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
6 months agoiio: temperature: ltc2983: rename ltc2983_parse_dt()
Nuno Sa [Thu, 22 Feb 2024 12:55:53 +0000 (13:55 +0100)]
iio: temperature: ltc2983: rename ltc2983_parse_dt()

Rename ltc2983_parse_dt() to ltc2983_parse_fw() as there's no explicit
dependency on devicetree. No functional change intended...

Signed-off-by: Nuno Sa <nuno.sa@analog.com>
Link: https://lore.kernel.org/r/20240222-ltc2983-misc-improv-v1-2-cf7d4457e98c@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
6 months agoiio: temperature: ltc2983: make use of spi_get_device_match_data()
Nuno Sa [Thu, 22 Feb 2024 12:55:52 +0000 (13:55 +0100)]
iio: temperature: ltc2983: make use of spi_get_device_match_data()

Use spi_get_device_match_data() as it simplifies the code. No functional
change intended...

Signed-off-by: Nuno Sa <nuno.sa@analog.com>
Link: https://lore.kernel.org/r/20240222-ltc2983-misc-improv-v1-1-cf7d4457e98c@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
6 months agoiio: adc: ti-ads1298: prevent divide by zero in ads1298_set_samp_freq()
Dan Carpenter [Thu, 22 Feb 2024 06:15:37 +0000 (09:15 +0300)]
iio: adc: ti-ads1298: prevent divide by zero in ads1298_set_samp_freq()

The "val" variable comes from the user so we need to ensure that it's not
zero.  In fact, all negative values are invalid as well.  Add a check for
that.

Fixes: 00ef7708fa60 ("iio: adc: ti-ads1298: Add driver")
Acked-by: Mike Looijmans <mike.looijmans@topic.nl>
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Link: https://lore.kernel.org/r/c32c9087-86de-423b-8101-67b4a7f9d728@moroto.mountain
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
6 months agoiio: adc: ti-ads1298: Fix error code in probe()
Dan Carpenter [Thu, 22 Feb 2024 06:14:25 +0000 (09:14 +0300)]
iio: adc: ti-ads1298: Fix error code in probe()

There is a copy and paste bug here, it should be "reg_vref" instead of
"reg_avdd".  The "priv->reg_avdd" variable is zero so it ends up
returning success.

Fixes: 00ef7708fa60 ("iio: adc: ti-ads1298: Add driver")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Acked-by: Mike Looijmans <mike.looijmans@topic.nl>
Link: https://lore.kernel.org/r/5f393a87-ca8b-4e68-a6f4-a79f75a91ccb@moroto.mountain
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
6 months agodocs: iio: add documentation for adis16475 driver
Ramona Gradinariu [Wed, 21 Feb 2024 08:58:48 +0000 (10:58 +0200)]
docs: iio: add documentation for adis16475 driver

Add documentation for adis16475 driver which describes
the driver device files and shows how the user may use the
ABI for various scenarios (configuration, measurement, etc.).

Signed-off-by: Ramona Gradinariu <ramona.gradinariu@analog.com>
Link: https://lore.kernel.org/r/20240221085848.991413-4-ramona.gradinariu@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
6 months agodocs: iio: add documentation for device buffers
Ramona Gradinariu [Wed, 21 Feb 2024 08:58:47 +0000 (10:58 +0200)]
docs: iio: add documentation for device buffers

Add documentation for IIO device buffers describing buffer
attributes and how data is structured in buffers using
scan elements.

Signed-off-by: Ramona Gradinariu <ramona.gradinariu@analog.com>
Link: https://lore.kernel.org/r/20240221085848.991413-3-ramona.gradinariu@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
6 months agodocs: iio: Refactor index.rst
Ramona Gradinariu [Wed, 21 Feb 2024 08:58:46 +0000 (10:58 +0200)]
docs: iio: Refactor index.rst

Refactor index.rst such that it contains a section for generic
documentation and a section for Kernel Drivers documentation.

Signed-off-by: Ramona Gradinariu <ramona.gradinariu@analog.com>
Link: https://lore.kernel.org/r/20240221085848.991413-2-ramona.gradinariu@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
6 months agoiio: amplifiers: hmc425a: add support for LTC6373 Instrumentation Amplifier
Dumitru Ceclan [Tue, 20 Feb 2024 15:34:53 +0000 (17:34 +0200)]
iio: amplifiers: hmc425a: add support for LTC6373 Instrumentation Amplifier

This adds support for LTC6373 36 V Fully-Differential Programmable-Gain
Instrumentation Amplifier with 25 pA Input Bias Current.
The user can program the gain to one of seven available settings through
a 3-bit parallel interface (A2 to A0).

Signed-off-by: Dumitru Ceclan <mitrutzceclan@gmail.com>
Reviewed-by: Nuno Sa <nuno.sa@analog.com>
Link: https://lore.kernel.org/r/20240220153553.2432-6-mitrutzceclan@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
6 months agoiio: amplifiers: hmc425a: use pointers in match table
Dumitru Ceclan [Tue, 20 Feb 2024 15:34:51 +0000 (17:34 +0200)]
iio: amplifiers: hmc425a: use pointers in match table

Change the match table to use pointers instead of device ids.
Remove type from state as it is not used anymore.

Also make the chip_info structures const.

Signed-off-by: Dumitru Ceclan <mitrutzceclan@gmail.com>
Reviewed-by: Nuno Sa <nuno.sa@analog.com>
Link: https://lore.kernel.org/r/20240220153553.2432-4-mitrutzceclan@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
6 months agoiio: amplifiers: hmc425a: move conversion logic
Dumitru Ceclan [Tue, 20 Feb 2024 15:34:49 +0000 (17:34 +0200)]
iio: amplifiers: hmc425a: move conversion logic

Move gain-dB<->code conversion logic from read_raw and write_raw to
chip_info callbacks.

Signed-off-by: Dumitru Ceclan <mitrutzceclan@gmail.com>
Reviewed-by: Nuno Sa <nuno.sa@analog.com>
Link: https://lore.kernel.org/r/20240220153553.2432-2-mitrutzceclan@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
6 months agodt-bindings: iio: hmc425a: add entry for LTC6373
Dumitru Ceclan [Tue, 20 Feb 2024 15:34:52 +0000 (17:34 +0200)]
dt-bindings: iio: hmc425a: add entry for LTC6373

The LTC6373 is a silicon, 3-bit Fully-Differential digital instrumentation
amplifier that supports the following programmable gains (Vout/Vin):
 G = 0.25, 0.5, 1, 2, 4, 8, 16 + Shutdown.

Acked-by: Conor Dooley <conor.dooley@microchip.com>
Signed-off-by: Dumitru Ceclan <mitrutzceclan@gmail.com>
Link: https://lore.kernel.org/r/20240220153553.2432-5-mitrutzceclan@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
6 months agodt-bindings: iio: hmc425a: add conditional GPIO array size constraints
Dumitru Ceclan [Tue, 20 Feb 2024 15:34:50 +0000 (17:34 +0200)]
dt-bindings: iio: hmc425a: add conditional GPIO array size constraints

ADRF5740 and HMC540S have a 4 bit parallel interface.
Update ctrl-gpios description and min/maxItems values depending on the
matched compatible to correctly reflect the hardware properties.

Fixes: 79f2ff6461e7 ("dt-bindings: iio: hmc425a: add entry for ADRF5740 Attenuator")
Fixes: 20f87a9a26be ("dt-bindings: iio: hmc425a: add entry for HMC540S")
Acked-by: Conor Dooley <conor.dooley@microchip.com>
Signed-off-by: Dumitru Ceclan <mitrutzceclan@gmail.com>
Link: https://lore.kernel.org/r/20240220153553.2432-3-mitrutzceclan@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
6 months agodt-bindings: iio: humidity: hdc20x0: add optional interrupts property
Josua Mayer [Mon, 19 Feb 2024 14:48:21 +0000 (15:48 +0100)]
dt-bindings: iio: humidity: hdc20x0: add optional interrupts property

HDC2010 and HDC2080 humidity sensors both have an interrupt / data-ready
signal which can be used for signaling to the host.

Add binding for "interrupts" property so that boards wiring this signal
may describe the connection.

Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Josua Mayer <josua@solid-run.com>
Link: https://lore.kernel.org/r/20240219-iio-hdc20x0-interrupt-binding-v7-1-c8ffb39c3768@solid-run.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
6 months agoiio: temperature: tmp117: add support for vcc-supply
Thomas Haemmerle [Mon, 19 Feb 2024 13:11:14 +0000 (14:11 +0100)]
iio: temperature: tmp117: add support for vcc-supply

Add support to specify the VCC supply which is required to power the
device. According the datasheet 7.3.1 Power Up, the device needs 1.5ms
after the supply voltage reaches the operating range before the
communcation can begin.

Signed-off-by: Thomas Haemmerle <thomas.haemmerle@leica-geosystems.com>
Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>
Link: https://lore.kernel.org/r/20240219131114.134607-2-m.felsch@pengutronix.de
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
6 months agodt-bindings: iio: ti,tmp117: add vcc supply binding
Thomas Haemmerle [Mon, 19 Feb 2024 13:11:13 +0000 (14:11 +0100)]
dt-bindings: iio: ti,tmp117: add vcc supply binding

Add the binding to specify the vcc supply. We can't make it required
since this would break the backward compatibility.

Reviewed-by: Conor Dooley <conor.dooley@microchip.com>
Signed-off-by: Thomas Haemmerle <thomas.haemmerle@leica-geosystems.com>
Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>
Link: https://lore.kernel.org/r/20240219131114.134607-1-m.felsch@pengutronix.de
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
6 months agoiio: adc: mcp320x: Simplify device removal logic
Arturas Moskvinas [Mon, 19 Feb 2024 07:41:40 +0000 (09:41 +0200)]
iio: adc: mcp320x: Simplify device removal logic

Use devm_* APIs to enable/disable regulator and to register in IIO infrastructure.

Signed-off-by: Arturas Moskvinas <arturas.moskvinas@gmail.com>
Link: https://lore.kernel.org/r/20240219074139.193464-2-arturas.moskvinas@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
6 months agoiio: accel: kxcjk-1013: Implement ACPI method ROTM to retrieve mount matrix.
Sean Rhodes [Sun, 18 Feb 2024 21:53:37 +0000 (21:53 +0000)]
iio: accel: kxcjk-1013: Implement ACPI method ROTM to retrieve mount matrix.

Implement kxj_acpi_orientation to retrieve mount matrix
from ACPI ROTM method

Cc: Jonathan Cameron <jic23@kernel.org>
Cc: Lars-Peter Clausen <lars@metafoo.de>
Cc: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
Signed-off-by: Sean Rhodes <sean@starlabs.systems>
Link: https://lore.kernel.org/r/19d7a10aae5238a2c8db37da1f74edb86480e17e.1708293140.git.sean@starlabs.systems
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
6 months agoiio: dac: mcp4821: Switch to including mod_devicetable.h for struct of_device_id...
Jonathan Cameron [Sun, 18 Feb 2024 17:33:23 +0000 (17:33 +0000)]
iio: dac: mcp4821: Switch to including mod_devicetable.h for struct of_device_id definition.

of.h was only included for this definition, so include the correct header
instead.

Reviewed-by: Nuno Sa <nuno.sa@analog.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20240218173323.1023703-9-jic23@kernel.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
6 months agoiio: accel: kxsd9: Switch from linux/of.h to linux/mod_devicetable.h
Jonathan Cameron [Sun, 18 Feb 2024 17:33:22 +0000 (17:33 +0000)]
iio: accel: kxsd9: Switch from linux/of.h to linux/mod_devicetable.h

The only of specific definition used is of_device_id table and that
is found in mod_devicetable.h not of.h

Reviewed-by: Nuno Sa <nuno.sa@analog.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20240218173323.1023703-8-jic23@kernel.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
6 months agoiio: accel: bma180: Switch from linux/of.h to linux/mod_devicetable.h
Jonathan Cameron [Sun, 18 Feb 2024 17:33:21 +0000 (17:33 +0000)]
iio: accel: bma180: Switch from linux/of.h to linux/mod_devicetable.h

The only of specific definition used is of_device_id table and that
is found in mod_devicetable.h not of.h

Reviewed-by: Nuno Sa <nuno.sa@analog.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20240218173323.1023703-7-jic23@kernel.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
6 months agoiio: accel: adxl372: Switch from linux/of.h to linux/mod_devicetable.h
Jonathan Cameron [Sun, 18 Feb 2024 17:33:20 +0000 (17:33 +0000)]
iio: accel: adxl372: Switch from linux/of.h to linux/mod_devicetable.h

The only of specific definition used is of_device_id table and that
is found in mod_devicetable.h not of.h

Reviewed-by: Nuno Sa <nuno.sa@analog.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20240218173323.1023703-6-jic23@kernel.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
6 months agoiio: adc: ads8688: Switch to mod_devicetable.h for struct of_device_id definition
Jonathan Cameron [Sun, 18 Feb 2024 17:33:19 +0000 (17:33 +0000)]
iio: adc: ads8688: Switch to mod_devicetable.h for struct of_device_id definition

of.h was only included to get access to this structure, so include the
correct header directly instead.

Reviewed-by: Nuno Sa <nuno.sa@analog.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20240218173323.1023703-5-jic23@kernel.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
6 months agoiio: light: al3010: Switch from linux/of.h to linux/mod_devicetable.h
Jonathan Cameron [Sun, 18 Feb 2024 17:33:18 +0000 (17:33 +0000)]
iio: light: al3010: Switch from linux/of.h to linux/mod_devicetable.h

The only of specific definition used is of_device_id table and that
is found in mod_devicetable.h not of.h

Reviewed-by: Nuno Sa <nuno.sa@analog.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20240218173323.1023703-4-jic23@kernel.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
6 months agoiio: light: al3320a: Drop unused linux/of.h include
Jonathan Cameron [Sun, 18 Feb 2024 17:33:17 +0000 (17:33 +0000)]
iio: light: al3320a: Drop unused linux/of.h include

Nothing from linux/of.h used in this driver.

Reviewed-by: Nuno Sa <nuno.sa@analog.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20240218173323.1023703-3-jic23@kernel.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>