]> git.ipfire.org Git - people/ms/linux.git/log
people/ms/linux.git
3 years agomfd: intel-lpss: Add Intel Meteor Lake-P PCI IDs
Andy Shevchenko [Tue, 28 Jun 2022 22:30:47 +0000 (01:30 +0300)] 
mfd: intel-lpss: Add Intel Meteor Lake-P PCI IDs

Add Intel Meteor Lake-P LPSS PCI IDs.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Link: https://lore.kernel.org/r/20220628223047.34301-1-andriy.shevchenko@linux.intel.com
3 years agomfd: mt6397: Add basic support for MT6331+MT6332 PMIC
AngeloGioacchino Del Regno [Mon, 27 Jun 2022 12:39:54 +0000 (14:39 +0200)] 
mfd: mt6397: Add basic support for MT6331+MT6332 PMIC

Add support for the MT6331 PMIC with MT6332 Companion PMIC, found
in MT6795 Helio X10 smartphone platforms.

This combo has support for multiple devices but, for a start,
only the following have been implemented:
- Regulators (two instances, one in MT6331, one in MT6332)
- RTC (MT6331)
- Keys (MT6331)
- Interrupts (MT6331 also dispatches MT6332's interrupts)

There's more to be implemented, especially for MT6332, which
will come at a later stage.

Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Reviewed-by: Matthias Brugger <matthias.bgg@gmail.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Link: https://lore.kernel.org/r/20220627123954.64299-1-angelogioacchino.delregno@collabora.com
3 years agomfd: axp20x: Add AXP221/AXP223/AXP809 GPIO cells
Samuel Holland [Thu, 16 Jun 2022 06:09:13 +0000 (01:09 -0500)] 
mfd: axp20x: Add AXP221/AXP223/AXP809 GPIO cells

These PMICs all contain a compatible GPIO controller.

Signed-off-by: Samuel Holland <samuel@sholland.org>
Reviewed-by: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Link: https://lore.kernel.org/r/20220616060915.48325-3-samuel@sholland.org
3 years agomfd: ipaq-micro: Fix spelling mistake of "receive{d}"
Zhang Jiaming [Thu, 23 Jun 2022 07:33:33 +0000 (15:33 +0800)] 
mfd: ipaq-micro: Fix spelling mistake of "receive{d}"

Change 'receieved' to 'received' and 'recieve' to 'receive'.

Signed-off-by: Zhang Jiaming <jiaming@nfschina.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Link: https://lore.kernel.org/r/20220623073333.5675-1-jiaming@nfschina.com
3 years agomfd: db8500-prcmu: Drop duplicated word "the" in the comments
Jiang Jian [Tue, 21 Jun 2022 10:38:39 +0000 (18:38 +0800)] 
mfd: db8500-prcmu: Drop duplicated word "the" in the comments

There is an unexpected word "the" in the comments that needs to be dropped.

Line 801: * This function sets the the operating point of the ARM.
                               -------

Signed-off-by: Jiang Jian <jiangjian@cdjrlc.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Link: https://lore.kernel.org/r/20220621103839.96847-1-jiangjian@cdjrlc.com
3 years agodt-bindings: mfd: Add i.MX8qm/qxp Control and Status Registers module binding
Liu Ying [Sat, 11 Jun 2022 14:14:20 +0000 (22:14 +0800)] 
dt-bindings: mfd: Add i.MX8qm/qxp Control and Status Registers module binding

This patch adds bindings for i.MX8qm/qxp Control and Status Registers module.

Signed-off-by: Liu Ying <victor.liu@nxp.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Link: https://lore.kernel.org/r/20220611141421.718743-14-victor.liu@nxp.com
3 years agomfd: intel_soc_pmic_chtwc: Switch from __maybe_unused to pm_sleep_ptr() etc
Andy Shevchenko [Thu, 16 Jun 2022 17:10:09 +0000 (20:10 +0300)] 
mfd: intel_soc_pmic_chtwc: Switch from __maybe_unused to pm_sleep_ptr() etc

Letting the compiler remove these functions when the kernel is built
without CONFIG_PM_SLEEP support is simpler and less heavier for builds
than the use of __maybe_unused attributes.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Link: https://lore.kernel.org/r/20220616171009.43524-2-andriy.shevchenko@linux.intel.com
3 years agomfd: intel_soc_pmic_chtwc: Use dev_err_probe()
Andy Shevchenko [Thu, 16 Jun 2022 17:10:08 +0000 (20:10 +0300)] 
mfd: intel_soc_pmic_chtwc: Use dev_err_probe()

Simplify the mux error path a bit by using dev_err_probe().

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Link: https://lore.kernel.org/r/20220616171009.43524-1-andriy.shevchenko@linux.intel.com
3 years agomfd: tc6393xb: Make disable callback return void
Uwe Kleine-König [Sun, 19 Jun 2022 08:26:55 +0000 (10:26 +0200)] 
mfd: tc6393xb: Make disable callback return void

All implementations return 0, so simplify accordingly.

This is a preparation for making platform remove callbacks return void.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Link: https://lore.kernel.org/r/20220619082655.53728-1-u.kleine-koenig@pengutronix.de
3 years agomfd: dln2: Automatically detect and fill endpoint pointers
Andy Shevchenko [Fri, 17 Jun 2022 18:23:38 +0000 (21:23 +0300)] 
mfd: dln2: Automatically detect and fill endpoint pointers

The usb_find_common_endpoints() finds and fills the endpoints
in accordance with their types. Use it to automatically detect
and fill endpoint pointers.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Link: https://lore.kernel.org/r/20220617182338.32402-1-andriy.shevchenko@linux.intel.com
3 years agodt-bindings: mfd: mt6397: Add compatibles for MT6331 RTC and keys
AngeloGioacchino Del Regno [Fri, 17 Jun 2022 11:07:27 +0000 (13:07 +0200)] 
dt-bindings: mfd: mt6397: Add compatibles for MT6331 RTC and keys

The MT6331 PMIC provides many sub modules: regulators, audio
codec, LED controller, keys, RTC and some GPIOs.
It is always paired with a MT6332 Companion PMIC, which provides
thermistors, WLEDs (display LED backlight), secondary AP cluster
regulators, modem clocks, battery charger and fuel gauge.

Add the necessary compatibles to start implementing the basics.

Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Matthias Brugger <matthias.bgg@gmail.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Link: https://lore.kernel.org/r/20220617110728.90132-2-angelogioacchino.delregno@collabora.com
3 years agodt-bindings: mfd: qcom-pm8xxx: Update the maintainers section
Satya Priya [Wed, 22 Jun 2022 05:10:38 +0000 (10:40 +0530)] 
dt-bindings: mfd: qcom-pm8xxx: Update the maintainers section

Update the maintainers section with latest mail ID.

Signed-off-by: Satya Priya <quic_c_skakit@quicinc.com>
Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Link: https://lore.kernel.org/r/1655874639-11273-2-git-send-email-quic_c_skakit@quicinc.com
3 years agomfd: pm8008: Remove driver data structure pm8008_data
Lee Jones [Tue, 21 Jun 2022 08:14:02 +0000 (09:14 +0100)] 
mfd: pm8008: Remove driver data structure pm8008_data

Maintaining a local driver data structure that is never shared
outside of the core device is an unnecessary complexity.  Half of the
attributes were not used outside of a single function, one of which
was not used at all.  The remaining 2 are generic and can be passed
around as required.

Signed-off-by: Lee Jones <lee.jones@linaro.org>
3 years agomfd: twl: Remove platform data support
Uwe Kleine-König [Tue, 14 Jun 2022 15:21:48 +0000 (17:21 +0200)] 
mfd: twl: Remove platform data support

There is no in-tree machine that provides a struct twl4030_platform_data
since commit e92fc4f04a34 ("ARM: OMAP2+: Drop legacy board file for
LDP"). So assume dev_get_platdata() returns NULL in twl_probe() and
simplify accordingly.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Link: https://lore.kernel.org/r/20220614152148.252820-1-u.kleine-koenig@pengutronix.de
3 years agodt-bindings: mfd: Add mp2733 compatible
Saravanan Sekar [Wed, 15 Jun 2022 14:53:53 +0000 (16:53 +0200)] 
dt-bindings: mfd: Add mp2733 compatible

Add new compatible for mp2733 mfd driver.

Signed-off-by: Saravanan Sekar <sravanhome@gmail.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Link: https://lore.kernel.org/r/20220615145357.2370044-3-sravanhome@gmail.com
3 years agodt-bindings: mfd: qcom,tcsr: Add qcom,tcsr-mdm9615
Krzysztof Kozlowski [Tue, 7 Jun 2022 13:34:43 +0000 (15:34 +0200)] 
dt-bindings: mfd: qcom,tcsr: Add qcom,tcsr-mdm9615

Document the (already used) TCSR on MDM9615.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Link: https://lore.kernel.org/r/20220607133443.182468-2-krzysztof.kozlowski@linaro.org
3 years agodt-bindings: mfd: qcom,tcsr: Convert to dtschema
Krzysztof Kozlowski [Tue, 7 Jun 2022 13:34:42 +0000 (15:34 +0200)] 
dt-bindings: mfd: qcom,tcsr: Convert to dtschema

Convert the Qualcomm Top Control and Status Register to DT Schema.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Link: https://lore.kernel.org/r/20220607133443.182468-1-krzysztof.kozlowski@linaro.org
3 years agomfd: cros_ec: Add SCP Core-1 as a new CrOS EC MCU
Tinghan Shen [Wed, 1 Jun 2022 11:22:01 +0000 (19:22 +0800)] 
mfd: cros_ec: Add SCP Core-1 as a new CrOS EC MCU

MT8195 System Companion Processors(SCP) is a dual-core RISC-V MCU.
Add a new CrOS feature ID to represent the SCP's 2nd core.

The 1st core is referred to as 'core 0', and the 2nd core is referred
to as 'core 1'.

Signed-off-by: Tinghan Shen <tinghan.shen@mediatek.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Link: https://lore.kernel.org/r/20220601112201.15510-16-tinghan.shen@mediatek.com
3 years agomfd: mt6358-irq: Add MT6357 PMIC support
Fabien Parent [Tue, 31 May 2022 12:49:57 +0000 (14:49 +0200)] 
mfd: mt6358-irq: Add MT6357 PMIC support

Add MT6357 PMIC IRQ support.

Signed-off-by: Fabien Parent <fparent@baylibre.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Link: https://lore.kernel.org/r/20220531124959.202787-6-fparent@baylibre.com
3 years agomfd: mt6397-core: Add MT6357 PMIC support
Fabien Parent [Tue, 31 May 2022 12:49:56 +0000 (14:49 +0200)] 
mfd: mt6397-core: Add MT6357 PMIC support

Adds support for PMIC keys, Regulator, and RTC for the MT6357 PMIC.

Signed-off-by: Fabien Parent <fparent@baylibre.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Link: https://lore.kernel.org/r/20220531124959.202787-5-fparent@baylibre.com
3 years agodt-bindings: mfd: Add compatible for MT6331 PMIC
AngeloGioacchino Del Regno [Fri, 20 May 2022 12:40:36 +0000 (14:40 +0200)] 
dt-bindings: mfd: Add compatible for MT6331 PMIC

Add a compatible for the MT6331 PMIC MFD device.

Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Link: https://lore.kernel.org/r/20220520124039.228314-5-angelogioacchino.delregno@collabora.com
3 years agodt-bindings: mfd: stm32-timers: Document how to specify interrupts
Uwe Kleine-König [Thu, 19 May 2022 16:28:37 +0000 (18:28 +0200)] 
dt-bindings: mfd: stm32-timers: Document how to specify interrupts

The timer units in the stm32mp1 CPUs have interrupts, depending on the
timer flavour either one "global" or four dedicated ones. Document how
to formalize these in a device tree.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Reviewed-by: Rob Herring <robh@kernel.org>
Reviewed-by: Fabrice Gasnier <fabrice.gasnier@foss.st.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Link: https://lore.kernel.org/r/20220519162838.695404-1-u.kleine-koenig@pengutronix.de
3 years agomfd: max77620: Fix refcount leak in max77620_initialise_fps
Miaoqian Lin [Wed, 1 Jun 2022 04:32:22 +0000 (08:32 +0400)] 
mfd: max77620: Fix refcount leak in max77620_initialise_fps

of_get_child_by_name() returns a node pointer with refcount
incremented, we should use of_node_put() on it when not need anymore.
Add missing of_node_put() to avoid refcount leak.

Fixes: 327156c59360 ("mfd: max77620: Add core driver for MAX77620/MAX20024")
Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Link: https://lore.kernel.org/r/20220601043222.64441-1-linmq006@gmail.com
3 years agoMAINTAINERS: Fix file entry for MAX77693 DT
Lukas Bulwahn [Wed, 1 Jun 2022 07:35:11 +0000 (09:35 +0200)] 
MAINTAINERS: Fix file entry for MAX77693 DT

Commit b38213c6118b ("dt-bindings: mfd: maxim,max77693: Convert to
dtschema") converts max77693.txt to maxim,max77693.yaml and adjusts the
file entry in MAINTAINERS accordingly.

Unfortunately, the merge commit afb67df31a8c ("Merge branches [...] into
ibs-for-mfd-merged") resolves some conflict in MAINTAINERS in such a way
that the file entry for the converted text file max77693.txt, removed in
the commit above, is added back into MAINTAINERS.

Remove the file entry to this converted text file in MAXIM PMIC AND MUIC
DRIVERS FOR EXYNOS BASED BOARDS.

Signed-off-by: Lukas Bulwahn <lukas.bulwahn@gmail.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Link: https://lore.kernel.org/r/20220601073511.15721-1-lukas.bulwahn@gmail.com
3 years agosyscon: Use %pa to format the variable of resource_size_t type
Andy Shevchenko [Tue, 31 May 2022 20:24:04 +0000 (23:24 +0300)] 
syscon: Use %pa to format the variable of resource_size_t type

Instead of explicit casting, use %pa specifier to format
the variable of resource_size_t type.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Link: https://lore.kernel.org/r/20220531202404.70282-1-andriy.shevchenko@linux.intel.com
3 years agomfd: tc6387xb: Drop disable callback that is never called
Uwe Kleine-König [Mon, 30 May 2022 19:24:29 +0000 (21:24 +0200)] 
mfd: tc6387xb: Drop disable callback that is never called

The driver never calls the disable callback, so drop the member from
the platform struct and all callbacks from the actual platform datas.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Link: https://lore.kernel.org/r/20220530192430.2108217-4-u.kleine-koenig@pengutronix.de
3 years agomfd: t7l66xb: Drop platform disable callback
Uwe Kleine-König [Mon, 30 May 2022 19:24:28 +0000 (21:24 +0200)] 
mfd: t7l66xb: Drop platform disable callback

None of the in-tree instantiations of struct t7l66xb_platform_data
provides a disable callback. So better don't dereference this function
pointer unconditionally. As there is no user, drop it completely instead
of calling it conditional.

This is a preparation for making platform remove callbacks return void.

Fixes: 1f192015ca5b ("mfd: driver for the T7L66XB TMIO SoC")
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Link: https://lore.kernel.org/r/20220530192430.2108217-3-u.kleine-koenig@pengutronix.de
3 years agomfd: asic3: Make asic3_gpio_remove() return void
Uwe Kleine-König [Mon, 30 May 2022 19:24:27 +0000 (21:24 +0200)] 
mfd: asic3: Make asic3_gpio_remove() return void

Up to now asic3_gpio_remove() returns zero unconditionally. This makes it
easier to see in the caller that there is no error to handle.

This is a preparation for making platform remove callbacks return void.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Link: https://lore.kernel.org/r/20220530192430.2108217-2-u.kleine-koenig@pengutronix.de
3 years agoMAINTAINERS: Update Intel PMIC (MFD part) to Supported
Andy Shevchenko [Mon, 30 May 2022 12:00:15 +0000 (15:00 +0300)] 
MAINTAINERS: Update Intel PMIC (MFD part) to Supported

The actual status of the code is Supported.

Reported-by: Dave Hansen <dave.hansen@linux.intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Link: https://lore.kernel.org/r/20220530120015.70543-1-andriy.shevchenko@linux.intel.com
3 years agodt-bindings: mfd: ti,j721e-system-controller: Add clock property
Rahul T R [Mon, 30 May 2022 10:10:29 +0000 (15:40 +0530)] 
dt-bindings: mfd: ti,j721e-system-controller: Add clock property

Add a pattern property for clock-controller, also update the example
with a clock-controller node

Signed-off-by: Rahul T R <r-ravikumar@ti.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Link: https://lore.kernel.org/r/20220530101031.11357-2-r-ravikumar@ti.com
3 years agodt-bindings: mfd: Convert da9063 to yaml
Conor Dooley [Mon, 6 Jun 2022 20:13:43 +0000 (21:13 +0100)] 
dt-bindings: mfd: Convert da9063 to yaml

Convert the dt binding for the da9063/da9063l to yaml.

Signed-off-by: Conor Dooley <conor.dooley@microchip.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Link: https://lore.kernel.org/r/20220606201343.514391-4-mail@conchuod.ie
3 years agomfd: max77714: Update Luca Ceresoli's e-mail address
Luca Ceresoli [Fri, 3 Jun 2022 15:57:25 +0000 (17:57 +0200)] 
mfd: max77714: Update Luca Ceresoli's e-mail address

My Bootlin address is preferred from now on.

Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>
Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Link: https://lore.kernel.org/r/20220603155727.1232061-4-luca@lucaceresoli.net
3 years agoMerge branches 'ib-mfd-acpi-for-rafael-5.20', 'ib-mfd-edac-i2c-leds-pinctrl-platform...
Lee Jones [Tue, 19 Jul 2022 09:53:48 +0000 (10:53 +0100)] 
Merge branches 'ib-mfd-acpi-for-rafael-5.20', 'ib-mfd-edac-i2c-leds-pinctrl-platform-watchdog-5.20' and 'ib-mfd-soc-bcm-5.20' into ibs-for-mfd-merged

3 years agoapparmor: fix overlapping attachment computation
John Johansen [Sat, 26 Mar 2022 08:58:15 +0000 (01:58 -0700)] 
apparmor: fix overlapping attachment computation

When finding the profile via patterned attachments, the longest left
match is being set to the static compile time value and not using the
runtime computed value.

Fix this by setting the candidate value to the greater of the
precomputed value or runtime computed value.

Fixes: 21f606610502 ("apparmor: improve overlapping domain attachment resolution")
Signed-off-by: John Johansen <john.johansen@canonical.com>
3 years agobe2net: Fix buffer overflow in be_get_module_eeprom
Hristo Venev [Sat, 16 Jul 2022 08:51:34 +0000 (11:51 +0300)] 
be2net: Fix buffer overflow in be_get_module_eeprom

be_cmd_read_port_transceiver_data assumes that it is given a buffer that
is at least PAGE_DATA_LEN long, or twice that if the module supports SFF
8472. However, this is not always the case.

Fix this by passing the desired offset and length to
be_cmd_read_port_transceiver_data so that we only copy the bytes once.

Fixes: e36edd9d26cf ("be2net: add ethtool "-m" option support")
Signed-off-by: Hristo Venev <hristo@venev.name>
Link: https://lore.kernel.org/r/20220716085134.6095-1-hristo@venev.name
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
3 years agobacklight: lp855x: Switch to atomic PWM API
Maíra Canal [Thu, 14 Jul 2022 21:53:34 +0000 (18:53 -0300)] 
backlight: lp855x: Switch to atomic PWM API

Remove legacy PWM interface (pwm_config, pwm_enable, pwm_disable) and
replace it for the atomic PWM API.

Signed-off-by: Maíra Canal <mairacanal@riseup.net>
Reviewed-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Reviewed-by: Daniel Thompson <daniel.thompson@linaro.org>
Signed-off-by: Lee Jones <lee@kernel.org>
Link: https://lore.kernel.org/r/20220714215334.78226-1-mairacanal@riseup.net
3 years agodt-bindings: backlight: Update Lee Jones' email address
Lee Jones [Thu, 14 Jul 2022 11:25:31 +0000 (12:25 +0100)] 
dt-bindings: backlight: Update Lee Jones' email address

Going forward, I'll be using my kernel.org for upstream work.

Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Lee Jones <lee@kernel.org>
Acked-by: Pavel Machek <pavel@ucw.cz>
Acked-by: Daniel Thompson <daniel.thompson@linaro.org>
Link: https://lore.kernel.org/r/20220714112533.539910-7-lee@kernel.org
3 years agoapparmor: fix setting unconfined mode on a loaded profile
John Johansen [Sat, 26 Mar 2022 08:52:06 +0000 (01:52 -0700)] 
apparmor: fix setting unconfined mode on a loaded profile

When loading a profile that is set to unconfined mode, that label
flag is not set when it should be. Ensure it is set so that when
used in a label the unconfined check will be applied correctly.

Fixes: 038165070aa5 ("apparmor: allow setting any profile into the unconfined state")
Signed-off-by: John Johansen <john.johansen@canonical.com>
3 years agoapparmor: Fix some kernel-doc comments
Yang Li [Mon, 18 Jul 2022 06:30:22 +0000 (14:30 +0800)] 
apparmor: Fix some kernel-doc comments

Remove warnings found by running scripts/kernel-doc, which is caused by
using 'make W=1'.
security/apparmor/policy_ns.c:65: warning: Function parameter or member 'curr' not described in 'aa_ns_name'
security/apparmor/policy_ns.c:65: warning: Function parameter or member 'view' not described in 'aa_ns_name'
security/apparmor/policy_ns.c:65: warning: Function parameter or member 'subns' not described in 'aa_ns_name'
security/apparmor/policy_ns.c:65: warning: expecting prototype for aa_na_name(). Prototype was for aa_ns_name() instead
security/apparmor/policy_ns.c:214: warning: Function parameter or member 'view' not described in '__aa_lookupn_ns'
security/apparmor/policy_ns.c:214: warning: Excess function parameter 'base' description in '__aa_lookupn_ns'
security/apparmor/policy_ns.c:297: warning: expecting prototype for aa_create_ns(). Prototype was for __aa_find_or_create_ns() instead

Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Signed-off-by: Yang Li <yang.lee@linux.alibaba.com>
Signed-off-by: John Johansen <john.johansen@canonical.com>
3 years agoapparmor: Mark alloc_unconfined() as static
Souptick Joarder (HPE) [Tue, 19 Jul 2022 02:12:18 +0000 (07:42 +0530)] 
apparmor: Mark alloc_unconfined() as static

Kernel test robot throws below warning ->
security/apparmor/policy_ns.c:83:20: warning: no previous prototype
for function 'alloc_unconfined' [-Wmissing-prototypes]

Mark it as static.

Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Souptick Joarder (HPE) <jrdr.linux@gmail.com>
Signed-off-by: John Johansen <john.johansen@canonical.com>
3 years agogpio: remove VR41XX related gpio driver
Thomas Bogendoerfer [Fri, 15 Jul 2022 14:19:59 +0000 (16:19 +0200)] 
gpio: remove VR41XX related gpio driver

Commit d3164e2f3b0a ("MIPS: Remove VR41xx support") removed support
for MIPS VR41xx platform, so remove exclusive drivers for this
platform, too.

Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Acked-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
3 years agogpio: pca953x: use the correct register address when regcache sync during init
Haibo Chen [Mon, 18 Jul 2022 08:31:43 +0000 (16:31 +0800)] 
gpio: pca953x: use the correct register address when regcache sync during init

For regcache_sync_region, we need to use pca953x_recalc_addr() to get
the real register address.

Fixes: ec82d1eba346 ("gpio: pca953x: Zap ad-hoc reg_output cache")
Fixes: 0f25fda840a9 ("gpio: pca953x: Zap ad-hoc reg_direction cache")
Signed-off-by: Haibo Chen <haibo.chen@nxp.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
3 years agomtd: spi-nor: micron-st: Skip FSR reading if SPI controller does not support it
Mika Westerberg [Fri, 6 May 2022 10:51:58 +0000 (13:51 +0300)] 
mtd: spi-nor: micron-st: Skip FSR reading if SPI controller does not support it

The Intel SPI controller does not support low level operations, like
reading the flag status register (FSR). It only exposes a set of high
level operations for software to use. For this reason check the return
value of micron_st_nor_read_fsr() and if the operation was not
supported, use the status register value only. This allows the chip to
work even when attached to Intel SPI controller (there are such systems
out there).

Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com>
Reviewed-by: Michael Walle <michael@walle.cc>
Link: https://lore.kernel.org/r/20220506105158.43613-1-mika.westerberg@linux.intel.com
3 years agogpio: pca953x: use the correct range when do regmap sync
Haibo Chen [Mon, 18 Jul 2022 08:31:42 +0000 (16:31 +0800)] 
gpio: pca953x: use the correct range when do regmap sync

regmap will sync a range of registers, here use the correct range
to make sure the sync do not touch other unexpected registers.

Find on pca9557pw on imx8qxp/dxl evk board, this device support
8 pin, so only need one register(8 bits) to cover all the 8 pins's
property setting. But when sync the output, we find it actually
update two registers, output register and the following register.

Fixes: b76574300504 ("gpio: pca953x: Restore registers after suspend/resume cycle")
Fixes: ec82d1eba346 ("gpio: pca953x: Zap ad-hoc reg_output cache")
Fixes: 0f25fda840a9 ("gpio: pca953x: Zap ad-hoc reg_direction cache")
Signed-off-by: Haibo Chen <haibo.chen@nxp.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
3 years agogpio: pca953x: only use single read/write for No AI mode
Haibo Chen [Mon, 18 Jul 2022 08:31:41 +0000 (16:31 +0800)] 
gpio: pca953x: only use single read/write for No AI mode

For the device use NO AI mode(not support auto address increment),
only use the single read/write when config the regmap.

We meet issue on PCA9557PW on i.MX8QXP/DXL evk board, this device
do not support AI mode, but when do the regmap sync, regmap will
sync 3 byte data to register 1, logically this means write first
data to register 1, write second data to register 2, write third data
to register 3. But this device do not support AI mode, finally, these
three data write only into register 1 one by one. the reault is the
value of register 1 alway equal to the latest data, here is the third
data, no operation happened on register 2 and register 3. This is
not what we expect.

Fixes: 49427232764d ("gpio: pca953x: Perform basic regmap conversion")
Signed-off-by: Haibo Chen <haibo.chen@nxp.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
3 years agoata: libata-scsi: cap ata_device->max_sectors according to shost->max_sectors
John Garry [Thu, 14 Jul 2022 11:15:29 +0000 (19:15 +0800)] 
ata: libata-scsi: cap ata_device->max_sectors according to shost->max_sectors

ATA devices (struct ata_device) have a max_sectors field which is
configured internally in libata. This is then used to (re)configure the
associated sdev request queue max_sectors value from how it is earlier set
in __scsi_init_queue(). In __scsi_init_queue() the max_sectors value is set
according to shost limits, which includes host DMA mapping limits.

Cap the ata_device max_sectors according to shost->max_sectors to respect
this shost limit.

Signed-off-by: John Garry <john.garry@huawei.com>
Acked-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
Acked-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
3 years agoscsi: scsi_transport_sas: cap shost opt_sectors according to DMA optimal limit
John Garry [Thu, 14 Jul 2022 11:15:28 +0000 (19:15 +0800)] 
scsi: scsi_transport_sas: cap shost opt_sectors according to DMA optimal limit

Streaming DMA mappings may be considerably slower when mappings go through
an IOMMU and the total mapping length is somewhat long. This is because the
IOMMU IOVA code allocates and free an IOVA for each mapping, which may
affect performance.

For performance reasons set the request queue max_sectors from
dma_opt_mapping_size(), which knows this mapping limit.

Signed-off-by: John Garry <john.garry@huawei.com>
Reviewed-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
3 years agoscsi: sd: allow max_sectors be capped at DMA optimal size limit
John Garry [Thu, 14 Jul 2022 11:15:27 +0000 (19:15 +0800)] 
scsi: sd: allow max_sectors be capped at DMA optimal size limit

Streaming DMA mappings may be considerably slower when mappings go through
an IOMMU and the total mapping length is somewhat long. This is because the
IOMMU IOVA code allocates and free an IOVA for each mapping, which may
affect performance.

New member Scsi_Host.opt_sectors is added, which is the optimal host
max_sectors, and use this value to cap the request queue max_sectors when
set.

It could be considered to have request queues io_opt value initially
set at Scsi_Host.opt_sectors in __scsi_init_queue(), but that is not
really the purpose of io_opt.

Finally, even though Scsi_Host.opt_sectors value should never be greater
than the request queue max_hw_sectors value, continue to limit to this
value for safety.

Signed-off-by: John Garry <john.garry@huawei.com>
Reviewed-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
Acked-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
3 years agoiio: light: isl29028: Fix the warning in isl29028_remove()
Zheyu Ma [Sun, 17 Jul 2022 00:42:41 +0000 (08:42 +0800)] 
iio: light: isl29028: Fix the warning in isl29028_remove()

The driver use the non-managed form of the register function in
isl29028_remove(). To keep the release order as mirroring the ordering
in probe, the driver should use non-managed form in probe, too.

The following log reveals it:

[   32.374955] isl29028 0-0010: remove
[   32.376861] general protection fault, probably for non-canonical address 0xdffffc0000000006: 0000 [#1] PREEMPT SMP KASAN PTI
[   32.377676] KASAN: null-ptr-deref in range [0x0000000000000030-0x0000000000000037]
[   32.379432] RIP: 0010:kernfs_find_and_get_ns+0x28/0xe0
[   32.385461] Call Trace:
[   32.385807]  sysfs_unmerge_group+0x59/0x110
[   32.386110]  dpm_sysfs_remove+0x58/0xc0
[   32.386391]  device_del+0x296/0xe50
[   32.386959]  cdev_device_del+0x1d/0xd0
[   32.387231]  devm_iio_device_unreg+0x27/0xb0
[   32.387542]  devres_release_group+0x319/0x3d0
[   32.388162]  i2c_device_remove+0x93/0x1f0

Fixes: 2db5054ac28d ("staging: iio: isl29028: add runtime power management support")
Signed-off-by: Zheyu Ma <zheyuma97@gmail.com>
Link: https://lore.kernel.org/r/20220717004241.2281028-1-zheyuma97@gmail.com
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: accel: sca3300: Extend the trigger buffer from 16 to 32 bytes
LI Qingwu [Fri, 1 Jul 2022 02:30:30 +0000 (02:30 +0000)] 
iio: accel: sca3300: Extend the trigger buffer from 16 to 32 bytes

After added inclination angle channels, the trigger buffer size is
insufficient. Extend the buffer size from 16 to 32 bytes, and change
the trigger buffer from the struct to a u8 array to adapt the sensor
with/without inclination angles output.
New trigger buffer data:
  - SCA3300: 3 accel channels, temp, and timestamp.
  - SCL3300: 3 accel channels, temp, 3 incli channels, and timestamp.
Readjustment the scan index to make it consistent with the buffer data.

Signed-off-by: LI Qingwu <Qing-wu.Li@leica-geosystems.com.cn>
Link: https://lore.kernel.org/r/20220701023030.2527019-2-Qing-wu.Li@leica-geosystems.com.cn
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: fix iio_format_avail_range() printing for none IIO_VAL_INT
Fawzi Khaber [Mon, 18 Jul 2022 13:07:06 +0000 (15:07 +0200)] 
iio: fix iio_format_avail_range() printing for none IIO_VAL_INT

iio_format_avail_range() should print range as follow [min, step, max], so
the function was previously calling iio_format_list() with length = 3,
length variable refers to the array size of values not the number of
elements. In case of non IIO_VAL_INT values each element has integer part
and decimal part. With length = 3 this would cause premature end of loop
and result in printing only one element.

Signed-off-by: Fawzi Khaber <fawzi.khaber@tdk.com>
Signed-off-by: Jean-Baptiste Maneyrol <jean-baptiste.maneyrol@tdk.com>
Fixes: eda20ba1e25e ("iio: core: Consolidate iio_format_avail_{list,range}()")
Link: https://lore.kernel.org/r/20220718130706.32571-1-jmaneyrol@invensense.com
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoRDMA/rxe: Remove unused qp parameter
Xiao Yang [Fri, 8 Jul 2022 03:55:50 +0000 (03:55 +0000)] 
RDMA/rxe: Remove unused qp parameter

The qp parameter in free_rd_atomic_resource() has become
unused so remove it directly.

Fixes: 15ae1375ea91 ("RDMA/rxe: Fix qp reference counting for atomic ops")
Link: https://lore.kernel.org/all/20220708035547.6592-1-yangx.jy@fujitsu.com/
Signed-off-by: Xiao Yang <yangx.jy@fujitsu.com>
Signed-off-by: Leon Romanovsky <leon@kernel.org>
3 years agoiio: adc: max1027: unlock on error path in max1027_read_single_value()
Dan Carpenter [Thu, 7 Jul 2022 14:54:45 +0000 (17:54 +0300)] 
iio: adc: max1027: unlock on error path in max1027_read_single_value()

If max1027_wait_eoc() fails then call iio_device_release_direct_mode()
before returning.

Fixes: a0e831653ef9 ("iio: adc: max1027: Introduce an end of conversion helper")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Link: https://lore.kernel.org/r/YsbztVuAXnau2cIZ@kili
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agodt-bindings: gpio: add pull-disable flag
Nuno Sá [Wed, 13 Jul 2022 13:14:21 +0000 (15:14 +0200)] 
dt-bindings: gpio: add pull-disable flag

This extends the flags that can be used in GPIO specifiers to indicate
that no bias is intended in the pin.

Signed-off-by: Nuno Sá <nuno.sa@analog.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
3 years agogpiolib: acpi: support bias pull disable
Nuno Sá [Wed, 13 Jul 2022 13:14:20 +0000 (15:14 +0200)] 
gpiolib: acpi: support bias pull disable

On top of looking at PULL_UP and PULL_DOWN flags, also look at
PULL_DISABLE and set the appropriate GPIO flag. The GPIO core will then
pass down this to controllers that support it.

Signed-off-by: Nuno Sá <nuno.sa@analog.com>
Acked-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
3 years agogpiolib: of: support bias pull disable
Nuno Sá [Wed, 13 Jul 2022 13:14:19 +0000 (15:14 +0200)] 
gpiolib: of: support bias pull disable

On top of looking at PULL_UP and PULL_DOWN flags, also look at
PULL_DISABLE and set the appropriate GPIO flag. The GPIO core will then
pass down this to controllers that support it.

Signed-off-by: Nuno Sá <nuno.sa@analog.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
3 years agogpiolib: add support for bias pull disable
Nuno Sá [Wed, 13 Jul 2022 13:14:18 +0000 (15:14 +0200)] 
gpiolib: add support for bias pull disable

This change prepares the gpio core to look at firmware flags and set
'FLAG_BIAS_DISABLE' if necessary. It works in similar way to
'GPIO_PULL_DOWN' and 'GPIO_PULL_UP'.

Signed-off-by: Nuno Sá <nuno.sa@analog.com>
Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
3 years agogpio: 74xx-mmio: use bits.h macros for all masks
Andy Shevchenko [Mon, 18 Jul 2022 22:02:52 +0000 (01:02 +0300)] 
gpio: 74xx-mmio: use bits.h macros for all masks

Make use of the GENMASK() (far less error-prone, far more concise).

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
3 years agogpio: 74xx-mmio: Check MMIO_74XX_DIR_IN flag in mmio_74xx_dir_in()
Andy Shevchenko [Mon, 18 Jul 2022 22:02:51 +0000 (01:02 +0300)] 
gpio: 74xx-mmio: Check MMIO_74XX_DIR_IN flag in mmio_74xx_dir_in()

It's logically better to check the IN in ->direction_input() and
_OUT in ->direction_output().

While at it, replace ternary with plain if-conditional for the sake
of consistency with mmio_74xx_dir_out().

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
3 years agogpio: 74xx-mmio: Make use of device properties
Andy Shevchenko [Mon, 18 Jul 2022 22:02:50 +0000 (01:02 +0300)] 
gpio: 74xx-mmio: Make use of device properties

Convert the module to be property provider agnostic and allow
it to be used on non-OF platforms.

Add mod_devicetable.h include.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
3 years agoIB/qib: Fix comment typo
Jason Wang [Fri, 15 Jul 2022 05:40:07 +0000 (13:40 +0800)] 
IB/qib: Fix comment typo

The double `are' is duplicated in line 156, remove one.

Link: https://lore.kernel.org/r/20220715054007.5320-1-wangborong@cdjrlc.com
Signed-off-by: Jason Wang <wangborong@cdjrlc.com>
Signed-off-by: Leon Romanovsky <leon@kernel.org>
3 years agogpiolib: cdev: compile out HTE unless CONFIG_HTE selected
Kent Gibson [Thu, 14 Jul 2022 02:03:19 +0000 (10:03 +0800)] 
gpiolib: cdev: compile out HTE unless CONFIG_HTE selected

The majority of builds do not include HTE, so compile out hte
functionality unless CONFIG_HTE is selected.

Signed-off-by: Kent Gibson <warthog618@gmail.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
3 years agogpiolib: cdev: consolidate edge detector configuration flags
Kent Gibson [Thu, 14 Jul 2022 02:03:18 +0000 (10:03 +0800)] 
gpiolib: cdev: consolidate edge detector configuration flags

Combine the polarity_change flag, struct line eflags, and hte enable
flag into a single flag variable.

The combination of these flags describes the configuration state
of the edge detector, so formalize and clarify that by combining
them into a single variable, edflags, in struct line.

The edflags is a subset of the GPIO_V2_LINE_FLAGsb relevant to
the edge detector, and is also a superset of the eflags it replaces.
The eflags name is still used to describe the subset of edflags
corresponding to the rising/falling edge flags where edflags is
masked down to that subset.

This consolidation reduces the number of variables being passed,
simplifies state comparisons, and provides a more extensible
foundation should additional edge sources be integrated in the
future.

Signed-off-by: Kent Gibson <warthog618@gmail.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
3 years agogpiolib: cdev: simplify line event identification
Kent Gibson [Thu, 14 Jul 2022 02:03:17 +0000 (10:03 +0800)] 
gpiolib: cdev: simplify line event identification

Reorganise line event identification code to reduce code duplication,
and replace if-else initializers with a helper function to improve
readability.

Signed-off-by: Kent Gibson <warthog618@gmail.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
3 years agogpiolib: cdev: replace if-else chains with switches
Kent Gibson [Thu, 14 Jul 2022 02:03:16 +0000 (10:03 +0800)] 
gpiolib: cdev: replace if-else chains with switches

Improve readability by replacing if-else chains with switch
statements.

Signed-off-by: Kent Gibson <warthog618@gmail.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
3 years agogpiolib: cdev: simplify parameter in call to hte_edge_setup
Kent Gibson [Thu, 14 Jul 2022 02:03:15 +0000 (10:03 +0800)] 
gpiolib: cdev: simplify parameter in call to hte_edge_setup

Improve readability by using the GPIO_V2_LINE_FLAG_EDGE_BOTH instead
of combining the rising and falling edge flags.

Signed-off-by: Kent Gibson <warthog618@gmail.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Acked-by: Dipen Patel <dipenp@nvidia.com>
Tested-by: Dipen Patel <dipenp@nvidia.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
3 years agogpiolib: cdev: simplify linereq_free
Kent Gibson [Thu, 14 Jul 2022 02:03:14 +0000 (10:03 +0800)] 
gpiolib: cdev: simplify linereq_free

The edge detector is only ever started after the line desc has been
determined, so move edge_detector_stop() inside the line desc check,
and merge the two checked regions into one.

Signed-off-by: Kent Gibson <warthog618@gmail.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Acked-by: Dipen Patel <dipenp@nvidia.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
3 years agogpio: 104-idi-48: unsigned to unsigned int cleanup
Aakash Sen Sharma [Mon, 11 Jul 2022 14:17:53 +0000 (19:47 +0530)] 
gpio: 104-idi-48: unsigned to unsigned int cleanup

Remove checkpatch warnings. No functional changes.

Signed-off-by: Aakash Sen Sharma <aakashsensharma@gmail.com>
Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
3 years agogpio: GPIO_SAMA5D2_PIOBU should depend on ARCH_AT91
Geert Uytterhoeven [Mon, 11 Jul 2022 08:36:35 +0000 (10:36 +0200)] 
gpio: GPIO_SAMA5D2_PIOBU should depend on ARCH_AT91

The SAMA5D2 PIOBU is only present on some AT91/Microchip SoCs.  Hence
add a dependency on ARCH_AT91, to prevent asking the user about this
driver when configuring a kernel without AT91/Microchip SoC support.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Acked-by: Nicolas Ferre <nicolas.ferre@microchip.com>
Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
3 years agogpio: gpiolib-of: Fix refcount bugs in of_mm_gpiochip_add_data()
Liang He [Mon, 11 Jul 2022 12:52:38 +0000 (20:52 +0800)] 
gpio: gpiolib-of: Fix refcount bugs in of_mm_gpiochip_add_data()

We should use of_node_get() when a new reference of device_node
is created. It is noted that the old reference stored in
'mm_gc->gc.of_node' should also be decreased.

This patch is based on the fact that there is a call site in function
'qe_add_gpiochips()' of src file 'drivers\soc\fsl\qe\gpio.c'. In this
function, of_mm_gpiochip_add_data() is contained in an iteration of
for_each_compatible_node() which will automatically increase and
decrease the refcount. So we need additional of_node_get() for the
reference escape in of_mm_gpiochip_add_data().

Fixes: a19e3da5bc5f ("of/gpio: Kill of_gpio_chip and add members directly to gpio_chip")
Signed-off-by: Liang He <windhl@126.com>
Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
3 years agodt-bindings: gpio: Convert TI TPIC2810 GPIO Controller bindings to YAML
Aparna M [Fri, 8 Jul 2022 15:58:19 +0000 (21:28 +0530)] 
dt-bindings: gpio: Convert TI TPIC2810 GPIO Controller bindings to YAML

Convert gpio-tpic2810 bindings to yaml format and remove outdated
bindings in .txt format.

Signed-off-by: Aparna M <a-m1@ti.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Vignesh Raghavendra <vigneshr@ti.com>
Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
3 years agogpio: lp3943: unsigned to unsigned int cleanup
Shinyzenith [Mon, 11 Jul 2022 05:29:35 +0000 (10:59 +0530)] 
gpio: lp3943: unsigned to unsigned int cleanup

Getting rid of checkpatch findings. No functional changes.

Signed-off-by: Shinyzenith <aakashsensharma@gmail.com>
Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
3 years agoMerge tag 'intel-gpio-v5.20-1' of git://git.kernel.org/pub/scm/linux/kernel/git/andy...
Bartosz Golaszewski [Tue, 19 Jul 2022 07:57:25 +0000 (09:57 +0200)] 
Merge tag 'intel-gpio-v5.20-1' of git://git.kernel.org/pub/scm/linux/kernel/git/andy/linux-gpio-intel into TEST_MERGE

intel-gpio for v5.20-1

* Clean up the GPIO driver of Intel EG20 PCH

The following is an automated git shortlog grouped by driver:

pch:
 -  Change PCI device macros
 -  Use dev_err_probe()

3 years agogpiolib: of: Use device_match_of_node() helper
Andy Shevchenko [Wed, 29 Jun 2022 11:30:58 +0000 (14:30 +0300)] 
gpiolib: of: Use device_match_of_node() helper

Instead of open coding, use device_match_of_node() helper.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
3 years agogpio: adp5588: sort header inclusion alphabetically
Andy Shevchenko [Tue, 28 Jun 2022 19:39:05 +0000 (22:39 +0300)] 
gpio: adp5588: sort header inclusion alphabetically

Sort header inclusion alphabetically.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
3 years agogpio: adp5588: Do not use defined value for driver name and compatible
Andy Shevchenko [Tue, 28 Jun 2022 19:39:04 +0000 (22:39 +0300)] 
gpio: adp5588: Do not use defined value for driver name and compatible

It's wrong to use defined string literal for three semantically different
cases, i.e.:
1) compatible string, which is part of ABI and has to have specific format;
2) I2C ID, which is user space visible and also ABI;
3) driver name, that can be changed.

Drop the define and use appropriate string literals in place.

While at it, drop comma at terminator entry of OF ID table.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
3 years agogpio: adp5588: Switch from of headers to mod_devicetable.h
Andy Shevchenko [Tue, 28 Jun 2022 19:39:03 +0000 (22:39 +0300)] 
gpio: adp5588: Switch from of headers to mod_devicetable.h

There is nothing directly using of specific interfaces in this driver,
so lets not include the headers.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
3 years agogpio: rockchip: add support for rk3588
Jianqun Xu [Thu, 23 Jun 2022 16:08:01 +0000 (18:08 +0200)] 
gpio: rockchip: add support for rk3588

Add V2.1 rockchip gpio controller type, which is part of the
RK3588 SoC.

Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Reviewed-by: Heiko Stuebner <heiko@sntech.de>
3 years agodt-bindings: gpio: rockchip: add gpio-ranges
Sebastian Reichel [Thu, 23 Jun 2022 16:08:00 +0000 (18:08 +0200)] 
dt-bindings: gpio: rockchip: add gpio-ranges

Allow usage of gpio-ranges with the rockchip gpio controller. The driver
already had support for this since it has been added to the mainline kernel
in the first place.

Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Reviewed-by: Heiko Stuebner <heiko@sntech.de>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
3 years agogpio: adnp: Make use of device properties
Andy Shevchenko [Tue, 28 Jun 2022 19:59:13 +0000 (22:59 +0300)] 
gpio: adnp: Make use of device properties

Convert the module to be property provider agnostic and allow
it to be used on non-OF platforms.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
3 years agogpio: adnp: use simple i2c probe function
Andy Shevchenko [Tue, 28 Jun 2022 19:59:12 +0000 (22:59 +0300)] 
gpio: adnp: use simple i2c probe function

The i2c probe functions here don't use the id information provided in
their second argument, so the single-parameter i2c probe function
("probe_new") can be used instead.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
3 years agogpio: pca9570: add pca9571 support
Lucas Stach [Wed, 29 Jun 2022 17:04:20 +0000 (19:04 +0200)] 
gpio: pca9570: add pca9571 support

The PCA9571 very similar to the PCA9570, it only differs in the
number of GPIOs.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
3 years agogpio: pca9570: Add DT bindings for NXP PCA9571
Lucas Stach [Wed, 29 Jun 2022 17:04:19 +0000 (19:04 +0200)] 
gpio: pca9570: Add DT bindings for NXP PCA9571

This patch adds device tree bindings for the NXP PCA9571,
a 8-bit I2C GPIO expander.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
3 years agogpio: xgs-iproc: Drop if with an always false condition
Uwe Kleine-König [Wed, 15 Jun 2022 12:47:18 +0000 (14:47 +0200)] 
gpio: xgs-iproc: Drop if with an always false condition

The remove callback is only called after probe completed successfully.
In this case platform_set_drvdata() was called with a non-NULL argument
and so chip is never NULL.

Also note that returning an error code from a remove callback doesn't
result in the device staying bound. It's still removed and devm
callbacks are called.

This is a preparation for making platform remove callbacks return void.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
3 years agogpio: brcmstb: Make .remove() obviously always return 0
Uwe Kleine-König [Tue, 21 Jun 2022 06:35:24 +0000 (08:35 +0200)] 
gpio: brcmstb: Make .remove() obviously always return 0

priv cannot be NULL because brcmstb_gpio_probe() calls
platform_set_drvdata() with a non-NULL argument, so the check for !priv can
be dropped.

Also remove the variable ret that is only used to hide a bit that in the
end zero is returned.

This is a preparation for making platform remove callbacks return void.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
3 years agogpio: ucb1400: Remove platform setup and teardown support
Uwe Kleine-König [Tue, 14 Jun 2022 19:48:02 +0000 (21:48 +0200)] 
gpio: ucb1400: Remove platform setup and teardown support

There is no user of these callbacks. The motivation for this change is
to stop returning an error code from the remove callback.

This is a preparation for making platform remove callbacks return void.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
3 years agogpio: twl4030: Don't return an error after WARN in .remove
Uwe Kleine-König [Tue, 14 Jun 2022 15:23:39 +0000 (17:23 +0200)] 
gpio: twl4030: Don't return an error after WARN in .remove

Returning a non-zero value in a platform driver's remove callback only
results in an error message ("remove callback returned a non-zero value.
This will be ignored.", see platform_remove()), and then the device is
removed anyhow.

As there was just a WARN_ON triggered, return 0 to drop the follow up
warning. The latter output is hardly relevant after the big WARN splat.

This is a preparation for making platform remove callbacks return void.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
3 years agogpio: twl4030: Drop platform teardown callback
Uwe Kleine-König [Tue, 14 Jun 2022 15:23:38 +0000 (17:23 +0200)] 
gpio: twl4030: Drop platform teardown callback

There is no machine providing a teardown callback, so drop the unused
code.

This is a preparation for making platform remove callbacks return void.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
3 years agodt-bindings: gpio: renesas,rcar-gpio: R-Car V3U is R-Car Gen4
Geert Uytterhoeven [Fri, 10 Jun 2022 10:08:22 +0000 (12:08 +0200)] 
dt-bindings: gpio: renesas,rcar-gpio: R-Car V3U is R-Car Gen4

Despite the name, R-Car V3U is the first member of the R-Car Gen4
family.  Hence move its compatible value to the R-Car Gen4 section.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
3 years agogpio: davinci: Add support for system suspend/resume PM
Devarsh Thakkar [Mon, 13 Jun 2022 05:43:10 +0000 (11:13 +0530)] 
gpio: davinci: Add support for system suspend/resume PM

Add support for system suspend/resume PM hooks, save the
register context of all the required gpio registers on suspend
and restore context on the resume.

Signed-off-by: Devarsh Thakkar <devarsht@ti.com>
Signed-off-by: Aswath Govindraju <a-govindraju@ti.com>
Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
3 years agodt-bindings: gpio: gpio-mvebu: document offset and marvell,pwm-offset
Chris Packham [Thu, 26 May 2022 01:29:46 +0000 (13:29 +1200)] 
dt-bindings: gpio: gpio-mvebu: document offset and marvell,pwm-offset

The offset and marvell,pwm-offset properties weren't in the old binding.
Add them based on the existing usage in the driver and board DTS when
the marvell,armada-8k-gpio compatible is used.

Signed-off-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Acked-by: Thierry Reding <thierry.reding@gmail.com>
Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
3 years agodt-bindings: gpio: gpio-mvebu: deprecate armadaxp-gpio
Chris Packham [Thu, 26 May 2022 01:29:45 +0000 (13:29 +1200)] 
dt-bindings: gpio: gpio-mvebu: deprecate armadaxp-gpio

Commit 5f79c651e81e ("arm: mvebu: use global interrupts for GPIOs on
Armada XP") the marvell,armadaxp-gpio compatible obsolete.

The driver code still exists to handle the armadaxp behaviour but all
the in-tree boards use the marvell,armada-370-gpio.  Document the
marvell,armadaxp-gpio compatible as deprecated.

Signed-off-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
3 years agodt-bindings: gpio: gpio-mvebu: convert txt binding to DT schema format
Chris Packham [Thu, 26 May 2022 01:29:44 +0000 (13:29 +1200)] 
dt-bindings: gpio: gpio-mvebu: convert txt binding to DT schema format

Convert the existing device tree binding to DT schema format.

The old binding listed the interrupt-controller and related properties
as required but there are sufficiently many existing usages without it
that the YAML binding does not make the interrupt properties required.

Signed-off-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
3 years agogpiolib: devres: Get rid of unused devm_gpio_free()
Andy Shevchenko [Wed, 22 Jun 2022 17:28:42 +0000 (20:28 +0300)] 
gpiolib: devres: Get rid of unused devm_gpio_free()

The last user, which in fact was a dead code, has gone a year ago,
previous one 3 years ago. On top of that we want to drop away the
legacy GPIO APIs in the kernel, so take a chance to get rid of
unused devm_gpio_free() and accompanying stuff.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
3 years agonet: prestera: acl: add support for 'police' action on egress
Maksym Glubokiy [Thu, 14 Jul 2022 08:35:41 +0000 (11:35 +0300)] 
net: prestera: acl: add support for 'police' action on egress

Propagate ingress/egress direction for 'police' action down to hardware.

Co-developed-by: Volodymyr Mytnyk <volodymyr.mytnyk@plvision.eu>
Signed-off-by: Volodymyr Mytnyk <volodymyr.mytnyk@plvision.eu>
Signed-off-by: Maksym Glubokiy <maksym.glubokiy@plvision.eu>
Link: https://lore.kernel.org/r/20220714083541.1973919-1-maksym.glubokiy@plvision.eu
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
3 years agoMAINTAINERS: Use my kernel.org email
Pratyush Yadav [Mon, 18 Jul 2022 15:12:43 +0000 (20:42 +0530)] 
MAINTAINERS: Use my kernel.org email

Use the kernel.org email I have for reviewing patches.

Signed-off-by: Pratyush Yadav <p.yadav@ti.com>
Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com>
Link: https://lore.kernel.org/r/20220718151243.1149442-1-p.yadav@ti.com
3 years agoclk: lan966x: Fix the lan966x clock gate register address
Herve Codina [Mon, 4 Jul 2022 10:28:43 +0000 (12:28 +0200)] 
clk: lan966x: Fix the lan966x clock gate register address

The register address used for the clock gate register is the base
register address coming from first reg map (ie. the generic
clock registers) instead of the second reg map defining the clock
gate register.

Use the correct clock gate register address.

Fixes: 5ad5915dea00 ("clk: lan966x: Extend lan966x clock driver for clock gating support")
Signed-off-by: Herve Codina <herve.codina@bootlin.com>
Link: https://lore.kernel.org/r/20220704102845.168438-2-herve.codina@bootlin.com
Reviewed-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Tested-by: Michael Walle <michael@walle.cc>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
3 years agoOPP: Don't drop opp->np reference while it is still in use
Liang He [Mon, 18 Jul 2022 13:36:32 +0000 (21:36 +0800)] 
OPP: Don't drop opp->np reference while it is still in use

The struct dev_pm_opp contains a reference of the DT node, opp->np,
throughout its lifetime. We should increase the refcount for the same
from _opp_add_static_v2(), and drop it while removing the OPP finally.

Signed-off-by: Liang He <windhl@126.com>
[ Viresh: Updated subject / commit log, create _of_clear_opp() and drop
  reference from it]
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
3 years agoRDMA/hfi1: fix potential memory leak in setup_base_ctxt()
Jianglei Nie [Mon, 11 Jul 2022 07:07:18 +0000 (15:07 +0800)] 
RDMA/hfi1: fix potential memory leak in setup_base_ctxt()

setup_base_ctxt() allocates a memory chunk for uctxt->groups with
hfi1_alloc_ctxt_rcv_groups(). When init_user_ctxt() fails, uctxt->groups
is not released, which will lead to a memory leak.

We should release the uctxt->groups with hfi1_free_ctxt_rcv_groups()
when init_user_ctxt() fails.

Fixes: e87473bc1b6c ("IB/hfi1: Only set fd pointer when base context is completely initialized")
Link: https://lore.kernel.org/r/20220711070718.2318320-1-niejianglei2021@163.com
Signed-off-by: Jianglei Nie <niejianglei2021@163.com>
Acked-by: Dennis Dalessandro <dennis.dalessandro@cornelisnetworks.com>
Signed-off-by: Leon Romanovsky <leon@kernel.org>
3 years agoOPP: Don't drop opp_table->np reference while it is still in use
Liang He [Mon, 18 Jul 2022 13:36:31 +0000 (21:36 +0800)] 
OPP: Don't drop opp_table->np reference while it is still in use

The OPP table contains a reference of the DT node, opp_table->np,
throughout its lifetime. We shouldn't drop the refcount for the same
from _of_init_opp_table(), but do that while removing the OPP table
finally.

Signed-off-by: Liang He <windhl@126.com>
[ Viresh: Updated subject / commit log and drop reference from
  _of_clear_opp_table() ]
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>