* Re: [PATCH v14 04/10] pwm: max7360: Add MAX7360 PWM support
From: Mathieu Dubois-Briand @ 2025-09-12 6:23 UTC (permalink / raw)
To: Lee Jones, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Kamel Bouhara, Linus Walleij, Bartosz Golaszewski,
Dmitry Torokhov, Uwe Kleine-König, Michael Walle, Mark Brown,
Greg Kroah-Hartman, Rafael J. Wysocki, Danilo Krummrich
Cc: devicetree, linux-kernel, linux-gpio, linux-input, linux-pwm,
andriy.shevchenko, Grégory Clement, Thomas Petazzoni,
Andy Shevchenko
In-Reply-To: <20250824-mdb-max7360-support-v14-4-435cfda2b1ea@bootlin.com>
On Sun Aug 24, 2025 at 1:57 PM CEST, Mathieu Dubois-Briand wrote:
> From: Kamel Bouhara <kamel.bouhara@bootlin.com>
>
> Add driver for Maxim Integrated MAX7360 PWM controller, supporting up to
> 8 independent PWM outputs.
>
> Signed-off-by: Kamel Bouhara <kamel.bouhara@bootlin.com>
> Co-developed-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
> Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> ---
> drivers/pwm/Kconfig | 10 +++
> drivers/pwm/Makefile | 1 +
> drivers/pwm/pwm-max7360.c | 209 ++++++++++++++++++++++++++++++++++++++++++++++
> 3 files changed, 220 insertions(+)
>
> diff --git a/drivers/pwm/Kconfig b/drivers/pwm/Kconfig
> index f00ce973dddf..f2b1ce47de7f 100644
> --- a/drivers/pwm/Kconfig
> +++ b/drivers/pwm/Kconfig
> @@ -432,6 +432,16 @@ config PWM_LPSS_PLATFORM
> To compile this driver as a module, choose M here: the module
> will be called pwm-lpss-platform.
>
> +config PWM_MAX7360
> + tristate "MAX7360 PWMs"
> + depends on MFD_MAX7360
> + help
> + PWM driver for Maxim Integrated MAX7360 multifunction device, with
> + support for up to 8 PWM outputs.
> +
> + To compile this driver as a module, choose M here: the module
> + will be called pwm-max7360.
> +
> config PWM_MC33XS2410
> tristate "MC33XS2410 PWM support"
> depends on OF
> diff --git a/drivers/pwm/Makefile b/drivers/pwm/Makefile
> index ff4f47e5fb7a..dfa8b4966ee1 100644
> --- a/drivers/pwm/Makefile
> +++ b/drivers/pwm/Makefile
> @@ -38,6 +38,7 @@ obj-$(CONFIG_PWM_LPC32XX) += pwm-lpc32xx.o
> obj-$(CONFIG_PWM_LPSS) += pwm-lpss.o
> obj-$(CONFIG_PWM_LPSS_PCI) += pwm-lpss-pci.o
> obj-$(CONFIG_PWM_LPSS_PLATFORM) += pwm-lpss-platform.o
> +obj-$(CONFIG_PWM_MAX7360) += pwm-max7360.o
> obj-$(CONFIG_PWM_MC33XS2410) += pwm-mc33xs2410.o
> obj-$(CONFIG_PWM_MEDIATEK) += pwm-mediatek.o
> obj-$(CONFIG_PWM_MESON) += pwm-meson.o
> diff --git a/drivers/pwm/pwm-max7360.c b/drivers/pwm/pwm-max7360.c
> new file mode 100644
> index 000000000000..ebf93a7aee5b
> --- /dev/null
> +++ b/drivers/pwm/pwm-max7360.c
> @@ -0,0 +1,209 @@
> +// SPDX-License-Identifier: GPL-2.0-only
> +/*
> + * Copyright 2025 Bootlin
> + *
> + * Author: Kamel BOUHARA <kamel.bouhara@bootlin.com>
> + * Author: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
> + *
> + * PWM functionality of the MAX7360 multi-function device.
> + * https://www.analog.com/media/en/technical-documentation/data-sheets/MAX7360.pdf
> + *
> + * Limitations:
> + * - Only supports normal polarity.
> + * - The period is fixed to 2 ms.
> + * - Only the duty cycle can be changed, new values are applied at the beginning
> + * of the next cycle.
> + * - When disabled, the output is put in Hi-Z immediately.
> + */
> +#include <linux/bits.h>
> +#include <linux/dev_printk.h>
> +#include <linux/err.h>
> +#include <linux/math64.h>
> +#include <linux/mfd/max7360.h>
> +#include <linux/minmax.h>
> +#include <linux/mod_devicetable.h>
> +#include <linux/module.h>
> +#include <linux/platform_device.h>
> +#include <linux/pwm.h>
> +#include <linux/regmap.h>
> +#include <linux/time.h>
> +#include <linux/types.h>
> +
> +#define MAX7360_NUM_PWMS 8
> +#define MAX7360_PWM_MAX 255
> +#define MAX7360_PWM_STEPS 256
> +#define MAX7360_PWM_PERIOD_NS (2 * NSEC_PER_MSEC)
> +
> +struct max7360_pwm_waveform {
> + u8 duty_steps;
> + bool enabled;
> +};
> +
> +static int max7360_pwm_request(struct pwm_chip *chip, struct pwm_device *pwm)
> +{
> + struct regmap *regmap = pwmchip_get_drvdata(chip);
> +
> + /*
> + * Make sure we use the individual PWM configuration register and not
> + * the global one.
> + * We never need to use the global one, so there is no need to revert
> + * that in the .free() callback.
> + */
> + return regmap_write_bits(regmap, MAX7360_REG_PWMCFG(pwm->hwpwm),
> + MAX7360_PORT_CFG_COMMON_PWM, 0);
> +}
> +
> +static int max7360_pwm_round_waveform_tohw(struct pwm_chip *chip,
> + struct pwm_device *pwm,
> + const struct pwm_waveform *wf,
> + void *_wfhw)
> +{
> + struct max7360_pwm_waveform *wfhw = _wfhw;
> + u64 duty_steps;
> +
> + /*
> + * Ignore user provided values for period_length_ns and duty_offset_ns:
> + * we only support fixed period of MAX7360_PWM_PERIOD_NS and offset of 0.
> + * Values from 0 to 254 as duty_steps will provide duty cycles of 0/256
> + * to 254/256, while value 255 will provide a duty cycle of 100%.
> + */
> + if (wf->duty_length_ns >= MAX7360_PWM_PERIOD_NS) {
> + duty_steps = MAX7360_PWM_MAX;
> + } else {
> + duty_steps = (u32)wf->duty_length_ns * MAX7360_PWM_STEPS / MAX7360_PWM_PERIOD_NS;
> + if (duty_steps == MAX7360_PWM_MAX)
> + duty_steps = MAX7360_PWM_MAX - 1;
> + }
> +
> + wfhw->duty_steps = min(MAX7360_PWM_MAX, duty_steps);
> + wfhw->enabled = !!wf->period_length_ns;
> +
> + if (wf->period_length_ns && wf->period_length_ns < MAX7360_PWM_PERIOD_NS)
> + return 1;
> + else
> + return 0;
> +}
> +
> +static int max7360_pwm_round_waveform_fromhw(struct pwm_chip *chip, struct pwm_device *pwm,
> + const void *_wfhw, struct pwm_waveform *wf)
> +{
> + const struct max7360_pwm_waveform *wfhw = _wfhw;
> +
> + wf->period_length_ns = wfhw->enabled ? MAX7360_PWM_PERIOD_NS : 0;
> + wf->duty_offset_ns = 0;
> +
> + if (wfhw->enabled) {
> + if (wfhw->duty_steps == MAX7360_PWM_MAX)
> + wf->duty_length_ns = MAX7360_PWM_PERIOD_NS;
> + else
> + wf->duty_length_ns = DIV_ROUND_UP(wfhw->duty_steps * MAX7360_PWM_PERIOD_NS,
> + MAX7360_PWM_STEPS);
> + } else {
> + wf->duty_length_ns = 0;
> + }
> +
> + return 0;
> +}
> +
> +static int max7360_pwm_write_waveform(struct pwm_chip *chip,
> + struct pwm_device *pwm,
> + const void *_wfhw)
> +{
> + struct regmap *regmap = pwmchip_get_drvdata(chip);
> + const struct max7360_pwm_waveform *wfhw = _wfhw;
> + unsigned int val;
> + int ret;
> +
> + if (wfhw->enabled) {
> + ret = regmap_write(regmap, MAX7360_REG_PWM(pwm->hwpwm), wfhw->duty_steps);
> + if (ret)
> + return ret;
> + }
> +
> + val = wfhw->enabled ? BIT(pwm->hwpwm) : 0;
> + return regmap_write_bits(regmap, MAX7360_REG_GPIOCTRL, BIT(pwm->hwpwm), val);
> +}
> +
> +static int max7360_pwm_read_waveform(struct pwm_chip *chip,
> + struct pwm_device *pwm,
> + void *_wfhw)
> +{
> + struct regmap *regmap = pwmchip_get_drvdata(chip);
> + struct max7360_pwm_waveform *wfhw = _wfhw;
> + unsigned int val;
> + int ret;
> +
> + ret = regmap_read(regmap, MAX7360_REG_GPIOCTRL, &val);
> + if (ret)
> + return ret;
> +
> + if (val & BIT(pwm->hwpwm)) {
> + wfhw->enabled = true;
> + ret = regmap_read(regmap, MAX7360_REG_PWM(pwm->hwpwm), &val);
> + if (ret)
> + return ret;
> +
> + wfhw->duty_steps = val;
> + } else {
> + wfhw->enabled = false;
> + wfhw->duty_steps = 0;
> + }
> +
> + return 0;
> +}
> +
> +static const struct pwm_ops max7360_pwm_ops = {
> + .request = max7360_pwm_request,
> + .round_waveform_tohw = max7360_pwm_round_waveform_tohw,
> + .round_waveform_fromhw = max7360_pwm_round_waveform_fromhw,
> + .read_waveform = max7360_pwm_read_waveform,
> + .write_waveform = max7360_pwm_write_waveform,
> +};
> +
> +static int max7360_pwm_probe(struct platform_device *pdev)
> +{
> + struct device *dev = &pdev->dev;
> + struct pwm_chip *chip;
> + struct regmap *regmap;
> + int ret;
> +
> + regmap = dev_get_regmap(dev->parent, NULL);
> + if (!regmap)
> + return dev_err_probe(dev, -ENODEV, "Could not get parent regmap\n");
> +
> + /*
> + * This MFD sub-device does not have any associated device tree node:
> + * properties are stored in the device node of the parent (MFD) device
> + * and this same node is used in phandles of client devices.
> + * Reuse this device tree node here, as otherwise the PWM subsystem
> + * would be confused by this topology.
> + */
> + device_set_of_node_from_dev(dev, dev->parent);
> +
> + chip = devm_pwmchip_alloc(dev, MAX7360_NUM_PWMS, 0);
> + if (IS_ERR(chip))
> + return PTR_ERR(chip);
> + chip->ops = &max7360_pwm_ops;
> +
> + pwmchip_set_drvdata(chip, regmap);
> +
> + ret = devm_pwmchip_add(dev, chip);
> + if (ret)
> + return dev_err_probe(dev, ret, "Failed to add PWM chip\n");
> +
> + return 0;
> +}
> +
> +static struct platform_driver max7360_pwm_driver = {
> + .driver = {
> + .name = "max7360-pwm",
> + .probe_type = PROBE_PREFER_ASYNCHRONOUS,
> + },
> + .probe = max7360_pwm_probe,
> +};
> +module_platform_driver(max7360_pwm_driver);
> +
> +MODULE_DESCRIPTION("MAX7360 PWM driver");
> +MODULE_AUTHOR("Kamel BOUHARA <kamel.bouhara@bootlin.com>");
> +MODULE_AUTHOR("Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>");
> +MODULE_LICENSE("GPL");
Hi Uwe,
Any thought about this new version? I believe I fixed all the points we
have been discussing previously.
Thanks,
Mathieu
--
Mathieu Dubois-Briand, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
^ permalink raw reply
* Re: [PATCH v2 06/12] dt-bindings: display: mediatek,ufoe: Add mediatek,gce-client-reg property
From: Krzysztof Kozlowski @ 2025-09-12 6:19 UTC (permalink / raw)
To: Ariel D'Alessandro
Cc: airlied, amergnat, andrew+netdev, andrew-ct.chen,
angelogioacchino.delregno, broonie, chunkuang.hu, conor+dt, davem,
dmitry.torokhov, edumazet, flora.fu, heiko, houlong.wei, jeesw,
kernel, krzk+dt, kuba, lgirdwood, linus.walleij,
louisalexis.eyraud, luiz.dentz, maarten.lankhorst, marcel,
matthias.bgg, mchehab, minghsiu.tsai, mripard, p.zabel, pabeni,
robh, sean.wang, simona, support.opensource, tiffany.lin,
tzimmermann, yunfei.dong, devicetree, dri-devel, linux-arm-kernel,
linux-bluetooth, linux-gpio, linux-input, linux-kernel,
linux-media, linux-mediatek, linux-rockchip, linux-sound, netdev
In-Reply-To: <20250911151001.108744-7-ariel.dalessandro@collabora.com>
On Thu, Sep 11, 2025 at 12:09:55PM -0300, Ariel D'Alessandro wrote:
> Currently, users of Mediatek UFOe (Unified Frame Optimization engine) DT
> bindings set mediatek,gce-client-reg node property, which is missing from
> the DT schema.
>
> For example, device tree arch/arm64/boot/dts/mediatek/mt8173.dtsi is
> causing the following dtb check error:
>
> ```
> $ make CHECK_DTBS=y mediatek/mt8173-elm.dtb
> SCHEMA Documentation/devicetree/bindings/processed-schema.json
> DTC [C] arch/arm64/boot/dts/mediatek/mt8173-elm.dtb
> [...]
You can drop above 4 lines, they are obvious. Your "dtbs_check error"
message already defined that.
> arch/arm64/boot/dts/mediatek/mt8173-elm.dtb: ufoe@1401a000
> (mediatek,mt8173-disp-ufoe): 'mediatek,gce-client-reg' does not match
> any of the regexes: '^pinctrl-[0-9]+$'
The warning message should not be wrapped, so this should be two lines.
Maybe entire warning should be in one line, at least that's what I would
do, after dropping "arch/arm64/boot/dts/".
Anyway, no need to resend just for these. Thanks for the update.
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Best regards,
Krzysztof
^ permalink raw reply
* [BUG] Dell Premium 14 – Cirque touchpad 0488:108C not working
From: Visnupriyan Nagathurai @ 2025-09-12 6:09 UTC (permalink / raw)
To: linux-input@vger.kernel.org
Hello,
On a Dell Premium 14 ( Model: DA14250 ) laptop the Cirque I²C touchpad does not work under Linux.
ACPI ID: VEN_0488:00, HID: 0488:108C
Kernel tested: 6.14 (Ubuntu 24.04)
The device is detected (evtest shows multitouch events), but the mouse pointer never moves in Xorg/Wayland.
Please add support for this touchpad in hid-multitouch.
Thanks.
^ permalink raw reply
* Re: [PATCH v2 02/12] dt-bindings: media: Convert MediaTek mt8173-vpu bindings to DT schema
From: Krzysztof Kozlowski @ 2025-09-12 6:07 UTC (permalink / raw)
To: Ariel D'Alessandro
Cc: airlied, amergnat, andrew+netdev, andrew-ct.chen,
angelogioacchino.delregno, broonie, chunkuang.hu, conor+dt, davem,
dmitry.torokhov, edumazet, flora.fu, heiko, houlong.wei, jeesw,
kernel, krzk+dt, kuba, lgirdwood, linus.walleij,
louisalexis.eyraud, luiz.dentz, maarten.lankhorst, marcel,
matthias.bgg, mchehab, minghsiu.tsai, mripard, p.zabel, pabeni,
robh, sean.wang, simona, support.opensource, tiffany.lin,
tzimmermann, yunfei.dong, devicetree, dri-devel, linux-arm-kernel,
linux-bluetooth, linux-gpio, linux-input, linux-kernel,
linux-media, linux-mediatek, linux-rockchip, linux-sound, netdev
In-Reply-To: <20250911151001.108744-3-ariel.dalessandro@collabora.com>
On Thu, Sep 11, 2025 at 12:09:51PM -0300, Ariel D'Alessandro wrote:
> Convert the existing text-based DT bindings for Mediatek MT8173 Video
> Processor Unit to a DT schema.
>
> Signed-off-by: Ariel D'Alessandro <ariel.dalessandro@collabora.com>
> ---
> .../bindings/media/mediatek,mt8173-vpu.yaml | 74 +++++++++++++++++++
> .../bindings/media/mediatek-vpu.txt | 31 --------
> 2 files changed, 74 insertions(+), 31 deletions(-)
> create mode 100644 Documentation/devicetree/bindings/media/mediatek,mt8173-vpu.yaml
> delete mode 100644 Documentation/devicetree/bindings/media/mediatek-vpu.txt
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Best regards,
Krzysztof
^ permalink raw reply
* Re: [PATCH v2 01/12] dt-bindings: media: Convert MediaTek mt8173-mdp bindings to DT schema
From: Krzysztof Kozlowski @ 2025-09-12 6:06 UTC (permalink / raw)
To: Ariel D'Alessandro
Cc: airlied, amergnat, andrew+netdev, andrew-ct.chen,
angelogioacchino.delregno, broonie, chunkuang.hu, conor+dt, davem,
dmitry.torokhov, edumazet, flora.fu, heiko, houlong.wei, jeesw,
kernel, krzk+dt, kuba, lgirdwood, linus.walleij,
louisalexis.eyraud, luiz.dentz, maarten.lankhorst, marcel,
matthias.bgg, mchehab, minghsiu.tsai, mripard, p.zabel, pabeni,
robh, sean.wang, simona, support.opensource, tiffany.lin,
tzimmermann, yunfei.dong, devicetree, dri-devel, linux-arm-kernel,
linux-bluetooth, linux-gpio, linux-input, linux-kernel,
linux-media, linux-mediatek, linux-rockchip, linux-sound, netdev
In-Reply-To: <20250911151001.108744-2-ariel.dalessandro@collabora.com>
On Thu, Sep 11, 2025 at 12:09:50PM -0300, Ariel D'Alessandro wrote:
> Convert the existing text-based DT bindings for MediaTek MT8173 Media Data
> Path to a DT schema.
>
> Signed-off-by: Ariel D'Alessandro <ariel.dalessandro@collabora.com>
> ---
> .../bindings/media/mediatek,mt8173-mdp.yaml | 169 ++++++++++++++++++
> .../bindings/media/mediatek-mdp.txt | 95 ----------
> 2 files changed, 169 insertions(+), 95 deletions(-)
> create mode 100644 Documentation/devicetree/bindings/media/mediatek,mt8173-mdp.yaml
> delete mode 100644 Documentation/devicetree/bindings/media/mediatek-mdp.txt
>
> diff --git a/Documentation/devicetree/bindings/media/mediatek,mt8173-mdp.yaml b/Documentation/devicetree/bindings/media/mediatek,mt8173-mdp.yaml
> new file mode 100644
> index 0000000000000..8ca33a733c478
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/media/mediatek,mt8173-mdp.yaml
> @@ -0,0 +1,169 @@
> +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/media/mediatek,mt8173-mdp.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: MediaTek MT8173 Media Data Path
> +
> +maintainers:
> + - Ariel D'Alessandro <ariel.dalessandro@collabora.com>
> +
> +description:
> + Media Data Path is used for scaling and color space conversion.
> +
> +properties:
> + compatible:
> + oneOf:
> + - enum:
> + - mediatek,mt8173-mdp-rdma
> + - mediatek,mt8173-mdp-rsz
> + - mediatek,mt8173-mdp-wdma
> + - mediatek,mt8173-mdp-wrot
Why there is no mediatek,mt8173-mdp here? What does this compatible
represent?
> + - items:
> + - const: mediatek,mt8173-mdp-rdma
Still suspicious. Device cannot be simulatanously: compatible and not
compatible. This is not a well known cat that has superposition of two
states, whenenver you look the other way.
Maybe the old binding was incorrect, maybe the in-tree DTS is incorrect.
Whichever the reason, this must be investigated and documented, because
by standard rules this is wrong. Each wrong code needs very clear
explanations (and "someone did it" is not a good enough explanation).
> + - const: mediatek,mt8173-mdp
> +
> + reg:
> + maxItems: 1
> +
> + clocks:
> + minItems: 1
> + maxItems: 2
> +
> + power-domains:
> + maxItems: 1
> +
> + iommus:
> + maxItems: 1
> +
> + mediatek,vpu:
> + $ref: /schemas/types.yaml#/definitions/phandle
> + description:
> + phandle to Mediatek Video Processor Unit for HW Codec encode/decode and
> + image processing.
> +
> +required:
> + - compatible
> + - reg
> + - clocks
> + - power-domains
> +
> +allOf:
> + - if:
> + properties:
> + compatible:
> + contains:
> + const: mediatek,mt8173-mdp-rdma
> + then:
> + properties:
> + clocks:
> + items:
> + - description: Main clock
> + - description: Mutex clock
> + else:
> + properties:
> + clocks:
> + items:
> + - description: Main clock
> +
> + - if:
> + properties:
> + compatible:
> + contains:
> + enum:
> + - mediatek,mt8173-mdp-rdma
> + - mediatek,mt8173-mdp-wdma
> + - mediatek,mt8173-mdp-wrot
> + then:
> + required:
> + - iommus
> +
> + - if:
> + properties:
> + compatible:
> + contains:
> + const: mediatek,mt8173-mdp
> + then:
> + required:
> + - mediatek,vpu
> +
> +additionalProperties: false
> +
> +examples:
> + - |
> + #include <dt-bindings/clock/mt8173-clk.h>
> + #include <dt-bindings/memory/mt8173-larb-port.h>
> + #include <dt-bindings/power/mt8173-power.h>
> +
> + soc {
> + #address-cells = <2>;
> + #size-cells = <2>;
> +
> + mdp_rdma0: rdma@14001000 {
> + compatible = "mediatek,mt8173-mdp-rdma",
> + "mediatek,mt8173-mdp";
> + reg = <0 0x14001000 0 0x1000>;
> + clocks = <&mmsys CLK_MM_MDP_RDMA0>,
> + <&mmsys CLK_MM_MUTEX_32K>;
> + power-domains = <&spm MT8173_POWER_DOMAIN_MM>;
> + iommus = <&iommu M4U_PORT_MDP_RDMA0>;
> + mediatek,vpu = <&vpu>;
> + };
> +
> + mdp_rdma1: rdma@14002000 {
> + compatible = "mediatek,mt8173-mdp-rdma";
> + reg = <0 0x14002000 0 0x1000>;
> + clocks = <&mmsys CLK_MM_MDP_RDMA1>,
> + <&mmsys CLK_MM_MUTEX_32K>;
> + power-domains = <&spm MT8173_POWER_DOMAIN_MM>;
> + iommus = <&iommu M4U_PORT_MDP_RDMA1>;
> + };
My previous comment applies.
Keep one or two examples.
Best regards,
Krzysztof
^ permalink raw reply
* [RFC PATCH 2/2] Input: add support for the STM FTS2BA61Y touchscreen
From: Eric Gonçalves @ 2025-09-11 21:19 UTC (permalink / raw)
To: Dmitry Torokhov, Henrik Rydberg, Rob Herring, Krzysztof Kozlowski,
Conor Dooley
Cc: Ivaylo Ivanov, linux-input, devicetree, linux-kernel,
Eric Gonçalves
In-Reply-To: <20250911211910.45903-1-ghatto404@gmail.com>
The ST-Microelectronics FTS2BA61Y touchscreen is a capacitive multi-touch
controller connected through SPI at 0x0, the touchscreen is typically
used in mobile devices (like the Galaxy S22 series)
Signed-off-by: Ivaylo Ivanov <ivo.ivanov.ivanov1@gmail.com>
Signed-off-by: Eric Gonçalves <ghatto404@gmail.com>
---
Ivaylo Ivanov originally wrote the FTS2BA61Y driver, I am upstreaming it
on his behalf.
---
drivers/input/touchscreen/Kconfig | 11 +
drivers/input/touchscreen/Makefile | 1 +
drivers/input/touchscreen/fts2ba61y.c | 588 ++++++++++++++++++++++++++
3 files changed, 600 insertions(+)
create mode 100644 drivers/input/touchscreen/fts2ba61y.c
diff --git a/drivers/input/touchscreen/Kconfig b/drivers/input/touchscreen/Kconfig
index 196905162945..1e199191f527 100644
--- a/drivers/input/touchscreen/Kconfig
+++ b/drivers/input/touchscreen/Kconfig
@@ -370,6 +370,17 @@ config TOUCHSCREEN_EXC3000
To compile this driver as a module, choose M here: the
module will be called exc3000.
+config TOUCHSCREEN_FTS2BA61Y
+ tristate "ST-Microelectronics FTS2BA61Y touchscreen"
+ depends on SPI
+ help
+ Say Y here if you have the ST-Microelectronics FTS2BA61Y touchscreen
+
+ If unsure, say N.
+
+ To compile this driver as a module, choose M here: the
+ module will be called fts2ba61y.
+
config TOUCHSCREEN_FUJITSU
tristate "Fujitsu serial touchscreen"
select SERIO
diff --git a/drivers/input/touchscreen/Makefile b/drivers/input/touchscreen/Makefile
index 97a025c6a377..408a9fd5bd35 100644
--- a/drivers/input/touchscreen/Makefile
+++ b/drivers/input/touchscreen/Makefile
@@ -43,6 +43,7 @@ obj-$(CONFIG_TOUCHSCREEN_ELO) += elo.o
obj-$(CONFIG_TOUCHSCREEN_EGALAX) += egalax_ts.o
obj-$(CONFIG_TOUCHSCREEN_EGALAX_SERIAL) += egalax_ts_serial.o
obj-$(CONFIG_TOUCHSCREEN_EXC3000) += exc3000.o
+obj-$(CONFIG_TOUCHSCREEN_FTS2BA61Y) += fts2ba61y.o
obj-$(CONFIG_TOUCHSCREEN_FUJITSU) += fujitsu_ts.o
obj-$(CONFIG_TOUCHSCREEN_GOODIX) += goodix_ts.o
obj-$(CONFIG_TOUCHSCREEN_GOODIX_BERLIN_CORE) += goodix_berlin_core.o
diff --git a/drivers/input/touchscreen/fts2ba61y.c b/drivers/input/touchscreen/fts2ba61y.c
new file mode 100644
index 000000000000..b3b3abca5404
--- /dev/null
+++ b/drivers/input/touchscreen/fts2ba61y.c
@@ -0,0 +1,588 @@
+// SPDX-License-Identifier: GPL-2.0
+// Based loosely on s6sy761.c
+
+#include <linux/delay.h>
+#include <linux/input.h>
+#include <linux/interrupt.h>
+#include <linux/module.h>
+#include <linux/of.h>
+#include <linux/input/mt.h>
+#include <linux/spi/spi.h>
+#include <linux/input/touchscreen.h>
+#include <linux/unaligned.h>
+#include <linux/regulator/consumer.h>
+
+/* commands */
+#define FTS2BA61Y_CMD_SENSE_ON 0x10
+#define FTS2BA61Y_CMD_SENSE_OFF 0x11
+#define FTS2BA61Y_CMD_READ_PANEL_INFO 0x23
+#define FTS2BA61Y_CMD_READ_FW_VER 0x24
+#define FTS2BA61Y_CMD_TOUCHTYPE 0x30 /* R/W for get/set */
+#define FTS2BA61Y_CMD_CLEAR_EVENTS 0x62
+#define FTS2BA61Y_CMD_READ_EVENT 0x87
+#define FTS2BA61Y_CMD_CUSTOM_W 0xC0
+#define FTS2BA61Y_CMD_CUSTOM_R 0xD1
+#define FTS2BA61Y_CMD_REG_W 0xFA
+#define FTS2BA61Y_CMD_REG_R 0xFB
+
+/* touch type masks */
+#define FTS2BA61Y_MASK_TOUCH BIT(0)
+#define FTS2BA61Y_MASK_HOVER BIT(1)
+#define FTS2BA61Y_MASK_COVER BIT(2)
+#define FTS2BA61Y_MASK_GLOVE BIT(3)
+#define FTS2BA61Y_MASK_STYLUS BIT(4)
+#define FTS2BA61Y_MASK_PALM BIT(5)
+#define FTS2BA61Y_MASK_WET BIT(6)
+#define FTS2BA61Y_TOUCHTYPE_DEFAULT (FTS2BA61Y_MASK_TOUCH | \
+ FTS2BA61Y_MASK_PALM | \
+ FTS2BA61Y_MASK_WET)
+
+/* event status masks */
+#define FTS2BA61Y_MASK_STYPE GENMASK(5, 2)
+#define FTS2BA61Y_MASK_EVENT_ID GENMASK(1, 0)
+
+/* event coordinate masks */
+#define FTS2BA61Y_MASK_TCHSTA GENMASK(7, 6)
+#define FTS2BA61Y_MASK_TID GENMASK(5, 2)
+#define FTS2BA61Y_MASK_X_3_0 GENMASK(7, 4)
+#define FTS2BA61Y_MASK_Y_3_0 GENMASK(3, 0)
+#define FTS2BA61Y_MASK_Z GENMASK(5, 0)
+#define FTS2BA61Y_MASK_TTYPE_3_2 GENMASK(7, 6)
+#define FTS2BA61Y_MASK_TTYPE_1_0 GENMASK(1, 0)
+#define FTS2BA61Y_MASK_LEFT_EVENTS GENMASK(4, 0)
+
+/* event error status */
+#define FTS2BA61Y_EVENT_STATUSTYPE_INFO 0x2
+
+/* information report */
+#define FTS2BA61Y_INFO_READY_STATUS 0x0
+
+/* event status */
+#define FTS2BA61Y_COORDINATE_EVENT 0x0
+
+/* touch types */
+#define FTS2BA61Y_TOUCHTYPE_NORMAL 0x0
+#define FTS2BA61Y_TOUCHTYPE_HOVER 0x1
+#define FTS2BA61Y_TOUCHTYPE_FLIPCOVER 0x2
+#define FTS2BA61Y_TOUCHTYPE_GLOVE 0x3
+#define FTS2BA61Y_TOUCHTYPE_STYLUS 0x4
+#define FTS2BA61Y_TOUCHTYPE_PALM 0x5
+#define FTS2BA61Y_TOUCHTYPE_WET 0x6
+#define FTS2BA61Y_TOUCHTYPE_PROXIMITY 0x7
+#define FTS2BA61Y_TOUCHTYPE_JIG 0x8
+
+#define FTS2BA61Y_COORDINATE_ACTION_NONE 0x0
+#define FTS2BA61Y_COORDINATE_ACTION_PRESS 0x1
+#define FTS2BA61Y_COORDINATE_ACTION_MOVE 0x2
+#define FTS2BA61Y_COORDINATE_ACTION_RELEASE 0x3
+
+#define FTS2BA61Y_DEV_NAME "fts2ba61y"
+#define FTS2BA61Y_EVENT_BUFF_SIZE 16
+#define FTS2BA61Y_PANEL_INFO_SIZE 11
+#define FTS2BA61Y_RESET_CMD_SIZE 5
+#define FTS2BA61Y_EVENT_COUNT 31
+#define MAX_TRANSFER_SIZE 256
+
+enum fts2ba61y_regulators {
+ FTS2BA61Y_REGULATOR_VDD,
+ FTS2BA61Y_REGULATOR_AVDD,
+};
+
+struct fts2ba61y_data {
+ struct spi_device *spi;
+ struct regulator_bulk_data regulators[2];
+ struct input_dev *input_dev;
+ struct mutex mutex;
+ struct touchscreen_properties prop;
+
+ u8 tx_count;
+
+ unsigned int max_x;
+ unsigned int max_y;
+};
+
+static int fts2ba61y_write(struct fts2ba61y_data *ts,
+ u8 *reg, int cmd_len, u8 *data, int data_len)
+{
+ struct spi_message msg;
+ struct spi_transfer xfers;
+ char *tx_buf;
+ int len;
+ int ret;
+
+ tx_buf = kzalloc(cmd_len + data_len + 1, GFP_KERNEL);
+ if (!tx_buf) {
+ ret = -ENOMEM;
+ goto out;
+ }
+
+ memset(&xfers, 0, sizeof(xfers));
+ spi_message_init(&msg);
+
+ memcpy(&tx_buf[0], reg, cmd_len);
+ if (data_len && data)
+ memcpy(&tx_buf[cmd_len], data, data_len);
+
+ len = cmd_len + data_len;
+
+ /* custom write cmd */
+ if (reg[0] != FTS2BA61Y_CMD_REG_W &&
+ reg[0] != FTS2BA61Y_CMD_REG_R) {
+ memmove(tx_buf + 1, tx_buf, len);
+ tx_buf[0] = FTS2BA61Y_CMD_CUSTOM_W;
+ len++;
+ }
+
+ xfers.len = len;
+ xfers.tx_buf = tx_buf;
+
+ spi_message_add_tail(&xfers, &msg);
+
+ mutex_lock(&ts->mutex);
+ ret = spi_sync(ts->spi, &msg);
+ if (ret)
+ dev_err(&ts->spi->dev, "spi transfer error, %d", ret);
+ mutex_unlock(&ts->mutex);
+
+out:
+ kfree(tx_buf);
+ return ret;
+}
+
+static int fts2ba61y_spi_raw_read(struct fts2ba61y_data *ts,
+ u8 *tx_buf, u8 *rx_buf, int len)
+{
+ struct spi_message msg;
+ struct spi_transfer xfer;
+ int ret;
+
+ memset(&xfer, 0, sizeof(xfer));
+ spi_message_init(&msg);
+
+ xfer.len = len;
+ xfer.tx_buf = tx_buf;
+ xfer.rx_buf = rx_buf;
+ spi_message_add_tail(&xfer, &msg);
+
+ mutex_lock(&ts->mutex);
+ ret = spi_sync(ts->spi, &msg);
+ if (ret)
+ dev_err(&ts->spi->dev, "spi transfer error, %d", ret);
+ mutex_unlock(&ts->mutex);
+
+ return ret;
+}
+
+/*
+ * higher-level wrapper that prepares the buffers for a read.
+ */
+static int fts2ba61y_read(struct fts2ba61y_data *ts,
+ u8 reg[], int tx_len, u8 buf[], int rx_len)
+{
+ char *tx_buf, *rx_buf;
+ int ret, mem_len;
+ u16 reg_val;
+
+ if (tx_len > 3)
+ mem_len = rx_len + 1 + tx_len;
+ else
+ mem_len = rx_len + 4;
+
+ tx_buf = kzalloc(mem_len, GFP_KERNEL);
+ rx_buf = kzalloc(mem_len, GFP_KERNEL);
+ if (!tx_buf || !rx_buf) {
+ ret = -ENOMEM;
+ goto out;
+ }
+
+ switch (reg[0]) {
+ case FTS2BA61Y_CMD_READ_EVENT:
+ case FTS2BA61Y_CMD_REG_W:
+ case FTS2BA61Y_CMD_REG_R:
+ memcpy(tx_buf, reg, tx_len);
+ break;
+
+ default:
+ tx_buf[0] = FTS2BA61Y_CMD_CUSTOM_R;
+
+ if (tx_len == 1)
+ reg_val = 0;
+ else if (tx_len == 2)
+ reg_val = reg[0];
+ else if (tx_len == 3)
+ reg_val = reg[0] | (reg[1] << 8);
+ else {
+ ret = -EINVAL;
+ goto out;
+ }
+
+ tx_len = 3;
+ put_unaligned_be16(reg_val, &tx_buf[1]);
+
+ ret = fts2ba61y_write(ts, reg, 1, NULL, 0);
+ if (ret < 0)
+ goto out;
+ break;
+ }
+
+ ret = fts2ba61y_spi_raw_read(ts, tx_buf, rx_buf, rx_len + 1 + tx_len);
+ if (ret < 0)
+ goto out;
+
+ memcpy(buf, &rx_buf[1 + tx_len], rx_len);
+
+out:
+ kfree(tx_buf);
+ kfree(rx_buf);
+ return ret;
+}
+
+static int fts2ba61y_wait_for_ready(struct fts2ba61y_data *ts)
+{
+ u8 buffer[FTS2BA61Y_EVENT_BUFF_SIZE];
+ u8 cmd = FTS2BA61Y_CMD_READ_EVENT;
+ u8 status_id, stype;
+ int ret;
+
+ for (int retries = 5; retries > 0; retries--) {
+ ret = fts2ba61y_read(ts, &cmd, 1, buffer, FTS2BA61Y_EVENT_BUFF_SIZE);
+
+ stype = FIELD_GET(FTS2BA61Y_MASK_STYPE, buffer[0]);
+ status_id = buffer[1];
+
+ if (stype == FTS2BA61Y_EVENT_STATUSTYPE_INFO &&
+ status_id == FTS2BA61Y_INFO_READY_STATUS) {
+ ret = 0;
+ break;
+ } else
+ ret = -ENODEV;
+
+ msleep(20);
+ }
+
+ return ret;
+}
+
+static int fts2ba61y_reset(struct fts2ba61y_data *ts)
+{
+ u8 cmd = FTS2BA61Y_CMD_REG_W;
+ /* the following sequence is undocumented */
+ u8 reset[FTS2BA61Y_RESET_CMD_SIZE] = { 0x20, 0x00,
+ 0x00, 0x24, 0x81 };
+ int ret;
+
+ disable_irq(ts->spi->irq);
+
+ ret = fts2ba61y_write(ts, &cmd, 1, &reset[0], FTS2BA61Y_RESET_CMD_SIZE);
+ if (ret)
+ return ret;
+ msleep(30);
+
+ ret = fts2ba61y_wait_for_ready(ts);
+ if (ret)
+ return ret;
+
+ enable_irq(ts->spi->irq);
+
+ return 0;
+}
+
+static int fts2ba61y_set_channels(struct fts2ba61y_data *ts)
+{
+ int ret;
+ u8 cmd = FTS2BA61Y_CMD_READ_PANEL_INFO;
+ u8 data[FTS2BA61Y_PANEL_INFO_SIZE];
+
+ ret = fts2ba61y_read(ts, &cmd, 1, data, FTS2BA61Y_PANEL_INFO_SIZE);
+ if (ret)
+ return ret;
+
+ ts->max_x = get_unaligned_be16(data);
+ ts->max_y = get_unaligned_be16(data + 2);
+
+ /* if no tx channels defined, at least keep one */
+ ts->tx_count = max_t(u8, data[8], 1);
+
+ return 0;
+}
+
+static int fts2ba61y_set_touch_func(struct fts2ba61y_data *ts)
+{
+ u8 cmd = FTS2BA61Y_CMD_TOUCHTYPE;
+ u16 touchtype = cpu_to_le16(FTS2BA61Y_TOUCHTYPE_DEFAULT);
+
+ return fts2ba61y_write(ts, &cmd, 1, (u8 *)&touchtype, 2);
+}
+
+static int fts2ba61y_hw_init(struct fts2ba61y_data *ts)
+{
+ int ret;
+
+ ret = regulator_bulk_enable(ARRAY_SIZE(ts->regulators),
+ ts->regulators);
+ if (ret)
+ return ret;
+
+ msleep(140);
+
+ ret = fts2ba61y_reset(ts);
+ if (ret)
+ return ret;
+
+ ret = fts2ba61y_set_channels(ts);
+ if (ret)
+ return ret;
+
+ return fts2ba61y_set_touch_func(ts);
+}
+
+static int fts2ba61y_get_event(struct fts2ba61y_data *ts, u8 *data, int *n_events)
+{
+ int ret;
+ u8 cmd = FTS2BA61Y_CMD_READ_EVENT;
+
+ ret = fts2ba61y_read(ts, &cmd, 1, data, FTS2BA61Y_EVENT_BUFF_SIZE);
+ if (ret < 0)
+ return ret;
+
+ if (!data[0]) {
+ *n_events = 0;
+ return 0;
+ }
+
+ *n_events = FIELD_GET(FTS2BA61Y_MASK_LEFT_EVENTS, data[7]);
+ if (unlikely(*n_events >= FTS2BA61Y_EVENT_COUNT)) {
+ cmd = FTS2BA61Y_CMD_CLEAR_EVENTS;
+ fts2ba61y_write(ts, &cmd, 1, NULL, 0);
+ *n_events = 0;
+ return -EINVAL;
+ }
+
+ if (*n_events > 0) {
+ ret = fts2ba61y_read(ts, &cmd, 1,
+ &data[1 * FTS2BA61Y_EVENT_BUFF_SIZE],
+ FTS2BA61Y_EVENT_BUFF_SIZE * (*n_events));
+ if (ret)
+ return ret;
+ }
+
+ return 0;
+}
+
+static void fts2ba61y_report_coordinates(struct fts2ba61y_data *ts,
+ u8 *event, u8 tid)
+{
+ u8 major = event[4];
+ u8 minor = event[5];
+ u8 z = FIELD_GET(FTS2BA61Y_MASK_Z, event[6]);
+
+ u16 x = (event[1] << 4) |
+ FIELD_GET(FTS2BA61Y_MASK_X_3_0, event[3]);
+ u16 y = (event[2] << 4) |
+ FIELD_GET(FTS2BA61Y_MASK_Y_3_0, event[3]);
+ u16 ttype = (FIELD_GET(FTS2BA61Y_MASK_TTYPE_3_2, event[6]) << 2) |
+ (FIELD_GET(FTS2BA61Y_MASK_TTYPE_1_0, event[7]) << 0);
+
+ if (ttype != FTS2BA61Y_TOUCHTYPE_NORMAL &&
+ ttype != FTS2BA61Y_TOUCHTYPE_PALM &&
+ ttype != FTS2BA61Y_TOUCHTYPE_WET &&
+ ttype != FTS2BA61Y_TOUCHTYPE_GLOVE)
+ return;
+
+ input_mt_slot(ts->input_dev, tid);
+ input_mt_report_slot_state(ts->input_dev, MT_TOOL_FINGER, true);
+ input_report_abs(ts->input_dev, ABS_MT_POSITION_X, x);
+ input_report_abs(ts->input_dev, ABS_MT_POSITION_Y, y);
+ input_report_abs(ts->input_dev, ABS_MT_TOUCH_MAJOR, major);
+ input_report_abs(ts->input_dev, ABS_MT_TOUCH_MINOR, minor);
+ input_report_abs(ts->input_dev, ABS_MT_PRESSURE, z);
+
+ input_mt_sync_frame(ts->input_dev);
+ input_sync(ts->input_dev);
+}
+
+static void fts2ba61y_report_release(struct fts2ba61y_data *ts, u8 tid)
+{
+ input_mt_slot(ts->input_dev, tid);
+ input_mt_report_slot_state(ts->input_dev, MT_TOOL_FINGER, false);
+
+ input_mt_sync_frame(ts->input_dev);
+ input_sync(ts->input_dev);
+}
+
+static void fts2ba61y_handle_coordinates(struct fts2ba61y_data *ts, u8 *event)
+{
+ u8 t_id = FIELD_GET(FTS2BA61Y_MASK_TID, event[0]);
+ u8 action = FIELD_GET(FTS2BA61Y_MASK_TCHSTA, event[0]);
+
+ if (t_id > ts->tx_count)
+ return;
+
+ switch (action) {
+ case FTS2BA61Y_COORDINATE_ACTION_PRESS:
+ case FTS2BA61Y_COORDINATE_ACTION_MOVE:
+ fts2ba61y_report_coordinates(ts, event, t_id);
+ break;
+
+ case FTS2BA61Y_COORDINATE_ACTION_RELEASE:
+ fts2ba61y_report_release(ts, t_id);
+ break;
+ }
+}
+
+static irqreturn_t fts2ba61y_irq_handler(int irq, void *handle)
+{
+ struct fts2ba61y_data *ts = handle;
+ u8 buffer[FTS2BA61Y_EVENT_COUNT * FTS2BA61Y_EVENT_BUFF_SIZE];
+ u8 *event;
+ u8 event_id;
+ int n_events = 0;
+ int ret;
+
+ usleep(1);
+
+ ret = fts2ba61y_get_event(ts, buffer, &n_events);
+ if (ret < 0) {
+ dev_dbg(&ts->spi->dev, "failed to get event: %d", ret);
+ return IRQ_HANDLED;
+ }
+
+ for (int i = 0; i <= n_events; i++) {
+ event = &buffer[i * FTS2BA61Y_EVENT_BUFF_SIZE];
+ event_id = FIELD_GET(FTS2BA61Y_MASK_EVENT_ID, event[0]);
+
+ if (event_id == FTS2BA61Y_COORDINATE_EVENT)
+ fts2ba61y_handle_coordinates(ts, event);
+ }
+
+ return IRQ_HANDLED;
+}
+
+static int fts2ba61y_input_open(struct input_dev *dev)
+{
+ struct fts2ba61y_data *ts = input_get_drvdata(dev);
+ u8 cmd = FTS2BA61Y_CMD_SENSE_ON;
+
+ return fts2ba61y_write(ts, &cmd, 1, NULL, 0);
+}
+
+static void fts2ba61y_input_close(struct input_dev *dev)
+{
+ struct fts2ba61y_data *ts = input_get_drvdata(dev);
+ int ret;
+ u8 cmd = FTS2BA61Y_CMD_SENSE_OFF;
+
+ ret = fts2ba61y_write(ts, &cmd, 1, NULL, 0);
+ if (ret)
+ dev_err(&ts->spi->dev, "failed to turn off sensing\n");
+}
+
+static void fts2ba61y_power_off(void *data)
+{
+ struct fts2ba61y_data *ts = data;
+
+ disable_irq(ts->spi->irq);
+ regulator_bulk_disable(ARRAY_SIZE(ts->regulators),
+ ts->regulators);
+}
+
+static int fts2ba61y_probe(struct spi_device *spi) {
+ struct fts2ba61y_data *ts;
+ struct input_dev *input_dev;
+ int error;
+
+ ts = devm_kzalloc(&spi->dev, sizeof(*ts), GFP_KERNEL);
+ if (!ts)
+ return -ENOMEM;
+
+ ts->spi = spi;
+ mutex_init(&ts->mutex);
+
+ spi->mode = SPI_MODE_0;
+ spi->bits_per_word = 8;
+
+ error = spi_setup(spi);
+ if (error)
+ return error;
+
+ ts->regulators[FTS2BA61Y_REGULATOR_VDD].supply = "vdd";
+ ts->regulators[FTS2BA61Y_REGULATOR_AVDD].supply = "avdd";
+ error = devm_regulator_bulk_get(&spi->dev,
+ ARRAY_SIZE(ts->regulators),
+ ts->regulators);
+ if (error)
+ return error;
+
+ error = fts2ba61y_hw_init(ts);
+ if (error)
+ return error;
+
+ error = devm_add_action_or_reset(&ts->spi->dev, fts2ba61y_power_off, ts);
+ if (error)
+ return error;
+
+ input_dev = devm_input_allocate_device(&spi->dev);
+ if (!input_dev)
+ return -ENOMEM;
+
+ ts->input_dev = input_dev;
+
+ input_dev->name = FTS2BA61Y_DEV_NAME;
+ input_dev->id.bustype = BUS_SPI;
+ input_dev->open = fts2ba61y_input_open;
+ input_dev->close = fts2ba61y_input_close;
+
+ input_set_abs_params(input_dev, ABS_MT_POSITION_X, 0, ts->max_x, 0, 0);
+ input_set_abs_params(input_dev, ABS_MT_POSITION_Y, 0, ts->max_y, 0, 0);
+ input_set_abs_params(input_dev, ABS_MT_TOUCH_MAJOR, 0, 255, 0, 0);
+ input_set_abs_params(input_dev, ABS_MT_TOUCH_MINOR, 0, 255, 0, 0);
+ input_set_abs_params(input_dev, ABS_MT_PRESSURE, 0, 255, 0, 0);
+
+ touchscreen_parse_properties(input_dev, true, &ts->prop);
+
+ spi_set_drvdata(spi, ts);
+ input_set_drvdata(input_dev, ts);
+
+ error = input_mt_init_slots(input_dev, ts->tx_count, INPUT_MT_DIRECT);
+ if (error)
+ return error;
+
+ error = input_register_device(input_dev);
+ if (error)
+ return error;
+
+ error = devm_request_threaded_irq(&spi->dev, spi->irq, NULL,
+ fts2ba61y_irq_handler,
+ IRQF_TRIGGER_LOW | IRQF_ONESHOT,
+ "fts2ba61y_irq", ts);
+ return error;
+}
+
+#ifdef CONFIG_OF
+static const struct of_device_id spi_touchscreen_dt_ids[] = {
+ { .compatible = "st,fts2ba61y" },
+ {},
+};
+MODULE_DEVICE_TABLE(of, spi_touchscreen_dt_ids);
+#endif
+
+static const struct spi_device_id fts2ba61y_spi_ids[] = {
+ { "fts2ba61y" },
+ { },
+};
+MODULE_DEVICE_TABLE(spi, fts2ba61y_spi_ids);
+
+static struct spi_driver spi_touchscreen_driver = {
+ .driver = {
+ .name = FTS2BA61Y_DEV_NAME,
+ .of_match_table = of_match_ptr(spi_touchscreen_dt_ids),
+ },
+ .probe = fts2ba61y_probe,
+ .id_table = fts2ba61y_spi_ids,
+};
+
+module_spi_driver(spi_touchscreen_driver);
+
+MODULE_AUTHOR("Ivaylo Ivanov <ivo.ivanov.ivanov1@gmail.com>");
+MODULE_DESCRIPTION("ST-Microelectronics FTS2BA61Y Touch Screen");
+MODULE_LICENSE("GPL");
--
2.50.1
^ permalink raw reply related
* [RFC PATCH 1/2] dt-bindings: input: add ST-Microelectronics FTS2BA61Y touchscreen binding
From: Eric Gonçalves @ 2025-09-11 21:19 UTC (permalink / raw)
To: Dmitry Torokhov, Henrik Rydberg, Rob Herring, Krzysztof Kozlowski,
Conor Dooley
Cc: Ivaylo Ivanov, linux-input, devicetree, linux-kernel,
Eric Gonçalves
In-Reply-To: <20250911211910.45903-1-ghatto404@gmail.com>
Add the bindings for ST-Microelectronics FTS2BA61Y capacitive touchscreen.
Signed-off-by: Eric Gonçalves <ghatto404@gmail.com>
---
.../input/touchscreen/st,fts2ba61y.yaml | 52 +++++++++++++++++++
1 file changed, 52 insertions(+)
create mode 100755 Documentation/devicetree/bindings/input/touchscreen/st,fts2ba61y.yaml
diff --git a/Documentation/devicetree/bindings/input/touchscreen/st,fts2ba61y.yaml b/Documentation/devicetree/bindings/input/touchscreen/st,fts2ba61y.yaml
new file mode 100644
index 000000000000..e4d076bc7bcd
--- /dev/null
+++ b/Documentation/devicetree/bindings/input/touchscreen/st,fts2ba61y.yaml
@@ -0,0 +1,52 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/input/touchscreen/st,fts2ba61y.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: ST-Microelectronics FTS2BA61Y touchscreen controller
+
+maintainers:
+ - Ivaylo Ivanov <ivo.ivanov.ivanov1@gmail.com>
+
+allOf:
+ - $ref: touchscreen.yaml#
+
+properties:
+ compatible:
+ const: st,fts2ba61y
+
+ reg:
+ maxItems: 1
+
+ interrupts:
+ maxItems: 1
+
+ avdd-supply: true
+ vdd-supply: true
+
+unevaluatedProperties: false
+
+required:
+ - compatible
+ - reg
+ - interrupts
+ - avdd-supply
+ - vdd-supply
+
+examples:
+ - |
+ #include <dt-bindings/interrupt-controller/irq.h>
+ spi {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ touchscreen@0 {
+ compatible = "st,fts2ba61y";
+ reg = <0x0>;
+ interrupt-parent = <&gpa2>;
+ interrupts = <2 IRQ_TYPE_LEVEL_HIGH>;
+ avdd-supply = <&ldo17_reg>;
+ vdd-supply = <&ldo28_reg>;
+ };
+ };
--
2.50.1
^ permalink raw reply related
* [RFC PATCH 0/2] Input: add fts2ba61y touchscreen driver
From: Eric Gonçalves @ 2025-09-11 21:19 UTC (permalink / raw)
To: Dmitry Torokhov, Henrik Rydberg, Rob Herring, Krzysztof Kozlowski,
Conor Dooley
Cc: Ivaylo Ivanov, linux-input, devicetree, linux-kernel,
Eric Gonçalves
This patchset adds support for the ST-Microelectronics FTS2BA61Y,
a capacitive multi-touch touchscreen controller. this touchscreen
is used in many mobile devices, like ones from the Galaxy S22 series
and the Z Fold 5. Ivaylo Ivanov wrote the driver originally,
and I'm upstreaming it on his behalf.
Thanks!
Eric Gonçalves (2):
dt-bindings: input: add ST-Microelectronics FTS2BA61Y touchscreen
binding
Input: add support for the STM FTS2BA61Y touchscreen
.../input/touchscreen/st,fts2ba61y.yaml | 52 ++
drivers/input/touchscreen/Kconfig | 11 +
drivers/input/touchscreen/Makefile | 1 +
drivers/input/touchscreen/fts2ba61y.c | 588 ++++++++++++++++++
4 files changed, 652 insertions(+)
create mode 100755 Documentation/devicetree/bindings/input/touchscreen/st,fts2ba61y.yaml
create mode 100644 drivers/input/touchscreen/fts2ba61y.c
--
2.50.1
^ permalink raw reply
* Re: (subset) [PATCH v1 0/2] input: rmi4: fix RMI_2D clipping
From: Thierry Reding @ 2025-09-11 16:03 UTC (permalink / raw)
To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Thierry Reding,
Jonathan Hunter, Dmitry Torokhov, Jonas Schwöbel,
Svyatoslav Ryhel
Cc: devicetree, linux-tegra, linux-kernel, linux-input
In-Reply-To: <20250903161947.109328-1-clamor95@gmail.com>
From: Thierry Reding <treding@nvidia.com>
On Wed, 03 Sep 2025 19:19:44 +0300, Svyatoslav Ryhel wrote:
> The physical max_y value was overridden with a clip_y_max value. This
> caused problems when inverting/flipping the screen. Further it messed up
> calculation of resolution.
>
> Jonas Schwöbel (2):
> input: rmi4: fix RMI_2D clipping
> ARM: tegra: p880: set correct touchscreen clipping
>
> [...]
Applied, thanks!
[2/2] ARM: tegra: p880: set correct touchscreen clipping
commit: 2fa1118387295b9fa6d70a48011b30184348abd0
Best regards,
--
Thierry Reding <treding@nvidia.com>
^ permalink raw reply
* [PATCH v2 12/12] dt-bindings: input: Convert MELFAS MIP4 Touchscreen to DT schema
From: Ariel D'Alessandro @ 2025-09-11 15:10 UTC (permalink / raw)
To: airlied, amergnat, andrew+netdev, andrew-ct.chen,
angelogioacchino.delregno, ariel.dalessandro, broonie,
chunkuang.hu, conor+dt, davem, dmitry.torokhov, edumazet,
flora.fu, heiko, houlong.wei, jeesw, kernel, krzk+dt, kuba,
lgirdwood, linus.walleij, louisalexis.eyraud, luiz.dentz,
maarten.lankhorst, marcel, matthias.bgg, mchehab, minghsiu.tsai,
mripard, p.zabel, pabeni, robh, sean.wang, simona,
support.opensource, tiffany.lin, tzimmermann, yunfei.dong
Cc: devicetree, dri-devel, linux-arm-kernel, linux-bluetooth,
linux-gpio, linux-input, linux-kernel, linux-media,
linux-mediatek, linux-rockchip, linux-sound, netdev
In-Reply-To: <20250911151001.108744-1-ariel.dalessandro@collabora.com>
Convert the existing text-based DT bindings for MELFAS MIP4 Touchscreen
controller to a DT schema.
Signed-off-by: Ariel D'Alessandro <ariel.dalessandro@collabora.com>
Reviewed-by: Rob Herring (Arm) <robh@kernel.org>
---
.../input/touchscreen/melfas,mip4_ts.yaml | 56 +++++++++++++++++++
.../input/touchscreen/melfas_mip4.txt | 20 -------
2 files changed, 56 insertions(+), 20 deletions(-)
create mode 100644 Documentation/devicetree/bindings/input/touchscreen/melfas,mip4_ts.yaml
delete mode 100644 Documentation/devicetree/bindings/input/touchscreen/melfas_mip4.txt
diff --git a/Documentation/devicetree/bindings/input/touchscreen/melfas,mip4_ts.yaml b/Documentation/devicetree/bindings/input/touchscreen/melfas,mip4_ts.yaml
new file mode 100644
index 0000000000000..314be65c56caa
--- /dev/null
+++ b/Documentation/devicetree/bindings/input/touchscreen/melfas,mip4_ts.yaml
@@ -0,0 +1,56 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/input/touchscreen/melfas,mip4_ts.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: MELFAS MIP4 Touchscreen
+
+maintainers:
+ - Ariel D'Alessandro <ariel.dalessandro@collabora.com>
+
+properties:
+ compatible:
+ const: melfas,mip4_ts
+
+ reg:
+ description: I2C address of the chip (0x48 or 0x34)
+ maxItems: 1
+
+ interrupts:
+ maxItems: 1
+
+ ce-gpios:
+ description:
+ GPIO connected to the CE (chip enable) pin of the chip (active high)
+ maxItems: 1
+
+required:
+ - compatible
+ - reg
+ - interrupts
+
+additionalProperties: false
+
+examples:
+ - |
+ #include <dt-bindings/gpio/gpio.h>
+ #include <dt-bindings/interrupt-controller/irq.h>
+
+ i2c {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ touchscreen@34 {
+ compatible = "melfas,mip4_ts";
+ reg = <0x34>;
+
+ interrupts-extended = <&tlmm 13 IRQ_TYPE_EDGE_FALLING>;
+ ce-gpios = <&tlmm 12 GPIO_ACTIVE_HIGH>;
+
+ pinctrl-0 = <&touchscreen_default>;
+ pinctrl-names = "default";
+ };
+ };
+
+...
diff --git a/Documentation/devicetree/bindings/input/touchscreen/melfas_mip4.txt b/Documentation/devicetree/bindings/input/touchscreen/melfas_mip4.txt
deleted file mode 100644
index b2ab5498e5190..0000000000000
--- a/Documentation/devicetree/bindings/input/touchscreen/melfas_mip4.txt
+++ /dev/null
@@ -1,20 +0,0 @@
-* MELFAS MIP4 Touchscreen
-
-Required properties:
-- compatible: must be "melfas,mip4_ts"
-- reg: I2C slave address of the chip (0x48 or 0x34)
-- interrupts: interrupt to which the chip is connected
-
-Optional properties:
-- ce-gpios: GPIO connected to the CE (chip enable) pin of the chip
-
-Example:
- i2c@00000000 {
- touchscreen: melfas_mip4@48 {
- compatible = "melfas,mip4_ts";
- reg = <0x48>;
- interrupt-parent = <&gpio>;
- interrupts = <0 IRQ_TYPE_EDGE_FALLING>;
- ce-gpios = <&gpio 0 GPIO_ACTIVE_HIGH>;
- };
- };
--
2.50.1
^ permalink raw reply related
* [PATCH v2 11/12] dt-bindings: soc: mediatek: pwrap: Add power-domains property
From: Ariel D'Alessandro @ 2025-09-11 15:10 UTC (permalink / raw)
To: airlied, amergnat, andrew+netdev, andrew-ct.chen,
angelogioacchino.delregno, ariel.dalessandro, broonie,
chunkuang.hu, conor+dt, davem, dmitry.torokhov, edumazet,
flora.fu, heiko, houlong.wei, jeesw, kernel, krzk+dt, kuba,
lgirdwood, linus.walleij, louisalexis.eyraud, luiz.dentz,
maarten.lankhorst, marcel, matthias.bgg, mchehab, minghsiu.tsai,
mripard, p.zabel, pabeni, robh, sean.wang, simona,
support.opensource, tiffany.lin, tzimmermann, yunfei.dong
Cc: devicetree, dri-devel, linux-arm-kernel, linux-bluetooth,
linux-gpio, linux-input, linux-kernel, linux-media,
linux-mediatek, linux-rockchip, linux-sound, netdev
In-Reply-To: <20250911151001.108744-1-ariel.dalessandro@collabora.com>
Currently, the DT bindings for Mediatek PMIC Wrapper is missing the
power-domains property, which is used in the MT8173 E1 evaluation board as
it needs USB power domain.
Signed-off-by: Ariel D'Alessandro <ariel.dalessandro@collabora.com>
Acked-by: Rob Herring (Arm) <robh@kernel.org>
---
.../bindings/soc/mediatek/mediatek,pwrap.yaml | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/Documentation/devicetree/bindings/soc/mediatek/mediatek,pwrap.yaml b/Documentation/devicetree/bindings/soc/mediatek/mediatek,pwrap.yaml
index 4737e5f45d541..54c0cd64d3094 100644
--- a/Documentation/devicetree/bindings/soc/mediatek/mediatek,pwrap.yaml
+++ b/Documentation/devicetree/bindings/soc/mediatek/mediatek,pwrap.yaml
@@ -98,6 +98,9 @@ properties:
- const: pwrap
- const: pwrap-bridge
+ power-domains:
+ maxItems: 1
+
pmic:
type: object
@@ -126,6 +129,18 @@ allOf:
clock-names:
minItems: 4
+ - if:
+ properties:
+ compatible:
+ contains:
+ const: mediatek,mt8173-pwrap
+ then:
+ properties:
+ power-domains: true
+ else:
+ properties:
+ power-domains: false
+
additionalProperties: false
examples:
--
2.50.1
^ permalink raw reply related
* [PATCH v2 10/12] arm64: dts: mediatek: mt8173-elm: Drop unused bank supply
From: Ariel D'Alessandro @ 2025-09-11 15:09 UTC (permalink / raw)
To: airlied, amergnat, andrew+netdev, andrew-ct.chen,
angelogioacchino.delregno, ariel.dalessandro, broonie,
chunkuang.hu, conor+dt, davem, dmitry.torokhov, edumazet,
flora.fu, heiko, houlong.wei, jeesw, kernel, krzk+dt, kuba,
lgirdwood, linus.walleij, louisalexis.eyraud, luiz.dentz,
maarten.lankhorst, marcel, matthias.bgg, mchehab, minghsiu.tsai,
mripard, p.zabel, pabeni, robh, sean.wang, simona,
support.opensource, tiffany.lin, tzimmermann, yunfei.dong
Cc: devicetree, dri-devel, linux-arm-kernel, linux-bluetooth,
linux-gpio, linux-input, linux-kernel, linux-media,
linux-mediatek, linux-rockchip, linux-sound, netdev
In-Reply-To: <20250911151001.108744-1-ariel.dalessandro@collabora.com>
The mediatek,mt8173-thermal device tree binding schema doesn't allow
regulator supplies like the ones defined in mt8173-elm.dtsi. Drop these as
the associated driver doesn't implement them either.
Signed-off-by: Ariel D'Alessandro <ariel.dalessandro@collabora.com>
---
arch/arm64/boot/dts/mediatek/mt8173-elm.dtsi | 5 -----
1 file changed, 5 deletions(-)
diff --git a/arch/arm64/boot/dts/mediatek/mt8173-elm.dtsi b/arch/arm64/boot/dts/mediatek/mt8173-elm.dtsi
index f52a9906f6a65..eb4f6ba555465 100644
--- a/arch/arm64/boot/dts/mediatek/mt8173-elm.dtsi
+++ b/arch/arm64/boot/dts/mediatek/mt8173-elm.dtsi
@@ -1149,11 +1149,6 @@ &ssusb {
status = "okay";
};
-&thermal {
- bank0-supply = <&mt6397_vpca15_reg>;
- bank1-supply = <&da9211_vcpu_reg>;
-};
-
&uart0 {
status = "okay";
};
--
2.50.1
^ permalink raw reply related
* [PATCH v2 09/12] dt-bindings: regulator: Convert Dialog DA9211 Regulators to DT schema
From: Ariel D'Alessandro @ 2025-09-11 15:09 UTC (permalink / raw)
To: airlied, amergnat, andrew+netdev, andrew-ct.chen,
angelogioacchino.delregno, ariel.dalessandro, broonie,
chunkuang.hu, conor+dt, davem, dmitry.torokhov, edumazet,
flora.fu, heiko, houlong.wei, jeesw, kernel, krzk+dt, kuba,
lgirdwood, linus.walleij, louisalexis.eyraud, luiz.dentz,
maarten.lankhorst, marcel, matthias.bgg, mchehab, minghsiu.tsai,
mripard, p.zabel, pabeni, robh, sean.wang, simona,
support.opensource, tiffany.lin, tzimmermann, yunfei.dong
Cc: devicetree, dri-devel, linux-arm-kernel, linux-bluetooth,
linux-gpio, linux-input, linux-kernel, linux-media,
linux-mediatek, linux-rockchip, linux-sound, netdev
In-Reply-To: <20250911151001.108744-1-ariel.dalessandro@collabora.com>
Convert the existing text-based DT bindings for Dialog Semiconductor DA9211
Voltage Regulators family to a DT schema. Examples are simplified, as these
are all equal.
Signed-off-by: Ariel D'Alessandro <ariel.dalessandro@collabora.com>
---
.../devicetree/bindings/regulator/da9211.txt | 205 ------------------
.../bindings/regulator/dlg,da9211.yaml | 104 +++++++++
2 files changed, 104 insertions(+), 205 deletions(-)
delete mode 100644 Documentation/devicetree/bindings/regulator/da9211.txt
create mode 100644 Documentation/devicetree/bindings/regulator/dlg,da9211.yaml
diff --git a/Documentation/devicetree/bindings/regulator/da9211.txt b/Documentation/devicetree/bindings/regulator/da9211.txt
deleted file mode 100644
index eb871447d5082..0000000000000
--- a/Documentation/devicetree/bindings/regulator/da9211.txt
+++ /dev/null
@@ -1,205 +0,0 @@
-* Dialog Semiconductor DA9211/DA9212/DA9213/DA9223/DA9214/DA9224/DA9215/DA9225
- Voltage Regulator
-
-Required properties:
-- compatible: "dlg,da9211" or "dlg,da9212" or "dlg,da9213" or "dlg,da9223"
- or "dlg,da9214" or "dlg,da9224" or "dlg,da9215" or "dlg,da9225"
-- reg: I2C slave address, usually 0x68.
-- interrupts: the interrupt outputs of the controller
-- regulators: A node that houses a sub-node for each regulator within the
- device. Each sub-node is identified using the node's name, with valid
- values listed below. The content of each sub-node is defined by the
- standard binding for regulators; see regulator.txt.
- BUCKA and BUCKB.
-
-Optional properties:
-- enable-gpios: platform gpio for control of BUCKA/BUCKB.
-- Any optional property defined in regulator.txt
- - regulator-initial-mode and regulator-allowed-modes may be specified using
- mode values from dt-bindings/regulator/dlg,da9211-regulator.h
-
-Example 1) DA9211
- pmic: da9211@68 {
- compatible = "dlg,da9211";
- reg = <0x68>;
- interrupts = <3 27>;
-
- regulators {
- BUCKA {
- regulator-name = "VBUCKA";
- regulator-min-microvolt = < 300000>;
- regulator-max-microvolt = <1570000>;
- regulator-min-microamp = <2000000>;
- regulator-max-microamp = <5000000>;
- enable-gpios = <&gpio 27 0>;
- regulator-allowed-modes = <DA9211_BUCK_MODE_SYNC
- DA9211_BUCK_MODE_AUTO>;
- };
- };
- };
-
-Example 2) DA9212
- pmic: da9212@68 {
- compatible = "dlg,da9212";
- reg = <0x68>;
- interrupts = <3 27>;
-
- regulators {
- BUCKA {
- regulator-name = "VBUCKA";
- regulator-min-microvolt = < 300000>;
- regulator-max-microvolt = <1570000>;
- regulator-min-microamp = <2000000>;
- regulator-max-microamp = <5000000>;
- enable-gpios = <&gpio 27 0>;
- };
- BUCKB {
- regulator-name = "VBUCKB";
- regulator-min-microvolt = < 300000>;
- regulator-max-microvolt = <1570000>;
- regulator-min-microamp = <2000000>;
- regulator-max-microamp = <5000000>;
- enable-gpios = <&gpio 17 0>;
- };
- };
- };
-
-Example 3) DA9213
- pmic: da9213@68 {
- compatible = "dlg,da9213";
- reg = <0x68>;
- interrupts = <3 27>;
-
- regulators {
- BUCKA {
- regulator-name = "VBUCKA";
- regulator-min-microvolt = < 300000>;
- regulator-max-microvolt = <1570000>;
- regulator-min-microamp = <3000000>;
- regulator-max-microamp = <6000000>;
- enable-gpios = <&gpio 27 0>;
- };
- };
- };
-
-Example 4) DA9223
- pmic: da9223@68 {
- compatible = "dlg,da9223";
- reg = <0x68>;
- interrupts = <3 27>;
-
- regulators {
- BUCKA {
- regulator-name = "VBUCKA";
- regulator-min-microvolt = < 300000>;
- regulator-max-microvolt = <1570000>;
- regulator-min-microamp = <3000000>;
- regulator-max-microamp = <6000000>;
- enable-gpios = <&gpio 27 0>;
- };
- };
- };
-
-Example 5) DA9214
- pmic: da9214@68 {
- compatible = "dlg,da9214";
- reg = <0x68>;
- interrupts = <3 27>;
-
- regulators {
- BUCKA {
- regulator-name = "VBUCKA";
- regulator-min-microvolt = < 300000>;
- regulator-max-microvolt = <1570000>;
- regulator-min-microamp = <3000000>;
- regulator-max-microamp = <6000000>;
- enable-gpios = <&gpio 27 0>;
- };
- BUCKB {
- regulator-name = "VBUCKB";
- regulator-min-microvolt = < 300000>;
- regulator-max-microvolt = <1570000>;
- regulator-min-microamp = <3000000>;
- regulator-max-microamp = <6000000>;
- enable-gpios = <&gpio 17 0>;
- };
- };
- };
-
-Example 6) DA9224
- pmic: da9224@68 {
- compatible = "dlg,da9224";
- reg = <0x68>;
- interrupts = <3 27>;
-
- regulators {
- BUCKA {
- regulator-name = "VBUCKA";
- regulator-min-microvolt = < 300000>;
- regulator-max-microvolt = <1570000>;
- regulator-min-microamp = <3000000>;
- regulator-max-microamp = <6000000>;
- enable-gpios = <&gpio 27 0>;
- };
- BUCKB {
- regulator-name = "VBUCKB";
- regulator-min-microvolt = < 300000>;
- regulator-max-microvolt = <1570000>;
- regulator-min-microamp = <3000000>;
- regulator-max-microamp = <6000000>;
- enable-gpios = <&gpio 17 0>;
- };
- };
- };
-
-Example 7) DA9215
- pmic: da9215@68 {
- compatible = "dlg,da9215";
- reg = <0x68>;
- interrupts = <3 27>;
-
- regulators {
- BUCKA {
- regulator-name = "VBUCKA";
- regulator-min-microvolt = < 300000>;
- regulator-max-microvolt = <1570000>;
- regulator-min-microamp = <4000000>;
- regulator-max-microamp = <7000000>;
- enable-gpios = <&gpio 27 0>;
- };
- BUCKB {
- regulator-name = "VBUCKB";
- regulator-min-microvolt = < 300000>;
- regulator-max-microvolt = <1570000>;
- regulator-min-microamp = <4000000>;
- regulator-max-microamp = <7000000>;
- enable-gpios = <&gpio 17 0>;
- };
- };
- };
-
-Example 8) DA9225
- pmic: da9225@68 {
- compatible = "dlg,da9225";
- reg = <0x68>;
- interrupts = <3 27>;
-
- regulators {
- BUCKA {
- regulator-name = "VBUCKA";
- regulator-min-microvolt = < 300000>;
- regulator-max-microvolt = <1570000>;
- regulator-min-microamp = <4000000>;
- regulator-max-microamp = <7000000>;
- enable-gpios = <&gpio 27 0>;
- };
- BUCKB {
- regulator-name = "VBUCKB";
- regulator-min-microvolt = < 300000>;
- regulator-max-microvolt = <1570000>;
- regulator-min-microamp = <4000000>;
- regulator-max-microamp = <7000000>;
- enable-gpios = <&gpio 17 0>;
- };
- };
- };
diff --git a/Documentation/devicetree/bindings/regulator/dlg,da9211.yaml b/Documentation/devicetree/bindings/regulator/dlg,da9211.yaml
new file mode 100644
index 0000000000000..9d5e25bc3872c
--- /dev/null
+++ b/Documentation/devicetree/bindings/regulator/dlg,da9211.yaml
@@ -0,0 +1,104 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/regulator/dlg,da9211.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title:
+ Dialog Semiconductor DA9211/DA9212/DA9213/DA9223/DA9214/DA9224/DA9215/DA9225
+ Voltage Regulator
+
+maintainers:
+ - Ariel D'Alessandro <ariel.dalessandro@collabora.com>
+
+properties:
+ compatible:
+ enum:
+ - dlg,da9211
+ - dlg,da9212
+ - dlg,da9213
+ - dlg,da9214
+ - dlg,da9215
+ - dlg,da9223
+ - dlg,da9224
+ - dlg,da9225
+
+ reg:
+ maxItems: 1
+
+ interrupts:
+ maxItems: 1
+
+ regulators:
+ type: object
+ additionalProperties: false
+ description:
+ List of regulators provided by the device
+
+ patternProperties:
+ "^BUCK([AB])$":
+ type: object
+ $ref: regulator.yaml#
+ unevaluatedProperties: false
+ description: |
+ Properties for a single BUCK regulator
+
+ properties:
+ regulator-initial-mode:
+ items:
+ enum: [ 1, 2, 3 ]
+ description: |
+ Defined in include/dt-bindings/regulator/dlg,da9211-regulator.h
+
+ regulator-allowed-modes:
+ items:
+ enum: [ 1, 2, 3 ]
+ description: |
+ Defined in include/dt-bindings/regulator/dlg,da9211-regulator.h
+
+ enable-gpios:
+ maxItems: 1
+
+required:
+ - compatible
+ - reg
+ - interrupts
+ - regulators
+
+additionalProperties: false
+
+examples:
+ - |
+ #include <dt-bindings/regulator/dlg,da9211-regulator.h>
+
+ i2c {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ regulator@68 {
+ compatible = "dlg,da9212";
+ reg = <0x68>;
+ interrupts = <3 27>;
+
+ regulators {
+ BUCKA {
+ regulator-name = "VBUCKA";
+ regulator-min-microvolt = < 300000>;
+ regulator-max-microvolt = <1570000>;
+ regulator-min-microamp = <2000000>;
+ regulator-max-microamp = <5000000>;
+ enable-gpios = <&gpio 27 0>;
+ };
+ BUCKB {
+ regulator-name = "VBUCKB";
+ regulator-min-microvolt = < 300000>;
+ regulator-max-microvolt = <1570000>;
+ regulator-min-microamp = <2000000>;
+ regulator-max-microamp = <5000000>;
+ enable-gpios = <&gpio 17 0>;
+ };
+ };
+ };
+ };
+
+...
--
2.50.1
^ permalink raw reply related
* [PATCH v2 08/12] dt-bindings: pinctrl: mt65xx: Allow gpio-line-names
From: Ariel D'Alessandro @ 2025-09-11 15:09 UTC (permalink / raw)
To: airlied, amergnat, andrew+netdev, andrew-ct.chen,
angelogioacchino.delregno, ariel.dalessandro, broonie,
chunkuang.hu, conor+dt, davem, dmitry.torokhov, edumazet,
flora.fu, heiko, houlong.wei, jeesw, kernel, krzk+dt, kuba,
lgirdwood, linus.walleij, louisalexis.eyraud, luiz.dentz,
maarten.lankhorst, marcel, matthias.bgg, mchehab, minghsiu.tsai,
mripard, p.zabel, pabeni, robh, sean.wang, simona,
support.opensource, tiffany.lin, tzimmermann, yunfei.dong
Cc: devicetree, dri-devel, linux-arm-kernel, linux-bluetooth,
linux-gpio, linux-input, linux-kernel, linux-media,
linux-mediatek, linux-rockchip, linux-sound, netdev
In-Reply-To: <20250911151001.108744-1-ariel.dalessandro@collabora.com>
Current, the DT bindings for MediaTek's MT65xx Pin controller is missing
the gpio-line-names property, add it to the associated schema.
Signed-off-by: Ariel D'Alessandro <ariel.dalessandro@collabora.com>
---
.../devicetree/bindings/pinctrl/mediatek,mt65xx-pinctrl.yaml | 2 ++
1 file changed, 2 insertions(+)
diff --git a/Documentation/devicetree/bindings/pinctrl/mediatek,mt65xx-pinctrl.yaml b/Documentation/devicetree/bindings/pinctrl/mediatek,mt65xx-pinctrl.yaml
index b9680b896f12f..aa71398cf522f 100644
--- a/Documentation/devicetree/bindings/pinctrl/mediatek,mt65xx-pinctrl.yaml
+++ b/Documentation/devicetree/bindings/pinctrl/mediatek,mt65xx-pinctrl.yaml
@@ -43,6 +43,8 @@ properties:
the amount of cells must be specified as 2. See the below mentioned gpio
binding representation for description of particular cells.
+ gpio-line-names: true
+
mediatek,pctl-regmap:
$ref: /schemas/types.yaml#/definitions/phandle-array
items:
--
2.50.1
^ permalink raw reply related
* [PATCH v2 07/12] arm64: dts: mediatek: mt8173: Fix mt8173-pinctrl node names
From: Ariel D'Alessandro @ 2025-09-11 15:09 UTC (permalink / raw)
To: airlied, amergnat, andrew+netdev, andrew-ct.chen,
angelogioacchino.delregno, ariel.dalessandro, broonie,
chunkuang.hu, conor+dt, davem, dmitry.torokhov, edumazet,
flora.fu, heiko, houlong.wei, jeesw, kernel, krzk+dt, kuba,
lgirdwood, linus.walleij, louisalexis.eyraud, luiz.dentz,
maarten.lankhorst, marcel, matthias.bgg, mchehab, minghsiu.tsai,
mripard, p.zabel, pabeni, robh, sean.wang, simona,
support.opensource, tiffany.lin, tzimmermann, yunfei.dong
Cc: devicetree, dri-devel, linux-arm-kernel, linux-bluetooth,
linux-gpio, linux-input, linux-kernel, linux-media,
linux-mediatek, linux-rockchip, linux-sound, netdev
In-Reply-To: <20250911151001.108744-1-ariel.dalessandro@collabora.com>
According to the mediatek,mt8173-pinctrl device tree binding schema, the
pinctrl node names should match pattern 'pins$'. Fix this.
Signed-off-by: Ariel D'Alessandro <ariel.dalessandro@collabora.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Rob Herring (Arm) <robh@kernel.org>
---
.../boot/dts/mediatek/mt8173-elm-hana.dtsi | 2 +-
arch/arm64/boot/dts/mediatek/mt8173-elm.dtsi | 26 +++++++++----------
arch/arm64/boot/dts/mediatek/mt8173-evb.dts | 14 +++++-----
arch/arm64/boot/dts/mediatek/mt8173.dtsi | 14 +++++-----
4 files changed, 28 insertions(+), 28 deletions(-)
diff --git a/arch/arm64/boot/dts/mediatek/mt8173-elm-hana.dtsi b/arch/arm64/boot/dts/mediatek/mt8173-elm-hana.dtsi
index dfc5c2f0ddefd..7d665cedf8a44 100644
--- a/arch/arm64/boot/dts/mediatek/mt8173-elm-hana.dtsi
+++ b/arch/arm64/boot/dts/mediatek/mt8173-elm-hana.dtsi
@@ -80,7 +80,7 @@ pins2 {
};
};
- mmc1_pins_default: mmc1default {
+ mmc1_pins_default: mmc1_default_pins {
pins_wp {
pinmux = <MT8173_PIN_42_DSI_TE__FUNC_GPIO42>;
input-enable;
diff --git a/arch/arm64/boot/dts/mediatek/mt8173-elm.dtsi b/arch/arm64/boot/dts/mediatek/mt8173-elm.dtsi
index 8d1f40077a5e5..f52a9906f6a65 100644
--- a/arch/arm64/boot/dts/mediatek/mt8173-elm.dtsi
+++ b/arch/arm64/boot/dts/mediatek/mt8173-elm.dtsi
@@ -601,7 +601,7 @@ &pio {
"SOC_I2C4_1V8_SDA_400K",
"SOC_I2C4_1V8_SCL_400K";
- aud_i2s2: aud_i2s2 {
+ aud_i2s2: aud_i2s2_pins {
pins1 {
pinmux = <MT8173_PIN_128_I2S0_LRCK__FUNC_I2S1_WS>,
<MT8173_PIN_129_I2S0_BCK__FUNC_I2S1_BCK>,
@@ -654,14 +654,14 @@ pins1 {
};
};
- i2c1_pins_a: i2c1 {
+ i2c1_pins_a: i2c1_pins {
da9211_pins {
pinmux = <MT8173_PIN_15_EINT15__FUNC_GPIO15>;
bias-pull-up;
};
};
- mmc0_pins_default: mmc0default {
+ mmc0_pins_default: mmc0_default_pins {
pins_cmd_dat {
pinmux = <MT8173_PIN_57_MSDC0_DAT0__FUNC_MSDC0_DAT0>,
<MT8173_PIN_58_MSDC0_DAT1__FUNC_MSDC0_DAT1>,
@@ -686,7 +686,7 @@ pins_rst {
};
};
- mmc1_pins_default: mmc1default {
+ mmc1_pins_default: mmc1_default_pins {
pins_cmd_dat {
pinmux = <MT8173_PIN_73_MSDC1_DAT0__FUNC_MSDC1_DAT0>,
<MT8173_PIN_74_MSDC1_DAT1__FUNC_MSDC1_DAT1>,
@@ -710,7 +710,7 @@ pins_insert {
};
};
- mmc3_pins_default: mmc3default {
+ mmc3_pins_default: mmc3_default_pins {
pins_dat {
pinmux = <MT8173_PIN_22_MSDC3_DAT0__FUNC_MSDC3_DAT0>,
<MT8173_PIN_23_MSDC3_DAT1__FUNC_MSDC3_DAT1>,
@@ -735,7 +735,7 @@ pins_clk {
};
};
- mmc0_pins_uhs: mmc0 {
+ mmc0_pins_uhs: mmc0_uhs_pins {
pins_cmd_dat {
pinmux = <MT8173_PIN_57_MSDC0_DAT0__FUNC_MSDC0_DAT0>,
<MT8173_PIN_58_MSDC0_DAT1__FUNC_MSDC0_DAT1>,
@@ -769,7 +769,7 @@ pins_rst {
};
};
- mmc1_pins_uhs: mmc1 {
+ mmc1_pins_uhs: mmc1_uhs_pins {
pins_cmd_dat {
pinmux = <MT8173_PIN_73_MSDC1_DAT0__FUNC_MSDC1_DAT0>,
<MT8173_PIN_74_MSDC1_DAT1__FUNC_MSDC1_DAT1>,
@@ -788,7 +788,7 @@ pins_clk {
};
};
- mmc3_pins_uhs: mmc3 {
+ mmc3_pins_uhs: mmc3_uhs_pins {
pins_dat {
pinmux = <MT8173_PIN_22_MSDC3_DAT0__FUNC_MSDC3_DAT0>,
<MT8173_PIN_23_MSDC3_DAT1__FUNC_MSDC3_DAT1>,
@@ -813,7 +813,7 @@ pins_clk {
};
};
- nor_gpio1_pins: nor {
+ nor_gpio1_pins: nor_pins {
pins1 {
pinmux = <MT8173_PIN_6_EINT6__FUNC_SFCS0>,
<MT8173_PIN_7_EINT7__FUNC_SFHOLD>,
@@ -863,7 +863,7 @@ pins1 {
};
};
- rt5650_irq: rt5650_irq {
+ rt5650_irq: rt5650_irq_pins {
pins1 {
pinmux = <MT8173_PIN_3_EINT3__FUNC_GPIO3>;
bias-pull-down;
@@ -877,7 +877,7 @@ pins1 {
};
};
- spi_pins_a: spi1 {
+ spi_pins_a: spi1_pins {
pins1 {
pinmux = <MT8173_PIN_0_EINT0__FUNC_GPIO0>;
bias-pull-up;
@@ -892,7 +892,7 @@ pins_spi {
};
};
- trackpad_irq: trackpad_irq {
+ trackpad_irq: trackpad_irq_pins {
pins1 {
pinmux = <MT8173_PIN_117_URXD3__FUNC_GPIO117>;
input-enable;
@@ -900,7 +900,7 @@ pins1 {
};
};
- usb_pins: usb {
+ usb_pins: usb_pins {
pins1 {
pinmux = <MT8173_PIN_101_MSDC2_DAT1__FUNC_GPIO101>;
output-high;
diff --git a/arch/arm64/boot/dts/mediatek/mt8173-evb.dts b/arch/arm64/boot/dts/mediatek/mt8173-evb.dts
index 9fffed0ef4bff..f28110c331c71 100644
--- a/arch/arm64/boot/dts/mediatek/mt8173-evb.dts
+++ b/arch/arm64/boot/dts/mediatek/mt8173-evb.dts
@@ -179,7 +179,7 @@ pins1 {
};
};
- mmc0_pins_default: mmc0default {
+ mmc0_pins_default: mmc0_default_pins {
pins_cmd_dat {
pinmux = <MT8173_PIN_57_MSDC0_DAT0__FUNC_MSDC0_DAT0>,
<MT8173_PIN_58_MSDC0_DAT1__FUNC_MSDC0_DAT1>,
@@ -205,7 +205,7 @@ pins_rst {
};
};
- mmc1_pins_default: mmc1default {
+ mmc1_pins_default: mmc1_default_pins {
pins_cmd_dat {
pinmux = <MT8173_PIN_73_MSDC1_DAT0__FUNC_MSDC1_DAT0>,
<MT8173_PIN_74_MSDC1_DAT1__FUNC_MSDC1_DAT1>,
@@ -229,7 +229,7 @@ pins_insert {
};
};
- mmc0_pins_uhs: mmc0 {
+ mmc0_pins_uhs: mmc0_uhs_pins {
pins_cmd_dat {
pinmux = <MT8173_PIN_57_MSDC0_DAT0__FUNC_MSDC0_DAT0>,
<MT8173_PIN_58_MSDC0_DAT1__FUNC_MSDC0_DAT1>,
@@ -257,7 +257,7 @@ pins_rst {
};
};
- mmc1_pins_uhs: mmc1 {
+ mmc1_pins_uhs: mmc1_uhs_pins {
pins_cmd_dat {
pinmux = <MT8173_PIN_73_MSDC1_DAT0__FUNC_MSDC1_DAT0>,
<MT8173_PIN_74_MSDC1_DAT1__FUNC_MSDC1_DAT1>,
@@ -276,14 +276,14 @@ pins_clk {
};
};
- usb_id_pins_float: usb_iddig_pull_up {
+ usb_id_pins_float: usb_iddig_pull_up_pins {
pins_iddig {
pinmux = <MT8173_PIN_16_IDDIG__FUNC_IDDIG>;
bias-pull-up;
};
};
- usb_id_pins_ground: usb_iddig_pull_down {
+ usb_id_pins_ground: usb_iddig_pull_down_pins {
pins_iddig {
pinmux = <MT8173_PIN_16_IDDIG__FUNC_IDDIG>;
bias-pull-down;
@@ -474,7 +474,7 @@ mt6397_vibr_reg: ldo_vibr {
};
&pio {
- spi_pins_a: spi0 {
+ spi_pins_a: spi0_pins {
pins_spi {
pinmux = <MT8173_PIN_69_SPI_CK__FUNC_SPI_CK_0_>,
<MT8173_PIN_70_SPI_MI__FUNC_SPI_MI_0_>,
diff --git a/arch/arm64/boot/dts/mediatek/mt8173.dtsi b/arch/arm64/boot/dts/mediatek/mt8173.dtsi
index 122a57c3780b6..7e522bb8963a0 100644
--- a/arch/arm64/boot/dts/mediatek/mt8173.dtsi
+++ b/arch/arm64/boot/dts/mediatek/mt8173.dtsi
@@ -391,7 +391,7 @@ pio: pinctrl@1000b000 {
<GIC_SPI 146 IRQ_TYPE_LEVEL_HIGH>,
<GIC_SPI 147 IRQ_TYPE_LEVEL_HIGH>;
- hdmi_pin: xxx {
+ hdmi_pin: hdmi_pins {
/*hdmi htplg pin*/
pins1 {
@@ -401,7 +401,7 @@ pins1 {
};
};
- i2c0_pins_a: i2c0 {
+ i2c0_pins_a: i2c0_pins {
pins1 {
pinmux = <MT8173_PIN_45_SDA0__FUNC_SDA0>,
<MT8173_PIN_46_SCL0__FUNC_SCL0>;
@@ -409,7 +409,7 @@ pins1 {
};
};
- i2c1_pins_a: i2c1 {
+ i2c1_pins_a: i2c1_pins {
pins1 {
pinmux = <MT8173_PIN_125_SDA1__FUNC_SDA1>,
<MT8173_PIN_126_SCL1__FUNC_SCL1>;
@@ -417,7 +417,7 @@ pins1 {
};
};
- i2c2_pins_a: i2c2 {
+ i2c2_pins_a: i2c2_pins {
pins1 {
pinmux = <MT8173_PIN_43_SDA2__FUNC_SDA2>,
<MT8173_PIN_44_SCL2__FUNC_SCL2>;
@@ -425,7 +425,7 @@ pins1 {
};
};
- i2c3_pins_a: i2c3 {
+ i2c3_pins_a: i2c3_pins {
pins1 {
pinmux = <MT8173_PIN_106_SDA3__FUNC_SDA3>,
<MT8173_PIN_107_SCL3__FUNC_SCL3>;
@@ -433,7 +433,7 @@ pins1 {
};
};
- i2c4_pins_a: i2c4 {
+ i2c4_pins_a: i2c4_pins {
pins1 {
pinmux = <MT8173_PIN_133_SDA4__FUNC_SDA4>,
<MT8173_PIN_134_SCL4__FUNC_SCL4>;
@@ -441,7 +441,7 @@ pins1 {
};
};
- i2c6_pins_a: i2c6 {
+ i2c6_pins_a: i2c6_pins {
pins1 {
pinmux = <MT8173_PIN_100_MSDC2_DAT0__FUNC_SDA5>,
<MT8173_PIN_101_MSDC2_DAT1__FUNC_SCL5>;
--
2.50.1
^ permalink raw reply related
* [PATCH v2 06/12] dt-bindings: display: mediatek,ufoe: Add mediatek,gce-client-reg property
From: Ariel D'Alessandro @ 2025-09-11 15:09 UTC (permalink / raw)
To: airlied, amergnat, andrew+netdev, andrew-ct.chen,
angelogioacchino.delregno, ariel.dalessandro, broonie,
chunkuang.hu, conor+dt, davem, dmitry.torokhov, edumazet,
flora.fu, heiko, houlong.wei, jeesw, kernel, krzk+dt, kuba,
lgirdwood, linus.walleij, louisalexis.eyraud, luiz.dentz,
maarten.lankhorst, marcel, matthias.bgg, mchehab, minghsiu.tsai,
mripard, p.zabel, pabeni, robh, sean.wang, simona,
support.opensource, tiffany.lin, tzimmermann, yunfei.dong
Cc: devicetree, dri-devel, linux-arm-kernel, linux-bluetooth,
linux-gpio, linux-input, linux-kernel, linux-media,
linux-mediatek, linux-rockchip, linux-sound, netdev
In-Reply-To: <20250911151001.108744-1-ariel.dalessandro@collabora.com>
Currently, users of Mediatek UFOe (Unified Frame Optimization engine) DT
bindings set mediatek,gce-client-reg node property, which is missing from
the DT schema.
For example, device tree arch/arm64/boot/dts/mediatek/mt8173.dtsi is
causing the following dtb check error:
```
$ make CHECK_DTBS=y mediatek/mt8173-elm.dtb
SCHEMA Documentation/devicetree/bindings/processed-schema.json
DTC [C] arch/arm64/boot/dts/mediatek/mt8173-elm.dtb
[...]
arch/arm64/boot/dts/mediatek/mt8173-elm.dtb: ufoe@1401a000
(mediatek,mt8173-disp-ufoe): 'mediatek,gce-client-reg' does not match
any of the regexes: '^pinctrl-[0-9]+$'
```
This commit adds the missing node property in the DT schema and updates the
example as well.
Signed-off-by: Ariel D'Alessandro <ariel.dalessandro@collabora.com>
---
.../bindings/display/mediatek/mediatek,ufoe.yaml | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/Documentation/devicetree/bindings/display/mediatek/mediatek,ufoe.yaml b/Documentation/devicetree/bindings/display/mediatek/mediatek,ufoe.yaml
index 61a5e22effbf2..036a66ed42e73 100644
--- a/Documentation/devicetree/bindings/display/mediatek/mediatek,ufoe.yaml
+++ b/Documentation/devicetree/bindings/display/mediatek/mediatek,ufoe.yaml
@@ -64,6 +64,18 @@ properties:
- port@0
- port@1
+ mediatek,gce-client-reg:
+ $ref: /schemas/types.yaml#/definitions/phandle-array
+ description: describes how to locate the GCE client register
+ items:
+ - items:
+ - description: Phandle reference to a Mediatek GCE Mailbox
+ - description:
+ GCE subsys id mapping to a client defined in header
+ include/dt-bindings/gce/<chip>-gce.h.
+ - description: offset for the GCE register offset
+ - description: size of the GCE register offset
+
required:
- compatible
- reg
@@ -77,7 +89,9 @@ examples:
- |
#include <dt-bindings/interrupt-controller/arm-gic.h>
#include <dt-bindings/clock/mt8173-clk.h>
+ #include <dt-bindings/gce/mt8173-gce.h>
#include <dt-bindings/power/mt8173-power.h>
+
soc {
#address-cells = <2>;
#size-cells = <2>;
@@ -88,5 +102,6 @@ examples:
interrupts = <GIC_SPI 191 IRQ_TYPE_LEVEL_LOW>;
power-domains = <&scpsys MT8173_POWER_DOMAIN_MM>;
clocks = <&mmsys CLK_MM_DISP_UFOE>;
+ mediatek,gce-client-reg = <&gce SUBSYS_1401XXXX 0xa000 0x1000>;
};
};
--
2.50.1
^ permalink raw reply related
* [PATCH v2 05/12] dt-bindings: display: mediatek,od: Add mediatek,gce-client-reg property
From: Ariel D'Alessandro @ 2025-09-11 15:09 UTC (permalink / raw)
To: airlied, amergnat, andrew+netdev, andrew-ct.chen,
angelogioacchino.delregno, ariel.dalessandro, broonie,
chunkuang.hu, conor+dt, davem, dmitry.torokhov, edumazet,
flora.fu, heiko, houlong.wei, jeesw, kernel, krzk+dt, kuba,
lgirdwood, linus.walleij, louisalexis.eyraud, luiz.dentz,
maarten.lankhorst, marcel, matthias.bgg, mchehab, minghsiu.tsai,
mripard, p.zabel, pabeni, robh, sean.wang, simona,
support.opensource, tiffany.lin, tzimmermann, yunfei.dong
Cc: devicetree, dri-devel, linux-arm-kernel, linux-bluetooth,
linux-gpio, linux-input, linux-kernel, linux-media,
linux-mediatek, linux-rockchip, linux-sound, netdev
In-Reply-To: <20250911151001.108744-1-ariel.dalessandro@collabora.com>
Currently, users of Mediatek OD (display overdrive) DT bindings set
mediatek,gce-client-reg node property, which is missing from the DT schema.
For example, device tree arch/arm64/boot/dts/mediatek/mt8173.dtsi is
causing the following dtb check error:
```
$ make CHECK_DTBS=y mediatek/mt8173-elm.dtb
SCHEMA Documentation/devicetree/bindings/processed-schema.json
DTC [C] arch/arm64/boot/dts/mediatek/mt8173-elm.dtb
[...]
arch/arm64/boot/dts/mediatek/mt8173-elm.dtb: od@14023000
(mediatek,mt8173-disp-od): 'mediatek,gce-client-reg' does not match
any of the regexes: '^pinctrl-[0-9]+$'
```
This commit adds the missing node property in the DT schema and updates the
example as well.
Signed-off-by: Ariel D'Alessandro <ariel.dalessandro@collabora.com>
---
.../bindings/display/mediatek/mediatek,od.yaml | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/Documentation/devicetree/bindings/display/mediatek/mediatek,od.yaml b/Documentation/devicetree/bindings/display/mediatek/mediatek,od.yaml
index 71534febd49c6..930c088a722a8 100644
--- a/Documentation/devicetree/bindings/display/mediatek/mediatek,od.yaml
+++ b/Documentation/devicetree/bindings/display/mediatek/mediatek,od.yaml
@@ -60,6 +60,18 @@ properties:
- port@0
- port@1
+ mediatek,gce-client-reg:
+ $ref: /schemas/types.yaml#/definitions/phandle-array
+ description: describes how to locate the GCE client register
+ items:
+ - items:
+ - description: Phandle reference to a Mediatek GCE Mailbox
+ - description:
+ GCE subsys id mapping to a client defined in header
+ include/dt-bindings/gce/<chip>-gce.h.
+ - description: offset for the GCE register offset
+ - description: size of the GCE register offset
+
required:
- compatible
- reg
@@ -70,6 +82,7 @@ additionalProperties: false
examples:
- |
#include <dt-bindings/clock/mt8173-clk.h>
+ #include <dt-bindings/gce/mt8173-gce.h>
soc {
#address-cells = <2>;
@@ -79,5 +92,6 @@ examples:
compatible = "mediatek,mt8173-disp-od";
reg = <0 0x14023000 0 0x1000>;
clocks = <&mmsys CLK_MM_DISP_OD>;
+ mediatek,gce-client-reg = <&gce SUBSYS_1402XXXX 0x3000 0x1000>;
};
};
--
2.50.1
^ permalink raw reply related
* [GIT PULL v2] Immutable branch between MFD and Input due for the v6.18 merge window
From: Lee Jones @ 2025-09-11 15:14 UTC (permalink / raw)
To: Michael Walle
Cc: Dmitry Torokhov, jcormier, Job Sava, linux-kernel, linux-input,
Nathan Chancellor
In-Reply-To: <20250903113255.GK2163762@google.com>
Here is an updated PR containing a recent fix:
a377b1be3a0e ("mfd: tps6594: Explicitly include bitfield.h")
LINK: https://lore.kernel.org/all/DCKNRRN0Q2I7.WFT5U4QKA9XS@kernel.org/
-----
The following changes since commit 8f5ae30d69d7543eee0d70083daf4de8fe15d585:
Linux 6.17-rc1 (2025-08-10 19:41:16 +0300)
are available in the Git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd.git tags/ib-mfd-input-v6.18-1
for you to fetch changes up to a377b1be3a0ed51ccabfe22908ebde065848313c:
mfd: tps6594: Explicitly include bitfield.h (2025-09-11 16:06:02 +0100)
----------------------------------------------------------------
[UPDATED] Immutable branch between MFD and Input due for the v6.18 merge window
----------------------------------------------------------------
Job Sava (1):
input: tps6594-pwrbutton: Add power button functionality
Michael Walle (2):
mfd: tps6594: Add power button functionality
mfd: tps6594: Add board power-off support
Nathan Chancellor (1):
mfd: tps6594: Explicitly include bitfield.h
drivers/input/misc/Kconfig | 10 +++
drivers/input/misc/Makefile | 1 +
drivers/input/misc/tps6594-pwrbutton.c | 126 +++++++++++++++++++++++++++++++++
drivers/mfd/tps6594-core.c | 59 ++++++++++++++-
4 files changed, 194 insertions(+), 2 deletions(-)
create mode 100644 drivers/input/misc/tps6594-pwrbutton.c
--
Lee Jones [李琼斯]
^ permalink raw reply
* [PATCH v2 04/12] dt-bindings: ASoC: Convert MediaTek RT5650 codecs bindings to DT schema
From: Ariel D'Alessandro @ 2025-09-11 15:09 UTC (permalink / raw)
To: airlied, amergnat, andrew+netdev, andrew-ct.chen,
angelogioacchino.delregno, ariel.dalessandro, broonie,
chunkuang.hu, conor+dt, davem, dmitry.torokhov, edumazet,
flora.fu, heiko, houlong.wei, jeesw, kernel, krzk+dt, kuba,
lgirdwood, linus.walleij, louisalexis.eyraud, luiz.dentz,
maarten.lankhorst, marcel, matthias.bgg, mchehab, minghsiu.tsai,
mripard, p.zabel, pabeni, robh, sean.wang, simona,
support.opensource, tiffany.lin, tzimmermann, yunfei.dong
Cc: devicetree, dri-devel, linux-arm-kernel, linux-bluetooth,
linux-gpio, linux-input, linux-kernel, linux-media,
linux-mediatek, linux-rockchip, linux-sound, netdev
In-Reply-To: <20250911151001.108744-1-ariel.dalessandro@collabora.com>
Convert the existing text-based DT bindings for Mediatek MT8173 RT5650
codecs to a DT schema.
Signed-off-by: Ariel D'Alessandro <ariel.dalessandro@collabora.com>
---
.../sound/mediatek,mt8173-rt5650.yaml | 73 +++++++++++++++++++
.../bindings/sound/mt8173-rt5650.txt | 31 --------
2 files changed, 73 insertions(+), 31 deletions(-)
create mode 100644 Documentation/devicetree/bindings/sound/mediatek,mt8173-rt5650.yaml
delete mode 100644 Documentation/devicetree/bindings/sound/mt8173-rt5650.txt
diff --git a/Documentation/devicetree/bindings/sound/mediatek,mt8173-rt5650.yaml b/Documentation/devicetree/bindings/sound/mediatek,mt8173-rt5650.yaml
new file mode 100644
index 0000000000000..a3166cc40a206
--- /dev/null
+++ b/Documentation/devicetree/bindings/sound/mediatek,mt8173-rt5650.yaml
@@ -0,0 +1,73 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/sound/mediatek,mt8173-rt5650.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Mediatek MT8173 with RT5650 codecs and HDMI via I2S
+
+maintainers:
+ - Ariel D'Alessandro <ariel.dalessandro@collabora.com>
+
+properties:
+ compatible:
+ const: mediatek,mt8173-rt5650
+
+ reg:
+ maxItems: 1
+
+ interrupts:
+ maxItems: 1
+
+ mediatek,audio-codec:
+ $ref: /schemas/types.yaml#/definitions/phandle-array
+ description:
+ The phandles of rt5650 codecs and of the HDMI encoder node.
+ minItems: 2
+
+ mediatek,platform:
+ $ref: /schemas/types.yaml#/definitions/phandle
+ description:
+ The phandle of MT8173 ASoC platform.
+
+ mediatek,mclk:
+ $ref: /schemas/types.yaml#/definitions/uint32
+ description: |
+ The MCLK source.
+ 0: external oscillator, MCLK = 12.288M
+ 1: internal source from mt8173, MCLK = sampling rate * 256
+
+ codec-capture:
+ description: Subnode of rt5650 codec capture.
+ type: object
+
+ properties:
+ sound-dai:
+ maxItems: 1
+ description: phandle of the CPU DAI
+
+ additionalProperties: false
+
+required:
+ - compatible
+ - mediatek,audio-codec
+ - mediatek,platform
+
+additionalProperties: false
+
+examples:
+ - |
+ sound {
+ compatible = "mediatek,mt8173-rt5650";
+ mediatek,audio-codec = <&rt5650 &hdmi0>;
+ mediatek,platform = <&afe>;
+ pinctrl-names = "default";
+ pinctrl-0 = <&aud_i2s2>;
+
+ mediatek,mclk = <1>;
+ codec-capture {
+ sound-dai = <&rt5650 1>;
+ };
+ };
+
+...
diff --git a/Documentation/devicetree/bindings/sound/mt8173-rt5650.txt b/Documentation/devicetree/bindings/sound/mt8173-rt5650.txt
deleted file mode 100644
index 29dce2ac8773a..0000000000000
--- a/Documentation/devicetree/bindings/sound/mt8173-rt5650.txt
+++ /dev/null
@@ -1,31 +0,0 @@
-MT8173 with RT5650 CODECS and HDMI via I2S
-
-Required properties:
-- compatible : "mediatek,mt8173-rt5650"
-- mediatek,audio-codec: the phandles of rt5650 codecs
- and of the hdmi encoder node
-- mediatek,platform: the phandle of MT8173 ASoC platform
-
-Optional subnodes:
-- codec-capture : the subnode of rt5650 codec capture
-Required codec-capture subnode properties:
-- sound-dai: audio codec dai name on capture path
- <&rt5650 0> : Default setting. Connect rt5650 I2S1 for capture. (dai_name = rt5645-aif1)
- <&rt5650 1> : Connect rt5650 I2S2 for capture. (dai_name = rt5645-aif2)
-
-- mediatek,mclk: the MCLK source
- 0 : external oscillator, MCLK = 12.288M
- 1 : internal source from mt8173, MCLK = sampling rate*256
-
-Example:
-
- sound {
- compatible = "mediatek,mt8173-rt5650";
- mediatek,audio-codec = <&rt5650 &hdmi0>;
- mediatek,platform = <&afe>;
- mediatek,mclk = <0>;
- codec-capture {
- sound-dai = <&rt5650 1>;
- };
- };
-
--
2.50.1
^ permalink raw reply related
* [PATCH v2 03/12] dt-bindings: net: Convert Marvell 8897/8997 bindings to DT schema
From: Ariel D'Alessandro @ 2025-09-11 15:09 UTC (permalink / raw)
To: airlied, amergnat, andrew+netdev, andrew-ct.chen,
angelogioacchino.delregno, ariel.dalessandro, broonie,
chunkuang.hu, conor+dt, davem, dmitry.torokhov, edumazet,
flora.fu, heiko, houlong.wei, jeesw, kernel, krzk+dt, kuba,
lgirdwood, linus.walleij, louisalexis.eyraud, luiz.dentz,
maarten.lankhorst, marcel, matthias.bgg, mchehab, minghsiu.tsai,
mripard, p.zabel, pabeni, robh, sean.wang, simona,
support.opensource, tiffany.lin, tzimmermann, yunfei.dong
Cc: devicetree, dri-devel, linux-arm-kernel, linux-bluetooth,
linux-gpio, linux-input, linux-kernel, linux-media,
linux-mediatek, linux-rockchip, linux-sound, netdev
In-Reply-To: <20250911151001.108744-1-ariel.dalessandro@collabora.com>
Convert the existing text-based DT bindings for Marvell 8897/8997
(sd8897/sd8997) bluetooth devices controller to a DT schema.
While here:
* bindings for "usb1286,204e" (USB interface) are dropped from the DT
schema definition as these are currently documented in file [0].
* DT binding users are updated to use bluetooth generic name
recommendation.
[0] Documentation/devicetree/bindings/net/btusb.txt
Signed-off-by: Ariel D'Alessandro <ariel.dalessandro@collabora.com>
---
.../net/bluetooth/marvell,sd8897-bt.yaml | 79 ++++++++++++++++++
.../devicetree/bindings/net/btusb.txt | 2 +-
.../bindings/net/marvell-bt-8xxx.txt | 83 -------------------
.../dts/rockchip/rk3288-veyron-fievel.dts | 2 +-
.../boot/dts/rockchip/rk3288-veyron-jaq.dts | 2 +-
arch/arm64/boot/dts/mediatek/mt8173-elm.dtsi | 2 +-
6 files changed, 83 insertions(+), 87 deletions(-)
create mode 100644 Documentation/devicetree/bindings/net/bluetooth/marvell,sd8897-bt.yaml
delete mode 100644 Documentation/devicetree/bindings/net/marvell-bt-8xxx.txt
diff --git a/Documentation/devicetree/bindings/net/bluetooth/marvell,sd8897-bt.yaml b/Documentation/devicetree/bindings/net/bluetooth/marvell,sd8897-bt.yaml
new file mode 100644
index 0000000000000..a307c64cfa4d6
--- /dev/null
+++ b/Documentation/devicetree/bindings/net/bluetooth/marvell,sd8897-bt.yaml
@@ -0,0 +1,79 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/net/bluetooth/marvell,sd8897-bt.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Marvell 8897/8997 (sd8897/sd8997) bluetooth devices (SDIO)
+
+maintainers:
+ - Ariel D'Alessandro <ariel.dalessandro@collabora.com>
+
+allOf:
+ - $ref: /schemas/net/bluetooth/bluetooth-controller.yaml#
+
+properties:
+ compatible:
+ enum:
+ - marvell,sd8897-bt
+ - marvell,sd8997-bt
+
+ reg:
+ maxItems: 1
+
+ interrupts:
+ maxItems: 1
+
+ marvell,cal-data:
+ $ref: /schemas/types.yaml#/definitions/uint8-array
+ description:
+ Calibration data downloaded to the device during initialization.
+ maxItems: 28
+
+ marvell,wakeup-pin:
+ $ref: /schemas/types.yaml#/definitions/uint16
+ description:
+ Wakeup pin number of the bluetooth chip. Used by firmware to wakeup host
+ system.
+
+ marvell,wakeup-gap-ms:
+ $ref: /schemas/types.yaml#/definitions/uint16
+ description:
+ Wakeup latency of the host platform. Required by the chip sleep feature.
+
+required:
+ - compatible
+ - reg
+ - interrupts
+
+additionalProperties: false
+
+examples:
+ - |
+ #include <dt-bindings/interrupt-controller/irq.h>
+
+ mmc {
+ vmmc-supply = <&wlan_en_reg>;
+ bus-width = <4>;
+ cap-power-off-card;
+ keep-power-in-suspend;
+
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ bluetooth@2 {
+ compatible = "marvell,sd8897-bt";
+ reg = <2>;
+ interrupt-parent = <&pio>;
+ interrupts = <119 IRQ_TYPE_LEVEL_LOW>;
+
+ marvell,cal-data = /bits/ 8 <
+ 0x37 0x01 0x1c 0x00 0xff 0xff 0xff 0xff 0x01 0x7f 0x04 0x02
+ 0x00 0x00 0xba 0xce 0xc0 0xc6 0x2d 0x00 0x00 0x00 0x00 0x00
+ 0x00 0x00 0xf0 0x00>;
+ marvell,wakeup-pin = /bits/ 16 <0x0d>;
+ marvell,wakeup-gap-ms = /bits/ 16 <0x64>;
+ };
+ };
+
+...
diff --git a/Documentation/devicetree/bindings/net/btusb.txt b/Documentation/devicetree/bindings/net/btusb.txt
index f546b1f7dd6d2..a68022a57c51e 100644
--- a/Documentation/devicetree/bindings/net/btusb.txt
+++ b/Documentation/devicetree/bindings/net/btusb.txt
@@ -14,7 +14,7 @@ Required properties:
Also, vendors that use btusb may have device additional properties, e.g:
-Documentation/devicetree/bindings/net/marvell-bt-8xxx.txt
+Documentation/devicetree/bindings/net/bluetooth/marvell,sd8897-bt.yaml
Optional properties:
diff --git a/Documentation/devicetree/bindings/net/marvell-bt-8xxx.txt b/Documentation/devicetree/bindings/net/marvell-bt-8xxx.txt
deleted file mode 100644
index 957e5e5c2927c..0000000000000
--- a/Documentation/devicetree/bindings/net/marvell-bt-8xxx.txt
+++ /dev/null
@@ -1,83 +0,0 @@
-Marvell 8897/8997 (sd8897/sd8997) bluetooth devices (SDIO or USB based)
-------
-The 8997 devices supports multiple interfaces. When used on SDIO interfaces,
-the btmrvl driver is used and when used on USB interface, the btusb driver is
-used.
-
-Required properties:
-
- - compatible : should be one of the following:
- * "marvell,sd8897-bt" (for SDIO)
- * "marvell,sd8997-bt" (for SDIO)
- * "usb1286,204e" (for USB)
-
-Optional properties:
-
- - marvell,cal-data: Calibration data downloaded to the device during
- initialization. This is an array of 28 values(u8).
- This is only applicable to SDIO devices.
-
- - marvell,wakeup-pin: It represents wakeup pin number of the bluetooth chip.
- firmware will use the pin to wakeup host system (u16).
- - marvell,wakeup-gap-ms: wakeup gap represents wakeup latency of the host
- platform. The value will be configured to firmware. This
- is needed to work chip's sleep feature as expected (u16).
- - interrupt-names: Used only for USB based devices (See below)
- - interrupts : specifies the interrupt pin number to the cpu. For SDIO, the
- driver will use the first interrupt specified in the interrupt
- array. For USB based devices, the driver will use the interrupt
- named "wakeup" from the interrupt-names and interrupt arrays.
- The driver will request an irq based on this interrupt number.
- During system suspend, the irq will be enabled so that the
- bluetooth chip can wakeup host platform under certain
- conditions. During system resume, the irq will be disabled
- to make sure unnecessary interrupt is not received.
-
-Example:
-
-IRQ pin 119 is used as system wakeup source interrupt.
-wakeup pin 13 and gap 100ms are configured so that firmware can wakeup host
-using this device side pin and wakeup latency.
-
-Example for SDIO device follows (calibration data is also available in
-below example).
-
-&mmc3 {
- vmmc-supply = <&wlan_en_reg>;
- bus-width = <4>;
- cap-power-off-card;
- keep-power-in-suspend;
-
- #address-cells = <1>;
- #size-cells = <0>;
- btmrvl: bluetooth@2 {
- compatible = "marvell,sd8897-bt";
- reg = <2>;
- interrupt-parent = <&pio>;
- interrupts = <119 IRQ_TYPE_LEVEL_LOW>;
-
- marvell,cal-data = /bits/ 8 <
- 0x37 0x01 0x1c 0x00 0xff 0xff 0xff 0xff 0x01 0x7f 0x04 0x02
- 0x00 0x00 0xba 0xce 0xc0 0xc6 0x2d 0x00 0x00 0x00 0x00 0x00
- 0x00 0x00 0xf0 0x00>;
- marvell,wakeup-pin = /bits/ 16 <0x0d>;
- marvell,wakeup-gap-ms = /bits/ 16 <0x64>;
- };
-};
-
-Example for USB device:
-
-&usb_host1_ohci {
- #address-cells = <1>;
- #size-cells = <0>;
-
- mvl_bt1: bt@1 {
- compatible = "usb1286,204e";
- reg = <1>;
- interrupt-parent = <&gpio0>;
- interrupt-names = "wakeup";
- interrupts = <119 IRQ_TYPE_LEVEL_LOW>;
- marvell,wakeup-pin = /bits/ 16 <0x0d>;
- marvell,wakeup-gap-ms = /bits/ 16 <0x64>;
- };
-};
diff --git a/arch/arm/boot/dts/rockchip/rk3288-veyron-fievel.dts b/arch/arm/boot/dts/rockchip/rk3288-veyron-fievel.dts
index 6a0844e162793..26817848c1541 100644
--- a/arch/arm/boot/dts/rockchip/rk3288-veyron-fievel.dts
+++ b/arch/arm/boot/dts/rockchip/rk3288-veyron-fievel.dts
@@ -177,7 +177,7 @@ &sdio0 {
#address-cells = <1>;
#size-cells = <0>;
- btmrvl: btmrvl@2 {
+ btmrvl: bluetooth@2 {
compatible = "marvell,sd8897-bt";
reg = <2>;
interrupt-parent = <&gpio4>;
diff --git a/arch/arm/boot/dts/rockchip/rk3288-veyron-jaq.dts b/arch/arm/boot/dts/rockchip/rk3288-veyron-jaq.dts
index 0d4c50e055587..cba2898f8b7df 100644
--- a/arch/arm/boot/dts/rockchip/rk3288-veyron-jaq.dts
+++ b/arch/arm/boot/dts/rockchip/rk3288-veyron-jaq.dts
@@ -48,7 +48,7 @@ &sdio0 {
#address-cells = <1>;
#size-cells = <0>;
- btmrvl: btmrvl@2 {
+ btmrvl: bluetooth@2 {
compatible = "marvell,sd8897-bt";
reg = <2>;
interrupt-parent = <&gpio4>;
diff --git a/arch/arm64/boot/dts/mediatek/mt8173-elm.dtsi b/arch/arm64/boot/dts/mediatek/mt8173-elm.dtsi
index 0d995b342d463..8d1f40077a5e5 100644
--- a/arch/arm64/boot/dts/mediatek/mt8173-elm.dtsi
+++ b/arch/arm64/boot/dts/mediatek/mt8173-elm.dtsi
@@ -432,7 +432,7 @@ &mmc3 {
#address-cells = <1>;
#size-cells = <0>;
- btmrvl: btmrvl@2 {
+ btmrvl: bluetooth@2 {
compatible = "marvell,sd8897-bt";
reg = <2>;
interrupts-extended = <&pio 119 IRQ_TYPE_LEVEL_LOW>;
--
2.50.1
^ permalink raw reply related
* [PATCH v2 02/12] dt-bindings: media: Convert MediaTek mt8173-vpu bindings to DT schema
From: Ariel D'Alessandro @ 2025-09-11 15:09 UTC (permalink / raw)
To: airlied, amergnat, andrew+netdev, andrew-ct.chen,
angelogioacchino.delregno, ariel.dalessandro, broonie,
chunkuang.hu, conor+dt, davem, dmitry.torokhov, edumazet,
flora.fu, heiko, houlong.wei, jeesw, kernel, krzk+dt, kuba,
lgirdwood, linus.walleij, louisalexis.eyraud, luiz.dentz,
maarten.lankhorst, marcel, matthias.bgg, mchehab, minghsiu.tsai,
mripard, p.zabel, pabeni, robh, sean.wang, simona,
support.opensource, tiffany.lin, tzimmermann, yunfei.dong
Cc: devicetree, dri-devel, linux-arm-kernel, linux-bluetooth,
linux-gpio, linux-input, linux-kernel, linux-media,
linux-mediatek, linux-rockchip, linux-sound, netdev
In-Reply-To: <20250911151001.108744-1-ariel.dalessandro@collabora.com>
Convert the existing text-based DT bindings for Mediatek MT8173 Video
Processor Unit to a DT schema.
Signed-off-by: Ariel D'Alessandro <ariel.dalessandro@collabora.com>
---
.../bindings/media/mediatek,mt8173-vpu.yaml | 74 +++++++++++++++++++
.../bindings/media/mediatek-vpu.txt | 31 --------
2 files changed, 74 insertions(+), 31 deletions(-)
create mode 100644 Documentation/devicetree/bindings/media/mediatek,mt8173-vpu.yaml
delete mode 100644 Documentation/devicetree/bindings/media/mediatek-vpu.txt
diff --git a/Documentation/devicetree/bindings/media/mediatek,mt8173-vpu.yaml b/Documentation/devicetree/bindings/media/mediatek,mt8173-vpu.yaml
new file mode 100644
index 0000000000000..8a47761f1e6b5
--- /dev/null
+++ b/Documentation/devicetree/bindings/media/mediatek,mt8173-vpu.yaml
@@ -0,0 +1,74 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/media/mediatek,mt8173-vpu.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Mediatek MT8173 Video Processor Unit
+
+maintainers:
+ - Ariel D'Alessandro <ariel.dalessandro@collabora.com>
+
+description:
+ Video Processor Unit is a HW video controller. It controls HW Codec including
+ H.264/VP8/VP9 Decode, H.264/VP8 Encode and Image Processor (scale/rotate/color
+ convert).
+
+properties:
+ compatible:
+ const: mediatek,mt8173-vpu
+
+ reg:
+ maxItems: 2
+
+ reg-names:
+ items:
+ - const: tcm
+ - const: cfg_reg
+
+ interrupts:
+ maxItems: 1
+
+ clocks:
+ maxItems: 1
+
+ clock-names:
+ items:
+ - const: main
+
+ memory-region:
+ maxItems: 1
+
+required:
+ - compatible
+ - reg
+ - reg-names
+ - interrupts
+ - clocks
+ - clock-names
+ - memory-region
+
+additionalProperties: false
+
+examples:
+ - |
+ #include <dt-bindings/clock/mt8173-clk.h>
+ #include <dt-bindings/interrupt-controller/arm-gic.h>
+
+ soc {
+ #address-cells = <2>;
+ #size-cells = <2>;
+
+ vpu: vpu@10020000 {
+ compatible = "mediatek,mt8173-vpu";
+ reg = <0 0x10020000 0 0x30000>,
+ <0 0x10050000 0 0x100>;
+ reg-names = "tcm", "cfg_reg";
+ interrupts = <GIC_SPI 166 IRQ_TYPE_LEVEL_HIGH>;
+ clocks = <&topckgen CLK_TOP_SCP_SEL>;
+ clock-names = "main";
+ memory-region = <&vpu_dma_reserved>;
+ };
+ };
+
+...
diff --git a/Documentation/devicetree/bindings/media/mediatek-vpu.txt b/Documentation/devicetree/bindings/media/mediatek-vpu.txt
deleted file mode 100644
index 2a5bac37f9a22..0000000000000
--- a/Documentation/devicetree/bindings/media/mediatek-vpu.txt
+++ /dev/null
@@ -1,31 +0,0 @@
-* Mediatek Video Processor Unit
-
-Video Processor Unit is a HW video controller. It controls HW Codec including
-H.264/VP8/VP9 Decode, H.264/VP8 Encode and Image Processor (scale/rotate/color convert).
-
-Required properties:
- - compatible: "mediatek,mt8173-vpu"
- - reg: Must contain an entry for each entry in reg-names.
- - reg-names: Must include the following entries:
- "tcm": tcm base
- "cfg_reg": Main configuration registers base
- - interrupts: interrupt number to the cpu.
- - clocks : clock name from clock manager
- - clock-names: must be main. It is the main clock of VPU
-
-Optional properties:
- - memory-region: phandle to a node describing memory (see
- Documentation/devicetree/bindings/reserved-memory/reserved-memory.txt)
- to be used for VPU extended memory; if not present, VPU may be located
- anywhere in the memory
-
-Example:
- vpu: vpu@10020000 {
- compatible = "mediatek,mt8173-vpu";
- reg = <0 0x10020000 0 0x30000>,
- <0 0x10050000 0 0x100>;
- reg-names = "tcm", "cfg_reg";
- interrupts = <GIC_SPI 166 IRQ_TYPE_LEVEL_HIGH>;
- clocks = <&topckgen TOP_SCP_SEL>;
- clock-names = "main";
- };
--
2.50.1
^ permalink raw reply related
* [PATCH v2 01/12] dt-bindings: media: Convert MediaTek mt8173-mdp bindings to DT schema
From: Ariel D'Alessandro @ 2025-09-11 15:09 UTC (permalink / raw)
To: airlied, amergnat, andrew+netdev, andrew-ct.chen,
angelogioacchino.delregno, ariel.dalessandro, broonie,
chunkuang.hu, conor+dt, davem, dmitry.torokhov, edumazet,
flora.fu, heiko, houlong.wei, jeesw, kernel, krzk+dt, kuba,
lgirdwood, linus.walleij, louisalexis.eyraud, luiz.dentz,
maarten.lankhorst, marcel, matthias.bgg, mchehab, minghsiu.tsai,
mripard, p.zabel, pabeni, robh, sean.wang, simona,
support.opensource, tiffany.lin, tzimmermann, yunfei.dong
Cc: devicetree, dri-devel, linux-arm-kernel, linux-bluetooth,
linux-gpio, linux-input, linux-kernel, linux-media,
linux-mediatek, linux-rockchip, linux-sound, netdev
In-Reply-To: <20250911151001.108744-1-ariel.dalessandro@collabora.com>
Convert the existing text-based DT bindings for MediaTek MT8173 Media Data
Path to a DT schema.
Signed-off-by: Ariel D'Alessandro <ariel.dalessandro@collabora.com>
---
.../bindings/media/mediatek,mt8173-mdp.yaml | 169 ++++++++++++++++++
.../bindings/media/mediatek-mdp.txt | 95 ----------
2 files changed, 169 insertions(+), 95 deletions(-)
create mode 100644 Documentation/devicetree/bindings/media/mediatek,mt8173-mdp.yaml
delete mode 100644 Documentation/devicetree/bindings/media/mediatek-mdp.txt
diff --git a/Documentation/devicetree/bindings/media/mediatek,mt8173-mdp.yaml b/Documentation/devicetree/bindings/media/mediatek,mt8173-mdp.yaml
new file mode 100644
index 0000000000000..8ca33a733c478
--- /dev/null
+++ b/Documentation/devicetree/bindings/media/mediatek,mt8173-mdp.yaml
@@ -0,0 +1,169 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/media/mediatek,mt8173-mdp.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: MediaTek MT8173 Media Data Path
+
+maintainers:
+ - Ariel D'Alessandro <ariel.dalessandro@collabora.com>
+
+description:
+ Media Data Path is used for scaling and color space conversion.
+
+properties:
+ compatible:
+ oneOf:
+ - enum:
+ - mediatek,mt8173-mdp-rdma
+ - mediatek,mt8173-mdp-rsz
+ - mediatek,mt8173-mdp-wdma
+ - mediatek,mt8173-mdp-wrot
+ - items:
+ - const: mediatek,mt8173-mdp-rdma
+ - const: mediatek,mt8173-mdp
+
+ reg:
+ maxItems: 1
+
+ clocks:
+ minItems: 1
+ maxItems: 2
+
+ power-domains:
+ maxItems: 1
+
+ iommus:
+ maxItems: 1
+
+ mediatek,vpu:
+ $ref: /schemas/types.yaml#/definitions/phandle
+ description:
+ phandle to Mediatek Video Processor Unit for HW Codec encode/decode and
+ image processing.
+
+required:
+ - compatible
+ - reg
+ - clocks
+ - power-domains
+
+allOf:
+ - if:
+ properties:
+ compatible:
+ contains:
+ const: mediatek,mt8173-mdp-rdma
+ then:
+ properties:
+ clocks:
+ items:
+ - description: Main clock
+ - description: Mutex clock
+ else:
+ properties:
+ clocks:
+ items:
+ - description: Main clock
+
+ - if:
+ properties:
+ compatible:
+ contains:
+ enum:
+ - mediatek,mt8173-mdp-rdma
+ - mediatek,mt8173-mdp-wdma
+ - mediatek,mt8173-mdp-wrot
+ then:
+ required:
+ - iommus
+
+ - if:
+ properties:
+ compatible:
+ contains:
+ const: mediatek,mt8173-mdp
+ then:
+ required:
+ - mediatek,vpu
+
+additionalProperties: false
+
+examples:
+ - |
+ #include <dt-bindings/clock/mt8173-clk.h>
+ #include <dt-bindings/memory/mt8173-larb-port.h>
+ #include <dt-bindings/power/mt8173-power.h>
+
+ soc {
+ #address-cells = <2>;
+ #size-cells = <2>;
+
+ mdp_rdma0: rdma@14001000 {
+ compatible = "mediatek,mt8173-mdp-rdma",
+ "mediatek,mt8173-mdp";
+ reg = <0 0x14001000 0 0x1000>;
+ clocks = <&mmsys CLK_MM_MDP_RDMA0>,
+ <&mmsys CLK_MM_MUTEX_32K>;
+ power-domains = <&spm MT8173_POWER_DOMAIN_MM>;
+ iommus = <&iommu M4U_PORT_MDP_RDMA0>;
+ mediatek,vpu = <&vpu>;
+ };
+
+ mdp_rdma1: rdma@14002000 {
+ compatible = "mediatek,mt8173-mdp-rdma";
+ reg = <0 0x14002000 0 0x1000>;
+ clocks = <&mmsys CLK_MM_MDP_RDMA1>,
+ <&mmsys CLK_MM_MUTEX_32K>;
+ power-domains = <&spm MT8173_POWER_DOMAIN_MM>;
+ iommus = <&iommu M4U_PORT_MDP_RDMA1>;
+ };
+
+ mdp_rsz0: rsz@14003000 {
+ compatible = "mediatek,mt8173-mdp-rsz";
+ reg = <0 0x14003000 0 0x1000>;
+ clocks = <&mmsys CLK_MM_MDP_RSZ0>;
+ power-domains = <&spm MT8173_POWER_DOMAIN_MM>;
+ };
+
+ mdp_rsz1: rsz@14004000 {
+ compatible = "mediatek,mt8173-mdp-rsz";
+ reg = <0 0x14004000 0 0x1000>;
+ clocks = <&mmsys CLK_MM_MDP_RSZ1>;
+ power-domains = <&spm MT8173_POWER_DOMAIN_MM>;
+ };
+
+ mdp_rsz2: rsz@14005000 {
+ compatible = "mediatek,mt8173-mdp-rsz";
+ reg = <0 0x14005000 0 0x1000>;
+ clocks = <&mmsys CLK_MM_MDP_RSZ2>;
+ power-domains = <&spm MT8173_POWER_DOMAIN_MM>;
+ };
+
+ mdp_wdma0: wdma@14006000 {
+ compatible = "mediatek,mt8173-mdp-wdma";
+ reg = <0 0x14006000 0 0x1000>;
+ clocks = <&mmsys CLK_MM_MDP_WDMA>;
+ power-domains = <&spm MT8173_POWER_DOMAIN_MM>;
+ iommus = <&iommu M4U_PORT_MDP_WDMA>;
+ };
+
+ mdp_wrot0: wrot@14007000 {
+ compatible = "mediatek,mt8173-mdp-wrot";
+ reg = <0 0x14007000 0 0x1000>;
+ clocks = <&mmsys CLK_MM_MDP_WROT0>;
+ power-domains = <&spm MT8173_POWER_DOMAIN_MM>;
+ iommus = <&iommu M4U_PORT_MDP_WROT0>;
+ };
+
+ mdp_wrot1: wrot@14008000 {
+ compatible = "mediatek,mt8173-mdp-wrot";
+ reg = <0 0x14008000 0 0x1000>;
+ clocks = <&mmsys CLK_MM_MDP_WROT1>;
+ power-domains = <&spm MT8173_POWER_DOMAIN_MM>;
+ iommus = <&iommu M4U_PORT_MDP_WROT1>;
+ };
+ };
+
+...
diff --git a/Documentation/devicetree/bindings/media/mediatek-mdp.txt b/Documentation/devicetree/bindings/media/mediatek-mdp.txt
deleted file mode 100644
index 53ef26e2c8570..0000000000000
--- a/Documentation/devicetree/bindings/media/mediatek-mdp.txt
+++ /dev/null
@@ -1,95 +0,0 @@
-* Mediatek Media Data Path
-
-Media Data Path is used for scaling and color space conversion.
-
-Required properties (controller node):
-- compatible: "mediatek,mt8173-mdp"
-- mediatek,vpu: the node of video processor unit, see
- Documentation/devicetree/bindings/media/mediatek-vpu.txt for details.
-
-Required properties (all function blocks, child node):
-- compatible: Should be one of
- "mediatek,mt8173-mdp-rdma" - read DMA
- "mediatek,mt8173-mdp-rsz" - resizer
- "mediatek,mt8173-mdp-wdma" - write DMA
- "mediatek,mt8173-mdp-wrot" - write DMA with rotation
-- reg: Physical base address and length of the function block register space
-- clocks: device clocks, see
- Documentation/devicetree/bindings/clock/clock-bindings.txt for details.
-- power-domains: a phandle to the power domain, see
- Documentation/devicetree/bindings/power/power_domain.txt for details.
-
-Required properties (DMA function blocks, child node):
-- compatible: Should be one of
- "mediatek,mt8173-mdp-rdma"
- "mediatek,mt8173-mdp-wdma"
- "mediatek,mt8173-mdp-wrot"
-- iommus: should point to the respective IOMMU block with master port as
- argument, see Documentation/devicetree/bindings/iommu/mediatek,iommu.yaml
- for details.
-
-Example:
- mdp_rdma0: rdma@14001000 {
- compatible = "mediatek,mt8173-mdp-rdma";
- "mediatek,mt8173-mdp";
- reg = <0 0x14001000 0 0x1000>;
- clocks = <&mmsys CLK_MM_MDP_RDMA0>,
- <&mmsys CLK_MM_MUTEX_32K>;
- power-domains = <&scpsys MT8173_POWER_DOMAIN_MM>;
- iommus = <&iommu M4U_PORT_MDP_RDMA0>;
- mediatek,vpu = <&vpu>;
- };
-
- mdp_rdma1: rdma@14002000 {
- compatible = "mediatek,mt8173-mdp-rdma";
- reg = <0 0x14002000 0 0x1000>;
- clocks = <&mmsys CLK_MM_MDP_RDMA1>,
- <&mmsys CLK_MM_MUTEX_32K>;
- power-domains = <&scpsys MT8173_POWER_DOMAIN_MM>;
- iommus = <&iommu M4U_PORT_MDP_RDMA1>;
- };
-
- mdp_rsz0: rsz@14003000 {
- compatible = "mediatek,mt8173-mdp-rsz";
- reg = <0 0x14003000 0 0x1000>;
- clocks = <&mmsys CLK_MM_MDP_RSZ0>;
- power-domains = <&scpsys MT8173_POWER_DOMAIN_MM>;
- };
-
- mdp_rsz1: rsz@14004000 {
- compatible = "mediatek,mt8173-mdp-rsz";
- reg = <0 0x14004000 0 0x1000>;
- clocks = <&mmsys CLK_MM_MDP_RSZ1>;
- power-domains = <&scpsys MT8173_POWER_DOMAIN_MM>;
- };
-
- mdp_rsz2: rsz@14005000 {
- compatible = "mediatek,mt8173-mdp-rsz";
- reg = <0 0x14005000 0 0x1000>;
- clocks = <&mmsys CLK_MM_MDP_RSZ2>;
- power-domains = <&scpsys MT8173_POWER_DOMAIN_MM>;
- };
-
- mdp_wdma0: wdma@14006000 {
- compatible = "mediatek,mt8173-mdp-wdma";
- reg = <0 0x14006000 0 0x1000>;
- clocks = <&mmsys CLK_MM_MDP_WDMA>;
- power-domains = <&scpsys MT8173_POWER_DOMAIN_MM>;
- iommus = <&iommu M4U_PORT_MDP_WDMA>;
- };
-
- mdp_wrot0: wrot@14007000 {
- compatible = "mediatek,mt8173-mdp-wrot";
- reg = <0 0x14007000 0 0x1000>;
- clocks = <&mmsys CLK_MM_MDP_WROT0>;
- power-domains = <&scpsys MT8173_POWER_DOMAIN_MM>;
- iommus = <&iommu M4U_PORT_MDP_WROT0>;
- };
-
- mdp_wrot1: wrot@14008000 {
- compatible = "mediatek,mt8173-mdp-wrot";
- reg = <0 0x14008000 0 0x1000>;
- clocks = <&mmsys CLK_MM_MDP_WROT1>;
- power-domains = <&scpsys MT8173_POWER_DOMAIN_MM>;
- iommus = <&iommu M4U_PORT_MDP_WROT1>;
- };
--
2.50.1
^ permalink raw reply related
* [PATCH v2 00/12] MediaTek dt-bindings sanitization (MT8173)
From: Ariel D'Alessandro @ 2025-09-11 15:09 UTC (permalink / raw)
To: airlied, amergnat, andrew+netdev, andrew-ct.chen,
angelogioacchino.delregno, ariel.dalessandro, broonie,
chunkuang.hu, conor+dt, davem, dmitry.torokhov, edumazet,
flora.fu, heiko, houlong.wei, jeesw, kernel, krzk+dt, kuba,
lgirdwood, linus.walleij, louisalexis.eyraud, luiz.dentz,
maarten.lankhorst, marcel, matthias.bgg, mchehab, minghsiu.tsai,
mripard, p.zabel, pabeni, robh, sean.wang, simona,
support.opensource, tiffany.lin, tzimmermann, yunfei.dong
Cc: devicetree, dri-devel, linux-arm-kernel, linux-bluetooth,
linux-gpio, linux-input, linux-kernel, linux-media,
linux-mediatek, linux-rockchip, linux-sound, netdev
This patch series continues the effort to address Device Tree validation
warnings for MediaTek platforms, with a focus on MT8173. It follows the
initial cleanup series by Angelo [0].
Similarly to the ongoing MT8183 work done by Julien Massot, this patchset
eliminates several of the remaining warnings by improving or converting DT
bindings to YAML, adding missing properties, and updating device tree files
accordingly.
[0] https://www.spinics.net/lists/kernel/msg5780177.html
Changes in v2:
* Wrapped commit messages to 75 columns line wrap.
* Replaced "YAML" by "DT schema" in patches subject and content.
* mt8173-mdp: Fixed properties: compatible, clocks, iommus and
mediatek,vpu.
* mt8173-vpu: Fixed line wrap. Dropped memory-region property description.
* mediatek,mmsys: Dropped patch as it's not a binding issue.
* mediatek,od: Rewrote commit log with details on DT schema users missing
the related property. Rewrote mediatek,gce-client-reg property.
* mediatek,ufoe: Rewrote commit log with details on DT schema users missing
the related property. Rewrote mediatek,gce-client-reg property.
* marvell,sd8897-bt: Moved to net/bluetooth/. Added missing ref to
bluetooth-controller.yaml. Dropped example. Updated reference in another
file. Minor fixes in properties.
* mediatek,mt8173-rt5650: Dropped unnecessary quotes and unused label.
* dlg,da9211: Dropped enable-gpios description. Rewrote generic example
node names. Minor fixes in properties.
* melfas,mip4_ts: Dropped unnecessary quotes. Added "active high" to
ce-gpios property description.
* mediatek,jpeg: Dropped patch as it doesn't apply.
Signed-off-by: Ariel D'Alessandro <ariel.dalessandro@collabora.com>
Ariel D'Alessandro (12):
dt-bindings: media: Convert MediaTek mt8173-mdp bindings to DT schema
dt-bindings: media: Convert MediaTek mt8173-vpu bindings to DT schema
dt-bindings: net: Convert Marvell 8897/8997 bindings to DT schema
dt-bindings: ASoC: Convert MediaTek RT5650 codecs bindings to DT
schema
dt-bindings: display: mediatek,od: Add mediatek,gce-client-reg
property
dt-bindings: display: mediatek,ufoe: Add mediatek,gce-client-reg
property
arm64: dts: mediatek: mt8173: Fix mt8173-pinctrl node names
dt-bindings: pinctrl: mt65xx: Allow gpio-line-names
dt-bindings: regulator: Convert Dialog DA9211 Regulators to DT schema
arm64: dts: mediatek: mt8173-elm: Drop unused bank supply
dt-bindings: soc: mediatek: pwrap: Add power-domains property
dt-bindings: input: Convert MELFAS MIP4 Touchscreen to DT schema
.../display/mediatek/mediatek,od.yaml | 14 ++
.../display/mediatek/mediatek,ufoe.yaml | 15 ++
.../input/touchscreen/melfas,mip4_ts.yaml | 56 +++++
.../input/touchscreen/melfas_mip4.txt | 20 --
.../bindings/media/mediatek,mt8173-mdp.yaml | 169 +++++++++++++++
.../bindings/media/mediatek,mt8173-vpu.yaml | 74 +++++++
.../bindings/media/mediatek-mdp.txt | 95 --------
.../bindings/media/mediatek-vpu.txt | 31 ---
.../net/bluetooth/marvell,sd8897-bt.yaml | 79 +++++++
.../devicetree/bindings/net/btusb.txt | 2 +-
.../bindings/net/marvell-bt-8xxx.txt | 83 -------
.../pinctrl/mediatek,mt65xx-pinctrl.yaml | 2 +
.../devicetree/bindings/regulator/da9211.txt | 205 ------------------
.../bindings/regulator/dlg,da9211.yaml | 104 +++++++++
.../bindings/soc/mediatek/mediatek,pwrap.yaml | 15 ++
.../sound/mediatek,mt8173-rt5650.yaml | 73 +++++++
.../bindings/sound/mt8173-rt5650.txt | 31 ---
.../dts/rockchip/rk3288-veyron-fievel.dts | 2 +-
.../boot/dts/rockchip/rk3288-veyron-jaq.dts | 2 +-
.../boot/dts/mediatek/mt8173-elm-hana.dtsi | 2 +-
arch/arm64/boot/dts/mediatek/mt8173-elm.dtsi | 33 ++-
arch/arm64/boot/dts/mediatek/mt8173-evb.dts | 14 +-
arch/arm64/boot/dts/mediatek/mt8173.dtsi | 14 +-
23 files changed, 633 insertions(+), 502 deletions(-)
create mode 100644 Documentation/devicetree/bindings/input/touchscreen/melfas,mip4_ts.yaml
delete mode 100644 Documentation/devicetree/bindings/input/touchscreen/melfas_mip4.txt
create mode 100644 Documentation/devicetree/bindings/media/mediatek,mt8173-mdp.yaml
create mode 100644 Documentation/devicetree/bindings/media/mediatek,mt8173-vpu.yaml
delete mode 100644 Documentation/devicetree/bindings/media/mediatek-mdp.txt
delete mode 100644 Documentation/devicetree/bindings/media/mediatek-vpu.txt
create mode 100644 Documentation/devicetree/bindings/net/bluetooth/marvell,sd8897-bt.yaml
delete mode 100644 Documentation/devicetree/bindings/net/marvell-bt-8xxx.txt
delete mode 100644 Documentation/devicetree/bindings/regulator/da9211.txt
create mode 100644 Documentation/devicetree/bindings/regulator/dlg,da9211.yaml
create mode 100644 Documentation/devicetree/bindings/sound/mediatek,mt8173-rt5650.yaml
delete mode 100644 Documentation/devicetree/bindings/sound/mt8173-rt5650.txt
--
2.50.1
^ permalink raw reply
* Re: [PATCH] HID: i2c-hid: Resolve touchpad issues on Dell systems during S4
From: Benjamin Tissoires @ 2025-09-11 14:55 UTC (permalink / raw)
To: Mario Limonciello; +Cc: jikos, linux-input
In-Reply-To: <06b2e03e-056d-4012-98c9-1741f2493c0d@kernel.org>
On Sep 11 2025, Mario Limonciello wrote:
> On 9/11/25 8:49 AM, Benjamin Tissoires wrote:
> > Hi Mario,
> >
> > On Sep 09 2025, Mario Limonciello (AMD) wrote:
> > > Dell systems utilize an EC-based touchpad emulation when the ACPI
> > > touchpad _DSM is not invoked. This emulation acts as a secondary
> > > master on the I2C bus, designed for scenarios where the I2C touchpad
> > > driver is absent, such as in BIOS menus. Typically, loading the
> > > i2c-hid module triggers the _DSM at initialization, disabling the
> > > EC-based emulation.
> > >
> > > However, if the i2c-hid module is missing from the boot kernel
> > > used for hibernation snapshot restoration, the _DSM remains
> > > uncalled, resulting in dual masters on the I2C bus and
> > > subsequent arbitration errors. This issue arises when i2c-hid
> > > resides in the rootfs instead of the kernel or initramfs.
> >
> > In the downstream Red Hat bug it was mentioned that the kernel
> > configuration had an impact though. But as I understand it now that I'm
> > re-reading it for the 4th time:
> > - on stock fedora kernel (i2c-hid in initramfs): works
> > - on stock RHEL kernel (i2c-hid in initramfs): bug but config issue
> > - on vanilla kernel without i2c-hid in initramfs: bug fixed by that
> > patch
> > - on vanilla kernel with i2c-hid in initramfs: works
>
> The detail you're missing here for #4 is vanilla kernel *with Fedora kernel
> config* not with a defconfig. A defconfig kernel I don't expect enables all
> the config options needed for this hardware.
>
> I've reproduced it with my own kernel config as well which is not the Fedora
> or RHEL kernel config but rather a narrowed down config of options that I
> normally use for testing.
>
> >
> > So that patch is needed no matter the config bug we have there and it
> > will also fix that config bug. Am I correct?
>
> Yes there are certainly circumstances it is needed if i2c-hid isn't present
> in the kernel used to restore the hibernation image.
>
> >
> > >
> > > To address this, switch from using the SYSTEM_SLEEP_PM_OPS()
> > > macro to dedicated callbacks, introducing a specific
> > > callback for restoring the S4 image. This callback ensures
> > > the _DSM is invoked.
> >
> > I'm a little bit hesitant to include this patch without proper testing.
> > Did you run this through a wider range of laptops than just the
> > problematic one?
>
> I have been including it in my (local) development and testing tree ever
> since I made it about a month ago so I've thrown it at a random assortment
> of hardware I boot that on. I have also been doing S4 testing explicitly
> because of checking that I didn't break S4 with by S4 at S5 series [1].
>
> That hardware is all biased to be AMD hardware though.
Alright, thanks for the precision.
I'll run on my intel based laptop a few tests then and will include this
upstream.
Cheers,
Benjamin
>
> [1] https://lore.kernel.org/linux-usb/20250909191619.2580169-1-superm1@kernel.org/
> >
> > Other than that, patch looks good to me, but I would have liked to have
> > another opinion on it.
> >
> > Cheers,
> > Benjamin
> >
> > >
> > > Signed-off-by: Mario Limonciello (AMD) <superm1@kernel.org>
> > > ---
> > > drivers/hid/i2c-hid/i2c-hid-acpi.c | 8 ++++++++
> > > drivers/hid/i2c-hid/i2c-hid-core.c | 28 +++++++++++++++++++++++++++-
> > > drivers/hid/i2c-hid/i2c-hid.h | 2 ++
> > > 3 files changed, 37 insertions(+), 1 deletion(-)
> > >
> > > diff --git a/drivers/hid/i2c-hid/i2c-hid-acpi.c b/drivers/hid/i2c-hid/i2c-hid-acpi.c
> > > index 1b49243adb16a..abd700a101f46 100644
> > > --- a/drivers/hid/i2c-hid/i2c-hid-acpi.c
> > > +++ b/drivers/hid/i2c-hid/i2c-hid-acpi.c
> > > @@ -76,6 +76,13 @@ static int i2c_hid_acpi_get_descriptor(struct i2c_hid_acpi *ihid_acpi)
> > > return hid_descriptor_address;
> > > }
> > > +static void i2c_hid_acpi_restore_sequence(struct i2chid_ops *ops)
> > > +{
> > > + struct i2c_hid_acpi *ihid_acpi = container_of(ops, struct i2c_hid_acpi, ops);
> > > +
> > > + i2c_hid_acpi_get_descriptor(ihid_acpi);
> > > +}
> > > +
> > > static void i2c_hid_acpi_shutdown_tail(struct i2chid_ops *ops)
> > > {
> > > struct i2c_hid_acpi *ihid_acpi = container_of(ops, struct i2c_hid_acpi, ops);
> > > @@ -96,6 +103,7 @@ static int i2c_hid_acpi_probe(struct i2c_client *client)
> > > ihid_acpi->adev = ACPI_COMPANION(dev);
> > > ihid_acpi->ops.shutdown_tail = i2c_hid_acpi_shutdown_tail;
> > > + ihid_acpi->ops.restore_sequence = i2c_hid_acpi_restore_sequence;
> > > ret = i2c_hid_acpi_get_descriptor(ihid_acpi);
> > > if (ret < 0)
> > > diff --git a/drivers/hid/i2c-hid/i2c-hid-core.c b/drivers/hid/i2c-hid/i2c-hid-core.c
> > > index d3912e3f2f13a..3257aa87be898 100644
> > > --- a/drivers/hid/i2c-hid/i2c-hid-core.c
> > > +++ b/drivers/hid/i2c-hid/i2c-hid-core.c
> > > @@ -961,6 +961,14 @@ static void i2c_hid_core_shutdown_tail(struct i2c_hid *ihid)
> > > ihid->ops->shutdown_tail(ihid->ops);
> > > }
> > > +static void i2c_hid_core_restore_sequence(struct i2c_hid *ihid)
> > > +{
> > > + if (!ihid->ops->restore_sequence)
> > > + return;
> > > +
> > > + ihid->ops->restore_sequence(ihid->ops);
> > > +}
> > > +
> > > static int i2c_hid_core_suspend(struct i2c_hid *ihid, bool force_poweroff)
> > > {
> > > struct i2c_client *client = ihid->client;
> > > @@ -1360,8 +1368,26 @@ static int i2c_hid_core_pm_resume(struct device *dev)
> > > return i2c_hid_core_resume(ihid);
> > > }
> > > +static int i2c_hid_core_pm_restore(struct device *dev)
> > > +{
> > > + struct i2c_client *client = to_i2c_client(dev);
> > > + struct i2c_hid *ihid = i2c_get_clientdata(client);
> > > +
> > > + if (ihid->is_panel_follower)
> > > + return 0;
> > > +
> > > + i2c_hid_core_restore_sequence(ihid);
> > > +
> > > + return i2c_hid_core_resume(ihid);
> > > +}
> > > +
> > > const struct dev_pm_ops i2c_hid_core_pm = {
> > > - SYSTEM_SLEEP_PM_OPS(i2c_hid_core_pm_suspend, i2c_hid_core_pm_resume)
> > > + .suspend = pm_sleep_ptr(i2c_hid_core_pm_suspend),
> > > + .resume = pm_sleep_ptr(i2c_hid_core_pm_resume),
> > > + .freeze = pm_sleep_ptr(i2c_hid_core_pm_suspend),
> > > + .thaw = pm_sleep_ptr(i2c_hid_core_pm_resume),
> > > + .poweroff = pm_sleep_ptr(i2c_hid_core_pm_suspend),
> > > + .restore = pm_sleep_ptr(i2c_hid_core_pm_restore),
> > > };
> > > EXPORT_SYMBOL_GPL(i2c_hid_core_pm);
> > > diff --git a/drivers/hid/i2c-hid/i2c-hid.h b/drivers/hid/i2c-hid/i2c-hid.h
> > > index 2c7b66d5caa0f..1724a435c783a 100644
> > > --- a/drivers/hid/i2c-hid/i2c-hid.h
> > > +++ b/drivers/hid/i2c-hid/i2c-hid.h
> > > @@ -27,11 +27,13 @@ static inline u32 i2c_hid_get_dmi_quirks(const u16 vendor, const u16 product)
> > > * @power_up: do sequencing to power up the device.
> > > * @power_down: do sequencing to power down the device.
> > > * @shutdown_tail: called at the end of shutdown.
> > > + * @restore_sequence: hibernation restore sequence.
> > > */
> > > struct i2chid_ops {
> > > int (*power_up)(struct i2chid_ops *ops);
> > > void (*power_down)(struct i2chid_ops *ops);
> > > void (*shutdown_tail)(struct i2chid_ops *ops);
> > > + void (*restore_sequence)(struct i2chid_ops *ops);
> > > };
> > > int i2c_hid_core_probe(struct i2c_client *client, struct i2chid_ops *ops,
> > > --
> > > 2.43.0
> > >
>
^ permalink raw reply
* Re: [PATCH v1 00/14] MediaTek dt-bindings sanitization (MT8173)
From: Ariel D'Alessandro @ 2025-09-11 14:29 UTC (permalink / raw)
To: Mark Brown
Cc: airlied, amergnat, andrew+netdev, andrew-ct.chen,
angelogioacchino.delregno, chunkuang.hu, ck.hu, conor+dt, davem,
dmitry.torokhov, edumazet, flora.fu, houlong.wei, jeesw, jmassot,
kernel, krzk+dt, kuba, kyrie.wu, lgirdwood, linus.walleij,
louisalexis.eyraud, maarten.lankhorst, matthias.bgg, mchehab,
minghsiu.tsai, mripard, p.zabel, pabeni, robh, sean.wang, simona,
support.opensource, tiffany.lin, tzimmermann, yunfei.dong,
devicetree, dri-devel, linux-arm-kernel, linux-clk, linux-gpio,
linux-input, linux-kernel, linux-media, linux-mediatek,
linux-sound, netdev
In-Reply-To: <9401aab0-1168-4570-a0a1-1310f37142eb@sirena.org.uk>
Mark,
On 8/20/25 2:19 PM, Mark Brown wrote:
> On Wed, Aug 20, 2025 at 02:12:48PM -0300, Ariel D'Alessandro wrote:
>> This patch series continues the effort to address Device Tree validation
>> warnings for MediaTek platforms, with a focus on MT8173. It follows the initial
>> cleanup series by Angelo (https://www.spinics.net/lists/kernel/msg5780177.html)
>>
>> Similarly to the ongoing MT8183 work done by Julien Massot, this patchset
>> eliminates several of the remaining warnings by improving or converting DT
>> bindings to YAML, adding missing properties, and updating device tree files
>> accordingly.
>
> Same question as for that series, what's the story with
> interdependencies between the patches?
>
> Please submit patches using subject lines reflecting the style for the
> subsystem, this makes it easier for people to identify relevant patches.
> Look at what existing commits in the area you're changing are doing and
> make sure your subject lines visually resemble what they're doing.
> There's no need to resubmit to fix this alone.
I'm resubmitting patchset v2 with several fixes addressing feedback on
each patch. While doing so, I've updated each subject line according to
each subsystem log.
Of course let me know if this still need some work.
Thanks for your help!
--
Ariel D'Alessandro
Software Engineer
Collabora Ltd.
Platinum Building, St John's Innovation Park, Cambridge CB4 0DS, UK
Registered in England & Wales, no. 5513718
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox