Linux Input/HID development
 help / color / mirror / Atom feed
* Re: [PATCH 1/3] Input: gpio_keys - fall back to platform_get_irq() for interrupt-only keys
From: Andy Shevchenko @ 2025-08-20 13:37 UTC (permalink / raw)
  To: Dmitry Torokhov
  Cc: Matti Vaittinen, Lee Jones, Arnd Bergmann, Bartosz Golaszewski,
	Linus Walleij, linux-input, linux-kernel
In-Reply-To: <20250817224731.1911207-1-dmitry.torokhov@gmail.com>

On Sun, Aug 17, 2025 at 03:47:26PM -0700, Dmitry Torokhov wrote:
> To allow transitioning away from gpio-keys platform data attempt to
> retrieve IRQ for interrupt-only keys using platform_get_irq_optional()
> if interrupt is not specified in platform data.

...

> +			irq = platform_get_irq_optional(pdev, idx);
> +			if (irq < 0) {

> +				error = irq;
> +				return dev_err_probe(dev, error,

Assigning error is redundant.

> +						     "Unable to determine IRQ# for button #%d",
> +						     idx);
> +			}

-- 
With Best Regards,
Andy Shevchenko



^ permalink raw reply

* Re: [PATCH 2/2] pinctrl: amd: Add PM debugging message for turning on/off wakes
From: Andy Shevchenko @ 2025-08-20 13:45 UTC (permalink / raw)
  To: Mario Limonciello (AMD)
  Cc: Linus Walleij, Bartosz Golaszewski, Mika Westerberg,
	open list:GPIO ACPI SUPPORT, open list:GPIO ACPI SUPPORT,
	open list:INPUT (KEYBOARD, MOUSE, JOYSTICK, TOUCHSCREEN)...
In-Reply-To: <20250814183430.3887973-2-superm1@kernel.org>

On Thu, Aug 14, 2025 at 01:34:30PM -0500, Mario Limonciello (AMD) wrote:
> The GPIOs for devices not in _AEI/_EVT such as touchpad or touchscreen
> won't have wakeup turned on until the suspend sequence starts.
> 
> Due to code in amd_gpio_suspend_hibernate_common() masking the interrupt
> can make this difficult to follow what's going on.  Add an explicit
> debugging message to tell when that was turned on/off.

...

> +	pm_pr_dbg("Setting wake for GPIO %lu to %s\n",
> +		   d->hwirq, str_enable_disable(on));

Can you send a follow up to move from dereference to an API for hwirq?


-- 
With Best Regards,
Andy Shevchenko



^ permalink raw reply

* Re: [PATCH 1/2] gpiolib: acpi: Add quirk for ASUS ProArt PX13
From: Andy Shevchenko @ 2025-08-20 13:46 UTC (permalink / raw)
  To: Linus Walleij
  Cc: Mario Limonciello (AMD), Bartosz Golaszewski, Mika Westerberg,
	open list:GPIO ACPI SUPPORT, open list:GPIO ACPI SUPPORT,
	open list:INPUT (KEYBOARD, MOUSE, JOYSTICK, TOUCHSCREEN)...,
	Amit Chaudhari
In-Reply-To: <CACRpkdba9c9FdJoAufRVEKxXRP-kk5QZusiqxmWoY6D-gK9tYA@mail.gmail.com>

On Tue, Aug 19, 2025 at 02:16:28PM +0200, Linus Walleij wrote:
> On Thu, Aug 14, 2025 at 8:34 PM Mario Limonciello (AMD)
> <superm1@kernel.org> wrote:
> 
> > The ASUS ProArt PX13 has a spurious wakeup event from the touchpad
> > a few moments after entering hardware sleep.  This can be avoided
> > by preventing the touchpad from being a wake source.
> >
> > Add to the wakeup ignore list.
> >
> > Reported-by: Amit Chaudhari <amitchaudhari@mac.com>
> > Closes: https://gitlab.freedesktop.org/drm/amd/-/issues/4482
> > Tested-by: Amit Chaudhari <amitchaudhari@mac.com>
> > Signed-off-by: Mario Limonciello (AMD) <superm1@kernel.org>
> 
> Bartosz is on vacation and this patch series is half-pinctrl so I applied this
> and patch 2/2 for pin control fixes.

I also was on vacation and become to full speed next week. But series is fine,
just one nit-pick I commented on, it can be addressed in a separate followup.

-- 
With Best Regards,
Andy Shevchenko



^ permalink raw reply

* Re: [PATCH v4] input: dt-bindings: ti,twl4030-keypad: convert to DT schema
From: Rob Herring (Arm) @ 2025-08-20 14:12 UTC (permalink / raw)
  To: Jihed Chaibi
  Cc: shuah, peter.ujfalusi, devicetree, linux-kernel, conor+dt,
	dmitry.torokhov, linux-input, krzk+dt
In-Reply-To: <20250819222823.157943-1-jihed.chaibi.dev@gmail.com>


On Wed, 20 Aug 2025 00:28:23 +0200, Jihed Chaibi wrote:
> Convert the legacy TXT binding for the TWL4030 keypad module
> to the modern YAML DT schema format. This adds formal validation
> and improves documentation by inheriting from the matrix-keymap schema.
> 
> Signed-off-by: Jihed Chaibi <jihed.chaibi.dev@gmail.com>
> 
> ---
> Changes in v4:
>  - No changes.
>  - This patch is split from larger series per maintainer feedback.
>  - v3 link:
>     https://lore.kernel.org/all/20250816021523.167049-1-jihed.chaibi.dev@gmail.com/
> 
> Changes in v3:
>  - Made 'linux,keymap' a required property as suggested by the reviewer.
> 
> Changes in v2:
>  - Simplified the description field by removing redundant '|'
>  as it does not affect formatting in this context.
> ---
>  .../bindings/input/ti,twl4030-keypad.yaml     | 59 +++++++++++++++++++
>  .../bindings/input/twl4030-keypad.txt         | 27 ---------
>  2 files changed, 59 insertions(+), 27 deletions(-)
>  create mode 100644 Documentation/devicetree/bindings/input/ti,twl4030-keypad.yaml
>  delete mode 100644 Documentation/devicetree/bindings/input/twl4030-keypad.txt
> 

Reviewed-by: Rob Herring (Arm) <robh@kernel.org>


^ permalink raw reply

* Fw: [BUG] hid-mcp2221: I2C timeouts cause permanent bus lockup
From: Feliks Peysakhov @ 2025-08-20 14:44 UTC (permalink / raw)
  To: Feliks Peysakhov; +Cc: linux-i2c@vger.kernel.org, linux-input@vger.kernel.org
In-Reply-To: <DS0PR09MB1082645B489866447C7166858C430A@DS0PR09MB10826.namprd09.prod.outlook.com>

Hi Rishi Gupta,

I'm experiencing an issue with the hid-mcp2221 driver where I2C operations
to non-existent addresses cause timeouts that permanently lock the I2C bus,
requiring a USB device reset to recover.

**Problem Description:**
When sending an I2C command to an empty/non-existent address, the operation
times out and all subsequent I2C operations fail until the MCP2221 USB device
is physically reset. This can also happen if sending a command to a valid address,
but there is a connection issue and the request is not returned.

**Expected Behavior:**
The driver should handle timeouts gracefully and reset the I2C bus state
automatically, similar to how the Microchip-provided driver handles this scenario.

**System Information:**
- Kernel version: 6.8.0-59-generic #61~22.04.1-Ubuntu
- Repo from Canonical: https://git.launchpad.net/~ubuntu-kernel/ubuntu/+source/linux/+git/jammy/commit/drivers/hid/hid-mcp2221.c?h=Ubuntu-hwe-6.8-6.8.0-52.53_22.04.1
- Driver: hid-mcp2221
- Device: MCP2221A USB-to-I2C bridge (04d8:00dd)

**Steps to Reproduce:**
1. Send I2C command to non-existent address (e.g., 0x99)
2. Operation times out
3. All subsequent I2C operations fail with timeout errors, even to a valid address after that.
4. Only USB device reset restores functionality

**Comparison:**
The Microchip-provided i2c-mcp2221 driver (from their example code) handles
this scenario with some form of bus recovery. In fact I noticed that the LK driver
used to do the same until it was removed in this commit. This includes a full
reset of the I2C bus on the chip via a set speed command. I can see why this
was cleaned up since its not efficient.
https://github.com/torvalds/linux/commit/02a46753601a24e1673d9c28173121055e8e6cc9

**Impact:**
This makes the driver unreliable for production I2C applications where addressing
non-existent devices might occur during bus scanning or device detection routines.
For our use cases the greatest risk could be a board that is not powered up fully or a
mistake on the user side where nothing is connected forcing the chip to lock up
for any subsequent R/Ws.

**Proposed Solution:**
The driver should implement automatic I2C bus cancellation/reset when
operations timeout, similar to the recovery logic in the Microchip driver.
I think potentially there are some cancels missing in the mcp_i2c_write
and mcp_i2c_smbus_read functions.

I noticed there are cancels in place that are trying to be called but also failing
since the chip has a successful return status, but then sets a NACK flag. The
cancel commands themselves are failing at the chip. I noticed that cancels
do not work until the chip actually reports an error state.

--- a/hid-mcp2221.c
+++ b/hid-mcp2221.c
@@ -318,6 +318,8 @@ static int mcp_i2c_write(struct mcp2221 *mcp,
              ret = mcp_send_data_req_status(mcp, mcp->txbuf, len + 4);
              if (ret) {
+                      usleep_range(980, 1000);
+                      mcp_cancel_last_cmd(mcp);
                      return ret;
              }
@@ -399,6 +401,8 @@ static int mcp_i2c_smbus_read(struct mcp2221 *mcp,
      ret = mcp_send_data_req_status(mcp, mcp->txbuf, 4);
      if (ret) {
+              usleep_range(980, 1000);
+              mcp_cancel_last_cmd(mcp);
              return ret;
      }

I'm happy to provide more details, test patches, or assist with debugging.
Please let me know what you think.

Best regards,
Feliks Peysakhov

P.S. Sorry for the duplicate email resent to mailing list as plain text
This message is intended solely for the Addressee and may contain information that is PROPRIETARY and CONFIDENTIAL. If you are not the intended recipient and/or are not responsible for delivery of the message to such intended recipient, or if you believe you have received this communication in error, please do not print, copy, retransmit, disseminate, or otherwise use the information. Please notify the sender immediately that you have received this e-mail in error, and please delete all copies of the message and its attachments that you have received. Thank You. Persistent Systems, LLC, www.persistentsystems.com

^ permalink raw reply

* [BUG] hid-mcp2221: I2C timeouts cause permanent bus lockup
From: Feliks Peysakhov @ 2025-08-20 14:47 UTC (permalink / raw)
  To: gupt21@gmail.com; +Cc: linux-i2c@vger.kernel.org, linux-input@vger.kernel.org
In-Reply-To: <SJ0PR09MB10822B683C8306136D37C01B9C433A@SJ0PR09MB10822.namprd09.prod.outlook.com>

Hi Rishi Gupta,

I'm experiencing an issue with the hid-mcp2221 driver where I2C operations
to non-existent addresses cause timeouts that permanently lock the I2C bus,
requiring a USB device reset to recover.

**Problem Description:**
When sending an I2C command to an empty/non-existent address, the operation
times out and all subsequent I2C operations fail until the MCP2221 USB device
is physically reset. This can also happen if sending a command to a valid address,
but there is a connection issue and the request is not returned.

**Expected Behavior:**
The driver should handle timeouts gracefully and reset the I2C bus state
automatically, similar to how the Microchip-provided driver handles this scenario.

**System Information:**
- Kernel version: 6.8.0-59-generic #61~22.04.1-Ubuntu
- Repo from Canonical: https://git.launchpad.net/~ubuntu-kernel/ubuntu/+source/linux/+git/jammy/commit/drivers/hid/hid-mcp2221.c?h=Ubuntu-hwe-6.8-6.8.0-52.53_22.04.1
- Driver: hid-mcp2221
- Device: MCP2221A USB-to-I2C bridge (04d8:00dd)

**Steps to Reproduce:**
1. Send I2C command to non-existent address (e.g., 0x99)
2. Operation times out
3. All subsequent I2C operations fail with timeout errors, even to a valid address after that.
4. Only USB device reset restores functionality

**Comparison:**
The Microchip-provided i2c-mcp2221 driver (from their example code) handles
this scenario with some form of bus recovery. In fact I noticed that the LK driver
used to do the same until it was removed in this commit. This includes a full
reset of the I2C bus on the chip via a set speed command. I can see why this
was cleaned up since its not efficient.
https://github.com/torvalds/linux/commit/02a46753601a24e1673d9c28173121055e8e6cc9

**Impact:**
This makes the driver unreliable for production I2C applications where addressing
non-existent devices might occur during bus scanning or device detection routines.
For our use cases the greatest risk could be a board that is not powered up fully or a
mistake on the user side where nothing is connected forcing the chip to lock up
for any subsequent R/Ws.

**Proposed Solution:**
The driver should implement automatic I2C bus cancellation/reset when
operations timeout, similar to the recovery logic in the Microchip driver.
I think potentially there are some cancels missing in the mcp_i2c_write
and mcp_i2c_smbus_read functions.

I noticed there are cancels in place that are trying to be called but also failing
since the chip has a successful return status, but then sets a NACK flag. The
cancel commands themselves are failing at the chip. I noticed that cancels
do not work until the chip actually reports an error state.

--- a/hid-mcp2221.c
+++ b/hid-mcp2221.c
@@ -318,6 +318,8 @@ static int mcp_i2c_write(struct mcp2221 *mcp,
             ret = mcp_send_data_req_status(mcp, mcp->txbuf, len + 4);
             if (ret) {
+                      usleep_range(980, 1000);
+                      mcp_cancel_last_cmd(mcp);
                     return ret;
             }
@@ -399,6 +401,8 @@ static int mcp_i2c_smbus_read(struct mcp2221 *mcp,
     ret = mcp_send_data_req_status(mcp, mcp->txbuf, 4);
     if (ret) {
+              usleep_range(980, 1000);
+              mcp_cancel_last_cmd(mcp);
             return ret;
     }

I'm happy to provide more details, test patches, or assist with debugging.
Please let me know what you think.

Best regards,
Feliks Peysakhov

P.S. Sorry for the duplicate email resent to mailing list as plain text
This message is intended solely for the Addressee and may contain information that is PROPRIETARY and CONFIDENTIAL. If you are not the intended recipient and/or are not responsible for delivery of the message to such intended recipient, or if you believe you have received this communication in error, please do not print, copy, retransmit, disseminate, or otherwise use the information. Please notify the sender immediately that you have received this e-mail in error, and please delete all copies of the message and its attachments that you have received. Thank You. Persistent Systems, LLC, www.persistentsystems.com

^ permalink raw reply

* Re: [PATCH v2 2/2] HID: i2c-hid: elan: Add parade-tc3408 timing
From: Doug Anderson @ 2025-08-20 14:47 UTC (permalink / raw)
  To: Langyan Ye
  Cc: dmitry.torokhov, robh, krzk+dt, conor+dt, jikos, bentiss,
	linux-input, devicetree, linux-kernel
In-Reply-To: <20250820122520.3356738-3-yelangyan@huaqin.corp-partner.google.com>

Hi,

On Wed, Aug 20, 2025 at 5:25 AM Langyan Ye
<yelangyan@huaqin.corp-partner.google.com> wrote:
>
> Parade-tc3408 requires reset to pull down time greater than 10ms,
> so the configuration post_power_delay_ms is 10, and the chipset
> initial time is required to be greater than 300ms,
> so the post_gpio_reset_on_delay_ms is set to 300.
>
> Signed-off-by: Langyan Ye <yelangyan@huaqin.corp-partner.google.com>
> ---
>  drivers/hid/i2c-hid/i2c-hid-of-elan.c | 8 ++++++++
>  1 file changed, 8 insertions(+)

Reviewed-by: Douglas Anderson <dianders@chromium.org>

^ permalink raw reply

* Re: (subset) [PATCH 00/21] treewide: remove unneeded 'fast_io' parameter in regmap_config
From: Vinod Koul @ 2025-08-20 17:02 UTC (permalink / raw)
  To: linux-kernel, Wolfram Sang
  Cc: Mark Brown, Adrian Hunter, Alexandre Belloni, Alexandre Torgue,
	Alim Akhtar, Andrea della Porta, Andreas Färber,
	Andrzej Hajda, Andy Shevchenko, Andy Yan, Avi Fishman,
	Bartosz Golaszewski, Benjamin Fair, Bjorn Andersson, Chen-Yu Tsai,
	Daniel Lezcano, David Airlie, David Lechner, Dmitry Torokhov,
	Drew Fustini, dri-devel, Fabio Estevam, Fabrice Gasnier, Fu Wei,
	Guo Ren, Hans Verkuil, Heiko Stübner, imx, Iwona Winiarska,
	Jaroslav Kysela, Jassi Brar, Jernej Skrabec, Jerome Brunet,
	Jonas Karlman, Jonathan Cameron, Kevin Hilman,
	Kishon Vijay Abraham I, Konrad Dybcio, Krzysztof Kozlowski,
	Laurent Pinchart, Lee Jones, Liam Girdwood, Linus Walleij,
	linux-actions, linux-amlogic, linux-arm-kernel, linux-arm-msm,
	linux-clk, linux-gpio, linux-iio, linux-input, linux-media,
	linux-mmc, linux-phy, linux-pm, linuxppc-dev, linux-pwm,
	linux-riscv, linux-rockchip, linux-rtc, linux-samsung-soc,
	linux-sound, linux-spi, linux-stm32, linux-sunxi, Liu Ying,
	Lukasz Luba, Maarten Lankhorst, Manivannan Sadhasivam,
	Martin Blumenstingl, Mauro Carvalho Chehab, Maxime Coquelin,
	Maxime Ripard, Michael Turquette, Miquel Raynal, Nancy Yuen,
	Neil Armstrong, Nicolin Chen, Nuno Sá, openbmc,
	Patrick Venture, Paul Walmsley, Pengutronix Kernel Team,
	Philipp Zabel, Piotr Wojtaszczyk, Rafael J. Wysocki, Robert Foss,
	Samuel Holland, Samuel Holland, Sandy Huang, Sascha Hauer,
	Shawn Guo, Shengjiu Wang, Simona Vetter, Stephen Boyd,
	Takashi Iwai, Tali Perry, Thomas Zimmermann, Tomer Maimon,
	Ulf Hansson, Uwe Kleine-König, Vasily Khoruzhick,
	Vladimir Zapolskiy, Xiubo Li, Yangtao Li, Zhang Rui
In-Reply-To: <20250813161517.4746-1-wsa+renesas@sang-engineering.com>


On Wed, 13 Aug 2025 18:14:46 +0200, Wolfram Sang wrote:
> While working on a driver using regmap with MMIO, I wondered if I need
> to set 'fast_io' in the config. Turned out I don't need to, so I added
> documentation for it with commit ffc72771ff6e ("regmap: Annotate that
> MMIO implies fast IO").
> 
> This series fixes the existing users in the tree which needlessly set
> the flag. They have been found using this coccinelle script:
> 
> [...]

Applied, thanks!

[12/21] phy: remove unneeded 'fast_io' parameter in regmap_config
        commit: e1e1e77f7df7cbee959ba024e5475907fe561c98

Best regards,
-- 
~Vinod



^ permalink raw reply

* [PATCH v1 00/14] MediaTek dt-bindings sanitization (MT8173)
From: Ariel D'Alessandro @ 2025-08-20 17:12 UTC (permalink / raw)
  To: airlied, amergnat, andrew+netdev, andrew-ct.chen,
	angelogioacchino.delregno, ariel.dalessandro, broonie,
	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
  Cc: devicetree, dri-devel, linux-arm-kernel, linux-clk, linux-gpio,
	linux-input, linux-kernel, linux-media, linux-mediatek,
	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 (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.

Signed-off-by: Ariel D'Alessandro <ariel.dalessandro@collabora.com>

Ariel D'Alessandro (14):
  media: dt-bindings: Convert MediaTek mt8173-mdp bindings to YAML
  media: dt-bindings: Convert MediaTek mt8173-vpu bindings to YAML
  dt-bindings: arm: mediatek: mmsys: Add assigned-clocks/rates
    properties
  net: dt-bindings: Convert Marvell 8897/8997 bindings to YAML
  sound: dt-bindings: Convert MediaTek RT5650 codecs bindings to YAML
  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: mediatek,mt65xx-pinctrl: Allow gpio-line-names
  regulator: dt-bindings: Convert Dialog Semiconductor DA9211 Regulators
    to YAML
  arm64: dts: mediatek: mt8173-elm: Drop unused bank supply
  dt-bindings: soc: mediatek: pwrap: Add power-domains property
  dt-bindings: input/touchscreen: Convert MELFAS MIP4 Touchscreen to
    YAML
  dt-bindings: media: mediatek,jpeg: Fix jpeg encoder/decoder ranges

 .../bindings/arm/mediatek/mediatek,mmsys.yaml |   9 +
 .../display/mediatek/mediatek,od.yaml         |  10 +
 .../display/mediatek/mediatek,ufoe.yaml       |  11 +
 .../input/touchscreen/melfas,mip4_ts.yaml     |  55 +++++
 .../input/touchscreen/melfas_mip4.txt         |  20 --
 .../bindings/media/mediatek,mt8173-mdp.yaml   | 174 +++++++++++++++
 .../bindings/media/mediatek,mt8173-vpu.yaml   |  76 +++++++
 .../media/mediatek,mt8195-jpegdec.yaml        |  31 +--
 .../media/mediatek,mt8195-jpegenc.yaml        |  15 +-
 .../bindings/media/mediatek-mdp.txt           |  95 --------
 .../bindings/media/mediatek-vpu.txt           |  31 ---
 .../bindings/net/marvell,sd8897-bt.yaml       |  91 ++++++++
 .../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 ---
 .../boot/dts/mediatek/mt8173-elm-hana.dtsi    |   2 +-
 arch/arm64/boot/dts/mediatek/mt8173-elm.dtsi  |  31 ++-
 arch/arm64/boot/dts/mediatek/mt8173-evb.dts   |  14 +-
 arch/arm64/boot/dts/mediatek/mt8173.dtsi      |  14 +-
 23 files changed, 672 insertions(+), 520 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/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

* [PATCH v1 01/14] media: dt-bindings: Convert MediaTek mt8173-mdp bindings to YAML
From: Ariel D'Alessandro @ 2025-08-20 17:12 UTC (permalink / raw)
  To: airlied, amergnat, andrew+netdev, andrew-ct.chen,
	angelogioacchino.delregno, ariel.dalessandro, broonie,
	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
  Cc: devicetree, dri-devel, linux-arm-kernel, linux-clk, linux-gpio,
	linux-input, linux-kernel, linux-media, linux-mediatek,
	linux-sound, netdev
In-Reply-To: <20250820171302.324142-1-ariel.dalessandro@collabora.com>

Convert the existing text-based DT bindings for MediaTek MT8173 Media Data Path
to a YAML schema.

Signed-off-by: Ariel D'Alessandro <ariel.dalessandro@collabora.com>
---
 .../bindings/media/mediatek,mt8173-mdp.yaml   | 174 ++++++++++++++++++
 .../bindings/media/mediatek-mdp.txt           |  95 ----------
 2 files changed, 174 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..f3a08afc305b1
--- /dev/null
+++ b/Documentation/devicetree/bindings/media/mediatek,mt8173-mdp.yaml
@@ -0,0 +1,174 @@
+# 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:
+      - items:
+          - enum:
+              - mediatek,mt8173-mdp-rdma
+              - mediatek,mt8173-mdp-rsz
+              - mediatek,mt8173-mdp-wdma
+              - mediatek,mt8173-mdp-wrot
+      - items:
+          - enum:
+              - mediatek,mt8173-mdp-rdma
+              - mediatek,mt8173-mdp-rsz
+              - mediatek,mt8173-mdp-wdma
+              - mediatek,mt8173-mdp-wrot
+          - const: mediatek,mt8173-mdp
+
+  reg:
+    maxItems: 1
+
+  clocks: true
+
+  power-domains:
+    maxItems: 1
+
+  iommus:
+    description: |
+      This property should point to the respective IOMMU block with master port as argument,
+      see Documentation/devicetree/bindings/iommu/mediatek,iommu.yaml for details.
+    maxItems: 1
+
+  mediatek,vpu:
+    $ref: /schemas/types.yaml#/definitions/phandle
+    description:
+      Describes point to vpu.
+
+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 v1 02/14] media: dt-bindings: Convert MediaTek mt8173-vpu bindings to YAML
From: Ariel D'Alessandro @ 2025-08-20 17:12 UTC (permalink / raw)
  To: airlied, amergnat, andrew+netdev, andrew-ct.chen,
	angelogioacchino.delregno, ariel.dalessandro, broonie,
	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
  Cc: devicetree, dri-devel, linux-arm-kernel, linux-clk, linux-gpio,
	linux-input, linux-kernel, linux-media, linux-mediatek,
	linux-sound, netdev
In-Reply-To: <20250820171302.324142-1-ariel.dalessandro@collabora.com>

Convert the existing text-based DT bindings for Mediatek MT8173 Video Processor
Unit to a YAML schema.

Signed-off-by: Ariel D'Alessandro <ariel.dalessandro@collabora.com>
---
 .../bindings/media/mediatek,mt8173-vpu.yaml   | 76 +++++++++++++++++++
 .../bindings/media/mediatek-vpu.txt           | 31 --------
 2 files changed, 76 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..44f5d7cc44042
--- /dev/null
+++ b/Documentation/devicetree/bindings/media/mediatek,mt8173-vpu.yaml
@@ -0,0 +1,76 @@
+# 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:
+    minItems: 2
+
+  reg-names:
+    items:
+      - const: tcm
+      - const: cfg_reg
+
+  interrupts:
+    maxItems: 1
+
+  clocks:
+    maxItems: 1
+
+  clock-names:
+    items:
+      - const: main
+
+  memory-region:
+    description:
+      phandle to a node describing reserved memory used by VPU
+      (see bindings/reserved-memory/reserved-memory.txt)
+    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 v1 03/14] dt-bindings: arm: mediatek: mmsys: Add assigned-clocks/rates properties
From: Ariel D'Alessandro @ 2025-08-20 17:12 UTC (permalink / raw)
  To: airlied, amergnat, andrew+netdev, andrew-ct.chen,
	angelogioacchino.delregno, ariel.dalessandro, broonie,
	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
  Cc: devicetree, dri-devel, linux-arm-kernel, linux-clk, linux-gpio,
	linux-input, linux-kernel, linux-media, linux-mediatek,
	linux-sound, netdev
In-Reply-To: <20250820171302.324142-1-ariel.dalessandro@collabora.com>

Current, the DT bindings for MediaTek mmsys controller is missing the
assigned-clocks and assigned-clocks-rates properties. Add these and
update the example as well.

Signed-off-by: Ariel D'Alessandro <ariel.dalessandro@collabora.com>
---
 .../devicetree/bindings/arm/mediatek/mediatek,mmsys.yaml | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/Documentation/devicetree/bindings/arm/mediatek/mediatek,mmsys.yaml b/Documentation/devicetree/bindings/arm/mediatek/mediatek,mmsys.yaml
index 3f4262e93c789..d045d366eb8e2 100644
--- a/Documentation/devicetree/bindings/arm/mediatek/mediatek,mmsys.yaml
+++ b/Documentation/devicetree/bindings/arm/mediatek/mediatek,mmsys.yaml
@@ -68,6 +68,12 @@ properties:
       of the power controller specified by phandle. See
       Documentation/devicetree/bindings/power/power-domain.yaml for details.
 
+  assigned-clocks:
+    maxItems: 1
+
+  assigned-clock-rates:
+    maxItems: 1
+
   mboxes:
     description:
       Using mailbox to communicate with GCE, it should have this
@@ -130,6 +136,7 @@ additionalProperties: false
 
 examples:
   - |
+    #include <dt-bindings/clock/mt8173-clk.h>
     #include <dt-bindings/power/mt8173-power.h>
     #include <dt-bindings/gce/mt8173-gce.h>
 
@@ -137,6 +144,8 @@ examples:
         compatible = "mediatek,mt8173-mmsys", "syscon";
         reg = <0x14000000 0x1000>;
         power-domains = <&spm MT8173_POWER_DOMAIN_MM>;
+        assigned-clocks = <&topckgen CLK_TOP_MM_SEL>;
+        assigned-clock-rates = <400000000>;
         #clock-cells = <1>;
         #reset-cells = <1>;
         mboxes = <&gce 0 CMDQ_THR_PRIO_HIGHEST>,
-- 
2.50.1


^ permalink raw reply related

* [PATCH v1 04/14] net: dt-bindings: Convert Marvell 8897/8997 bindings to YAML
From: Ariel D'Alessandro @ 2025-08-20 17:12 UTC (permalink / raw)
  To: airlied, amergnat, andrew+netdev, andrew-ct.chen,
	angelogioacchino.delregno, ariel.dalessandro, broonie,
	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
  Cc: devicetree, dri-devel, linux-arm-kernel, linux-clk, linux-gpio,
	linux-input, linux-kernel, linux-media, linux-mediatek,
	linux-sound, netdev
In-Reply-To: <20250820171302.324142-1-ariel.dalessandro@collabora.com>

Convert the existing text-based DT bindings for Marvell 8897/8997
(sd8897/sd8997) bluetooth devices controller to a YAML schema.

While here, bindings for "usb1286,204e" (USB interface) are dropped from
the YAML definition as these are currently documented in file:

- Documentation/devicetree/bindings/net/btusb.txt

Signed-off-by: Ariel D'Alessandro <ariel.dalessandro@collabora.com>
---
 .../bindings/net/marvell,sd8897-bt.yaml       | 91 +++++++++++++++++++
 .../bindings/net/marvell-bt-8xxx.txt          | 83 -----------------
 2 files changed, 91 insertions(+), 83 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/net/marvell,sd8897-bt.yaml
 delete mode 100644 Documentation/devicetree/bindings/net/marvell-bt-8xxx.txt

diff --git a/Documentation/devicetree/bindings/net/marvell,sd8897-bt.yaml b/Documentation/devicetree/bindings/net/marvell,sd8897-bt.yaml
new file mode 100644
index 0000000000000..6539868c08b8a
--- /dev/null
+++ b/Documentation/devicetree/bindings/net/marvell,sd8897-bt.yaml
@@ -0,0 +1,91 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/net/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>
+
+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.
+    minItems: 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:
+    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>
+    #include <dt-bindings/pinctrl/rockchip.h>
+
+    sdio0 {
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        btmrvl: btmrvl@2 {
+            compatible = "marvell,sd8897-bt";
+            reg = <2>;
+            interrupt-parent = <&gpio4>;
+            interrupts = <RK_PD7 IRQ_TYPE_LEVEL_LOW>;
+            marvell,wakeup-pin = /bits/ 16 <13>;
+            pinctrl-names = "default";
+            pinctrl-0 = <&bt_host_wake_l>;
+        };
+    };
+
+    mmc3 {
+        vmmc-supply = <&wlan_en_reg>;
+        bus-width = <4>;
+        cap-power-off-card;
+        keep-power-in-suspend;
+
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        bluetooth: 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/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>;
-    };
-};
-- 
2.50.1


^ permalink raw reply related

* [PATCH v1 05/14] sound: dt-bindings: Convert MediaTek RT5650 codecs bindings to YAML
From: Ariel D'Alessandro @ 2025-08-20 17:12 UTC (permalink / raw)
  To: airlied, amergnat, andrew+netdev, andrew-ct.chen,
	angelogioacchino.delregno, ariel.dalessandro, broonie,
	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
  Cc: devicetree, dri-devel, linux-arm-kernel, linux-clk, linux-gpio,
	linux-input, linux-kernel, linux-media, linux-mediatek,
	linux-sound, netdev
In-Reply-To: <20250820171302.324142-1-ariel.dalessandro@collabora.com>

Convert the existing text-based DT bindings for Mediatek MT8173 RT5650
codecs to a YAML 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..36e4f9c4c3d62
--- /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: 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 v1 06/14] dt-bindings: display: mediatek,od: Add mediatek,gce-client-reg property
From: Ariel D'Alessandro @ 2025-08-20 17:12 UTC (permalink / raw)
  To: airlied, amergnat, andrew+netdev, andrew-ct.chen,
	angelogioacchino.delregno, ariel.dalessandro, broonie,
	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
  Cc: devicetree, dri-devel, linux-arm-kernel, linux-clk, linux-gpio,
	linux-input, linux-kernel, linux-media, linux-mediatek,
	linux-sound, netdev
In-Reply-To: <20250820171302.324142-1-ariel.dalessandro@collabora.com>

Current, the DT bindings for Mediatek OD (display overdrive) is missing
the mediatek,gce-client-reg property. Add it and update the example as
well.

Signed-off-by: Ariel D'Alessandro <ariel.dalessandro@collabora.com>
---
 .../bindings/display/mediatek/mediatek,od.yaml         | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/Documentation/devicetree/bindings/display/mediatek/mediatek,od.yaml b/Documentation/devicetree/bindings/display/mediatek/mediatek,od.yaml
index 71534febd49c6..d5b42a4bba190 100644
--- a/Documentation/devicetree/bindings/display/mediatek/mediatek,od.yaml
+++ b/Documentation/devicetree/bindings/display/mediatek/mediatek,od.yaml
@@ -60,6 +60,14 @@ properties:
       - port@0
       - port@1
 
+  mediatek,gce-client-reg:
+    description: The register of client driver can be configured by gce with
+      4 arguments defined in this property, such as phandle of gce, subsys id,
+      register offset and size. Each GCE subsys id is mapping to a client
+      defined in the header include/dt-bindings/gce/<chip>-gce.h.
+    $ref: /schemas/types.yaml#/definitions/phandle-array
+    maxItems: 1
+
 required:
   - compatible
   - reg
@@ -70,6 +78,7 @@ additionalProperties: false
 examples:
   - |
     #include <dt-bindings/clock/mt8173-clk.h>
+    #include <dt-bindings/gce/mt8173-gce.h>
 
     soc {
         #address-cells = <2>;
@@ -79,5 +88,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

* [PATCH v1 07/14] dt-bindings: display: mediatek,ufoe: Add mediatek,gce-client-reg property
From: Ariel D'Alessandro @ 2025-08-20 17:12 UTC (permalink / raw)
  To: airlied, amergnat, andrew+netdev, andrew-ct.chen,
	angelogioacchino.delregno, ariel.dalessandro, broonie,
	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
  Cc: devicetree, dri-devel, linux-arm-kernel, linux-clk, linux-gpio,
	linux-input, linux-kernel, linux-media, linux-mediatek,
	linux-sound, netdev
In-Reply-To: <20250820171302.324142-1-ariel.dalessandro@collabora.com>

Current, the DT bindings for Mediatek UFOe (Unified Frame Optimization
engine) is missing the mediatek,gce-client-reg property. Add it and
update the example as well.

Signed-off-by: Ariel D'Alessandro <ariel.dalessandro@collabora.com>
---
 .../bindings/display/mediatek/mediatek,ufoe.yaml      | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/Documentation/devicetree/bindings/display/mediatek/mediatek,ufoe.yaml b/Documentation/devicetree/bindings/display/mediatek/mediatek,ufoe.yaml
index 61a5e22effbf2..ecb4c0359fec3 100644
--- a/Documentation/devicetree/bindings/display/mediatek/mediatek,ufoe.yaml
+++ b/Documentation/devicetree/bindings/display/mediatek/mediatek,ufoe.yaml
@@ -64,6 +64,14 @@ properties:
       - port@0
       - port@1
 
+  mediatek,gce-client-reg:
+    description: The register of client driver can be configured by gce with
+      4 arguments defined in this property, such as phandle of gce, subsys id,
+      register offset and size. Each GCE subsys id is mapping to a client
+      defined in the header include/dt-bindings/gce/<chip>-gce.h.
+    $ref: /schemas/types.yaml#/definitions/phandle-array
+    maxItems: 1
+
 required:
   - compatible
   - reg
@@ -77,7 +85,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 +98,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 v1 08/14] arm64: dts: mediatek: mt8173: Fix mt8173-pinctrl node names
From: Ariel D'Alessandro @ 2025-08-20 17:12 UTC (permalink / raw)
  To: airlied, amergnat, andrew+netdev, andrew-ct.chen,
	angelogioacchino.delregno, ariel.dalessandro, broonie,
	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
  Cc: devicetree, dri-devel, linux-arm-kernel, linux-clk, linux-gpio,
	linux-input, linux-kernel, linux-media, linux-mediatek,
	linux-sound, netdev
In-Reply-To: <20250820171302.324142-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>
---
 .../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 0d995b342d463..0766026864c9d 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 v1 09/14] dt-bindings: pinctrl: mediatek,mt65xx-pinctrl: Allow gpio-line-names
From: Ariel D'Alessandro @ 2025-08-20 17:12 UTC (permalink / raw)
  To: airlied, amergnat, andrew+netdev, andrew-ct.chen,
	angelogioacchino.delregno, ariel.dalessandro, broonie,
	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
  Cc: devicetree, dri-devel, linux-arm-kernel, linux-clk, linux-gpio,
	linux-input, linux-kernel, linux-media, linux-mediatek,
	linux-sound, netdev
In-Reply-To: <20250820171302.324142-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 v1 10/14] regulator: dt-bindings: Convert Dialog Semiconductor DA9211 Regulators to YAML
From: Ariel D'Alessandro @ 2025-08-20 17:12 UTC (permalink / raw)
  To: airlied, amergnat, andrew+netdev, andrew-ct.chen,
	angelogioacchino.delregno, ariel.dalessandro, broonie,
	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
  Cc: devicetree, dri-devel, linux-arm-kernel, linux-clk, linux-gpio,
	linux-input, linux-kernel, linux-media, linux-mediatek,
	linux-sound, netdev
In-Reply-To: <20250820171302.324142-1-ariel.dalessandro@collabora.com>

Convert the existing text-based DT bindings for Dialog Semiconductor DA9211
Voltage Regulators family to a YAML 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..d4c5b354497f4
--- /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,da9223"
+      - "dlg,da9214"
+      - "dlg,da9224"
+      - "dlg,da9215"
+      - "dlg,da9225"
+
+  reg:
+    maxItems: 1
+
+  interrupts:
+    maxItems: 1
+
+  regulators:
+    type: object
+    additionalProperties: false
+    description: |
+      List of regulators provided by the device
+
+    patternProperties:
+      "^BUCK([A-B])$":
+        type: object
+        $ref: regulator.yaml#
+        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
+            description: Specify a valid GPIO for platform control of the regulator
+
+        unevaluatedProperties: false
+
+required:
+  - compatible
+  - reg
+  - interrupts
+  - regulators
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/regulator/dlg,da9211-regulator.h>
+
+    i2c1 {
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        da9212: 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>;
+                };
+            };
+        };
+    };
+
+...
-- 
2.50.1


^ permalink raw reply related

* [PATCH v1 11/14] arm64: dts: mediatek: mt8173-elm: Drop unused bank supply
From: Ariel D'Alessandro @ 2025-08-20 17:12 UTC (permalink / raw)
  To: airlied, amergnat, andrew+netdev, andrew-ct.chen,
	angelogioacchino.delregno, ariel.dalessandro, broonie,
	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
  Cc: devicetree, dri-devel, linux-arm-kernel, linux-clk, linux-gpio,
	linux-input, linux-kernel, linux-media, linux-mediatek,
	linux-sound, netdev
In-Reply-To: <20250820171302.324142-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 0766026864c9d..b6fe979fcfb10 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 v1 12/14] dt-bindings: soc: mediatek: pwrap: Add power-domains property
From: Ariel D'Alessandro @ 2025-08-20 17:13 UTC (permalink / raw)
  To: airlied, amergnat, andrew+netdev, andrew-ct.chen,
	angelogioacchino.delregno, ariel.dalessandro, broonie,
	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
  Cc: devicetree, dri-devel, linux-arm-kernel, linux-clk, linux-gpio,
	linux-input, linux-kernel, linux-media, linux-mediatek,
	linux-sound, netdev
In-Reply-To: <20250820171302.324142-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>
---
 .../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 v1 13/14] dt-bindings: input/touchscreen: Convert MELFAS MIP4 Touchscreen to YAML
From: Ariel D'Alessandro @ 2025-08-20 17:13 UTC (permalink / raw)
  To: airlied, amergnat, andrew+netdev, andrew-ct.chen,
	angelogioacchino.delregno, ariel.dalessandro, broonie,
	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
  Cc: devicetree, dri-devel, linux-arm-kernel, linux-clk, linux-gpio,
	linux-input, linux-kernel, linux-media, linux-mediatek,
	linux-sound, netdev
In-Reply-To: <20250820171302.324142-1-ariel.dalessandro@collabora.com>

Convert the existing text-based DT bindings for MELFAS MIP4 Touchscreen
controller to a YAML schema.

Signed-off-by: Ariel D'Alessandro <ariel.dalessandro@collabora.com>
---
 .../input/touchscreen/melfas,mip4_ts.yaml     | 55 +++++++++++++++++++
 .../input/touchscreen/melfas_mip4.txt         | 20 -------
 2 files changed, 55 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..170fd4212467e
--- /dev/null
+++ b/Documentation/devicetree/bindings/input/touchscreen/melfas,mip4_ts.yaml
@@ -0,0 +1,55 @@
+# 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
+    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 v1 14/14] dt-bindings: media: mediatek,jpeg: Fix jpeg encoder/decoder ranges
From: Ariel D'Alessandro @ 2025-08-20 17:13 UTC (permalink / raw)
  To: airlied, amergnat, andrew+netdev, andrew-ct.chen,
	angelogioacchino.delregno, ariel.dalessandro, broonie,
	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
  Cc: devicetree, dri-devel, linux-arm-kernel, linux-clk, linux-gpio,
	linux-input, linux-kernel, linux-media, linux-mediatek,
	linux-sound, netdev
In-Reply-To: <20250820171302.324142-1-ariel.dalessandro@collabora.com>

Commit 14176e94bb35d ("arm64: dts: mediatek: mt8195: Fix ranges for jpeg
enc/decoder nodes") redefined jpeg encoder/decoder children node ranges.
Update the related device tree binding yaml definition to match
mediatek/mt8195.dtsi, as this is currently the only one using it.

Signed-off-by: Ariel D'Alessandro <ariel.dalessandro@collabora.com>
---
 .../media/mediatek,mt8195-jpegdec.yaml        | 31 ++++++++++---------
 .../media/mediatek,mt8195-jpegenc.yaml        | 15 ++++-----
 2 files changed, 24 insertions(+), 22 deletions(-)

diff --git a/Documentation/devicetree/bindings/media/mediatek,mt8195-jpegdec.yaml b/Documentation/devicetree/bindings/media/mediatek,mt8195-jpegdec.yaml
index e5448c60e3eb5..b1f3df258dc87 100644
--- a/Documentation/devicetree/bindings/media/mediatek,mt8195-jpegdec.yaml
+++ b/Documentation/devicetree/bindings/media/mediatek,mt8195-jpegdec.yaml
@@ -36,7 +36,7 @@ properties:
 
 # Required child node:
 patternProperties:
-  "^jpgdec@[0-9a-f]+$":
+  "^jpgdec@[0-9],[0-9a-f]+$":
     type: object
     description:
       The jpeg decoder hardware device node which should be added as subnodes to
@@ -100,22 +100,23 @@ examples:
         #address-cells = <2>;
         #size-cells = <2>;
 
-        jpgdec-master {
+        jpeg-decoder@1a040000 {
             compatible = "mediatek,mt8195-jpgdec";
             power-domains = <&spm MT8195_POWER_DOMAIN_VDEC1>;
-            iommus = <&iommu_vpp M4U_PORT_L19_JPGDEC_WDMA0>,
-                     <&iommu_vpp M4U_PORT_L19_JPGDEC_BSDMA0>,
-                     <&iommu_vpp M4U_PORT_L19_JPGDEC_WDMA1>,
-                     <&iommu_vpp M4U_PORT_L19_JPGDEC_BSDMA1>,
-                     <&iommu_vpp M4U_PORT_L19_JPGDEC_BUFF_OFFSET1>,
-                     <&iommu_vpp M4U_PORT_L19_JPGDEC_BUFF_OFFSET0>;
+            iommus = <&iommu_vdo M4U_PORT_L19_JPGDEC_WDMA0>,
+                     <&iommu_vdo M4U_PORT_L19_JPGDEC_BSDMA0>,
+                     <&iommu_vdo M4U_PORT_L19_JPGDEC_WDMA1>,
+                     <&iommu_vdo M4U_PORT_L19_JPGDEC_BSDMA1>,
+                     <&iommu_vdo M4U_PORT_L19_JPGDEC_BUFF_OFFSET1>,
+                     <&iommu_vdo M4U_PORT_L19_JPGDEC_BUFF_OFFSET0>;
             #address-cells = <2>;
             #size-cells = <2>;
-            ranges;
+            ranges = <0 0 0 0x1a040000 0 0x20000>,
+                     <1 0 0 0x1b040000 0 0x10000>;
 
-            jpgdec@1a040000 {
+            jpgdec@0,0 {
                 compatible = "mediatek,mt8195-jpgdec-hw";
-                reg = <0 0x1a040000 0 0x10000>;/* JPGDEC_C0 */
+                reg = <0 0 0 0x10000>;/* JPGDEC_C0 */
                 iommus = <&iommu_vdo M4U_PORT_L19_JPGDEC_WDMA0>,
                          <&iommu_vdo M4U_PORT_L19_JPGDEC_BSDMA0>,
                          <&iommu_vdo M4U_PORT_L19_JPGDEC_WDMA1>,
@@ -128,9 +129,9 @@ examples:
                 power-domains = <&spm MT8195_POWER_DOMAIN_VDEC0>;
             };
 
-            jpgdec@1a050000 {
+            jpgdec@0,10000 {
                 compatible = "mediatek,mt8195-jpgdec-hw";
-                reg = <0 0x1a050000 0 0x10000>;/* JPGDEC_C1 */
+                reg = <0 0 0x10000 0x10000>;/* JPGDEC_C1 */
                 iommus = <&iommu_vdo M4U_PORT_L19_JPGDEC_WDMA0>,
                          <&iommu_vdo M4U_PORT_L19_JPGDEC_BSDMA0>,
                          <&iommu_vdo M4U_PORT_L19_JPGDEC_WDMA1>,
@@ -143,9 +144,9 @@ examples:
                 power-domains = <&spm MT8195_POWER_DOMAIN_VDEC1>;
             };
 
-            jpgdec@1b040000 {
+            jpgdec@1,0 {
                 compatible = "mediatek,mt8195-jpgdec-hw";
-                reg = <0 0x1b040000 0 0x10000>;/* JPGDEC_C2 */
+                reg = <1 0 0 0x10000>;/* JPGDEC_C2 */
                 iommus = <&iommu_vpp M4U_PORT_L20_JPGDEC_WDMA0>,
                          <&iommu_vpp M4U_PORT_L20_JPGDEC_BSDMA0>,
                          <&iommu_vpp M4U_PORT_L20_JPGDEC_WDMA1>,
diff --git a/Documentation/devicetree/bindings/media/mediatek,mt8195-jpegenc.yaml b/Documentation/devicetree/bindings/media/mediatek,mt8195-jpegenc.yaml
index 596186497b684..190e4e7470195 100644
--- a/Documentation/devicetree/bindings/media/mediatek,mt8195-jpegenc.yaml
+++ b/Documentation/devicetree/bindings/media/mediatek,mt8195-jpegenc.yaml
@@ -36,7 +36,7 @@ properties:
 
 # Required child node:
 patternProperties:
-  "^jpgenc@[0-9a-f]+$":
+  "^jpgenc@[0-9],[0-9a-f]+$":
     type: object
     description:
       The jpeg encoder hardware device node which should be added as subnodes to
@@ -100,7 +100,7 @@ examples:
         #address-cells = <2>;
         #size-cells = <2>;
 
-        jpgenc-master {
+        jpeg-encoder@1a030000 {
             compatible = "mediatek,mt8195-jpgenc";
             power-domains = <&spm MT8195_POWER_DOMAIN_VENC_CORE1>;
             iommus = <&iommu_vpp M4U_PORT_L20_JPGENC_Y_RDMA>,
@@ -109,11 +109,12 @@ examples:
                      <&iommu_vpp M4U_PORT_L20_JPGENC_BSDMA>;
             #address-cells = <2>;
             #size-cells = <2>;
-            ranges;
+            ranges = <0 0 0 0x1a030000 0 0x10000>,
+                     <1 0 0 0x1b030000 0 0x10000>;
 
-            jpgenc@1a030000 {
+            jpgenc@0,0 {
                 compatible = "mediatek,mt8195-jpgenc-hw";
-                reg = <0 0x1a030000 0 0x10000>;
+                reg = <0 0 0 0x10000>;
                 iommus = <&iommu_vdo M4U_PORT_L19_JPGENC_Y_RDMA>,
                          <&iommu_vdo M4U_PORT_L19_JPGENC_C_RDMA>,
                          <&iommu_vdo M4U_PORT_L19_JPGENC_Q_TABLE>,
@@ -124,9 +125,9 @@ examples:
                 power-domains = <&spm MT8195_POWER_DOMAIN_VENC>;
             };
 
-            jpgenc@1b030000 {
+            jpgenc@1,0 {
                 compatible = "mediatek,mt8195-jpgenc-hw";
-                reg = <0 0x1b030000 0 0x10000>;
+                reg = <1 0 0 0x10000>;
                 iommus = <&iommu_vpp M4U_PORT_L20_JPGENC_Y_RDMA>,
                          <&iommu_vpp M4U_PORT_L20_JPGENC_C_RDMA>,
                          <&iommu_vpp M4U_PORT_L20_JPGENC_Q_TABLE>,
-- 
2.50.1


^ permalink raw reply related

* Re: [PATCH v1 00/14] MediaTek dt-bindings sanitization (MT8173)
From: Mark Brown @ 2025-08-20 17:19 UTC (permalink / raw)
  To: Ariel D'Alessandro
  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: <20250820171302.324142-1-ariel.dalessandro@collabora.com>

[-- Attachment #1: Type: text/plain, Size: 1001 bytes --]

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.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply

* [PATCH v6] platform/x86: Add WMI driver for Redmibook keyboard.
From: Gladyshev Ilya @ 2025-08-20 17:41 UTC (permalink / raw)
  To: foxido
  Cc: w_armin, linux-input, nikita.nikita.krasnov, Armin Wolf,
	Hans de Goede, Ilpo Järvinen, linux-kernel,
	platform-driver-x86

This driver implements support for various Fn keys (like Cut) and Xiaomi
specific AI button.

Reviewed-by: Armin Wolf <W_Armin@gmx.de>
Signed-off-by: Gladyshev Ilya <foxido@foxido.dev>
---
Changes since v5:
- Fix var declaration in the middle of the func

Link to v5: https://lore.kernel.org/platform-driver-x86/20250813153137.18355-1-foxido@foxido.dev/
---
 MAINTAINERS                      |   6 ++
 drivers/platform/x86/Kconfig     |  12 +++
 drivers/platform/x86/Makefile    |   1 +
 drivers/platform/x86/redmi-wmi.c | 129 +++++++++++++++++++++++++++++++
 4 files changed, 148 insertions(+)
 create mode 100644 drivers/platform/x86/redmi-wmi.c

diff --git a/MAINTAINERS b/MAINTAINERS
index c0b444e5fd5a..eb25fb10e751 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -20965,6 +20965,12 @@ S:	Maintained
 T:	git https://github.com/pkshih/rtw.git
 F:	drivers/net/wireless/realtek/rtw89/
 
+REDMIBOOK WMI DRIVERS
+M:	Gladyshev Ilya <foxido@foxido.dev>
+L:	platform-driver-x86@vger.kernel.org
+S:	Maintained
+F:	drivers/platform/x86/redmi-wmi.c
+
 REDPINE WIRELESS DRIVER
 L:	linux-wireless@vger.kernel.org
 S:	Orphan
diff --git a/drivers/platform/x86/Kconfig b/drivers/platform/x86/Kconfig
index e5cbd58a99f3..9f98a7042e43 100644
--- a/drivers/platform/x86/Kconfig
+++ b/drivers/platform/x86/Kconfig
@@ -109,6 +109,18 @@ config XIAOMI_WMI
 	  To compile this driver as a module, choose M here: the module will
 	  be called xiaomi-wmi.
 
+config REDMI_WMI
+	tristate "Redmibook WMI key driver"
+	depends on ACPI_WMI
+	depends on INPUT
+	select INPUT_SPARSEKMAP
+	help
+	  Say Y here if you want support for WMI-based hotkey events on
+	  Xiaomi Redmibook devices.
+
+	  To compile this driver as a module, choose M here: the module will
+	  be called redmi-wmi.
+
 config GIGABYTE_WMI
 	tristate "Gigabyte WMI temperature driver"
 	depends on ACPI_WMI
diff --git a/drivers/platform/x86/Makefile b/drivers/platform/x86/Makefile
index bea87a85ae75..406dd0807ba7 100644
--- a/drivers/platform/x86/Makefile
+++ b/drivers/platform/x86/Makefile
@@ -13,6 +13,7 @@ obj-$(CONFIG_HUAWEI_WMI)		+= huawei-wmi.o
 obj-$(CONFIG_MXM_WMI)			+= mxm-wmi.o
 obj-$(CONFIG_NVIDIA_WMI_EC_BACKLIGHT)	+= nvidia-wmi-ec-backlight.o
 obj-$(CONFIG_XIAOMI_WMI)		+= xiaomi-wmi.o
+obj-$(CONFIG_REDMI_WMI)			+= redmi-wmi.o
 obj-$(CONFIG_GIGABYTE_WMI)		+= gigabyte-wmi.o
 
 # Acer
diff --git a/drivers/platform/x86/redmi-wmi.c b/drivers/platform/x86/redmi-wmi.c
new file mode 100644
index 000000000000..cb9f4e639acd
--- /dev/null
+++ b/drivers/platform/x86/redmi-wmi.c
@@ -0,0 +1,129 @@
+// SPDX-License-Identifier: GPL-2.0
+/* WMI driver for Xiaomi Redmibooks */
+
+#include <linux/acpi.h>
+#include <linux/device.h>
+#include <linux/input.h>
+#include <linux/input/sparse-keymap.h>
+#include <linux/module.h>
+#include <linux/mutex.h>
+#include <linux/unaligned.h>
+#include <linux/wmi.h>
+
+#include <uapi/linux/input-event-codes.h>
+
+#define WMI_REDMIBOOK_KEYBOARD_EVENT_GUID "46C93E13-EE9B-4262-8488-563BCA757FEF"
+
+#define AI_KEY_VALUE_MASK 0x00000100
+
+static const struct key_entry redmi_wmi_keymap[] = {
+	{KE_KEY, 0x00000201,	{KEY_SELECTIVE_SCREENSHOT}},
+	{KE_KEY, 0x00000301,	{KEY_ALL_APPLICATIONS}},
+	{KE_KEY, 0x00001b01,	{KEY_SETUP}},
+
+	/* AI button has code for each position */
+	{KE_KEY, 0x00011801,	{KEY_ASSISTANT}},
+	{KE_KEY, 0x00011901,	{KEY_ASSISTANT}},
+
+	/* Keyboard backlight */
+	{KE_IGNORE, 0x00000501, {}},
+	{KE_IGNORE, 0x00800501, {}},
+	{KE_IGNORE, 0x00050501, {}},
+	{KE_IGNORE, 0x000a0501, {}},
+
+	{KE_END}
+};
+
+struct redmi_wmi {
+	struct input_dev *input_dev;
+	/* Protects the key event sequence */
+	struct mutex key_lock;
+};
+
+static int redmi_wmi_probe(struct wmi_device *wdev, const void *context)
+{
+	struct redmi_wmi *data;
+	int err;
+
+	/* Init dev */
+	data = devm_kzalloc(&wdev->dev, sizeof(*data), GFP_KERNEL);
+	if (!data)
+		return -ENOMEM;
+
+	dev_set_drvdata(&wdev->dev, data);
+
+	err = devm_mutex_init(&wdev->dev, &data->key_lock);
+	if (err)
+		return err;
+
+	data->input_dev = devm_input_allocate_device(&wdev->dev);
+	if (!data->input_dev)
+		return -ENOMEM;
+
+	data->input_dev->name = "Redmibook WMI keys";
+	data->input_dev->phys = "wmi/input0";
+
+	err = sparse_keymap_setup(data->input_dev, redmi_wmi_keymap, NULL);
+	if (err)
+		return err;
+
+	return input_register_device(data->input_dev);
+}
+
+static void redmi_wmi_notify(struct wmi_device *wdev, union acpi_object *obj)
+{
+	struct key_entry *entry;
+	struct redmi_wmi *data = dev_get_drvdata(&wdev->dev);
+	bool autorelease = true;
+	u32 payload;
+	int value = 1;
+
+	if (obj->type != ACPI_TYPE_BUFFER) {
+		dev_err(&wdev->dev, "Bad response type %u\n", obj->type);
+		return;
+	}
+
+	if (obj->buffer.length < 32) {
+		dev_err(&wdev->dev, "Invalid buffer length %u\n", obj->buffer.length);
+		return;
+	}
+
+	payload = get_unaligned_le32(obj->buffer.pointer);
+	entry = sparse_keymap_entry_from_scancode(data->input_dev, payload);
+
+	if (!entry) {
+		dev_dbg(&wdev->dev, "Unknown WMI event with payload %u", payload);
+		return;
+	}
+
+	/* AI key quirk */
+	if (entry->keycode == KEY_ASSISTANT) {
+		value = !(payload & AI_KEY_VALUE_MASK);
+		autorelease = false;
+	}
+
+	guard(mutex)(&data->key_lock);
+	sparse_keymap_report_entry(data->input_dev, entry, value, autorelease);
+}
+
+static const struct wmi_device_id redmi_wmi_id_table[] = {
+	{ WMI_REDMIBOOK_KEYBOARD_EVENT_GUID, NULL },
+	{ }
+};
+
+static struct wmi_driver redmi_wmi_driver = {
+	.driver = {
+		.name = "redmi-wmi",
+		.probe_type = PROBE_PREFER_ASYNCHRONOUS,
+	},
+	.id_table = redmi_wmi_id_table,
+	.probe = redmi_wmi_probe,
+	.notify = redmi_wmi_notify,
+	.no_singleton = true,
+};
+module_wmi_driver(redmi_wmi_driver);
+
+MODULE_DEVICE_TABLE(wmi, redmi_wmi_id_table);
+MODULE_AUTHOR("Gladyshev Ilya <foxido@foxido.dev>");
+MODULE_DESCRIPTION("Redmibook WMI driver");
+MODULE_LICENSE("GPL");
-- 
2.50.0


^ permalink raw reply related


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox