Linux Input/HID development
 help / color / mirror / Atom feed
* goodix touchscreen: Issues on Ayaneo Flip DS (GDIX1002)
From: J Deckerido @ 2025-08-17  0:05 UTC (permalink / raw)
  To: linux-input

There was previous discussion for GDIX1003 (Flip DS bottom screen)
support in the goodix driver, and adding "GDIX1003" to acpi_device_id
for goodix_acpi_match worked.

However there remains issues for the top screen:

1. The config from the device isn't read properly, and the driver
assigns the default max x y and a max touch num of 1 to the device.
(GDIX1002 has the same bus as GDIX1003 on Ayaneo Flip DS, former has
addr 0x1, while latter has addr 0x14, and the latter's config loads
fine.)

2. The touch data read from the device is only valid for the first
touch (if max touch num is overridden in the source code). It seems
when reading from addr += header_contact_keycode_size, the device
treats the addr as the original GOODIX_READ_COOR_ADDR anyway. In other
words, unless it's an issue with configuring the device, we should
always read from GOODIX_READ_COOR_ADDR instead of an offset from it
for subsequent touches.

3. Timeout may be too short, as the device's touch up events are
sometimes skipped, making the touchscreen seem stuck.

Apologies if some info is irrelevant. I tried to fix it on my end
since I have a device, however issue 1 is very confusing to me. Advice
is appreciated!

Thanks and regards,

J

^ permalink raw reply

* [Bug][Patch] /dev/input/jsX absent for Nintendo Switch Pro controller
From: Tom Benham @ 2025-08-16 18:24 UTC (permalink / raw)
  To: linux-input; +Cc: linux-kernel


[-- Attachment #1.1: Type: text/plain, Size: 2447 bytes --]

First and foremost, apologies if this report is not properly done or 
formatted or whatever regarding the kernel development process. Feel 
free to correct me if I did something wrong.

Distribution: ArchLinux

|$ cat /proc/version
Linux version 6.16-arch2-1 (linux@archlinux) (gcc (GCC) 15.2.1 20250813, 
GNU ld (GNU Binutils) 2.45.0) #3 SMP PREEMPT_DYNAMIC Sat, 16 Aug 2025 
16:19:12 +0000
|
Problem description:
When plugging a Nintendo Switch Pro controller, the |/dev/input/js0| 
file does not get created.

Problem analysis:
I think I have pinpointed the bug in the hid-nintendo.c driver.

  * joydev (who is responsible for creating |/dev/input/js0|) is not
    handling the device.
  * However, joydev receives the handling request from input.c only for
    the IMU device (the accelerometer), which is blacklisted (totally
    normal) so we get the following message when activating debug
    messages in joydev:
      o |input input39: joydev: blacklisting 'Nintendo Co., Ltd. Pro
        Controller (IMU)'|
  * joydev is looking for |absbit| and |keybit| in order to match a
    device (defined in |joydev_ids| array)
  * But for the regular device (not IMU), |absbit| and |keybit| are 0
  * The reason is that in |joycon_input_create|, |input_register_device|
    is called BEFORE setting the bits (which happen in |joycon_config_*|)
  * This change was introduced in commit
    94f18bb19945915fcdfd1903841020ef1b6af44a
  * Before that, |input_register_device| was called AFTER setting the bits
  * So, possible regression ? I can't test with older kernels unfortunately

I attached the simple patch that works for me.

Would it also make sense to move the rumble config before the call to 
|input_register_device| ? It was moved after the IMU device creation in 
the same commit, although I am not sure if it NEEDS to be. Let me know 
what you think of that.

Unrelated to the bug but I noticed during my testing that when first 
plugging the controller, when the hid_nintendo module is not loaded, 
hid-generic handles it but then it gets disconnected right after and 
hid_nintendo takes over. I'm very new to kernel debugging so I don't 
know if this behavior is normal but I guess it is. What's funny is that 
because hid-generic doesn't have the same bug, the |/dev/input/js0| 
device gets created and then immediately removed. You can see it if you 
|ls| continuously the |/dev/input| folder. This was very confusing at 
first !

[-- Attachment #1.2: Type: text/html, Size: 3191 bytes --]

[-- Attachment #2: hid_nintendo.patch --]
[-- Type: text/x-patch, Size: 861 bytes --]

diff --git a/drivers/hid/hid-nintendo.c b/drivers/hid/hid-nintendo.c
index fb4985988615..a21618b42c38 100644
--- a/drivers/hid/hid-nintendo.c
+++ b/drivers/hid/hid-nintendo.c
@@ -2138,10 +2138,6 @@ static int joycon_input_create(struct joycon_ctlr *ctlr)
 	ctlr->input->phys = hdev->phys;
 	input_set_drvdata(ctlr->input, ctlr);
 
-	ret = input_register_device(ctlr->input);
-	if (ret)
-		return ret;
-
 	if (joycon_type_is_right_joycon(ctlr)) {
 		joycon_config_right_stick(ctlr->input);
 		joycon_config_buttons(ctlr->input, right_joycon_button_mappings);
@@ -2172,6 +2168,10 @@ static int joycon_input_create(struct joycon_ctlr *ctlr)
 		joycon_config_buttons(ctlr->input, n64con_button_mappings);
 	}
 
+	ret = input_register_device(ctlr->input);
+	if (ret)
+		return ret;
+
 	if (joycon_has_imu(ctlr)) {
 		ret = joycon_imu_input_create(ctlr);
 		if (ret)

^ permalink raw reply related

* [PATCH v3 6/6] dt-bindings: gpio: ti,twl4030: Correct the schema $id path
From: Jihed Chaibi @ 2025-08-16  2:15 UTC (permalink / raw)
  To: linux-kernel
  Cc: andreas, peter.ujfalusi, dmitry.torokhov, robh, krzk+dt,
	lgirdwood, tiwai, conor+dt, lee, ukleinek, broonie, gregkh,
	linus.walleij, brgl, aaro.koskinen, khilman, rogerq, tony,
	linux-gpio, linux-input, devicetree, linux-pwm, linux-sound,
	linux-usb, linux-omap, shuah, jihed.chaibi.dev
In-Reply-To: <20250816021523.167049-1-jihed.chaibi.dev@gmail.com>

The $id for a binding should match its file path. The ti,twl4030-gpio
binding is located in the gpio/ subdirectory but was missing this from
its $id.

Correct the path to follow the standard convention.

Signed-off-by: Jihed Chaibi <jihed.chaibi.dev@gmail.com>
---
 Documentation/devicetree/bindings/gpio/ti,twl4030-gpio.yaml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/gpio/ti,twl4030-gpio.yaml b/Documentation/devicetree/bindings/gpio/ti,twl4030-gpio.yaml
index 5e3e199fd..96d50d14c 100644
--- a/Documentation/devicetree/bindings/gpio/ti,twl4030-gpio.yaml
+++ b/Documentation/devicetree/bindings/gpio/ti,twl4030-gpio.yaml
@@ -1,7 +1,7 @@
 # SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
 %YAML 1.2
 ---
-$id: http://devicetree.org/schemas/ti,twl4030-gpio.yaml#
+$id: http://devicetree.org/schemas/gpio/ti,twl4030-gpio.yaml#
 $schema: http://devicetree.org/meta-schemas/core.yaml#
 
 title: TI TWL4030 GPIO controller
-- 
2.39.5


^ permalink raw reply related

* [PATCH v3 5/6] usb: dt-bindings: ti,twlxxxx-usb: convert to DT schema
From: Jihed Chaibi @ 2025-08-16  2:15 UTC (permalink / raw)
  To: linux-kernel
  Cc: andreas, peter.ujfalusi, dmitry.torokhov, robh, krzk+dt,
	lgirdwood, tiwai, conor+dt, lee, ukleinek, broonie, gregkh,
	linus.walleij, brgl, aaro.koskinen, khilman, rogerq, tony,
	linux-gpio, linux-input, devicetree, linux-pwm, linux-sound,
	linux-usb, linux-omap, shuah, jihed.chaibi.dev
In-Reply-To: <20250816021523.167049-1-jihed.chaibi.dev@gmail.com>

Convert the legacy TXT binding for the TWL4030/6030 USB module
to the modern YAML DT schema format. This adds formal validation
and improves documentation using a conditional schema.

Signed-off-by: Jihed Chaibi <jihed.chaibi.dev@gmail.com>

---
Changes in v3:
 - No changes.

Changes in v2:
 - Added '#phy-cells' property to support PHY framework integration.
---
 .../bindings/usb/ti,twlxxxx-usb.yaml          | 125 ++++++++++++++++++
 .../devicetree/bindings/usb/twlxxxx-usb.txt   |  43 ------
 2 files changed, 125 insertions(+), 43 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/usb/ti,twlxxxx-usb.yaml
 delete mode 100644 Documentation/devicetree/bindings/usb/twlxxxx-usb.txt

diff --git a/Documentation/devicetree/bindings/usb/ti,twlxxxx-usb.yaml b/Documentation/devicetree/bindings/usb/ti,twlxxxx-usb.yaml
new file mode 100644
index 000000000..48ff5b732
--- /dev/null
+++ b/Documentation/devicetree/bindings/usb/ti,twlxxxx-usb.yaml
@@ -0,0 +1,125 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/usb/ti,twlxxxx-usb.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Texas Instruments TWL4030/6030 USB PHY and Comparator
+
+maintainers:
+  - Peter Ujfalusi <peter.ujfalusi@gmail.com>
+
+description: |
+  Bindings for the USB PHY and comparator module found within the
+  TWL4030 and TWL6030 family of companion chips.
+
+  TWL6030: USB COMPARATOR
+  TWL4030: USB COMPARATOR & PHY
+
+  If a sibling node is compatible with "ti,twl4030-bci", the driver for
+  that node will query this device for USB power status.
+
+properties:
+  compatible:
+    enum:
+      - ti,twl4030-usb
+      - ti,twl6030-usb
+
+  interrupts:
+    description: |
+      Interrupts for ID and VBUS events.
+      For "ti,twl6030-usb", two interrupts must be specified:
+        - The first is the OTG interrupt for ID events (host mode).
+        - The second is the USB interrupt for VBUS events (device mode).
+      For "ti,twl4030-usb", one or two interrupts can be specified:
+        - The first is the OTG interrupt for both ID and VBUS events.
+        - The second is optional.
+    minItems: 1
+    maxItems: 2
+
+  usb-supply:
+    description:
+      Phandle to the VUSB regulator. For TWL6030, this should be the 'vusb'
+      regulator. For TWL6032 subclass, it should be the 'ldousb' regulator.
+
+  usb1v5-supply:
+    description: Phandle to the VUSB1V5 regulator (for TWL4030).
+
+  usb1v8-supply:
+    description: Phandle to the VUSB1V8 regulator (for TWL4030).
+
+  usb3v1-supply:
+    description: Phandle to the USB3V1 regulator (for TWL4030).
+
+  usb_mode:
+    description: |
+      The mode used by the PHY (TWL4030 ONLY) to connect to the controller:
+        1: ULPI mode
+        2: CEA2011_3PIN mode
+    $ref: /schemas/types.yaml#/definitions/uint32
+    enum: [1, 2]
+
+  '#phy-cells':
+    const: 0
+
+required:
+  - compatible
+  - interrupts
+
+additionalProperties: false
+
+if:
+  properties:
+    compatible:
+      contains:
+        const: ti,twl6030-usb
+then:
+  required:
+    - usb-supply
+  properties:
+    interrupts:
+      minItems: 2
+else:
+  required:
+    - usb1v5-supply
+    - usb1v8-supply
+    - usb3v1-supply
+    - usb_mode
+
+examples:
+  - |
+    i2c {
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        twl@48 {
+            reg = <0x48>;
+
+            usb_phy: twl4030-usb {
+                compatible = "ti,twl4030-usb";
+                interrupts = <10 4>;  // 1 interrupt: OTG (ID & VBUS events)
+                interrupt-parent = <&gic>;
+                usb1v5-supply = <&reg_vusb1v5>;
+                usb1v8-supply = <&reg_vusb1v8>;
+                usb3v1-supply  = <&reg_vusb3v1>;
+                usb_mode = <1>;
+                #phy-cells = <0>;
+            };
+        };
+    };
+  - |
+    i2c {
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        twl@48 {
+            reg = <0x48>;
+
+            usb_comp: twl6030-usb {
+                compatible = "ti,twl6030-usb";
+                interrupts = <4 4>, <10 4>;  // 2 interrupts: OTG & USB
+                interrupt-parent = <&gic>;
+                usb-supply = <&reg_vusb>;
+            };
+        };
+    };
diff --git a/Documentation/devicetree/bindings/usb/twlxxxx-usb.txt b/Documentation/devicetree/bindings/usb/twlxxxx-usb.txt
deleted file mode 100644
index 17327a296..000000000
--- a/Documentation/devicetree/bindings/usb/twlxxxx-usb.txt
+++ /dev/null
@@ -1,43 +0,0 @@
-USB COMPARATOR OF TWL CHIPS
-
-TWL6030 USB COMPARATOR
- - compatible : Should be "ti,twl6030-usb"
- - interrupts : Two interrupt numbers to the cpu should be specified. First
-   interrupt number is the otg interrupt number that raises ID interrupts when
-   the controller has to act as host and the second interrupt number is the
-   usb interrupt number that raises VBUS interrupts when the controller has to
-   act as device
- - usb-supply : phandle to the regulator device tree node. It should be vusb
-   if it is twl6030 or ldousb if it is twl6032 subclass.
-
-twl6030-usb {
-	compatible = "ti,twl6030-usb";
-	interrupts = < 4 10 >;
-};
-
-Board specific device node entry
-&twl6030-usb {
-	usb-supply = <&vusb>;
-};
-
-TWL4030 USB PHY AND COMPARATOR
- - compatible : Should be "ti,twl4030-usb"
- - interrupts : The interrupt numbers to the cpu should be specified. First
-   interrupt number is the otg interrupt number that raises ID interrupts
-   and VBUS interrupts. The second interrupt number is optional.
- - <supply-name>-supply : phandle to the regulator device tree node.
-   <supply-name> should be vusb1v5, vusb1v8 and vusb3v1
- - usb_mode : The mode used by the phy to connect to the controller. "1"
-   specifies "ULPI" mode and "2" specifies "CEA2011_3PIN" mode.
-
-If a sibling node is compatible "ti,twl4030-bci", then it will find
-this device and query it for USB power status.
-
-twl4030-usb {
-	compatible = "ti,twl4030-usb";
-	interrupts = < 10 4 >;
-	usb1v5-supply = <&vusb1v5>;
-	usb1v8-supply = <&vusb1v8>;
-	usb3v1-supply = <&vusb3v1>;
-	usb_mode = <1>;
-};
-- 
2.39.5


^ permalink raw reply related

* [PATCH v3 4/6] ASoC: dt-bindings: omap-twl4030: convert to DT schema
From: Jihed Chaibi @ 2025-08-16  2:15 UTC (permalink / raw)
  To: linux-kernel
  Cc: andreas, peter.ujfalusi, dmitry.torokhov, robh, krzk+dt,
	lgirdwood, tiwai, conor+dt, lee, ukleinek, broonie, gregkh,
	linus.walleij, brgl, aaro.koskinen, khilman, rogerq, tony,
	linux-gpio, linux-input, devicetree, linux-pwm, linux-sound,
	linux-usb, linux-omap, shuah, jihed.chaibi.dev
In-Reply-To: <20250816021523.167049-1-jihed.chaibi.dev@gmail.com>

Convert the legacy TXT binding for the OMAP TWL4030 sound card
to the modern YAML DT schema format. This adds formal validation
and improves documentation.

Acked-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Jihed Chaibi <jihed.chaibi.dev@gmail.com>

---
Changes in v3:
 - No change to binding content, only updating commit message format.

Changes in v2:
 - Fixed comment formatting (added spaces for better alignment).
 - Updated commit subject to align with subsystem style.
 - Retained Acked-by from v1 as changes are cosmetic.
---
 .../bindings/sound/omap-twl4030.txt           |  62 -----------
 .../bindings/sound/ti,omap-twl4030.yaml       | 102 ++++++++++++++++++
 2 files changed, 102 insertions(+), 62 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/sound/omap-twl4030.txt
 create mode 100644 Documentation/devicetree/bindings/sound/ti,omap-twl4030.yaml

diff --git a/Documentation/devicetree/bindings/sound/omap-twl4030.txt b/Documentation/devicetree/bindings/sound/omap-twl4030.txt
deleted file mode 100644
index f6a715e4e..000000000
--- a/Documentation/devicetree/bindings/sound/omap-twl4030.txt
+++ /dev/null
@@ -1,62 +0,0 @@
-* Texas Instruments SoC with twl4030 based audio setups
-
-Required properties:
-- compatible: "ti,omap-twl4030"
-- ti,model: Name of the sound card (for example "omap3beagle")
-- ti,mcbsp: phandle for the McBSP node
-
-Optional properties:
-- ti,codec: phandle for the twl4030 audio node
-- ti,mcbsp-voice: phandle for the McBSP node connected to the voice port of twl
-- ti, jack-det-gpio: Jack detect GPIO
-- ti,audio-routing: List of connections between audio components.
-  Each entry is a pair of strings, the first being the connection's sink,
-  the second being the connection's source.
-  If the routing is not provided all possible connection will be available
-
-Available audio endpoints for the audio-routing table:
-
-Board connectors:
- * Headset Stereophone
- * Earpiece Spk
- * Handsfree Spk
- * Ext Spk
- * Main Mic
- * Sub Mic
- * Headset Mic
- * Carkit Mic
- * Digital0 Mic
- * Digital1 Mic
- * Line In
-
-twl4030 pins:
- * HSOL
- * HSOR
- * EARPIECE
- * HFL
- * HFR
- * PREDRIVEL
- * PREDRIVER
- * CARKITL
- * CARKITR
- * MAINMIC
- * SUBMIC
- * HSMIC
- * DIGIMIC0
- * DIGIMIC1
- * CARKITMIC
- * AUXL
- * AUXR
-
- * Headset Mic Bias
- * Mic Bias 1 /* Used for Main Mic or Digimic0 */
- * Mic Bias 2 /* Used for Sub Mic or Digimic1 */
-
-Example:
-
-sound {
-	compatible = "ti,omap-twl4030";
-	ti,model = "omap3beagle";
-
-	ti,mcbsp = <&mcbsp2>;
-};
diff --git a/Documentation/devicetree/bindings/sound/ti,omap-twl4030.yaml b/Documentation/devicetree/bindings/sound/ti,omap-twl4030.yaml
new file mode 100644
index 000000000..7c9371860
--- /dev/null
+++ b/Documentation/devicetree/bindings/sound/ti,omap-twl4030.yaml
@@ -0,0 +1,102 @@
+# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/sound/ti,omap-twl4030.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Texas Instruments SoC with twl4030 based audio setups
+
+maintainers:
+  - Peter Ujfalusi <peter.ujfalusi@gmail.com>
+
+description:
+  Bindings for audio setups on TI OMAP SoCs using TWL4030-family audio
+  codec connected via a McBSP port.
+
+properties:
+  compatible:
+    const: ti,omap-twl4030
+
+  ti,model:
+    $ref: /schemas/types.yaml#/definitions/string
+    description: Name of the sound card (for example "omap3beagle").
+
+  ti,mcbsp:
+    $ref: /schemas/types.yaml#/definitions/phandle
+    description: phandle for the McBSP node.
+
+  ti,codec:
+    $ref: /schemas/types.yaml#/definitions/phandle
+    description: phandle for the twl4030 audio node.
+
+  ti,mcbsp-voice:
+    $ref: /schemas/types.yaml#/definitions/phandle
+    description: phandle to the McBSP node connected to the voice port.
+
+  ti,jack-det-gpio:
+    description: GPIO specifier for jack detection.
+    maxItems: 1
+
+  ti,audio-routing:
+    description: |
+      A list of audio routing connections. Each entry is a pair of strings,
+      with the first being the connection's sink and the second being the
+      source. If not provided, all possible connections are available.
+
+      Available TWL4030 Pins:  "HFL", "HFR",
+        "PREDRIVEL", "PREDRIVER", "CARKITL", "CARKITR", "MAINMIC", "SUBMIC",
+        "HSMIC", "DIGIMIC0", "DIGIMIC1", "CARKITMIC", "AUXL", "AUXR",
+        "Headset Mic Bias", "Mic Bias 1", "Mic Bias 2"
+    $ref: /schemas/types.yaml#/definitions/non-unique-string-array
+    items:
+      enum:
+        # Board Connectors
+        - Headset Stereophone
+        - Earpiece Spk
+        - Handsfree Spk
+        - Ext Spk
+        - Main Mic
+        - Sub Mic
+        - Headset Mic
+        - Carkit Mic
+        - Digital0 Mic
+        - Digital1 Mic
+        - Line In
+
+        # CODEC Pins
+        - HSOL
+        - HSOR
+        - EARPIECE
+        - HFL
+        - HFR
+        - PREDRIVEL
+        - PREDRIVER
+        - CARKITL
+        - CARKITR
+        - MAINMIC
+        - SUBMIC
+        - HSMIC
+        - DIGIMIC0
+        - DIGIMIC1
+        - CARKITMIC
+        - AUXL
+        - AUXR
+
+        # Headset Mic Bias
+        - Mic Bias 1   # Used for Main Mic or Digimic0
+        - Mic Bias 2   # Used for Sub Mic or Digimic1
+
+required:
+  - compatible
+  - ti,model
+  - ti,mcbsp
+
+additionalProperties: false
+
+examples:
+  - |
+    sound {
+        compatible = "ti,omap-twl4030";
+        ti,model = "omap3beagle";
+        ti,mcbsp = <&mcbsp2>;
+    };
-- 
2.39.5


^ permalink raw reply related

* [PATCH v3 3/6] input: dt-bindings: ti,twl4030-keypad: convert to DT schema
From: Jihed Chaibi @ 2025-08-16  2:15 UTC (permalink / raw)
  To: linux-kernel
  Cc: andreas, peter.ujfalusi, dmitry.torokhov, robh, krzk+dt,
	lgirdwood, tiwai, conor+dt, lee, ukleinek, broonie, gregkh,
	linus.walleij, brgl, aaro.koskinen, khilman, rogerq, tony,
	linux-gpio, linux-input, devicetree, linux-pwm, linux-sound,
	linux-usb, linux-omap, shuah, jihed.chaibi.dev
In-Reply-To: <20250816021523.167049-1-jihed.chaibi.dev@gmail.com>

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 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

diff --git a/Documentation/devicetree/bindings/input/ti,twl4030-keypad.yaml b/Documentation/devicetree/bindings/input/ti,twl4030-keypad.yaml
new file mode 100644
index 000000000..c69aa7f5c
--- /dev/null
+++ b/Documentation/devicetree/bindings/input/ti,twl4030-keypad.yaml
@@ -0,0 +1,59 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/input/ti,twl4030-keypad.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Texas Instruments TWL4030-family Keypad Controller
+
+maintainers:
+  - Peter Ujfalusi <peter.ujfalusi@gmail.com>
+
+description:
+  TWL4030's Keypad controller is used to interface a SoC with a matrix-type
+  keypad device. The keypad controller supports multiple row and column lines.
+  A key can be placed at each intersection of a unique row and a unique column.
+  The keypad controller can sense a key-press and key-release and report the
+  event using a interrupt to the cpu.
+
+allOf:
+  - $ref: matrix-keymap.yaml#
+
+properties:
+  compatible:
+    const: ti,twl4030-keypad
+
+  interrupts:
+    maxItems: 1
+
+required:
+  - compatible
+  - interrupts
+  - keypad,num-rows
+  - keypad,num-columns
+  - linux,keymap
+
+unevaluatedProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/input/input.h>
+
+    keypad {
+        compatible = "ti,twl4030-keypad";
+        interrupts = <1>;
+        keypad,num-rows = <8>;
+        keypad,num-columns = <8>;
+        linux,keymap = <
+            /* row 0 */
+            MATRIX_KEY(0, 0, KEY_1)
+            MATRIX_KEY(0, 1, KEY_2)
+            MATRIX_KEY(0, 2, KEY_3)
+
+            /* ...and so on for a full 8x8 matrix... */
+
+            /* row 7 */
+            MATRIX_KEY(7, 6, KEY_Y)
+            MATRIX_KEY(7, 7, KEY_Z)
+        >;
+    };
diff --git a/Documentation/devicetree/bindings/input/twl4030-keypad.txt b/Documentation/devicetree/bindings/input/twl4030-keypad.txt
deleted file mode 100644
index e4be2f76a..000000000
--- a/Documentation/devicetree/bindings/input/twl4030-keypad.txt
+++ /dev/null
@@ -1,27 +0,0 @@
-* TWL4030's Keypad Controller device tree bindings
-
-TWL4030's Keypad controller is used to interface a SoC with a matrix-type
-keypad device. The keypad controller supports multiple row and column lines.
-A key can be placed at each intersection of a unique row and a unique column.
-The keypad controller can sense a key-press and key-release and report the
-event using a interrupt to the cpu.
-
-This binding is based on the matrix-keymap binding with the following
-changes:
-
- * keypad,num-rows and keypad,num-columns are required.
-
-Required SoC Specific Properties:
-- compatible: should be one of the following
-   - "ti,twl4030-keypad": For controllers compatible with twl4030 keypad
-      controller.
-- interrupt: should be one of the following
-   - <1>: For controllers compatible with twl4030 keypad controller.
-
-Example:
-	twl_keypad: keypad {
-		compatible = "ti,twl4030-keypad";
-		interrupts = <1>;
-		keypad,num-rows = <8>;
-		keypad,num-columns = <8>;
-	};
-- 
2.39.5


^ permalink raw reply related

* [PATCH v3 2/6] mfd: dt-bindings: ti,twl4030-audio: convert to DT schema
From: Jihed Chaibi @ 2025-08-16  2:15 UTC (permalink / raw)
  To: linux-kernel
  Cc: andreas, peter.ujfalusi, dmitry.torokhov, robh, krzk+dt,
	lgirdwood, tiwai, conor+dt, lee, ukleinek, broonie, gregkh,
	linus.walleij, brgl, aaro.koskinen, khilman, rogerq, tony,
	linux-gpio, linux-input, devicetree, linux-pwm, linux-sound,
	linux-usb, linux-omap, shuah, jihed.chaibi.dev
In-Reply-To: <20250816021523.167049-1-jihed.chaibi.dev@gmail.com>

Convert the TWL4030 audio module bindings from txt to YAML format and
move them to the sound subsystem bindings directory. This patch also
refines the schema by adding an enum constraint for ti,enable-vibra and
updates the example to remove irrelevant I2C clock-frequency property.

Signed-off-by: Jihed Chaibi <jihed.chaibi.dev@gmail.com>

---
Changes in v3:
 - No changes.

Changes in v2:
 - Moved binding from mfd to sound directory.
 - Added enum: [0, 1] to ti,enable-vibra for stricter validation.
 - Removed clock-frequency from the example as it’s not relevant to the binding.
 - Simplified example by removing unnecessary I2C node properties.
---
 .../devicetree/bindings/mfd/twl4030-audio.txt | 46 ----------
 .../bindings/sound/ti,twl4030-audio.yaml      | 90 +++++++++++++++++++
 2 files changed, 90 insertions(+), 46 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/mfd/twl4030-audio.txt
 create mode 100644 Documentation/devicetree/bindings/sound/ti,twl4030-audio.yaml

diff --git a/Documentation/devicetree/bindings/mfd/twl4030-audio.txt b/Documentation/devicetree/bindings/mfd/twl4030-audio.txt
deleted file mode 100644
index 414d2ae0a..000000000
--- a/Documentation/devicetree/bindings/mfd/twl4030-audio.txt
+++ /dev/null
@@ -1,46 +0,0 @@
-Texas Instruments TWL family (twl4030) audio module
-
-The audio module inside the TWL family consist of an audio codec and a vibra
-driver.
-
-Required properties:
-- compatible : must be "ti,twl4030-audio"
-
-Optional properties, nodes:
-
-Audio functionality:
-- codec { }: Need to be present if the audio functionality is used. Within this
-	     section the following options can be used:
-- ti,digimic_delay: Delay need after enabling the digimic to reduce artifacts
-		    from the start of the recorded sample (in ms)
--ti,ramp_delay_value: HS ramp delay configuration to reduce pop noise
--ti,hs_extmute: Use external mute for HS pop reduction
--ti,hs_extmute_gpio: Use external GPIO to control the external mute
--ti,offset_cncl_path: Offset cancellation path selection, refer to TRM for the
-		      valid values.
-
-Vibra functionality
-- ti,enable-vibra: Need to be set to <1> if the vibra functionality is used. if
-		   missing or it is 0, the vibra functionality is disabled.
-
-Example:
-&i2c1 {
-	clock-frequency = <2600000>;
-
-	twl: twl@48 {
-		reg = <0x48>;
-		interrupts = <7>; /* SYS_NIRQ cascaded to intc */
-		interrupt-parent = <&intc>;
-
-		twl_audio: audio {
-			compatible = "ti,twl4030-audio";
-
-			ti,enable-vibra = <1>;
-
-			codec {
-				ti,ramp_delay_value = <3>;
-			};
-
-		};
-	};
-};
diff --git a/Documentation/devicetree/bindings/sound/ti,twl4030-audio.yaml b/Documentation/devicetree/bindings/sound/ti,twl4030-audio.yaml
new file mode 100644
index 000000000..c9c3f7513
--- /dev/null
+++ b/Documentation/devicetree/bindings/sound/ti,twl4030-audio.yaml
@@ -0,0 +1,90 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/sound/ti,twl4030-audio.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Texas Instruments TWL4030-family Audio Module
+
+maintainers:
+  - Peter Ujfalusi <peter.ujfalusi@gmail.com>
+
+description:
+  The audio module within the TWL4030-family of companion chips consists
+  of an audio codec and a vibra driver. This binding describes the parent
+  node for these functions.
+
+properties:
+  compatible:
+    const: ti,twl4030-audio
+
+  codec:
+    type: object
+    description: Node containing properties for the audio codec functionality.
+
+    properties:
+      ti,digimic_delay:
+        $ref: /schemas/types.yaml#/definitions/uint32
+        description:
+          Delay in milliseconds after enabling digital microphones to reduce
+          artifacts.
+
+      ti,ramp_delay_value:
+        $ref: /schemas/types.yaml#/definitions/uint32
+        description:
+          Headset ramp delay configuration to reduce pop noise.
+
+      ti,hs_extmute:
+        type: boolean
+        description:
+          Enable the use of an external mute for headset pop reduction.
+
+      ti,hs_extmute_gpio:
+        $ref: /schemas/types.yaml#/definitions/phandle-array
+        description:
+          The GPIO specifier for the external mute control.
+        maxItems: 1
+
+      ti,offset_cncl_path:
+        $ref: /schemas/types.yaml#/definitions/uint32
+        description:
+          Offset cancellation path selection. Refer to the Technical
+          Reference Manual for valid values.
+
+  # The 'codec' node itself is optional, but if it exists, it can be empty.
+  # We don't require any of its sub-properties.
+
+  ti,enable-vibra:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    enum: [0, 1]
+    description:
+      Enable or disable the vibra functionality.
+
+additionalProperties: false
+
+required:
+  - compatible
+
+examples:
+  - |
+    i2c {
+      #address-cells = <1>;
+      #size-cells = <0>;
+
+      twl: twl@48 {
+        reg = <0x48>;
+        interrupts = <7>; /* SYS_NIRQ cascaded to intc */
+        interrupt-parent = <&intc>;
+
+        twl_audio: audio {
+          compatible = "ti,twl4030-audio";
+
+          ti,enable-vibra = <1>;
+
+          codec {
+            ti,ramp_delay_value = <3>;
+          };
+
+        };
+      };
+    };
-- 
2.39.5


^ permalink raw reply related

* [PATCH v3 1/6] dt-bindings: mfd: twl: Add missing sub-nodes for TWL4030 & TWL603x
From: Jihed Chaibi @ 2025-08-16  2:15 UTC (permalink / raw)
  To: linux-kernel
  Cc: andreas, peter.ujfalusi, dmitry.torokhov, robh, krzk+dt,
	lgirdwood, tiwai, conor+dt, lee, ukleinek, broonie, gregkh,
	linus.walleij, brgl, aaro.koskinen, khilman, rogerq, tony,
	linux-gpio, linux-input, devicetree, linux-pwm, linux-sound,
	linux-usb, linux-omap, shuah, jihed.chaibi.dev
In-Reply-To: <20250816021523.167049-1-jihed.chaibi.dev@gmail.com>

Update the TI TWL family Device Tree binding to include additional
subnodes for TWL4030, TWL6030, and TWL6032 devices.

The simple power and PWM bindings (ti,twl4030-power, ti,twl-pwm, and
ti,twl-pwmled) are now defined directly within this binding.

Other child node definitions (audio, gpio, keypad, usb, etc.) are also
added to the schema. These additions fix 'unevaluated properties'
errors found during dtbs_check for boards like the omap3-beagle
and improve the binding's overall completeness.

Signed-off-by: Jihed Chaibi <jihed.chaibi.dev@gmail.com>

---
Changes in v3:
 - New patch to consolidate simple bindings (power, pwm) and add
   definitions for all child nodes to fix dtbs_check validation
   errors found in v2.
---
 .../devicetree/bindings/mfd/ti,twl.yaml       | 191 ++++++++++++++++++
 .../devicetree/bindings/mfd/twl4030-power.txt |  48 -----
 .../devicetree/bindings/pwm/ti,twl-pwm.txt    |  17 --
 .../devicetree/bindings/pwm/ti,twl-pwmled.txt |  17 --
 4 files changed, 191 insertions(+), 82 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/mfd/twl4030-power.txt
 delete mode 100644 Documentation/devicetree/bindings/pwm/ti,twl-pwm.txt
 delete mode 100644 Documentation/devicetree/bindings/pwm/ti,twl-pwmled.txt

diff --git a/Documentation/devicetree/bindings/mfd/ti,twl.yaml b/Documentation/devicetree/bindings/mfd/ti,twl.yaml
index f162ab60c..b0f1cb7b5 100644
--- a/Documentation/devicetree/bindings/mfd/ti,twl.yaml
+++ b/Documentation/devicetree/bindings/mfd/ti,twl.yaml
@@ -76,6 +76,98 @@ allOf:
           properties:
             compatible:
               const: ti,twl4030-wdt
+
+        audio:
+          type: object
+          $ref: /schemas/sound/ti,twl4030-audio.yaml#
+          unevaluatedProperties: false
+
+        keypad:
+          type: object
+          $ref: /schemas/input/ti,twl4030-keypad.yaml#
+          unevaluatedProperties: false
+
+        pwm:
+          type: object
+          $ref: /schemas/pwm/pwm.yaml#
+          unevaluatedProperties: false
+          description: |
+            TWL4030 series: PWMA and PWMB (connected to LEDA and LEDB terminals)
+          properties:
+            compatible:
+              enum:
+                - ti,twl4030-pwm
+            '#pwm-cells':
+              const: 2
+          required:
+            - compatible
+            - '#pwm-cells'
+
+        pwmled:
+          type: object
+          $ref: /schemas/pwm/pwm.yaml#
+          unevaluatedProperties: false
+          description: |
+            TWL4030 series: PWMA and PWMB (connected to LEDA and LEDB terminals)
+          properties:
+            compatible:
+              enum:
+                - ti,twl4030-pwmled
+            '#pwm-cells':
+              const: 2
+          required:
+            - compatible
+            - '#pwm-cells'
+
+        'twl4030-usb':
+          type: object
+          $ref: /schemas/usb/ti,twlxxxx-usb.yaml#
+          unevaluatedProperties: false
+
+        gpio:
+          type: object
+          $ref: /schemas/gpio/ti,twl4030-gpio.yaml#
+          unevaluatedProperties: false
+
+        power:
+          type: object
+          additionalProperties: false
+          description:
+            The power management module inside the TWL4030 provides several facilities
+            to control the power resources, including power scripts. For now, the
+            binding only supports the complete shutdown of the system after poweroff.
+          properties:
+            compatible:
+              description: |
+                The compatible string determines the specific power configuration.
+                "ti,twl4030-power": Standard power control.
+                "ti,twl4030-power-reset": Recommended for OMAP3530 and similar SoCs
+                  that require a special configuration for warm reset to work correctly.
+                "ti,twl4030-power-idle": Loads the TI-recommended configuration for
+                  idle modes into the PMIC.
+                "ti,twl4030-power-idle-osc-off": Uses the recommended idle configuration
+                  but also shuts down the external oscillator. This may not work on all
+                  boards depending on the oscillator wiring.
+              enum:
+                - ti,twl4030-power
+                - ti,twl4030-power-reset
+                - ti,twl4030-power-idle
+                - ti,twl4030-power-idle-osc-off
+
+            ti,system-power-controller:
+              type: boolean
+              deprecated: true
+              description: |
+                DEPRECATED. The standard 'system-power-controller' property
+                on the parent node should be used instead.
+
+            ti,use_poweroff:
+              type: boolean
+              deprecated: true
+
+          required:
+            - compatible
+
   - if:
       properties:
         compatible:
@@ -115,6 +207,44 @@ allOf:
           properties:
             compatible:
               const: ti,twl6030-gpadc
+
+        pwm:
+          type: object
+          $ref: /schemas/pwm/pwm.yaml#
+          unevaluatedProperties: false
+          description: |
+            TWL6030 series: LED PWM (mainly used as charging indicator LED)
+          properties:
+            compatible:
+              enum:
+                - ti,twl6030-pwm
+            '#pwm-cells':
+              const: 2
+          required:
+            - compatible
+            - '#pwm-cells'
+
+        pwmled:
+          type: object
+          $ref: /schemas/pwm/pwm.yaml#
+          unevaluatedProperties: false
+          description: |
+            TWL6030 series: LED PWM (mainly used as charging indicator LED)
+          properties:
+            compatible:
+              enum:
+                - ti,twl6030-pwmled
+            '#pwm-cells':
+              const: 2
+          required:
+            - compatible
+            - '#pwm-cells'
+
+        'twl6030-usb':
+          type: object
+          $ref: /schemas/usb/ti,twlxxxx-usb.yaml#
+          unevaluatedProperties: false
+
   - if:
       properties:
         compatible:
@@ -154,6 +284,43 @@ allOf:
             compatible:
               const: ti,twl6032-gpadc
 
+        pwm:
+          type: object
+          $ref: /schemas/pwm/pwm.yaml#
+          unevaluatedProperties: false
+          description: |
+            TWL6030 series: LED PWM (mainly used as charging indicator LED)
+          properties:
+            compatible:
+              enum:
+                - ti,twl6030-pwm
+            '#pwm-cells':
+              const: 2
+          required:
+            - compatible
+            - '#pwm-cells'
+
+        pwmled:
+          type: object
+          $ref: /schemas/pwm/pwm.yaml#
+          unevaluatedProperties: false
+          description: |
+            TWL6030 series: LED PWM (mainly used as charging indicator LED)
+          properties:
+            compatible:
+              enum:
+                - ti,twl6030-pwmled
+            '#pwm-cells':
+              const: 2
+          required:
+            - compatible
+            - '#pwm-cells'
+
+        'twl6030-usb':
+          type: object
+          $ref: /schemas/usb/ti,twlxxxx-usb.yaml
+          unevaluatedProperties: false
+
 properties:
   compatible:
     description:
@@ -271,6 +438,16 @@ examples:
           compatible = "ti,twl6030-vmmc";
           ti,retain-on-reset;
         };
+
+        pwm {
+          compatible = "ti,twl6030-pwm";
+          #pwm-cells = <2>;
+        };
+
+        pwmled {
+          compatible = "ti,twl6030-pwmled";
+          #pwm-cells = <2>;
+        };
       };
     };
 
@@ -325,6 +502,20 @@ examples:
         watchdog {
           compatible = "ti,twl4030-wdt";
         };
+
+        power {
+          compatible = "ti,twl4030-power";
+        };
+
+        pwm {
+          compatible = "ti,twl4030-pwm";
+          #pwm-cells = <2>;
+        };
+
+        pwmled {
+          compatible = "ti,twl4030-pwmled";
+          #pwm-cells = <2>;
+        };
       };
     };
 ...
diff --git a/Documentation/devicetree/bindings/mfd/twl4030-power.txt b/Documentation/devicetree/bindings/mfd/twl4030-power.txt
deleted file mode 100644
index 3d1996331..000000000
--- a/Documentation/devicetree/bindings/mfd/twl4030-power.txt
+++ /dev/null
@@ -1,48 +0,0 @@
-Texas Instruments TWL family (twl4030) reset and power management module
-
-The power management module inside the TWL family provides several facilities
-to control the power resources, including power scripts. For now, the
-binding only supports the complete shutdown of the system after poweroff.
-
-Required properties:
-- compatible : must be one of the following
-	"ti,twl4030-power"
-	"ti,twl4030-power-reset"
-	"ti,twl4030-power-idle"
-	"ti,twl4030-power-idle-osc-off"
-
-The use of ti,twl4030-power-reset is recommended at least on
-3530 that needs a special configuration for warm reset to work.
-
-When using ti,twl4030-power-idle, the TI recommended configuration
-for idle modes is loaded to the tlw4030 PMIC.
-
-When using ti,twl4030-power-idle-osc-off, the TI recommended
-configuration is used with the external oscillator being shut
-down during off-idle. Note that this does not work on all boards
-depending on how the external oscillator is wired.
-
-Optional properties:
-
-- ti,system-power-controller: This indicates that TWL4030 is the
-  power supply master of the system. With this flag, the chip will
-  initiate an ACTIVE-to-OFF or SLEEP-to-OFF transition when the
-  system poweroffs.
-
-- ti,use_poweroff: Deprecated name for ti,system-power-controller
-
-Example:
-&i2c1 {
-	clock-frequency = <2600000>;
-
-	twl: twl@48 {
-		reg = <0x48>;
-		interrupts = <7>; /* SYS_NIRQ cascaded to intc */
-		interrupt-parent = <&intc>;
-
-		twl_power: power {
-			compatible = "ti,twl4030-power";
-			ti,use_poweroff;
-		};
-	};
-};
diff --git a/Documentation/devicetree/bindings/pwm/ti,twl-pwm.txt b/Documentation/devicetree/bindings/pwm/ti,twl-pwm.txt
deleted file mode 100644
index d97ca1964..000000000
--- a/Documentation/devicetree/bindings/pwm/ti,twl-pwm.txt
+++ /dev/null
@@ -1,17 +0,0 @@
-Texas Instruments TWL series PWM drivers
-
-Supported PWMs:
-On TWL4030 series: PWM1 and PWM2
-On TWL6030 series: PWM0 and PWM1
-
-Required properties:
-- compatible: "ti,twl4030-pwm" or "ti,twl6030-pwm"
-- #pwm-cells: should be 2. See pwm.yaml in this directory for a description of
-  the cells format.
-
-Example:
-
-twl_pwm: pwm {
-	compatible = "ti,twl6030-pwm";
-	#pwm-cells = <2>;
-};
diff --git a/Documentation/devicetree/bindings/pwm/ti,twl-pwmled.txt b/Documentation/devicetree/bindings/pwm/ti,twl-pwmled.txt
deleted file mode 100644
index 31ca1b032..000000000
--- a/Documentation/devicetree/bindings/pwm/ti,twl-pwmled.txt
+++ /dev/null
@@ -1,17 +0,0 @@
-Texas Instruments TWL series PWM drivers connected to LED terminals
-
-Supported PWMs:
-On TWL4030 series: PWMA and PWMB (connected to LEDA and LEDB terminals)
-On TWL6030 series: LED PWM (mainly used as charging indicator LED)
-
-Required properties:
-- compatible: "ti,twl4030-pwmled" or "ti,twl6030-pwmled"
-- #pwm-cells: should be 2. See pwm.yaml in this directory for a description of
-  the cells format.
-
-Example:
-
-twl_pwmled: pwmled {
-	compatible = "ti,twl6030-pwmled";
-	#pwm-cells = <2>;
-};
-- 
2.39.5


^ permalink raw reply related

* [PATCH v3 0/6] dt-bindings: Convert TWL4030/6040 family binding to DT schema
From: Jihed Chaibi @ 2025-08-16  2:15 UTC (permalink / raw)
  To: linux-kernel
  Cc: andreas, peter.ujfalusi, dmitry.torokhov, robh, krzk+dt,
	lgirdwood, tiwai, conor+dt, lee, ukleinek, broonie, gregkh,
	linus.walleij, brgl, aaro.koskinen, khilman, rogerq, tony,
	linux-gpio, linux-input, devicetree, linux-pwm, linux-sound,
	linux-usb, linux-omap, shuah, jihed.chaibi.dev

Hello,

This series converts the remaining legacy TXT bindings for the Texas
Instruments TWL4030/6030 family to the DT schema format.

This v3 series addresses extensive feedback from v2. The main changes
include consolidating the simple power and PWM bindings directly into the
main ti,twl.yaml binding for a cleaner structure. It also adds a fix for
an incorrect schema $id in the ti,twl4030-gpio binding and corrects
various properties based on reviewer feedback.

This results in a cleaner, more accurate, and more consolidated set of
bindings for this TWL family.

As requested, the unrelated ti,twl6040 binding conversion has been dropped
from this series and will be sent separately.

Thank you,
Jihed

There is a typo in the subject, "TWL4030/6040" should be "TWL4030/6030".

---

Changes in v3:

  - Dropped ti,twl6040 patch to be sent separately.
  - Consolidated power, pwm and pwmled bindings into the main
    ti,twl.yaml binding, removing 3 patches from the series.
  - Added new patch (v3 6/6) to correct the $id in ti,twl4030-gpio.yaml.
  - Made 'linux,keymap' a required property in ti,twl4030-keypad.
  - Marked (very) old ti,twl4030-power properties as deprecated.
  - Updated commit message format for omap-twl4030.yaml (PATCH v2 7/9).

Changes in v2:

  - Add new patch (9/9) to fix the parent ti,twl.yaml binding by adding
    the missing sub-node definitions, resolving dtbs_check errors.
  - (1/9) ti,twl4030-audio: Moved binding to sound/, added enum for
    ti,enable-vibra, and simplified the example.
  - (2/9) ti,twl6040: Renamed twl6040,audpwron-gpio to ti,audpwron-gpio
    to fix a vendor prefix validation error.
  - (8/9) ti,twlxxxx-usb: Added '#phy-cells' property to support the
    standard PHY framework.
  - (7/9) omap-twl4030: Minor cosmetic fixes, retaining Acked-by Mark Brown.
  - Other patches: Minor description and formatting cleanups.

The following six patches are included in this series:

Jihed Chaibi (6):
  dt-bindings: mfd: twl: Add missing sub-nodes for TWL4030 & TWL603x
  mfd: dt-bindings: ti,twl4030-audio: convert to DT schema
  input: dt-bindings: ti,twl4030-keypad: convert to DT schema
  ASoC: dt-bindings: omap-twl4030: convert to DT schema
  usb: dt-bindings: ti,twlxxxx-usb: convert to DT schema
  dt-bindings: gpio: ti,twl4030: Correct the schema $id path

 .../bindings/gpio/ti,twl4030-gpio.yaml        |   2 +-
 .../bindings/input/ti,twl4030-keypad.yaml     |  59 ++++++
 .../bindings/input/twl4030-keypad.txt         |  27 ---
 .../devicetree/bindings/mfd/ti,twl.yaml       | 191 ++++++++++++++++++
 .../devicetree/bindings/mfd/twl4030-audio.txt |  46 -----
 .../devicetree/bindings/mfd/twl4030-power.txt |  48 -----
 .../devicetree/bindings/pwm/ti,twl-pwm.txt    |  17 --
 .../devicetree/bindings/pwm/ti,twl-pwmled.txt |  17 --
 .../bindings/sound/omap-twl4030.txt           |  62 ------
 .../bindings/sound/ti,omap-twl4030.yaml       | 102 ++++++++++
 .../bindings/sound/ti,twl4030-audio.yaml      |  90 +++++++++
 .../bindings/usb/ti,twlxxxx-usb.yaml          | 125 ++++++++++++
 .../devicetree/bindings/usb/twlxxxx-usb.txt   |  43 ----
 13 files changed, 568 insertions(+), 261 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/input/ti,twl4030-keypad.yaml
 delete mode 100644 Documentation/devicetree/bindings/input/twl4030-keypad.txt
 delete mode 100644 Documentation/devicetree/bindings/mfd/twl4030-audio.txt
 delete mode 100644 Documentation/devicetree/bindings/mfd/twl4030-power.txt
 delete mode 100644 Documentation/devicetree/bindings/pwm/ti,twl-pwm.txt
 delete mode 100644 Documentation/devicetree/bindings/pwm/ti,twl-pwmled.txt
 delete mode 100644 Documentation/devicetree/bindings/sound/omap-twl4030.txt
 create mode 100644 Documentation/devicetree/bindings/sound/ti,omap-twl4030.yaml
 create mode 100644 Documentation/devicetree/bindings/sound/ti,twl4030-audio.yaml
 create mode 100644 Documentation/devicetree/bindings/usb/ti,twlxxxx-usb.yaml
 delete mode 100644 Documentation/devicetree/bindings/usb/twlxxxx-usb.txt

-- 
2.39.5


^ permalink raw reply

* Re: [PATCH] Input: twl4030_keypad - drop support for platform data
From: Andreas Kemnade @ 2025-08-15 19:29 UTC (permalink / raw)
  To: Dmitry Torokhov
  Cc: linux-input, Jihed Chaibi, Tony Lindgren, Uwe Kleine-König,
	linux-kernel
In-Reply-To: <tica7ol7xwv5tqb7hlkzu6wkiv4quxwrpqv6croe4wfnwvj6wv@4ob6ktqqi3cr>

Am Fri, 15 Aug 2025 10:36:09 -0700
schrieb Dmitry Torokhov <dmitry.torokhov@gmail.com>:

> Support for platform data from dropped from twl in 4a346a03a63c ("mfd:
> twl: Remove platform data support") and board files were dropped even
> earlier. There are no in-kernel users of twl4030_keypad_data in the
> kernel, and the driver supports configuration via generic device
> properties.
> 
> Drop support of static platform data from the keypad driver.
> 
> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>

Reviewed-by: Andreas Kemnade <andreas@kemnade.info>

^ permalink raw reply

* [PATCH] Input: matrix-keymap - remove unused keymap_name parameter
From: Dmitry Torokhov @ 2025-08-15 17:46 UTC (permalink / raw)
  To: linux-input
  Cc: Robin van der Gracht, Andy Shevchenko, Geert Uytterhoeven,
	linux-kernel

The keymap_name parameter of matrix_keypad_build_keymap() is used to
specify the device tree property containing the keymap. If NULL, it
defaults to 'linux,keymap'.

All current callers pass NULL for this parameter, relying on the default
value. Remove the redundant parameter from the function declaration,
definition, and all call sites to simplify the API.

Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
---

Robin, Andy, Geert, ht16k33 is the only driver using this API that is
outside of drivers/input. Would you mind if I merge the patch through my
tree and not try t introduce intermediate API variant and split
the merge across multiple releases?

 drivers/auxdisplay/ht16k33.c                |  2 +-
 drivers/input/keyboard/adp5585-keys.c       |  2 +-
 drivers/input/keyboard/adp5588-keys.c       |  2 +-
 drivers/input/keyboard/bcm-keypad.c         |  2 +-
 drivers/input/keyboard/clps711x-keypad.c    |  2 +-
 drivers/input/keyboard/cros_ec_keyb.c       |  2 +-
 drivers/input/keyboard/ep93xx_keypad.c      |  2 +-
 drivers/input/keyboard/imx_keypad.c         |  2 +-
 drivers/input/keyboard/lm8333.c             |  2 +-
 drivers/input/keyboard/lpc32xx-keys.c       |  2 +-
 drivers/input/keyboard/matrix_keypad.c      |  2 +-
 drivers/input/keyboard/max7359_keypad.c     |  2 +-
 drivers/input/keyboard/mt6779-keypad.c      |  2 +-
 drivers/input/keyboard/nspire-keypad.c      |  2 +-
 drivers/input/keyboard/omap-keypad.c        |  2 +-
 drivers/input/keyboard/omap4-keypad.c       |  2 +-
 drivers/input/keyboard/pinephone-keyboard.c |  2 +-
 drivers/input/keyboard/pmic8xxx-keypad.c    |  2 +-
 drivers/input/keyboard/pxa27x_keypad.c      |  4 ++--
 drivers/input/keyboard/samsung-keypad.c     |  2 +-
 drivers/input/keyboard/spear-keyboard.c     |  2 +-
 drivers/input/keyboard/st-keyscan.c         |  2 +-
 drivers/input/keyboard/stmpe-keypad.c       |  2 +-
 drivers/input/keyboard/tc3589x-keypad.c     |  2 +-
 drivers/input/keyboard/tca8418_keypad.c     |  2 +-
 drivers/input/keyboard/tegra-kbc.c          |  2 +-
 drivers/input/keyboard/twl4030_keypad.c     |  2 +-
 drivers/input/matrix-keymap.c               | 16 ++++------------
 include/linux/input/matrix_keypad.h         |  1 -
 29 files changed, 32 insertions(+), 41 deletions(-)

diff --git a/drivers/auxdisplay/ht16k33.c b/drivers/auxdisplay/ht16k33.c
index 0b8ba754b343..eff8e93bc172 100644
--- a/drivers/auxdisplay/ht16k33.c
+++ b/drivers/auxdisplay/ht16k33.c
@@ -536,7 +536,7 @@ static int ht16k33_keypad_probe(struct i2c_client *client,
 	keypad->cols = cols;
 	keypad->row_shift = get_count_order(cols);
 
-	err = matrix_keypad_build_keymap(NULL, NULL, rows, cols, NULL,
+	err = matrix_keypad_build_keymap(NULL, rows, cols, NULL,
 					 keypad->dev);
 	if (err) {
 		dev_err(dev, "failed to build keymap\n");
diff --git a/drivers/input/keyboard/adp5585-keys.c b/drivers/input/keyboard/adp5585-keys.c
index 4208229e1356..cc7bcb2792e9 100644
--- a/drivers/input/keyboard/adp5585-keys.c
+++ b/drivers/input/keyboard/adp5585-keys.c
@@ -169,7 +169,7 @@ static int adp5585_keys_parse_fw(const struct adp5585_dev *adp5585,
 
 	cols = cols + 1 - kpad->info->max_rows;
 
-	error = matrix_keypad_build_keymap(NULL, NULL, rows, cols,
+	error = matrix_keypad_build_keymap(NULL, rows, cols,
 					   kpad->keycode, kpad->input);
 	if (error)
 		return error;
diff --git a/drivers/input/keyboard/adp5588-keys.c b/drivers/input/keyboard/adp5588-keys.c
index 2b2aca08423a..0582b5455f41 100644
--- a/drivers/input/keyboard/adp5588-keys.c
+++ b/drivers/input/keyboard/adp5588-keys.c
@@ -664,7 +664,7 @@ static int adp5588_fw_parse(struct adp5588_kpad *kpad)
 		return -EINVAL;
 	}
 
-	ret = matrix_keypad_build_keymap(NULL, NULL, kpad->rows, kpad->cols,
+	ret = matrix_keypad_build_keymap(NULL, kpad->rows, kpad->cols,
 					 kpad->keycode, kpad->input);
 	if (ret)
 		return ret;
diff --git a/drivers/input/keyboard/bcm-keypad.c b/drivers/input/keyboard/bcm-keypad.c
index 6b46f83a9edb..b0a6f48a2dcf 100644
--- a/drivers/input/keyboard/bcm-keypad.c
+++ b/drivers/input/keyboard/bcm-keypad.c
@@ -344,7 +344,7 @@ static int bcm_kp_probe(struct platform_device *pdev)
 	if (error)
 		return error;
 
-	error = matrix_keypad_build_keymap(NULL, NULL,
+	error = matrix_keypad_build_keymap(NULL,
 					   kp->n_rows, kp->n_cols,
 					   NULL, input_dev);
 	if (error) {
diff --git a/drivers/input/keyboard/clps711x-keypad.c b/drivers/input/keyboard/clps711x-keypad.c
index 4c1a3e611edd..d069e04ab417 100644
--- a/drivers/input/keyboard/clps711x-keypad.c
+++ b/drivers/input/keyboard/clps711x-keypad.c
@@ -137,7 +137,7 @@ static int clps711x_keypad_probe(struct platform_device *pdev)
 	input->id.product	= 0x0001;
 	input->id.version	= 0x0100;
 
-	err = matrix_keypad_build_keymap(NULL, NULL, priv->row_count,
+	err = matrix_keypad_build_keymap(NULL, priv->row_count,
 					 CLPS711X_KEYPAD_COL_COUNT,
 					 NULL, input);
 	if (err)
diff --git a/drivers/input/keyboard/cros_ec_keyb.c b/drivers/input/keyboard/cros_ec_keyb.c
index c1e53d87c8a7..718fb360b568 100644
--- a/drivers/input/keyboard/cros_ec_keyb.c
+++ b/drivers/input/keyboard/cros_ec_keyb.c
@@ -629,7 +629,7 @@ static int cros_ec_keyb_register_matrix(struct cros_ec_keyb *ckdev)
 	ckdev->ghost_filter = device_property_read_bool(dev,
 					"google,needs-ghost-filter");
 
-	err = matrix_keypad_build_keymap(NULL, NULL, ckdev->rows, ckdev->cols,
+	err = matrix_keypad_build_keymap(NULL, ckdev->rows, ckdev->cols,
 					 NULL, idev);
 	if (err) {
 		dev_err(dev, "cannot build key matrix\n");
diff --git a/drivers/input/keyboard/ep93xx_keypad.c b/drivers/input/keyboard/ep93xx_keypad.c
index 817c23438f6e..dba9f9ddc10a 100644
--- a/drivers/input/keyboard/ep93xx_keypad.c
+++ b/drivers/input/keyboard/ep93xx_keypad.c
@@ -237,7 +237,7 @@ static int ep93xx_keypad_probe(struct platform_device *pdev)
 	input_dev->open = ep93xx_keypad_open;
 	input_dev->close = ep93xx_keypad_close;
 
-	err = matrix_keypad_build_keymap(NULL, NULL,
+	err = matrix_keypad_build_keymap(NULL,
 					 EP93XX_MATRIX_ROWS, EP93XX_MATRIX_COLS,
 					 keypad->keycodes, input_dev);
 	if (err)
diff --git a/drivers/input/keyboard/imx_keypad.c b/drivers/input/keyboard/imx_keypad.c
index 069c1d6376e1..9d60b151c730 100644
--- a/drivers/input/keyboard/imx_keypad.c
+++ b/drivers/input/keyboard/imx_keypad.c
@@ -462,7 +462,7 @@ static int imx_keypad_probe(struct platform_device *pdev)
 	input_dev->open = imx_keypad_open;
 	input_dev->close = imx_keypad_close;
 
-	error = matrix_keypad_build_keymap(NULL, NULL,
+	error = matrix_keypad_build_keymap(NULL,
 					   MAX_MATRIX_KEY_ROWS,
 					   MAX_MATRIX_KEY_COLS,
 					   keypad->keycodes, input_dev);
diff --git a/drivers/input/keyboard/lm8333.c b/drivers/input/keyboard/lm8333.c
index 384baabf9924..26002077dcbc 100644
--- a/drivers/input/keyboard/lm8333.c
+++ b/drivers/input/keyboard/lm8333.c
@@ -158,7 +158,7 @@ static int lm8333_probe(struct i2c_client *client)
 
 	input_set_capability(input, EV_MSC, MSC_SCAN);
 
-	err = matrix_keypad_build_keymap(pdata->matrix_data, NULL,
+	err = matrix_keypad_build_keymap(pdata->matrix_data,
 					 LM8333_NUM_ROWS, LM8333_NUM_COLS,
 					 lm8333->keycodes, input);
 	if (err)
diff --git a/drivers/input/keyboard/lpc32xx-keys.c b/drivers/input/keyboard/lpc32xx-keys.c
index 2392e7ec3b19..758f12278bfb 100644
--- a/drivers/input/keyboard/lpc32xx-keys.c
+++ b/drivers/input/keyboard/lpc32xx-keys.c
@@ -202,7 +202,7 @@ static int lpc32xx_kscan_probe(struct platform_device *pdev)
 
 	input_set_capability(input, EV_MSC, MSC_SCAN);
 
-	error = matrix_keypad_build_keymap(NULL, NULL,
+	error = matrix_keypad_build_keymap(NULL,
 					   kscandat->matrix_sz,
 					   kscandat->matrix_sz,
 					   kscandat->keymap, kscandat->input);
diff --git a/drivers/input/keyboard/matrix_keypad.c b/drivers/input/keyboard/matrix_keypad.c
index e50a6fea9a60..644813644345 100644
--- a/drivers/input/keyboard/matrix_keypad.c
+++ b/drivers/input/keyboard/matrix_keypad.c
@@ -438,7 +438,7 @@ static int matrix_keypad_probe(struct platform_device *pdev)
 	input_dev->open		= matrix_keypad_start;
 	input_dev->close	= matrix_keypad_stop;
 
-	err = matrix_keypad_build_keymap(NULL, NULL,
+	err = matrix_keypad_build_keymap(NULL,
 					 keypad->num_row_gpios,
 					 keypad->num_col_gpios,
 					 NULL, input_dev);
diff --git a/drivers/input/keyboard/max7359_keypad.c b/drivers/input/keyboard/max7359_keypad.c
index c10726b5e4d1..2f81cdcaf62e 100644
--- a/drivers/input/keyboard/max7359_keypad.c
+++ b/drivers/input/keyboard/max7359_keypad.c
@@ -208,7 +208,7 @@ static int max7359_probe(struct i2c_client *client)
 	input_set_capability(input_dev, EV_MSC, MSC_SCAN);
 	input_set_drvdata(input_dev, keypad);
 
-	error = matrix_keypad_build_keymap(keymap_data, NULL,
+	error = matrix_keypad_build_keymap(keymap_data,
 					   MAX7359_MAX_KEY_ROWS,
 					   MAX7359_MAX_KEY_COLS,
 					   keypad->keycodes,
diff --git a/drivers/input/keyboard/mt6779-keypad.c b/drivers/input/keyboard/mt6779-keypad.c
index e5eb025c5e99..942d1d3b7d0a 100644
--- a/drivers/input/keyboard/mt6779-keypad.c
+++ b/drivers/input/keyboard/mt6779-keypad.c
@@ -185,7 +185,7 @@ static int mt6779_keypad_pdrv_probe(struct platform_device *pdev)
 	dev_dbg(&pdev->dev, "n_row=%d n_col=%d debounce=%d\n",
 		keypad->n_rows, keypad->n_cols, debounce);
 
-	error = matrix_keypad_build_keymap(NULL, NULL,
+	error = matrix_keypad_build_keymap(NULL,
 					   keypad->n_rows, keypad->n_cols,
 					   NULL, keypad->input_dev);
 	if (error) {
diff --git a/drivers/input/keyboard/nspire-keypad.c b/drivers/input/keyboard/nspire-keypad.c
index 096c18d7bca1..9f3e9b30d472 100644
--- a/drivers/input/keyboard/nspire-keypad.c
+++ b/drivers/input/keyboard/nspire-keypad.c
@@ -226,7 +226,7 @@ static int nspire_keypad_probe(struct platform_device *pdev)
 	__set_bit(EV_REP, input->evbit);
 	input_set_capability(input, EV_MSC, MSC_SCAN);
 
-	error = matrix_keypad_build_keymap(NULL, NULL,
+	error = matrix_keypad_build_keymap(NULL,
 					   KEYPAD_BITMASK_ROWS,
 					   KEYPAD_BITMASK_COLS,
 					   NULL, input);
diff --git a/drivers/input/keyboard/omap-keypad.c b/drivers/input/keyboard/omap-keypad.c
index 9e13f3f70a81..6d318c649425 100644
--- a/drivers/input/keyboard/omap-keypad.c
+++ b/drivers/input/keyboard/omap-keypad.c
@@ -233,7 +233,7 @@ static int omap_kp_probe(struct platform_device *pdev)
 	if (pdata->rep)
 		__set_bit(EV_REP, input_dev->evbit);
 
-	ret = matrix_keypad_build_keymap(pdata->keymap_data, NULL,
+	ret = matrix_keypad_build_keymap(pdata->keymap_data,
 					 pdata->rows, pdata->cols,
 					 omap_kp->keymap, input_dev);
 	if (ret < 0)
diff --git a/drivers/input/keyboard/omap4-keypad.c b/drivers/input/keyboard/omap4-keypad.c
index bffe89c0717a..cf1fe98e662f 100644
--- a/drivers/input/keyboard/omap4-keypad.c
+++ b/drivers/input/keyboard/omap4-keypad.c
@@ -440,7 +440,7 @@ static int omap4_keypad_probe(struct platform_device *pdev)
 		return -ENOMEM;
 	}
 
-	error = matrix_keypad_build_keymap(NULL, NULL,
+	error = matrix_keypad_build_keymap(NULL,
 					   keypad_data->rows, keypad_data->cols,
 					   keypad_data->keymap, input_dev);
 	if (error) {
diff --git a/drivers/input/keyboard/pinephone-keyboard.c b/drivers/input/keyboard/pinephone-keyboard.c
index 147b1f288a33..c1e37a13e6fb 100644
--- a/drivers/input/keyboard/pinephone-keyboard.c
+++ b/drivers/input/keyboard/pinephone-keyboard.c
@@ -405,7 +405,7 @@ static int ppkb_probe(struct i2c_client *client)
 	input_set_capability(ppkb->input, EV_MSC, MSC_SCAN);
 	__set_bit(EV_REP, ppkb->input->evbit);
 
-	error = matrix_keypad_build_keymap(&ppkb_keymap_data, NULL,
+	error = matrix_keypad_build_keymap(&ppkb_keymap_data,
 					   2 * PPKB_ROWS, PPKB_COLS, NULL,
 					   ppkb->input);
 	if (error) {
diff --git a/drivers/input/keyboard/pmic8xxx-keypad.c b/drivers/input/keyboard/pmic8xxx-keypad.c
index 35d1aa2a22a5..2bc84a2db4f4 100644
--- a/drivers/input/keyboard/pmic8xxx-keypad.c
+++ b/drivers/input/keyboard/pmic8xxx-keypad.c
@@ -562,7 +562,7 @@ static int pmic8xxx_kp_probe(struct platform_device *pdev)
 	kp->input->open		= pmic8xxx_kp_open;
 	kp->input->close	= pmic8xxx_kp_close;
 
-	rc = matrix_keypad_build_keymap(NULL, NULL,
+	rc = matrix_keypad_build_keymap(NULL,
 					PM8XXX_MAX_ROWS, PM8XXX_MAX_COLS,
 					kp->keycodes, kp->input);
 	if (rc) {
diff --git a/drivers/input/keyboard/pxa27x_keypad.c b/drivers/input/keyboard/pxa27x_keypad.c
index 38ec619aa359..d4eb839ffbf5 100644
--- a/drivers/input/keyboard/pxa27x_keypad.c
+++ b/drivers/input/keyboard/pxa27x_keypad.c
@@ -135,7 +135,7 @@ static int pxa27x_keypad_matrix_key_parse_dt(struct pxa27x_keypad *keypad,
 	pdata->matrix_key_rows = rows;
 	pdata->matrix_key_cols = cols;
 
-	error = matrix_keypad_build_keymap(NULL, NULL,
+	error = matrix_keypad_build_keymap(NULL,
 					   pdata->matrix_key_rows,
 					   pdata->matrix_key_cols,
 					   keypad->keycodes, input_dev);
@@ -346,7 +346,7 @@ static int pxa27x_keypad_build_keycode(struct pxa27x_keypad *keypad)
 	int i;
 	int error;
 
-	error = matrix_keypad_build_keymap(pdata->matrix_keymap_data, NULL,
+	error = matrix_keypad_build_keymap(pdata->matrix_keymap_data,
 					   pdata->matrix_key_rows,
 					   pdata->matrix_key_cols,
 					   keypad->keycodes, input_dev);
diff --git a/drivers/input/keyboard/samsung-keypad.c b/drivers/input/keyboard/samsung-keypad.c
index 5b3f83112b42..67a1072fccc1 100644
--- a/drivers/input/keyboard/samsung-keypad.c
+++ b/drivers/input/keyboard/samsung-keypad.c
@@ -266,7 +266,7 @@ static int samsung_keypad_parse_keymap(struct samsung_keypad *keypad)
 	}
 
 	retval = matrix_keypad_build_keymap(key_count ? &keymap_data : NULL,
-					    NULL, keypad->rows, keypad->cols,
+					    keypad->rows, keypad->cols,
 					    keypad->keycodes,
 					    keypad->input_dev);
 	kfree(keymap_data.keymap);
diff --git a/drivers/input/keyboard/spear-keyboard.c b/drivers/input/keyboard/spear-keyboard.c
index 2fae337562a2..e3abc1484520 100644
--- a/drivers/input/keyboard/spear-keyboard.c
+++ b/drivers/input/keyboard/spear-keyboard.c
@@ -234,7 +234,7 @@ static int spear_kbd_probe(struct platform_device *pdev)
 	input_dev->open = spear_kbd_open;
 	input_dev->close = spear_kbd_close;
 
-	error = matrix_keypad_build_keymap(keymap, NULL, NUM_ROWS, NUM_COLS,
+	error = matrix_keypad_build_keymap(keymap, NUM_ROWS, NUM_COLS,
 					   kbd->keycodes, input_dev);
 	if (error) {
 		dev_err(&pdev->dev, "Failed to build keymap\n");
diff --git a/drivers/input/keyboard/st-keyscan.c b/drivers/input/keyboard/st-keyscan.c
index e53ef4c670e4..3a10cd3fe58f 100644
--- a/drivers/input/keyboard/st-keyscan.c
+++ b/drivers/input/keyboard/st-keyscan.c
@@ -157,7 +157,7 @@ static int keyscan_probe(struct platform_device *pdev)
 	if (error)
 		return error;
 
-	error = matrix_keypad_build_keymap(NULL, NULL,
+	error = matrix_keypad_build_keymap(NULL,
 					   keypad_data->n_rows,
 					   keypad_data->n_cols,
 					   NULL, input_dev);
diff --git a/drivers/input/keyboard/stmpe-keypad.c b/drivers/input/keyboard/stmpe-keypad.c
index 0acded4fb9c9..15f492dc7e64 100644
--- a/drivers/input/keyboard/stmpe-keypad.c
+++ b/drivers/input/keyboard/stmpe-keypad.c
@@ -367,7 +367,7 @@ static int stmpe_keypad_probe(struct platform_device *pdev)
 	if (error)
 		return error;
 
-	error = matrix_keypad_build_keymap(NULL, NULL, rows, cols,
+	error = matrix_keypad_build_keymap(NULL, rows, cols,
 					   keypad->keymap, input);
 	if (error)
 		return error;
diff --git a/drivers/input/keyboard/tc3589x-keypad.c b/drivers/input/keyboard/tc3589x-keypad.c
index 11988cffdfae..042665d146ea 100644
--- a/drivers/input/keyboard/tc3589x-keypad.c
+++ b/drivers/input/keyboard/tc3589x-keypad.c
@@ -410,7 +410,7 @@ static int tc3589x_keypad_probe(struct platform_device *pdev)
 	input->open = tc3589x_keypad_open;
 	input->close = tc3589x_keypad_close;
 
-	error = matrix_keypad_build_keymap(plat->keymap_data, NULL,
+	error = matrix_keypad_build_keymap(plat->keymap_data,
 					   TC3589x_MAX_KPROW, TC3589x_MAX_KPCOL,
 					   NULL, input);
 	if (error) {
diff --git a/drivers/input/keyboard/tca8418_keypad.c b/drivers/input/keyboard/tca8418_keypad.c
index 68c0afafee7b..6a1ecd0d5a15 100644
--- a/drivers/input/keyboard/tca8418_keypad.c
+++ b/drivers/input/keyboard/tca8418_keypad.c
@@ -317,7 +317,7 @@ static int tca8418_keypad_probe(struct i2c_client *client)
 	input->id.product = 0x001;
 	input->id.version = 0x0001;
 
-	error = matrix_keypad_build_keymap(NULL, NULL, rows, cols, NULL, input);
+	error = matrix_keypad_build_keymap(NULL, rows, cols, NULL, input);
 	if (error) {
 		dev_err(dev, "Failed to build keymap\n");
 		return error;
diff --git a/drivers/input/keyboard/tegra-kbc.c b/drivers/input/keyboard/tegra-kbc.c
index bc1c80a456f2..663e0c6abab7 100644
--- a/drivers/input/keyboard/tegra-kbc.c
+++ b/drivers/input/keyboard/tegra-kbc.c
@@ -648,7 +648,7 @@ static int tegra_kbc_probe(struct platform_device *pdev)
 	if (kbc->keymap_data && kbc->use_fn_map)
 		keymap_rows *= 2;
 
-	err = matrix_keypad_build_keymap(kbc->keymap_data, NULL,
+	err = matrix_keypad_build_keymap(kbc->keymap_data,
 					 keymap_rows,
 					 kbc->hw_support->max_columns,
 					 kbc->keycode, kbc->idev);
diff --git a/drivers/input/keyboard/twl4030_keypad.c b/drivers/input/keyboard/twl4030_keypad.c
index 77e0743a3cf8..852f107e8e05 100644
--- a/drivers/input/keyboard/twl4030_keypad.c
+++ b/drivers/input/keyboard/twl4030_keypad.c
@@ -379,7 +379,7 @@ static int twl4030_kp_probe(struct platform_device *pdev)
 	if (kp->irq < 0)
 		return kp->irq;
 
-	error = matrix_keypad_build_keymap(keymap_data, NULL,
+	error = matrix_keypad_build_keymap(keymap_data,
 					   TWL4030_MAX_ROWS,
 					   1 << TWL4030_ROW_SHIFT,
 					   kp->keymap, input);
diff --git a/drivers/input/matrix-keymap.c b/drivers/input/matrix-keymap.c
index 3bea3575a0a9..8de9bad3865a 100644
--- a/drivers/input/matrix-keymap.c
+++ b/drivers/input/matrix-keymap.c
@@ -66,10 +66,10 @@ int matrix_keypad_parse_properties(struct device *dev,
 }
 EXPORT_SYMBOL_GPL(matrix_keypad_parse_properties);
 
-static int matrix_keypad_parse_keymap(const char *propname,
-				      unsigned int rows, unsigned int cols,
+static int matrix_keypad_parse_keymap(unsigned int rows, unsigned int cols,
 				      struct input_dev *input_dev)
 {
+	static const char propname[] = "linux,keymap";
 	struct device *dev = input_dev->dev.parent;
 	unsigned int row_shift = get_count_order(cols);
 	unsigned int max_keys = rows << row_shift;
@@ -77,9 +77,6 @@ static int matrix_keypad_parse_keymap(const char *propname,
 	int size;
 	int error;
 
-	if (!propname)
-		propname = "linux,keymap";
-
 	size = device_property_count_u32(dev, propname);
 	if (size <= 0) {
 		dev_err(dev, "missing or malformed property %s: %d\n",
@@ -116,8 +113,6 @@ static int matrix_keypad_parse_keymap(const char *propname,
 /**
  * matrix_keypad_build_keymap - convert platform keymap into matrix keymap
  * @keymap_data: keymap supplied by the platform code
- * @keymap_name: name of device tree property containing keymap (if device
- *	tree support is enabled).
  * @rows: number of rows in target keymap array
  * @cols: number of cols in target keymap array
  * @keymap: expanded version of keymap that is suitable for use by
@@ -129,8 +124,7 @@ static int matrix_keypad_parse_keymap(const char *propname,
  * keyboard driver that uses row and col as indices.
  *
  * If @keymap_data is not supplied and device tree support is enabled
- * it will attempt load the keymap from property specified by @keymap_name
- * argument (or "linux,keymap" if @keymap_name is %NULL).
+ * it will attempt load the keymap from "linux,keymap" property.
  *
  * If @keymap is %NULL the function will automatically allocate managed
  * block of memory to store the keymap. This memory will be associated with
@@ -141,7 +135,6 @@ static int matrix_keypad_parse_keymap(const char *propname,
  * function.
  */
 int matrix_keypad_build_keymap(const struct matrix_keymap_data *keymap_data,
-			       const char *keymap_name,
 			       unsigned int rows, unsigned int cols,
 			       unsigned short *keymap,
 			       struct input_dev *input_dev)
@@ -180,8 +173,7 @@ int matrix_keypad_build_keymap(const struct matrix_keymap_data *keymap_data,
 				return -EINVAL;
 		}
 	} else {
-		error = matrix_keypad_parse_keymap(keymap_name, rows, cols,
-						   input_dev);
+		error = matrix_keypad_parse_keymap(rows, cols, input_dev);
 		if (error)
 			return error;
 	}
diff --git a/include/linux/input/matrix_keypad.h b/include/linux/input/matrix_keypad.h
index 90867f44ab4d..04562627dd77 100644
--- a/include/linux/input/matrix_keypad.h
+++ b/include/linux/input/matrix_keypad.h
@@ -35,7 +35,6 @@ struct matrix_keymap_data {
 };
 
 int matrix_keypad_build_keymap(const struct matrix_keymap_data *keymap_data,
-			       const char *keymap_name,
 			       unsigned int rows, unsigned int cols,
 			       unsigned short *keymap,
 			       struct input_dev *input_dev);
-- 
2.51.0.rc1.163.g2494970778-goog


-- 
Dmitry

^ permalink raw reply related

* [PATCH] Input: twl4030_keypad - drop support for platform data
From: Dmitry Torokhov @ 2025-08-15 17:36 UTC (permalink / raw)
  To: linux-input
  Cc: Andreas Kemnade, Jihed Chaibi, Tony Lindgren,
	Uwe Kleine-König, linux-kernel

Support for platform data from dropped from twl in 4a346a03a63c ("mfd:
twl: Remove platform data support") and board files were dropped even
earlier. There are no in-kernel users of twl4030_keypad_data in the
kernel, and the driver supports configuration via generic device
properties.

Drop support of static platform data from the keypad driver.

Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
---
 drivers/input/keyboard/twl4030_keypad.c | 35 +++++--------------------
 1 file changed, 6 insertions(+), 29 deletions(-)

diff --git a/drivers/input/keyboard/twl4030_keypad.c b/drivers/input/keyboard/twl4030_keypad.c
index 852f107e8e05..3a5ab61d5347 100644
--- a/drivers/input/keyboard/twl4030_keypad.c
+++ b/drivers/input/keyboard/twl4030_keypad.c
@@ -28,10 +28,6 @@
  * an internal state machine that decodes pressed keys, including
  * multi-key combinations.
  *
- * This driver lets boards define what keycodes they wish to report for
- * which scancodes, as part of the "struct twl4030_keypad_data" used in
- * the probe() routine.
- *
  * See the TPS65950 documentation; that's the general availability
  * version of the TWL5030 second generation part.
  */
@@ -47,7 +43,6 @@
 struct twl4030_keypad {
 	unsigned short	keymap[TWL4030_KEYMAP_SIZE];
 	u16		kp_state[TWL4030_MAX_ROWS];
-	bool		autorepeat;
 	unsigned int	n_rows;
 	unsigned int	n_cols;
 	int		irq;
@@ -322,8 +317,6 @@ static int twl4030_kp_program(struct twl4030_keypad *kp)
  */
 static int twl4030_kp_probe(struct platform_device *pdev)
 {
-	struct twl4030_keypad_data *pdata = dev_get_platdata(&pdev->dev);
-	const struct matrix_keymap_data *keymap_data = NULL;
 	struct twl4030_keypad *kp;
 	struct input_dev *input;
 	u8 reg;
@@ -350,24 +343,10 @@ static int twl4030_kp_probe(struct platform_device *pdev)
 	input->id.product	= 0x0001;
 	input->id.version	= 0x0003;
 
-	if (pdata) {
-		if (!pdata->rows || !pdata->cols || !pdata->keymap_data) {
-			dev_err(&pdev->dev, "Missing platform_data\n");
-			return -EINVAL;
-		}
-
-		kp->n_rows = pdata->rows;
-		kp->n_cols = pdata->cols;
-		kp->autorepeat = pdata->rep;
-		keymap_data = pdata->keymap_data;
-	} else {
-		error = matrix_keypad_parse_properties(&pdev->dev, &kp->n_rows,
-						       &kp->n_cols);
-		if (error)
-			return error;
-
-		kp->autorepeat = true;
-	}
+	error = matrix_keypad_parse_properties(&pdev->dev,
+					       &kp->n_rows, &kp->n_cols);
+	if (error)
+		return error;
 
 	if (kp->n_rows > TWL4030_MAX_ROWS || kp->n_cols > TWL4030_MAX_COLS) {
 		dev_err(&pdev->dev,
@@ -379,7 +358,7 @@ static int twl4030_kp_probe(struct platform_device *pdev)
 	if (kp->irq < 0)
 		return kp->irq;
 
-	error = matrix_keypad_build_keymap(keymap_data,
+	error = matrix_keypad_build_keymap(NULL,
 					   TWL4030_MAX_ROWS,
 					   1 << TWL4030_ROW_SHIFT,
 					   kp->keymap, input);
@@ -389,9 +368,7 @@ static int twl4030_kp_probe(struct platform_device *pdev)
 	}
 
 	input_set_capability(input, EV_MSC, MSC_SCAN);
-	/* Enable auto repeat feature of Linux input subsystem */
-	if (kp->autorepeat)
-		__set_bit(EV_REP, input->evbit);
+	__set_bit(EV_REP, input->evbit);
 
 	error = input_register_device(input);
 	if (error) {
-- 
2.51.0.rc1.163.g2494970778-goog


-- 
Dmitry

^ permalink raw reply related

* Re: [PATCH v2 0/9] dt-bindings: Convert TWL4030/6040 family binding to DT schema
From: Andreas Kemnade @ 2025-08-15 15:00 UTC (permalink / raw)
  To: Jihed Chaibi
  Cc: linux-kernel, peter.ujfalusi, dmitry.torokhov, robh, krzk+dt,
	lgirdwood, tiwai, conor+dt, lee, ukleinek, broonie, gregkh,
	linux-input, devicetree, linux-pwm, linux-sound, linux-usb, shuah,
	linux-omap
In-Reply-To: <20250814132129.138943-1-jihed.chaibi.dev@gmail.com>

Hi,

Am Thu, 14 Aug 2025 15:21:20 +0200
schrieb Jihed Chaibi <jihed.chaibi.dev@gmail.com>:

> Hi,
> 
> This series modernizes the Device Tree bindings for the Texas
> Instruments TWL4030/TWL6040 family by converting all remaining
> legacy TXT bindings to the structured YAML DT schema format.
> 
> This improves the bindings by adding formal type checking, clear property
> definitions, and machine-readable examples, which allows for automated
> validation and better documentation for developers.
> 
> This v2 series addresses feedback from the initial submission, adds a new
> patch to fix validation errors that were uncovered by the stricter schemas,
> and includes several other minor improvements.
> 
for further submissions:
+CC: linux-omap@vger.kernel.org

That will help bringing the related people together. Apparently
MAINTAINERS needs to be updated, too. The drivers .c-files are listed
but not the bindings.

Regards,
Andreas

^ permalink raw reply

* Re: [PATCH 1/2] Input: Add key event code for Fn + P
From: Edip Hazuri @ 2025-08-15 14:49 UTC (permalink / raw)
  To: dmitry.torokhov, jikos; +Cc: bentiss, linux-input, linux-kernel, Edip Hazuri
In-Reply-To: <20250802212149.16707-2-edip@medip.dev>

On Sunday, August 3, 2025 12:21:50 AM GMT+03:00 edip@medip.dev wrote:
> From: Edip Hazuri <edip@medip.dev>
> 
> Newer Victus (and probably newer omen) laptops contains a "Fn + P"
> Shortcut. This is intended to use with Omen Gaming Hub, Which is
> changing the performance profile when this shortcut triggered. This
> shortcut is shown on performance control page, see [1]
> 
> Currently there is no key definition to handle this. So add a KEY_FN_P
> keycode define to be able to use this shortcut.
> 
> [1]: https://jpcdn.it/img/adadf6c927ffeb75afd8038f95db400a.png
> 
> Signed-off-by: Edip Hazuri <edip@medip.dev>
> ---
>  drivers/hid/hid-debug.c                | 2 +-
>  include/uapi/linux/input-event-codes.h | 1 +
>  2 files changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/hid/hid-debug.c b/drivers/hid/hid-debug.c
> index 4424c0512ba..2bcf7b24801 100644
> --- a/drivers/hid/hid-debug.c
> +++ b/drivers/hid/hid-debug.c
> @@ -3342,7 +3342,7 @@ static const char *keys[KEY_MAX + 1] = {
>  	[KEY_FN_1] = "Fn+1",			[KEY_FN_2] = 
"Fn+2",
>  	[KEY_FN_B] = "Fn+B",			[KEY_FN_D] = "Fn+D",
>  	[KEY_FN_E] = "Fn+E",			[KEY_FN_F] = 
"Fn+F",
> -	[KEY_FN_S] = "Fn+S",
> +	[KEY_FN_S] = "Fn+S",			[KEY_FN_P] = "Fn+P",
>  	[KEY_FN_F1] = "Fn+F1",			[KEY_FN_F2] = 
"Fn+F2",
>  	[KEY_FN_F3] = "Fn+F3",			[KEY_FN_F4] = 
"Fn+F4",
>  	[KEY_FN_F5] = "Fn+F5",			[KEY_FN_F6] = 
"Fn+F6",
> diff --git a/include/uapi/linux/input-event-codes.h
> b/include/uapi/linux/input-event-codes.h index 3b2524e4b66..2fc79b32425
> 100644
> --- a/include/uapi/linux/input-event-codes.h
> +++ b/include/uapi/linux/input-event-codes.h
> @@ -548,6 +548,7 @@
>  #define KEY_FN_S		0x1e3
>  #define KEY_FN_B		0x1e4
>  #define KEY_FN_RIGHT_SHIFT	0x1e5
> +#define KEY_FN_P		0x1e6
> 
>  #define KEY_BRL_DOT1		0x1f1
>  #define KEY_BRL_DOT2		0x1f2

Hello,

Please don't merge this. I made a v2 of this patch and this is no longer 
needed. 

Thanks!




^ permalink raw reply

* Re: (subset) [PATCH 00/21] treewide: remove unneeded 'fast_io' parameter in regmap_config
From: Bjorn Andersson @ 2025-08-15 14:42 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, 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, Vinod Koul,
	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!

[18/21] soc: remove unneeded 'fast_io' parameter in regmap_config
        commit: 5d8a9c8401648d338d072a488d455ed4611c5d4b

Best regards,
-- 
Bjorn Andersson <andersson@kernel.org>

^ permalink raw reply

* [dtor-input:next] BUILD SUCCESS 80025149db06566079a9727b2abf17300081608c
From: kernel test robot @ 2025-08-15 14:18 UTC (permalink / raw)
  To: Dmitry Torokhov; +Cc: linux-input

tree/branch: https://git.kernel.org/pub/scm/linux/kernel/git/dtor/input.git next
branch HEAD: 80025149db06566079a9727b2abf17300081608c  Input: include export.h in modules using EXPORT_SYMBOL*()

elapsed time: 1154m

configs tested: 128
configs skipped: 5

The following configs have been built successfully.
More configs may be tested in the coming days.

tested configs:
alpha                             allnoconfig    gcc-15.1.0
alpha                            allyesconfig    gcc-15.1.0
alpha                               defconfig    gcc-15.1.0
arc                              allmodconfig    gcc-15.1.0
arc                               allnoconfig    gcc-15.1.0
arc                              allyesconfig    gcc-15.1.0
arc                                 defconfig    gcc-15.1.0
arc                     haps_hs_smp_defconfig    gcc-15.1.0
arc                   randconfig-001-20250815    gcc-8.5.0
arc                   randconfig-002-20250815    gcc-9.5.0
arm                              allmodconfig    gcc-15.1.0
arm                               allnoconfig    clang-22
arm                              allyesconfig    gcc-15.1.0
arm                                 defconfig    clang-22
arm                      footbridge_defconfig    clang-17
arm                        mvebu_v5_defconfig    gcc-15.1.0
arm                   randconfig-001-20250815    clang-16
arm                   randconfig-002-20250815    clang-18
arm                   randconfig-003-20250815    gcc-14.3.0
arm                   randconfig-004-20250815    gcc-8.5.0
arm64                            allmodconfig    clang-19
arm64                             allnoconfig    gcc-15.1.0
arm64                               defconfig    gcc-15.1.0
arm64                 randconfig-001-20250815    gcc-8.5.0
arm64                 randconfig-002-20250815    gcc-8.5.0
arm64                 randconfig-003-20250815    clang-22
arm64                 randconfig-004-20250815    gcc-15.1.0
csky                              allnoconfig    gcc-15.1.0
csky                                defconfig    gcc-15.1.0
csky                  randconfig-001-20250815    gcc-15.1.0
csky                  randconfig-002-20250815    gcc-15.1.0
hexagon                          allmodconfig    clang-17
hexagon                           allnoconfig    clang-22
hexagon                          allyesconfig    clang-22
hexagon               randconfig-001-20250815    clang-22
hexagon               randconfig-002-20250815    clang-22
i386                             allmodconfig    gcc-12
i386                              allnoconfig    gcc-12
i386                             allyesconfig    gcc-12
i386        buildonly-randconfig-001-20250815    gcc-12
i386        buildonly-randconfig-002-20250815    clang-20
i386        buildonly-randconfig-003-20250815    clang-20
i386        buildonly-randconfig-004-20250815    clang-20
i386        buildonly-randconfig-005-20250815    clang-20
i386        buildonly-randconfig-006-20250815    gcc-12
i386                                defconfig    clang-20
loongarch                        allmodconfig    clang-19
loongarch                         allnoconfig    clang-22
loongarch             randconfig-001-20250815    clang-22
loongarch             randconfig-002-20250815    clang-20
m68k                             allmodconfig    gcc-15.1.0
m68k                              allnoconfig    gcc-15.1.0
m68k                             allyesconfig    gcc-15.1.0
microblaze                       allmodconfig    gcc-15.1.0
microblaze                        allnoconfig    gcc-15.1.0
microblaze                       allyesconfig    gcc-15.1.0
microblaze                          defconfig    gcc-15.1.0
mips                              allnoconfig    gcc-15.1.0
nios2                             allnoconfig    gcc-11.5.0
nios2                               defconfig    gcc-11.5.0
nios2                 randconfig-001-20250815    gcc-11.5.0
nios2                 randconfig-002-20250815    gcc-11.5.0
openrisc                          allnoconfig    gcc-15.1.0
openrisc                         allyesconfig    gcc-15.1.0
openrisc                            defconfig    gcc-15.1.0
parisc                           allmodconfig    gcc-15.1.0
parisc                            allnoconfig    gcc-15.1.0
parisc                           allyesconfig    gcc-15.1.0
parisc                              defconfig    gcc-15.1.0
parisc                randconfig-001-20250815    gcc-8.5.0
parisc                randconfig-002-20250815    gcc-14.3.0
parisc64                            defconfig    gcc-15.1.0
powerpc                          allmodconfig    gcc-15.1.0
powerpc                           allnoconfig    gcc-15.1.0
powerpc                          allyesconfig    clang-22
powerpc               randconfig-001-20250815    gcc-11.5.0
powerpc               randconfig-002-20250815    clang-19
powerpc               randconfig-003-20250815    gcc-11.5.0
powerpc64             randconfig-001-20250815    gcc-14.3.0
powerpc64             randconfig-002-20250815    gcc-10.5.0
powerpc64             randconfig-003-20250815    clang-22
riscv                            allmodconfig    clang-22
riscv                             allnoconfig    gcc-15.1.0
riscv                            allyesconfig    clang-16
riscv                               defconfig    clang-22
riscv                 randconfig-001-20250815    gcc-12.5.0
riscv                 randconfig-002-20250815    gcc-8.5.0
s390                             allmodconfig    clang-18
s390                              allnoconfig    clang-22
s390                             allyesconfig    gcc-15.1.0
s390                                defconfig    clang-22
s390                  randconfig-001-20250815    gcc-8.5.0
s390                  randconfig-002-20250815    clang-22
sh                               allmodconfig    gcc-15.1.0
sh                                allnoconfig    gcc-15.1.0
sh                               allyesconfig    gcc-15.1.0
sh                                  defconfig    gcc-15.1.0
sh                    randconfig-001-20250815    gcc-11.5.0
sh                    randconfig-002-20250815    gcc-12.5.0
sparc                            allmodconfig    gcc-15.1.0
sparc                             allnoconfig    gcc-15.1.0
sparc                               defconfig    gcc-15.1.0
sparc                 randconfig-001-20250815    gcc-11.5.0
sparc                 randconfig-002-20250815    gcc-13.4.0
sparc64                             defconfig    clang-20
sparc64               randconfig-001-20250815    clang-22
sparc64               randconfig-002-20250815    gcc-15.1.0
um                               allmodconfig    clang-19
um                                allnoconfig    clang-22
um                               allyesconfig    gcc-12
um                                  defconfig    clang-22
um                             i386_defconfig    gcc-12
um                    randconfig-001-20250815    gcc-12
um                    randconfig-002-20250815    clang-19
um                           x86_64_defconfig    clang-22
x86_64                            allnoconfig    clang-20
x86_64                           allyesconfig    clang-20
x86_64      buildonly-randconfig-001-20250815    clang-20
x86_64      buildonly-randconfig-002-20250815    gcc-12
x86_64      buildonly-randconfig-003-20250815    gcc-12
x86_64      buildonly-randconfig-004-20250815    clang-20
x86_64      buildonly-randconfig-005-20250815    clang-20
x86_64      buildonly-randconfig-006-20250815    gcc-12
x86_64                              defconfig    gcc-11
x86_64                          rhel-9.4-rust    clang-20
xtensa                            allnoconfig    gcc-15.1.0
xtensa                randconfig-001-20250815    gcc-8.5.0
xtensa                randconfig-002-20250815    gcc-15.1.0

--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

^ permalink raw reply

* Re: [PATCH v2 00/17] Further hid-pidff improvements and fixes
From: Jiri Kosina @ 2025-08-15 14:01 UTC (permalink / raw)
  To: Tomasz Pakuła; +Cc: bentiss, oleg, linux-input
In-Reply-To: <20250813201005.17819-1-tomasz.pakula.oficjalny@gmail.com>

On Wed, 13 Aug 2025, Tomasz Pakuła wrote:

> Another batch of improvements/fixes/updates to the hid-pidff driver. A lot of
> code quality improvements with probably more to come as we better understand the
> driver and strive to simplify it's inner workings. I think we're currently past
> 75% of touchups + Oleg is working on some compatibility changes for Simagic
> support in a "pass-through" mode.
> 
> Direction fix only for conditional effects fixes FFB in Forza games on Moza.
> 
> I removed Anssi's email from the "welcome message" that appears on succesful
> PID init to make sure people will look for LKML to send in bug reports.
> 
> Changes in v2:
> - Added changelogs to commits changing debug messages
> 
> Tomasz Pakuła (17):
>   HID: pidff: Use direction fix only for conditional effects
>   HID: pidff: Remove unhelpful pidff_set_actuators helper
>   HID: pidff: Remove unneeded debug
>   HID: pidff: Use ARRAY_SIZE macro instead of sizeof
>   HID: pidff: Treat PID_REQUIRED_REPORTS as count, not max
>   HID: pidff: Better quirk assigment when searching for fields
>   HID: pidff: Simplify HID field/usage searching logic
>   HID: pidff: Add support for AXES_ENABLE field
>   HID: pidff: Update debug messages
>   HID: pidff: Rework pidff_upload_effect
>   HID: pidff: Separate check for infinite duration
>   HID: pidff: PERMISSIVE_CONTROL quirk autodetection
>   HID: pidff: Remove Anssi's email address from info msg
>   HID: pidff: Define all cardinal directions
>   HID: pidff: clang-format pass
>   HID: universal-pidff: clang-format pass
>   HID: pidff: Reduce PID_EFFECT_OPERATION spam

This is now in hid.git#for-6.18/pidff. Thanks,

-- 
Jiri Kosina
SUSE Labs


^ permalink raw reply

* Re: [PATCH 0/1] HID: amd_sfh: Add support for tablet mode
From: Paweł Kotiuk @ 2025-08-15  9:12 UTC (permalink / raw)
  To: bnatikar
  Cc: adrian, basavaraj.natikar, benato.denis96, bentiss, iv.dovg,
	jikos, linux-input, linux-kernel, luke
In-Reply-To: <db1d95be-e92a-4328-b43e-8214a0b520be@amd.com>

> Sure, Jiri, I will get back to this patch soon.

Hi Basavaraj,

Could yougive us at least a rough estimate when you will be able to check this patch?

Thanks in advance
Paweł

^ permalink raw reply

* Re: [PATCH 1/2] gpiolib: acpi: Add quirk for ASUS ProArt PX13
From: Mika Westerberg @ 2025-08-15  6:45 UTC (permalink / raw)
  To: Mario Limonciello (AMD)
  Cc: Andy Shevchenko, Linus Walleij, 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: <20250814183430.3887973-1-superm1@kernel.org>

On Thu, Aug 14, 2025 at 01:34:29PM -0500, Mario Limonciello (AMD) 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>

Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com>

^ permalink raw reply

* Re: [PATCH v2 2/2] HID: Make elan touch controllers power on after panel is enabled
From: Doug Anderson @ 2025-08-15  0:19 UTC (permalink / raw)
  To: Pin-yen Lin
  Cc: Neil Armstrong, Jessica Zhang, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, David Airlie, Simona Vetter, Jiri Kosina,
	Benjamin Tissoires, dri-devel, linux-kernel, linux-input,
	Chen-Yu Tsai
In-Reply-To: <20250813125132.1319482-2-treapking@chromium.org>

Hi,

On Wed, Aug 13, 2025 at 5:51 AM Pin-yen Lin <treapking@chromium.org> wrote:
>
> Introduce a new HID quirk to indicate that this device has to be enabled
> after the panel's backlight is enabled, and update the driver data for
> the elan devices to enable this quirk. This cannot be a I2C HID quirk
> because the kernel needs to acknowledge this before powering up the
> device and read the VID/PID. When this quirk is enabled, register
> .panel_enabled()/.panel_disabling() instead for the panel follower.
>
> Also rename the *panel_prepare* functions into *panel_follower* because
> they could be called in other situations now.
>
> Signed-off-by: Pin-yen Lin <treapking@chromium.org>
>
> ---
>
> Changes in v2:
> - Rename *panel_prepare* functions to *panel_follower*
> - Replace after_panel_enabled flag with enabled/disabling callbacks
>
>  drivers/hid/i2c-hid/i2c-hid-core.c    | 46 ++++++++++++++++-----------
>  drivers/hid/i2c-hid/i2c-hid-of-elan.c | 11 ++++++-
>  include/linux/hid.h                   |  2 ++
>  3 files changed, 40 insertions(+), 19 deletions(-)

This seems reasonable to me.

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

Given that this affects devices that we already had support for
(you're changing the behavior of two touchscreens), should it have a
Fixes tag?

We'll also need to figure out a process for landing the two patches. I
can easily land the first one in drm-misc-next, but then it'll be a
while before the i2c-hid one can land. Is it OK to wait?


-Doug

^ permalink raw reply

* Re: [PATCH v2 1/2] drm/panel: Allow powering on panel follower after panel is enabled
From: Doug Anderson @ 2025-08-15  0:19 UTC (permalink / raw)
  To: Pin-yen Lin
  Cc: Neil Armstrong, Jessica Zhang, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, David Airlie, Simona Vetter, Jiri Kosina,
	Benjamin Tissoires, dri-devel, linux-kernel, linux-input,
	Chen-Yu Tsai
In-Reply-To: <20250813125132.1319482-1-treapking@chromium.org>

Hi,

On Wed, Aug 13, 2025 at 5:51 AM Pin-yen Lin <treapking@chromium.org> wrote:
>
> @@ -230,6 +239,18 @@ void drm_panel_enable(struct drm_panel *panel)
>         if (ret < 0)
>                 DRM_DEV_INFO(panel->dev, "failed to enable backlight: %d\n",
>                              ret);
> +
> +       list_for_each_entry(follower, &panel->followers, list) {
> +               if (!follower->funcs->panel_enabled)
> +                       continue;
> +
> +               ret = follower->funcs->panel_enabled(follower);
> +               if (ret < 0)
> +                       dev_info(panel->dev, "%ps failed: %d\n",
> +                                follower->funcs->panel_enabled, ret);
> +       }
> +exit:
> +       mutex_unlock(&panel->follower_lock);

Extremely nitty nit: all of the other functions have a blank line
before the "exit" label. :-P Could you match?


> @@ -598,12 +641,18 @@ void drm_panel_remove_follower(struct drm_panel_follower *follower)
>
>         mutex_lock(&panel->follower_lock);
>
> -       if (panel->prepared) {
> +       if (panel->prepared && follower->funcs->panel_unpreparing) {
>                 ret = follower->funcs->panel_unpreparing(follower);
>                 if (ret < 0)
>                         dev_info(panel->dev, "%ps failed: %d\n",
>                                  follower->funcs->panel_unpreparing, ret);
>         }
> +       if (panel->enabled && follower->funcs->panel_disabling) {
> +               ret = follower->funcs->panel_disabling(follower);
> +               if (ret < 0)
> +                       dev_info(panel->dev, "%ps failed: %d\n",
> +                                follower->funcs->panel_disabling, ret);
> +       }

The above order is incorrect. You should call "panel_disabling" before
"panel_unpreparing" which will match the natural order things are
called in.

Also: please review kernel-docs for the following functions and update
them for your patch:
* drm_panel_add_follower()
* drm_panel_remove_follower()

-Doug

^ permalink raw reply

* [PATCH v3] HID: lg-g15 - Add support for Logitech G13.
From: Leo L. Schwab @ 2025-08-14 21:26 UTC (permalink / raw)
  To: Hans de Goede
  Cc: Kate Hsuan, Leo L. Schwab, Jiri Kosina, Benjamin Tissoires,
	linux-input, linux-kernel

The Logitech G13 is a gaming keypad with general-purpose macro keys,
four LED-backlit macro preset keys, five "menu" keys, backlight toggle
key, an analog thumbstick, RGB LED backlight, and a monochrome LCD
display.

Support input event generation for all keys and the thumbstick, and
expose all LEDs.

Signed-off-by: Leo L. Schwab <ewhac@ewhac.org>
---
 drivers/hid/hid-ids.h    |   1 +
 drivers/hid/hid-lg-g15.c | 428 +++++++++++++++++++++++++++++++++++++--
 2 files changed, 413 insertions(+), 16 deletions(-)

diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h
index 33cc5820f2be..7ed1e402b80a 100644
--- a/drivers/hid/hid-ids.h
+++ b/drivers/hid/hid-ids.h
@@ -870,6 +870,7 @@
 #define USB_DEVICE_ID_LOGITECH_DUAL_ACTION	0xc216
 #define USB_DEVICE_ID_LOGITECH_RUMBLEPAD2	0xc218
 #define USB_DEVICE_ID_LOGITECH_RUMBLEPAD2_2	0xc219
+#define USB_DEVICE_ID_LOGITECH_G13		0xc21c
 #define USB_DEVICE_ID_LOGITECH_G15_LCD		0xc222
 #define USB_DEVICE_ID_LOGITECH_G11		0xc225
 #define USB_DEVICE_ID_LOGITECH_G15_V2_LCD	0xc227
diff --git a/drivers/hid/hid-lg-g15.c b/drivers/hid/hid-lg-g15.c
index f8605656257b..6e1d79abfb23 100644
--- a/drivers/hid/hid-lg-g15.c
+++ b/drivers/hid/hid-lg-g15.c
@@ -26,7 +26,11 @@
 #define LG_G510_FEATURE_BACKLIGHT_RGB	0x05
 #define LG_G510_FEATURE_POWER_ON_RGB	0x06
 
+#define LG_G13_FEATURE_M_KEYS_LEDS	0x05
+#define LG_G13_FEATURE_BACKLIGHT_RGB	0x07
+
 enum lg_g15_model {
+	LG_G13,
 	LG_G15,
 	LG_G15_V2,
 	LG_G510,
@@ -45,6 +49,12 @@ enum lg_g15_led_type {
 	LG_G15_LED_MAX
 };
 
+struct g13_input_report {
+	u8 report_id;	/* Report ID is always set to 1. */
+	u8 joy_x, joy_y;
+	u8 keybits[5];
+};
+
 struct lg_g15_led {
 	union {
 		struct led_classdev cdev;
@@ -63,12 +73,172 @@ struct lg_g15_data {
 	struct mutex mutex;
 	struct work_struct work;
 	struct input_dev *input;
+	struct input_dev *input_js; /* Separate joystick device for G13. */
 	struct hid_device *hdev;
 	enum lg_g15_model model;
 	struct lg_g15_led leds[LG_G15_LED_MAX];
 	bool game_mode_enabled;
 };
 
+/********* G13 LED functions ***********/
+/*
+ * G13 retains no state across power cycles, and always powers up with the backlight on,
+ * color #5AFF6E, all macro key LEDs off.
+ */
+static int lg_g13_get_leds_state(struct lg_g15_data *g15)
+{
+	u8 * const tbuf = g15->transfer_buf;
+	int ret, high;
+
+	/* RGB backlight. */
+	ret = hid_hw_raw_request(g15->hdev, LG_G13_FEATURE_BACKLIGHT_RGB,
+				 tbuf, 5,
+				 HID_FEATURE_REPORT, HID_REQ_GET_REPORT);
+	if (ret != 5) {
+		hid_err(g15->hdev, "Error getting backlight brightness: %d\n", ret);
+		return (ret < 0) ? ret : -EIO;
+	}
+
+	/* Normalize RGB intensities against the highest component. */
+	high = max3(tbuf[1], tbuf[2], tbuf[3]);
+	if (high) {
+		g15->leds[LG_G15_KBD_BRIGHTNESS].red =
+			DIV_ROUND_CLOSEST(tbuf[1] * 255, high);
+		g15->leds[LG_G15_KBD_BRIGHTNESS].green =
+			DIV_ROUND_CLOSEST(tbuf[2] * 255, high);
+		g15->leds[LG_G15_KBD_BRIGHTNESS].blue =
+			DIV_ROUND_CLOSEST(tbuf[3] * 255, high);
+		g15->leds[LG_G15_KBD_BRIGHTNESS].brightness = high;
+	} else {
+		g15->leds[LG_G15_KBD_BRIGHTNESS].red        = 255;
+		g15->leds[LG_G15_KBD_BRIGHTNESS].green      = 255;
+		g15->leds[LG_G15_KBD_BRIGHTNESS].blue       = 255;
+		g15->leds[LG_G15_KBD_BRIGHTNESS].brightness = 0;
+	}
+
+	/* Macro LEDs. */
+	ret = hid_hw_raw_request(g15->hdev, LG_G13_FEATURE_M_KEYS_LEDS,
+				 tbuf, 5,
+				 HID_FEATURE_REPORT, HID_REQ_GET_REPORT);
+	if (ret != 5) {
+		hid_err(g15->hdev, "Error getting macro LED brightness: %d\n", ret);
+		return (ret < 0) ? ret : -EIO;
+	}
+
+	for (int i = LG_G15_MACRO_PRESET1; i < LG_G15_LED_MAX; ++i)
+		g15->leds[i].brightness = tbuf[1] & (1 << (i - LG_G15_MACRO_PRESET1));
+
+	return 0;
+}
+
+static int lg_g13_kbd_led_write(struct lg_g15_data *g15,
+				struct lg_g15_led *g15_led,
+				enum led_brightness brightness)
+{
+	struct mc_subled const * const subleds = g15_led->mcdev.subled_info;
+	u8 * const tbuf = g15->transfer_buf;
+	int ret;
+
+	guard(mutex)(&g15->mutex);
+
+	led_mc_calc_color_components(&g15_led->mcdev, brightness);
+
+	tbuf[0] = 5;
+	tbuf[1] = subleds[0].brightness;
+	tbuf[2] = subleds[1].brightness;
+	tbuf[3] = subleds[2].brightness;
+	tbuf[4] = 0;
+
+	ret = hid_hw_raw_request(g15->hdev, LG_G13_FEATURE_BACKLIGHT_RGB,
+				 tbuf, 5,
+				 HID_FEATURE_REPORT, HID_REQ_SET_REPORT);
+	if (ret != 5) {
+		hid_err(g15->hdev, "Error setting backlight brightness: %d\n", ret);
+		return (ret < 0) ? ret : -EIO;
+	}
+
+	g15_led->brightness = brightness;
+	return 0;
+}
+
+static int lg_g13_kbd_led_set(struct led_classdev *led_cdev, enum led_brightness brightness)
+{
+	struct led_classdev_mc *mc = lcdev_to_mccdev(led_cdev);
+	struct lg_g15_led *g15_led =
+		container_of(mc, struct lg_g15_led, mcdev);
+	struct lg_g15_data *g15 = dev_get_drvdata(led_cdev->dev->parent);
+
+	/* Ignore LED off on unregister / keyboard unplug */
+	if (led_cdev->flags & LED_UNREGISTERING)
+		return 0;
+
+	return lg_g13_kbd_led_write(g15, g15_led, brightness);
+}
+
+static enum led_brightness lg_g13_kbd_led_get(struct led_classdev *led_cdev)
+{
+	struct led_classdev_mc const * const mc = lcdev_to_mccdev(led_cdev);
+	struct lg_g15_led const *g15_led =
+		container_of(mc, struct lg_g15_led, mcdev);
+
+	return g15_led->brightness;
+}
+
+static int lg_g13_mkey_led_set(struct led_classdev *led_cdev, enum led_brightness brightness)
+{
+	struct lg_g15_led *g15_led =
+		container_of(led_cdev, struct lg_g15_led, cdev);
+	struct lg_g15_data *g15 = dev_get_drvdata(led_cdev->dev->parent);
+	int i, ret;
+	u8 * const tbuf = g15->transfer_buf;
+	u8 val, mask = 0;
+
+	/* Ignore LED off on unregister / keyboard unplug */
+	if (led_cdev->flags & LED_UNREGISTERING)
+		return 0;
+
+	guard(mutex)(&g15->mutex);
+
+	for (i = LG_G15_MACRO_PRESET1; i < LG_G15_LED_MAX; ++i) {
+		if (i == g15_led->led)
+			val = brightness;
+		else
+			val = g15->leds[i].brightness;
+
+		if (val)
+			mask |= 1 << (i - LG_G15_MACRO_PRESET1);
+	}
+
+	tbuf[0] = 5;
+	tbuf[1] = mask;
+	tbuf[2] = 0;
+	tbuf[3] = 0;
+	tbuf[4] = 0;
+
+	ret = hid_hw_raw_request(g15->hdev, LG_G13_FEATURE_M_KEYS_LEDS,
+				 tbuf, 5,
+				 HID_FEATURE_REPORT, HID_REQ_SET_REPORT);
+	if (ret != 5) {
+		hid_err(g15->hdev, "Error setting LED brightness: %d\n", ret);
+		return (ret < 0) ? ret : -EIO;
+	}
+
+	g15_led->brightness = brightness;
+	return 0;
+}
+
+static enum led_brightness lg_g13_mkey_led_get(struct led_classdev *led_cdev)
+{
+	/*
+	 * G13 doesn't change macro key LEDs behind our back, so they're
+	 * whatever we last set them to.
+	 */
+	struct lg_g15_led *g15_led =
+		container_of(led_cdev, struct lg_g15_led, cdev);
+
+	return g15_led->brightness;
+}
+
 /******** G15 and G15 v2 LED functions ********/
 
 static int lg_g15_update_led_brightness(struct lg_g15_data *g15)
@@ -390,6 +560,8 @@ static int lg_g15_get_initial_led_brightness(struct lg_g15_data *g15)
 	int ret;
 
 	switch (g15->model) {
+	case LG_G13:
+		return lg_g13_get_leds_state(g15);
 	case LG_G15:
 	case LG_G15_V2:
 		return lg_g15_update_led_brightness(g15);
@@ -417,6 +589,116 @@ static int lg_g15_get_initial_led_brightness(struct lg_g15_data *g15)
 
 /******** Input functions ********/
 
+/**
+ * g13_input_report.keybits[] is not 32-bit aligned, so we can't use the bitops macros.
+ *
+ * @ary: Pointer to array of u8s
+ * @b: Bit index into ary, LSB first.  Not range checked.
+ */
+#define	TEST_BIT(ary, b)	((1 << ((b) & 7)) & (ary)[(b) >> 3])
+
+/* Table mapping keybits[] bit positions to event codes. */
+/* Note: Indices are discontinuous to aid readability. */
+static const u16 g13_keys_for_bits[] = {
+	/* Main keypad - keys G1 - G22 */
+	[0] = KEY_MACRO1,
+	[1] = KEY_MACRO2,
+	[2] = KEY_MACRO3,
+	[3] = KEY_MACRO4,
+	[4] = KEY_MACRO5,
+	[5] = KEY_MACRO6,
+	[6] = KEY_MACRO7,
+	[7] = KEY_MACRO8,
+	[8] = KEY_MACRO9,
+	[9] = KEY_MACRO10,
+	[10] = KEY_MACRO11,
+	[11] = KEY_MACRO12,
+	[12] = KEY_MACRO13,
+	[13] = KEY_MACRO14,
+	[14] = KEY_MACRO15,
+	[15] = KEY_MACRO16,
+	[16] = KEY_MACRO17,
+	[17] = KEY_MACRO18,
+	[18] = KEY_MACRO19,
+	[19] = KEY_MACRO20,
+	[20] = KEY_MACRO21,
+	[21] = KEY_MACRO22,
+
+	/* LCD menu buttons. */
+	[24] = KEY_KBD_LCD_MENU5,	/* "Next page" button */
+	[25] = KEY_KBD_LCD_MENU1,	/* Left-most */
+	[26] = KEY_KBD_LCD_MENU2,
+	[27] = KEY_KBD_LCD_MENU3,
+	[28] = KEY_KBD_LCD_MENU4,	/* Right-most */
+
+	/* Macro preset and record buttons; have red LEDs under them. */
+	[29] = KEY_MACRO_PRESET1,
+	[30] = KEY_MACRO_PRESET2,
+	[31] = KEY_MACRO_PRESET3,
+	[32] = KEY_MACRO_RECORD_START,
+
+	/* 33-35 handled by joystick device. */
+
+	/* Backlight toggle. */
+	[37] = KEY_LIGHTS_TOGGLE,
+};
+
+static const u16 g13_keys_for_bits_js[] = {
+	/* Joystick buttons */
+	/* These keybits are at bit indices 33, 34, and 35. */
+	BTN_BASE,	/* Left side */
+	BTN_BASE2,	/* Bottom side */
+	BTN_THUMB,	/* Stick depress */
+};
+
+static int lg_g13_event(struct lg_g15_data *g15, u8 const *data)
+{
+	struct g13_input_report const * const rep = (struct g13_input_report *) data;
+	int i, val;
+
+	/*
+	 * Main macropad and menu keys.
+	 * Emit key events defined for each bit position.
+	 */
+	for (i = 0; i < ARRAY_SIZE(g13_keys_for_bits); ++i) {
+		if (g13_keys_for_bits[i]) {
+			val = TEST_BIT(rep->keybits, i);
+			input_report_key(g15->input, g13_keys_for_bits[i], val);
+		}
+	}
+	input_sync(g15->input);
+
+	/*
+	 * Joystick.
+	 * Emit button and deflection events.
+	 */
+	for (i = 0; i < ARRAY_SIZE(g13_keys_for_bits_js); ++i) {
+		if (g13_keys_for_bits_js[i]) {
+			val = TEST_BIT(rep->keybits, i + 33);
+			input_report_key(g15->input_js, g13_keys_for_bits_js[i], val);
+		}
+	}
+	input_report_abs(g15->input_js, ABS_X, rep->joy_x);
+	input_report_abs(g15->input_js, ABS_Y, rep->joy_y);
+	input_sync(g15->input_js);
+
+	if (IS_ENABLED(CONFIG_LEDS_BRIGHTNESS_HW_CHANGED)) {
+		/*
+		 * Bit 23 of keybits[] reports the current backlight on/off
+		 * state.  If it has changed from the last cached value, apply
+		 * an update.
+		 */
+		bool hw_brightness_changed = (!!TEST_BIT(rep->keybits, 23))
+					   ^ (g15->leds[0].cdev.brightness_hw_changed > 0);
+		if (hw_brightness_changed)
+			led_classdev_notify_brightness_hw_changed(
+				&g15->leds[0].cdev,
+				TEST_BIT(rep->keybits, 23) ? LED_FULL : LED_OFF);
+	}
+
+	return 0;
+}
+
 /* On the G15 Mark I Logitech has been quite creative with which bit is what */
 static void lg_g15_handle_lcd_menu_keys(struct lg_g15_data *g15, u8 *data)
 {
@@ -572,6 +854,10 @@ static int lg_g15_raw_event(struct hid_device *hdev, struct hid_report *report,
 		return 0;
 
 	switch (g15->model) {
+	case LG_G13:
+		if (data[0] == 0x01 && size == sizeof(struct g13_input_report))
+			return lg_g13_event(g15, data);
+		break;
 	case LG_G15:
 		if (data[0] == 0x02 && size == 9)
 			return lg_g15_event(g15, data);
@@ -616,13 +902,22 @@ static void lg_g15_setup_led_rgb(struct lg_g15_data *g15, int index)
 {
 	int i;
 	struct mc_subled *subled_info;
-
-	g15->leds[index].mcdev.led_cdev.brightness_set_blocking =
-		lg_g510_kbd_led_set;
-	g15->leds[index].mcdev.led_cdev.brightness_get =
-		lg_g510_kbd_led_get;
-	g15->leds[index].mcdev.led_cdev.max_brightness = 255;
-	g15->leds[index].mcdev.num_colors = 3;
+	struct lg_g15_led * const gled = &g15->leds[index];
+
+	if (g15->model == LG_G13) {
+		gled->mcdev.led_cdev.brightness_set_blocking =
+			lg_g13_kbd_led_set;
+		gled->mcdev.led_cdev.brightness_get =
+			lg_g13_kbd_led_get;
+		gled->mcdev.led_cdev.flags = LED_BRIGHT_HW_CHANGED;
+	} else {
+		gled->mcdev.led_cdev.brightness_set_blocking =
+			lg_g510_kbd_led_set;
+		gled->mcdev.led_cdev.brightness_get =
+			lg_g510_kbd_led_get;
+	}
+	gled->mcdev.led_cdev.max_brightness = 255;
+	gled->mcdev.num_colors = 3;
 
 	subled_info = devm_kcalloc(&g15->hdev->dev, 3, sizeof(*subled_info), GFP_KERNEL);
 	if (!subled_info)
@@ -632,20 +927,20 @@ static void lg_g15_setup_led_rgb(struct lg_g15_data *g15, int index)
 		switch (i + 1) {
 		case LED_COLOR_ID_RED:
 			subled_info[i].color_index = LED_COLOR_ID_RED;
-			subled_info[i].intensity = g15->leds[index].red;
+			subled_info[i].intensity = gled->red;
 			break;
 		case LED_COLOR_ID_GREEN:
 			subled_info[i].color_index = LED_COLOR_ID_GREEN;
-			subled_info[i].intensity = g15->leds[index].green;
+			subled_info[i].intensity = gled->green;
 			break;
 		case LED_COLOR_ID_BLUE:
 			subled_info[i].color_index = LED_COLOR_ID_BLUE;
-			subled_info[i].intensity = g15->leds[index].blue;
+			subled_info[i].intensity = gled->blue;
 			break;
 		}
 		subled_info[i].channel = i;
 	}
-	g15->leds[index].mcdev.subled_info = subled_info;
+	gled->mcdev.subled_info = subled_info;
 }
 
 static int lg_g15_register_led(struct lg_g15_data *g15, int i, const char *name)
@@ -656,6 +951,23 @@ static int lg_g15_register_led(struct lg_g15_data *g15, int i, const char *name)
 	g15->leds[i].cdev.name = name;
 
 	switch (g15->model) {
+	case LG_G13:
+		if (i < LG_G15_BRIGHTNESS_MAX) {
+			/* RGB backlight. */
+			lg_g15_setup_led_rgb(g15, i);
+			ret = devm_led_classdev_multicolor_register_ext(&g15->hdev->dev,
+									&g15->leds[i].mcdev,
+									NULL);
+		} else {
+			/* Macro keys */
+			g15->leds[i].cdev.brightness_set_blocking = lg_g13_mkey_led_set;
+			g15->leds[i].cdev.brightness_get = lg_g13_mkey_led_get;
+			g15->leds[i].cdev.max_brightness = 1;
+
+			ret = devm_led_classdev_register(&g15->hdev->dev,
+							 &g15->leds[i].cdev);
+		}
+		break;
 	case LG_G15:
 	case LG_G15_V2:
 		g15->leds[i].cdev.brightness_get = lg_g15_led_get;
@@ -702,11 +1014,9 @@ static int lg_g15_register_led(struct lg_g15_data *g15, int i, const char *name)
 }
 
 /* Common input device init code shared between keyboards and Z-10 speaker handling */
-static void lg_g15_init_input_dev(struct hid_device *hdev, struct input_dev *input,
-				  const char *name)
+static void lg_g15_init_input_dev_core(struct hid_device *hdev, struct input_dev *input,
+				       char const *name)
 {
-	int i;
-
 	input->name = name;
 	input->phys = hdev->phys;
 	input->uniq = hdev->uniq;
@@ -717,12 +1027,44 @@ static void lg_g15_init_input_dev(struct hid_device *hdev, struct input_dev *inp
 	input->dev.parent = &hdev->dev;
 	input->open = lg_g15_input_open;
 	input->close = lg_g15_input_close;
+}
+
+static void lg_g15_init_input_dev(struct hid_device *hdev, struct input_dev *input,
+				  const char *name)
+{
+	int i;
+
+	lg_g15_init_input_dev_core(hdev, input, name);
 
 	/* Keys below the LCD, intended for controlling a menu on the LCD */
 	for (i = 0; i < 5; i++)
 		input_set_capability(input, EV_KEY, KEY_KBD_LCD_MENU1 + i);
 }
 
+static void lg_g13_init_input_dev(struct hid_device *hdev,
+				  struct input_dev *input, const char *name,
+				  struct input_dev *input_js, const char *name_js)
+{
+	/* Macropad. */
+	lg_g15_init_input_dev_core(hdev, input, name);
+	for (int i = 0; i < ARRAY_SIZE(g13_keys_for_bits); ++i) {
+		if (g13_keys_for_bits[i])
+			input_set_capability(input, EV_KEY, g13_keys_for_bits[i]);
+	}
+
+	/* OBTW, we're a joystick, too... */
+	lg_g15_init_input_dev_core(hdev, input_js, name_js);
+	for (int i = 0; i < ARRAY_SIZE(g13_keys_for_bits_js); ++i) {
+		if (g13_keys_for_bits_js[i])
+			input_set_capability(input_js, EV_KEY, g13_keys_for_bits_js[i]);
+	}
+
+	input_set_capability(input_js, EV_ABS, ABS_X);
+	input_set_abs_params(input_js, ABS_X, 0, 255, 0, 0);
+	input_set_capability(input_js, EV_ABS, ABS_Y);
+	input_set_abs_params(input_js, ABS_Y, 0, 255, 0, 0);
+}
+
 static int lg_g15_probe(struct hid_device *hdev, const struct hid_device_id *id)
 {
 	static const char * const led_names[] = {
@@ -739,7 +1081,7 @@ static int lg_g15_probe(struct hid_device *hdev, const struct hid_device_id *id)
 	unsigned int connect_mask = 0;
 	bool has_ff000000 = false;
 	struct lg_g15_data *g15;
-	struct input_dev *input;
+	struct input_dev *input, *input_js;
 	struct hid_report *rep;
 	int ret, i, gkeys = 0;
 
@@ -778,6 +1120,25 @@ static int lg_g15_probe(struct hid_device *hdev, const struct hid_device_id *id)
 	hid_set_drvdata(hdev, (void *)g15);
 
 	switch (g15->model) {
+	case LG_G13:
+		/*
+		 * The G13 has an analog thumbstick with nearby buttons.  Some
+		 * libraries and applications are known to ignore devices that
+		 * don't "look like" a joystick, and a device with two ABS axes
+		 * and 25+ macro keys would confuse them.
+		 *
+		 * Create an additional input device dedicated to appear as a
+		 * simplified joystick (two ABS axes, three BTN buttons).
+		 */
+		input_js = devm_input_allocate_device(&hdev->dev);
+		if (!input_js)
+			return -ENOMEM;
+		g15->input_js = input_js;
+		input_set_drvdata(input_js, hdev);
+
+		connect_mask = HID_CONNECT_HIDRAW;
+		gkeys = 25;
+		break;
 	case LG_G15:
 		INIT_WORK(&g15->work, lg_g15_leds_changed_work);
 		/*
@@ -859,6 +1220,34 @@ static int lg_g15_probe(struct hid_device *hdev, const struct hid_device_id *id)
 			goto error_hw_stop;
 
 		return 0; /* All done */
+	} else if (g15->model == LG_G13) {
+		static char const * const g13_led_names[] = {
+			/* Backlight is shared between LCD and keys. */
+			"g13:rgb:kbd_backlight",
+			NULL,	/* Keep in sync with led_type enum */
+			"g13:red:macro_preset_1",
+			"g13:red:macro_preset_2",
+			"g13:red:macro_preset_3",
+			"g13:red:macro_record",
+		};
+		lg_g13_init_input_dev(hdev,
+				      input, "Logitech G13 Gaming Keypad",
+				      input_js, "Logitech G13 Thumbstick");
+		ret = input_register_device(input);
+		if (ret)
+			goto error_hw_stop;
+		ret = input_register_device(input_js);
+		if (ret)
+			goto error_hw_stop;
+
+		for (i = 0; i < ARRAY_SIZE(g13_led_names); ++i) {
+			if (g13_led_names[i]) {
+				ret = lg_g15_register_led(g15, i, g13_led_names[i]);
+				if (ret)
+					goto error_hw_stop;
+			}
+		}
+		return 0;
 	}
 
 	/* Setup and register input device */
@@ -903,6 +1292,13 @@ static int lg_g15_probe(struct hid_device *hdev, const struct hid_device_id *id)
 }
 
 static const struct hid_device_id lg_g15_devices[] = {
+	/*
+	 * The G13 is a macropad-only device with an LCD, LED backlighing,
+	 * and joystick.
+	 */
+	{ HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH,
+			 USB_DEVICE_ID_LOGITECH_G13),
+		.driver_data = LG_G13 },
 	/* The G11 is a G15 without the LCD, treat it as a G15 */
 	{ HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH,
 		USB_DEVICE_ID_LOGITECH_G11),
-- 
2.50.1


^ permalink raw reply related

* Re: [PATCH 2/8] mfd: dt-bindings: ti,twl6040: convert to DT schema
From: Rob Herring @ 2025-08-14 21:24 UTC (permalink / raw)
  To: Jihed Chaibi
  Cc: tiwai, devicetree, linux-usb, gregkh, ukleinek, krzk+dt,
	dmitry.torokhov, broonie, linux-pwm, lee, linux-sound, lgirdwood,
	peter.ujfalusi, linux-kernel, linux-input, shuah, conor+dt
In-Reply-To: <CANBuOYrCAcgp+x+TL98V3ih_ThyPF7x6VgXxVi4YnAdOC3nZvA@mail.gmail.com>

On Tue, Aug 12, 2025 at 06:06:53PM +0200, Jihed Chaibi wrote:
> On Tue, Aug 12, 2025 at 4:54 PM Rob Herring <robh@kernel.org> wrote:
> >
> > On Mon, Aug 11, 2025 at 08:24:43PM -0500, Rob Herring (Arm) wrote:
> > >
> > > On Tue, 12 Aug 2025 00:47:33 +0200, Jihed Chaibi wrote:
> > > > Convert the legacy TXT binding for the TWL6040 MFD
> > > > to the modern YAML DT schema format. This adds formal validation
> > > > and improves documentation.
> > > >
> > > > Signed-off-by: Jihed Chaibi <jihed.chaibi.dev@gmail.com>
> > > > ---
> > > >  .../devicetree/bindings/mfd/ti,twl6040.yaml   | 155 ++++++++++++++++++
> > > >  .../devicetree/bindings/mfd/twl6040.txt       |  67 --------
> > > >  2 files changed, 155 insertions(+), 67 deletions(-)
> > > >  create mode 100644 Documentation/devicetree/bindings/mfd/ti,twl6040.yaml
> > > >  delete mode 100644 Documentation/devicetree/bindings/mfd/twl6040.txt
> > > >
> > >
> > > My bot found errors running 'make dt_binding_check' on your patch:
> > >
> > > yamllint warnings/errors:
> > >
> > > dtschema/dtc warnings/errors:
> > > /builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/mfd/ti,twl6040.example.dtb:
> > > twl@4b (ti,twl6040): 'twl6040,audpwron-gpio' does not match any of
> > > the regexes: '^#.*',
> > > '^(at25|bm|devbus|dmacap|dsa|exynos|fsi[ab]|gpio-fan|gpio-key|gpio|gpmc|hdmi|i2c-gpio),.*',
> > > '^(keypad|m25p|max8952|max8997|max8998|mpmc),.*',
> > > '^(pciclass|pinctrl-single|#pinctrl-single|PowerPC),.*',
> > > '^(pl022|pxa-mmc|rcar_sound|rotary-encoder|s5m8767|sdhci),.*',
> > > '^(simple-audio-card|st-plgpio|st-spics|ts),.*',
> >
> > You will need to add 'twl6040' to this list of exceptions in
> > vendor-prefixes.yaml.
> >
> > Rob
> 
> Hi Rob, thanks for the feedback.
> 
> Wouldn't it be simpler if we put 'ti' (the actual vendor) instead of 'twl6040'?
> No other file is using the current name, so there would be no need for
> additional editing.

Indeed. Actually, just drop the property because the driver doesn't use 
it either. Just note the change in the commit msg.

Rob

^ permalink raw reply

* Re: [PATCH v2] HID: lg-g15 - Add support for Logitech G13.
From: Leo L. Schwab @ 2025-08-14 20:27 UTC (permalink / raw)
  To: Kate Hsuan
  Cc: Hans de Goede, Jiri Kosina, Benjamin Tissoires, linux-input,
	linux-kernel
In-Reply-To: <CAEth8oEf3c9quzL2boHo=dJg6+p8scSsq5hL7j2LLjdtREsQxw@mail.gmail.com>

On Thu, Aug 14, 2025 at 05:09:09PM +0800, Kate Hsuan wrote:
> Thank you for your work.
>
	Thank you for your feedback.  And thank you for collecting all your
comments into one post.

> On Tue, Aug 12, 2025 at 2:57 PM Leo L. Schwab <ewhac@ewhac.org> wrote:
> The comment should in C comments, for example
>  struct input_dev *input_js;  /*joystick device for G13*/
>
	Will sweep all those up.

> > +static int lg_g13_kbd_led_set(struct led_classdev *led_cdev, enum led_brightness brightness)
> > +{
> > +       struct led_classdev_mc *mc = lcdev_to_mccdev(led_cdev);
> > +       struct lg_g15_led *g15_led =
> > +               container_of(mc, struct lg_g15_led, mcdev);
> > +       struct lg_g15_data *g15 = dev_get_drvdata(led_cdev->dev->parent);
> > +
> > +       /* Ignore LED off on unregister / keyboard unplug */
> > +       if (led_cdev->flags & LED_UNREGISTERING)
> > +               return 0;
> > +
> > +       guard(mutex)(&g15->mutex);
> guard() can be moved to lg_g13_kbd_led_write() to ensure the code is
> protected by a mutex lock when lg_g13_kbd_led_write() is called.
>
	I was mimicking the existing structure of the G15 and G510 code,
which I assumed was set up that way for a reason.  Will move this.

> > +static int lg_g13_event(struct lg_g15_data *g15, u8 const *data)
> > +{
> > +       struct g13_input_report const * const rep = (struct g13_input_report *) data;
> > +       int i, val;
> > +       bool hw_brightness_changed;
> Remove unused variable.
>
	I will be slightly restructuring this.

> >         switch (g15->model) {
> > +       case LG_G13:
> > +               /*
> > +                * Some usermode libraries tend to ignore devices that don't
> > +                * "look like" a joystick.  Create additional input device
> > +                * dedicated as joystick.
> > +                */
> Nit.
> Improve the comment and describe the hardware and the variable
> settings below in brief.

	I'll wordsmith this.  It'll get a bit wordier, though...

> Some style and comment style issues are pointed out, and I'll start to
> test this work after I receive my G13.
>
	If anything explodes, please let me know right away.

					Schwab

^ permalink raw reply

* Re: [PATCH v2 3/9] input: dt-bindings: ti,twl4030-keypad: convert to DT schema
From: Dmitry Torokhov @ 2025-08-14 18:35 UTC (permalink / raw)
  To: Jihed Chaibi
  Cc: linux-kernel, andreas, peter.ujfalusi, robh, krzk+dt, lgirdwood,
	tiwai, conor+dt, lee, ukleinek, broonie, gregkh, linux-input,
	devicetree, linux-pwm, linux-sound, linux-usb, shuah
In-Reply-To: <20250814132129.138943-4-jihed.chaibi.dev@gmail.com>

On Thu, Aug 14, 2025 at 03:21:23PM +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.
> 
> Changes in v2:
> Simplified the description field by removing redundant '|'
> as it does not affect formatting in this context.
> 
> Signed-off-by: Jihed Chaibi <jihed.chaibi.dev@gmail.com>
> ---
>  .../bindings/input/ti,twl4030-keypad.yaml     | 44 +++++++++++++++++++
>  .../bindings/input/twl4030-keypad.txt         | 27 ------------
>  2 files changed, 44 insertions(+), 27 deletions(-)
>  create mode 100644 Documentation/devicetree/bindings/input/ti,twl4030-keypad.yaml
>  delete mode 100644 Documentation/devicetree/bindings/input/twl4030-keypad.txt
> 
> diff --git a/Documentation/devicetree/bindings/input/ti,twl4030-keypad.yaml b/Documentation/devicetree/bindings/input/ti,twl4030-keypad.yaml
> new file mode 100644
> index 000000000..2efc88b89
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/input/ti,twl4030-keypad.yaml
> @@ -0,0 +1,44 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/input/ti,twl4030-keypad.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Texas Instruments TWL4030-family Keypad Controller
> +
> +maintainers:
> +  - Peter Ujfalusi <peter.ujfalusi@gmail.com>
> +
> +description:
> +  TWL4030's Keypad controller is used to interface a SoC with a matrix-type
> +  keypad device. The keypad controller supports multiple row and column lines.
> +  A key can be placed at each intersection of a unique row and a unique column.
> +  The keypad controller can sense a key-press and key-release and report the
> +  event using a interrupt to the cpu.
> +
> +allOf:
> +  - $ref: matrix-keymap.yaml#
> +
> +properties:
> +  compatible:
> +    const: ti,twl4030-keypad
> +
> +  interrupts:
> +    maxItems: 1
> +
> +required:
> +  - compatible
> +  - interrupts
> +  - keypad,num-rows
> +  - keypad,num-columns

I wonder if "linux,keymap" should not be made required as well... 

Thanks.

-- 
Dmitry

^ permalink raw reply


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