linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] Register virtual GPIO keys for VNC
@ 2025-07-29  6:43 marlonwu
  2025-07-29  6:43 ` [PATCH 1/2] dt-bindings vnc virtual input marlonwu
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: marlonwu @ 2025-07-29  6:43 UTC (permalink / raw)
  To: robh, dmitry.torokhov, krzk+dt
  Cc: linux-input, devicetree, marlonwu, MenglongWoo

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=y, Size: 2964 bytes --]

From: Menglong Wu <marlonwu@126.com>

Test platform
-------------
Kernel: 4.14.98
Rootfs: BusyBox 1.29
QT: 4.7
x11vnc: 0.9.16

Purpose
-------------

To emulate a full ANSI keyboard on embedded devices without physical 
keyboards.
The server responds to key events via x11vnc.
This resolves the limitation where embedded systems only register a few 
GPIO keys, making them unable to process full keyboard inputs.

documented in Documentation/devicetree/bindings/input/vnc-virtual-input.yaml

Scenario
-------------

- /dev/input/event1: Physical GPIO buttons

- /dev/input/event2: Physical touchscreen

Assume my-pcb.dts defines two GPIO-based hardware keys (A and B).
When the VNC server x11vnc is started, a remote PC connects via a VNC 
client and attempts to send key inputs.
Since the Linux kernel only recognizes two keys, the UI on the embedded 
device only responds to ‘A’ and ‘B’.

Start x11vnc server:

```
    x11vnc -noipv6 -rawfb /dev/fb0 -forever -clip 640x480+0+0 \
      -pipeinput UINPUT:touch,tslib_cal=/etc/pointercal,\
      direct_key=/dev/input/event1,\
      direct_abs=/dev/input/event2
```

Monitor key events:

```
    hexdump /dev/input/event1
```

Original my-pcb.dts:


```
    gpio_keys {
        compatible = "gpio-keys";
        pinctrl-0 = <&pinctrl_gpio_keys>;

        key-a {
            label = "btn-key-a";
            gpios = <&gpio1 10 GPIO_ACTIVE_HIGH>;
            linux,code = <KEY_A>;
        };
        key-b {
            label = "btn-key-b";
            gpios = <&gpio1 11 GPIO_ACTIVE_HIGH>;
            linux,code = <KEY_A>;
        };
    };
```


Solution
-------------

Modify my-pcb.dts to support a virtual ANSI keyboard:

```
    #include "vnc-virtual-input.dtsi"

    // Originally, the DTS relied on physical GPIO keys
    gpio_keys {
        // Disable the original physical key node
        status = "disable";
    };

    // The virtual GPIO DTS node now integrates physical GPIO
    vnc_key {
        compatible = "gpio-keys";
        pinctrl-0 = <&pinctrl_gpio_keys>;
        
        key-a {
            label = "btn-key-a";
            gpios = <&gpio1 10 GPIO_ACTIVE_HIGH>;
            linux,code = <KEY_A>;
        };
        key-b {
            label = "btn-key-b";
            gpios = <&gpio1 11 GPIO_ACTIVE_HIGH>;
            linux,code = <KEY_A>;
        };
    }
```
Menglong Wu (2):
  dt-bindings vnc virtual input
  ARM: dts: Add virtual GPIO input for VNC keyboard

 .../bindings/input/vnc-virtual-input.txt      | 153 +++++
 .../bindings/input/vnc-virtual-input.yaml     |  86 +++
 MAINTAINERS                                   |   8 +
 arch/arm/boot/dts/vnc-virtual-input.dtsi      | 569 ++++++++++++++++++
 4 files changed, 816 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/input/vnc-virtual-input.txt
 create mode 100644 Documentation/devicetree/bindings/input/vnc-virtual-input.yaml
 create mode 100644 arch/arm/boot/dts/vnc-virtual-input.dtsi

-- 
2.39.5


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH 1/2] dt-bindings vnc virtual input
  2025-07-29  6:43 [PATCH 0/2] Register virtual GPIO keys for VNC marlonwu
@ 2025-07-29  6:43 ` marlonwu
  2025-07-29  7:33   ` Krzysztof Kozlowski
  2025-07-29  6:43 ` [PATCH 2/2] ARM: dts: Add virtual GPIO input for VNC keyboard marlonwu
  2025-07-29  7:39 ` [PATCH 0/2] Register virtual GPIO keys for VNC Krzysztof Kozlowski
  2 siblings, 1 reply; 6+ messages in thread
From: marlonwu @ 2025-07-29  6:43 UTC (permalink / raw)
  To: robh, dmitry.torokhov, krzk+dt
  Cc: linux-input, devicetree, marlonwu, MenglongWoo

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=y, Size: 7929 bytes --]

From: Menglong Wu <marlonwu@126.com>

Add documentation for virtual GPIO keys to enable full ANSI keyboard
emulation via VNC on embedded devices without physical keyboards.

- vnc-virtual-input.txt: Usage scenario and implementation details
- vnc-virtual-input.yaml: Formal DT binding specification
- MAINTAINERS: Add entry for VNC virtual input support

The solution registers virtual GPIOs (starting from 400) to avoid conflicts
with physical GPIOs while supporting standard Linux input codes.

Signed-off-by: Menglong Wu <marlonwu@126.com>
---
 .../bindings/input/vnc-virtual-input.txt      | 153 ++++++++++++++++++
 .../bindings/input/vnc-virtual-input.yaml     |  86 ++++++++++
 MAINTAINERS                                   |   7 +
 3 files changed, 246 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/input/vnc-virtual-input.txt
 create mode 100644 Documentation/devicetree/bindings/input/vnc-virtual-input.yaml

diff --git a/Documentation/devicetree/bindings/input/vnc-virtual-input.txt b/Documentation/devicetree/bindings/input/vnc-virtual-input.txt
new file mode 100644
index 000000000000..77d12308c553
--- /dev/null
+++ b/Documentation/devicetree/bindings/input/vnc-virtual-input.txt
@@ -0,0 +1,153 @@
+Register virtual GPIO keys for VNC
+==========================
+
+# Purpose
+
+To emulate a full ANSI keyboard on embedded devices without physical
+keyboards.The server responds to key events via x11vnc.
+This resolves the limitation where embedded systems only register a few
+GPIO keys, making them unable to process full keyboard inputs.
+
+documented in Documentation/devicetree/bindings/input/vnc-virtual-input.yaml
+
+# Scenario
+
+- /dev/input/event1: Physical GPIO buttons
+
+- /dev/input/event2: Physical touchscreen
+
+Assume my-pcb.dts defines two GPIO-based hardware keys (‘A’ and ‘B’).
+When the VNC server x11vnc is started, a remote PC connects via a VNC
+client and attempts to send key inputs.
+Since the Linux kernel only recognizes two keys, the UI on the embedded
+device only responds to ‘A’ and ‘B’.
+
+Start x11vnc server:
+
+```
+    x11vnc -noipv6 -rawfb /dev/fb0 -forever -clip 640x480+0+0 \
+      -pipeinput UINPUT:touch,tslib_cal=/etc/pointercal,\
+      direct_key=/dev/input/event1,\
+      direct_abs=/dev/input/event2
+```
+
+Monitor key events:
+
+```
+    hexdump /dev/input/event1
+```
+
+Check registered virtual GPIOs:
+
+```
+    mount -t debugfs none /sys/kernel/debug/
+    cat /sys/kernel/debug/gpio
+
+    gpiochip5: GPIOs 400-503, parent: platform/gpio_mockup_hw, gpio-mockup-A:
+    gpio-400 (                    |vk_key_0            ) in  lo
+    gpio-401 (                    |vk_key_1            ) in  lo
+```
+
+Original my-pcb.dts:
+
+
+```
+    gpio_keys {
+        compatible = "gpio-keys";
+        pinctrl-0 = <&pinctrl_gpio_keys>;
+
+        key-a {
+            label = "btn-key-a";
+            gpios = <&gpio1 10 GPIO_ACTIVE_HIGH>;
+            linux,code = <KEY_A>;
+        };
+        key-b {
+            label = "btn-key-b";
+            gpios = <&gpio1 11 GPIO_ACTIVE_HIGH>;
+            linux,code = <KEY_A>;
+        };
+    };
+```
+
+
+# Solution
+
+Modify my-pcb.dts to support a virtual ANSI keyboard:
+
+```
+    #include "vnc-virtual-input.dtsi"
+
+    // Originally, the DTS relied on physical GPIO keys
+    gpio_keys {
+        // Disable the original physical key node
+        status = "disable";
+    };
+
+    // The virtual GPIO DTS node now integrates physical GPIO
+    vnc_key {
+        compatible = "gpio-keys";
+        pinctrl-0 = <&pinctrl_gpio_keys>;
+
+        key-a {
+            label = "btn-key-a";
+            gpios = <&gpio1 10 GPIO_ACTIVE_HIGH>;
+            linux,code = <KEY_A>;
+        };
+        key-b {
+            label = "btn-key-b";
+            gpios = <&gpio1 11 GPIO_ACTIVE_HIGH>;
+            linux,code = <KEY_A>;
+        };
+    }
+```
+
+# Explanation
+
+A virtual GPIO driver gpio_mockup_hw is registered, providing 104 GPIOs,
+starting from number 400.
+
+The starting number (400) avoids conflicts with physical GPIOs on
+commercialSoCs, which typically do not exceed 400. Most SoC vendors also
+start GPIO numbering from 0 in their drivers.
+
+The gpio_key_mockup node defines 100 ANSI standard keyboard keys.
+
+Key codes (KEY_xx) follow the definitions in
+include/uapi/linux/input-event-codes.h.
+
+
+
+ANSI Keyboard Layout (Symbolic Representation):
+
+```
+L FFFFFFFFFFFFFFF   MMM
+L NNNNNNNNNNNN  R   CCC   PPPP
+LL  AAAAAAAAA RRR   CCC   PPPP
+LLL  AAAAAAA RRRR         PPPP
+LLL   AAAAA RRRRR    C    PPPP
+LLLL  LLLLL RRRRR   CCC   PPPP
+```
+
+
+Key Layout Categories
+
+L: Left-side keys (ESC, TAB, CAPS LOCK, etc.)
+F: Function keys (F1–F12)
+N: Number row (1–0)
+A: Alphabet keys (A–Z)
+R: Right-side keys (BACKSPACE, [, ], , ENTER, etc.)
+M: Miscellaneous (Print Screen, Scroll Lock, Pause/Break)
+C: Cursor controls (Insert, Home, Arrow keys, etc.)
+P: Numpad keys (0–9, -, +, etc.)
+
+
+Example from vnc-virtual-input.dtsi:
+
+```
+    /* Left of a-z */
+    vk_78 {
+        label = "vk_key_78";
+        gpios = <&gpio_mockup_hw 78 GPIO_ACTIVE_HIGH>;
+        linux,code = <KEY_ESC>;
+    };
+```
diff --git a/Documentation/devicetree/bindings/input/vnc-virtual-input.yaml b/Documentation/devicetree/bindings/input/vnc-virtual-input.yaml
new file mode 100644
index 000000000000..8b5414cb2bea
--- /dev/null
+++ b/Documentation/devicetree/bindings/input/vnc-virtual-input.yaml
@@ -0,0 +1,86 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/input/a.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: VNC Virtual GPIO Keys
+
+maintainers:
+  - Menglong Wu <marlonwu@126.com>
+
+description: |
+  This binding describes a virtual GPIO key input node for VNC remote
+  input.
+  It is based on the standard gpio-keys binding.
+
+select: false
+
+allOf:
+  - $ref: gpio-keys.yaml#
+
+properties:
+  compatible:
+    const: gpio-keys
+
+  status:
+    enum:
+      - okay
+      - disabled
+
+patternProperties:
+  "^key(-)?[0-9a-zA-Z_-]+$":
+    type: object
+    properties:
+      label:
+        description: Descriptive name of the button
+        $ref: /schemas/types.yaml#/definitions/string
+
+      gpios:
+        maxItems: 1
+
+      linux,code:
+        description: Linux input event code
+        $ref: /schemas/types.yaml#/definitions/uint32
+
+      debounce-interval:
+        description: Debounce time in milliseconds
+        $ref: /schemas/types.yaml#/definitions/uint32
+
+      gpio-key,wakeup:
+        description: Enables wakeup function from suspend
+        type: boolean
+
+    required:
+      - label
+      - gpios
+      - linux,code
+
+additionalProperties: false
+
+required:
+  - compatible
+
+examples:
+  - |
+    #include <dt-bindings/input/input.h>
+    #include <dt-bindings/gpio/gpio.h>
+
+    test {
+      vnc_key: vnc_key {
+          compatible = "gpio-keys";
+
+          key-a {
+            label = "btn-key-a";
+            gpios = <&gpio1 10 GPIO_ACTIVE_HIGH>;
+            linux,code = <KEY_A>;
+          };
+          key-b {
+            label = "btn-key-b";
+            gpios = <&gpio1 11 GPIO_ACTIVE_HIGH>;
+            linux,code = <KEY_A>;
+          };
+      };
+    };
+
+...
diff --git a/MAINTAINERS b/MAINTAINERS
index c0b444e5fd5a..658ef6619542 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -27476,6 +27476,13 @@ S:	Maintained
 T:	git git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound.git
 F:	sound/pci/hda/patch_senarytech.c
 
+VNC VIRTUAL INPUT SUPPORT
+M:	Menglong Wu <marlonwu@126.com>
+L:	linux-kernel@vger.kernel.org
+S:	Maintained
+F:	Documentation/devicetree/bindings/input/vnc-virtual-input.txt
+F:	Documentation/devicetree/bindings/input/vnc-virtual-input.yaml
+
 THE REST
 M:	Linus Torvalds <torvalds@linux-foundation.org>
 L:	linux-kernel@vger.kernel.org
-- 
2.39.5


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 2/2] ARM: dts: Add virtual GPIO input for VNC keyboard
  2025-07-29  6:43 [PATCH 0/2] Register virtual GPIO keys for VNC marlonwu
  2025-07-29  6:43 ` [PATCH 1/2] dt-bindings vnc virtual input marlonwu
@ 2025-07-29  6:43 ` marlonwu
  2025-07-29  7:52   ` Krzysztof Kozlowski
  2025-07-29  7:39 ` [PATCH 0/2] Register virtual GPIO keys for VNC Krzysztof Kozlowski
  2 siblings, 1 reply; 6+ messages in thread
From: marlonwu @ 2025-07-29  6:43 UTC (permalink / raw)
  To: robh, dmitry.torokhov, krzk+dt
  Cc: linux-input, devicetree, marlonwu, MenglongWoo

From: Menglong Wu <marlonwu@126.com>

Implements a complete ANSI keyboard solution for VNC remote input
on ARM devices by:

1. Adding a device tree include file (vnc-virtual-input.dtsi) that:
   - Defines a gpio-mockup controller with 104 virtual GPIOs
   (startingfrom 400)
   - Maps all standard keyboard keys
   (F1-F12, alphanumeric, modifiers, etc.)
   - Follows Linux input event codes for key mappings

2. Updating MAINTAINERS to track the new dtsi file

The virtual GPIO approach allows embedded systems without physical
keyboards to receive full keyboard input via VNC while avoiding
conflicts with realGPIO numbering.

Signed-off-by: Menglong Wu <marlonwu@126.com>
---
 MAINTAINERS                              |   1 +
 arch/arm/boot/dts/vnc-virtual-input.dtsi | 569 +++++++++++++++++++++++
 2 files changed, 570 insertions(+)
 create mode 100644 arch/arm/boot/dts/vnc-virtual-input.dtsi

diff --git a/MAINTAINERS b/MAINTAINERS
index 658ef6619542..da69f516388c 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -27482,6 +27482,7 @@ L:	linux-kernel@vger.kernel.org
 S:	Maintained
 F:	Documentation/devicetree/bindings/input/vnc-virtual-input.txt
 F:	Documentation/devicetree/bindings/input/vnc-virtual-input.yaml
+F:	arch/arm/boot/dts/vnc-virtual-input.da9052_tsi
 
 THE REST
 M:	Linus Torvalds <torvalds@linux-foundation.org>
diff --git a/arch/arm/boot/dts/vnc-virtual-input.dtsi b/arch/arm/boot/dts/vnc-virtual-input.dtsi
new file mode 100644
index 000000000000..2937623d4099
--- /dev/null
+++ b/arch/arm/boot/dts/vnc-virtual-input.dtsi
@@ -0,0 +1,569 @@
+// SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+/*
+ * vnc-virtual-input.dtsi - Device tree file for x11vnc
+ *
+ * KEY_xx references can be found in input-event-codes.h
+ * See vnc-virtual-input.txt Documentation file for details.
+ *
+ * Copyright (C) 2025 Menglong Wu <marlonwu@126.com>
+ *
+ */
+
+
+gpio_mockup_hw: gpio_mockup_hw {
+	compatible = "gpio-mockup";
+	gpio-controller;
+	#gpio-cells = <2>;
+	gpio-base = <400>;
+	nr-gpios = <104>;
+	status = "okay";
+};
+
+vnc_key {
+	compatible = "gpio-keys";
+
+	/* F1 - F12 */
+	vk_0 {
+		label = "vk_key_0";
+		gpios = <&gpio_mockup_hw 0 GPIO_ACTIVE_HIGH>;
+		linux,code = <KEY_F1>;
+	};
+	vk_1 {
+		label = "vk_key_1";
+		gpios = <&gpio_mockup_hw 1 GPIO_ACTIVE_HIGH>;
+		linux,code = <KEY_F2>;
+	};
+	vk_2 {
+		label = "vk_key_2";
+		gpios = <&gpio_mockup_hw 2 GPIO_ACTIVE_HIGH>;
+		linux,code = <KEY_F3>;
+	};
+	vk_3 {
+		label = "vk_key_3";
+		gpios = <&gpio_mockup_hw 3 GPIO_ACTIVE_HIGH>;
+		linux,code = <KEY_F4>;
+	};
+	vk_4 {
+		label = "vk_key_4";
+		gpios = <&gpio_mockup_hw 4 GPIO_ACTIVE_HIGH>;
+		linux,code = <KEY_F5>;
+	};
+	vk_5 {
+		label = "vk_key_5";
+		gpios = <&gpio_mockup_hw 5 GPIO_ACTIVE_HIGH>;
+		linux,code = <KEY_F6>;
+	};
+	vk_6 {
+		label = "vk_key_6";
+		gpios = <&gpio_mockup_hw 6 GPIO_ACTIVE_HIGH>;
+		linux,code = <KEY_F7>;
+	};
+	vk_7 {
+		label = "vk_key_7";
+		gpios = <&gpio_mockup_hw 7 GPIO_ACTIVE_HIGH>;
+		linux,code = <KEY_F8>;
+	};
+	vk_8 {
+		label = "vk_key_8";
+		gpios = <&gpio_mockup_hw 8 GPIO_ACTIVE_HIGH>;
+		linux,code = <KEY_F9>;
+	};
+	vk_9 {
+		label = "vk_key_9";
+		gpios = <&gpio_mockup_hw 9 GPIO_ACTIVE_HIGH>;
+		linux,code = <KEY_F10>;
+	};
+	vk_10 {
+		label = "vk_key_10";
+		gpios = <&gpio_mockup_hw 10 GPIO_ACTIVE_HIGH>;
+		linux,code = <KEY_F11>;
+	};
+	vk_11 {
+		label = "vk_key_11";
+		gpios = <&gpio_mockup_hw 11 GPIO_ACTIVE_HIGH>;
+		linux,code = <KEY_F12>;
+	};
+
+	/* Number */
+	vk_12 {
+		label = "vk_key_12";
+		gpios = <&gpio_mockup_hw 12 GPIO_ACTIVE_HIGH>;
+		linux,code = <KEY_1>;
+	};
+	vk_13 {
+		label = "vk_key_13";
+		gpios = <&gpio_mockup_hw 13 GPIO_ACTIVE_HIGH>;
+		linux,code = <KEY_2>;
+	};
+	vk_14 {
+		label = "vk_key_14";
+		gpios = <&gpio_mockup_hw 14 GPIO_ACTIVE_HIGH>;
+		linux,code = <KEY_3>;
+	};
+	vk_15 {
+		label = "vk_key_15";
+		gpios = <&gpio_mockup_hw 15 GPIO_ACTIVE_HIGH>;
+		linux,code = <KEY_4>;
+	};
+	vk_16 {
+		label = "vk_key_16";
+		gpios = <&gpio_mockup_hw 16 GPIO_ACTIVE_HIGH>;
+		linux,code = <KEY_5>;
+	};
+	vk_17 {
+		label = "vk_key_17";
+		gpios = <&gpio_mockup_hw 17 GPIO_ACTIVE_HIGH>;
+		linux,code = <KEY_6>;
+	};
+	vk_18 {
+		label = "vk_key_18";
+		gpios = <&gpio_mockup_hw 18 GPIO_ACTIVE_HIGH>;
+		linux,code = <KEY_7>;
+	};
+	vk_19 {
+		label = "vk_key_19";
+		gpios = <&gpio_mockup_hw 19 GPIO_ACTIVE_HIGH>;
+		linux,code = <KEY_8>;
+	};
+	vk_20 {
+		label = "vk_key_20";
+		gpios = <&gpio_mockup_hw 20 GPIO_ACTIVE_HIGH>;
+		linux,code = <KEY_9>;
+	};
+	vk_21 {
+		label = "vk_key_21";
+		gpios = <&gpio_mockup_hw 21 GPIO_ACTIVE_HIGH>;
+		linux,code = <KEY_0>;
+	};
+
+
+	/* a - z */
+	vk_22 {
+		label = "vk_key_22";
+		gpios = <&gpio_mockup_hw 22 GPIO_ACTIVE_HIGH>;
+		linux,code = <KEY_A>;
+	};
+	vk_23 {
+		label = "vk_key_23";
+		gpios = <&gpio_mockup_hw 23 GPIO_ACTIVE_HIGH>;
+		linux,code = <KEY_B>;
+	};
+	vk_24 {
+		label = "vk_key_24";
+		gpios = <&gpio_mockup_hw 24 GPIO_ACTIVE_HIGH>;
+		linux,code = <KEY_C>;
+	};
+	vk_25 {
+		label = "vk_key_25";
+		gpios = <&gpio_mockup_hw 25 GPIO_ACTIVE_HIGH>;
+		linux,code = <KEY_D>;
+	};
+	vk_26 {
+		label = "vk_key_26";
+		gpios = <&gpio_mockup_hw 26 GPIO_ACTIVE_HIGH>;
+		linux,code = <KEY_E>;
+	};
+	vk_27 {
+		label = "vk_key_27";
+		gpios = <&gpio_mockup_hw 27 GPIO_ACTIVE_HIGH>;
+		linux,code = <KEY_F>;
+	};
+	vk_28 {
+		label = "vk_key_28";
+		gpios = <&gpio_mockup_hw 28 GPIO_ACTIVE_HIGH>;
+		linux,code = <KEY_G>;
+	};
+	vk_29 {
+		label = "vk_key_29";
+		gpios = <&gpio_mockup_hw 29 GPIO_ACTIVE_HIGH>;
+		linux,code = <KEY_H>;
+	};
+	vk_30 {
+		label = "vk_key_30";
+		gpios = <&gpio_mockup_hw 30 GPIO_ACTIVE_HIGH>;
+		linux,code = <KEY_I>;
+	};
+	vk_31 {
+		label = "vk_key_31";
+		gpios = <&gpio_mockup_hw 31 GPIO_ACTIVE_HIGH>;
+		linux,code = <KEY_J>;
+	};
+	vk_32 {
+		label = "vk_key_32";
+		gpios = <&gpio_mockup_hw 32 GPIO_ACTIVE_HIGH>;
+		linux,code = <KEY_K>;
+	};
+	vk_33 {
+		label = "vk_key_33";
+		gpios = <&gpio_mockup_hw 33 GPIO_ACTIVE_HIGH>;
+		linux,code = <KEY_L>;
+	};
+	vk_34 {
+		label = "vk_key_34";
+		gpios = <&gpio_mockup_hw 34 GPIO_ACTIVE_HIGH>;
+		linux,code = <KEY_M>;
+	};
+	vk_35 {
+		label = "vk_key_35";
+		gpios = <&gpio_mockup_hw 35 GPIO_ACTIVE_HIGH>;
+		linux,code = <KEY_N>;
+	};
+	vk_36 {
+		label = "vk_key_36";
+		gpios = <&gpio_mockup_hw 36 GPIO_ACTIVE_HIGH>;
+		linux,code = <KEY_O>;
+	};
+	vk_37 {
+		label = "vk_key_37";
+		gpios = <&gpio_mockup_hw 37 GPIO_ACTIVE_HIGH>;
+		linux,code = <KEY_P>;
+	};
+	vk_38 {
+		label = "vk_key_38";
+		gpios = <&gpio_mockup_hw 38 GPIO_ACTIVE_HIGH>;
+		linux,code = <KEY_Q>;
+	};
+	vk_39 {
+		label = "vk_key_39";
+		gpios = <&gpio_mockup_hw 39 GPIO_ACTIVE_HIGH>;
+		linux,code = <KEY_R>;
+	};
+	vk_40 {
+		label = "vk_key_40";
+		gpios = <&gpio_mockup_hw 40 GPIO_ACTIVE_HIGH>;
+		linux,code = <KEY_S>;
+	};
+	vk_41 {
+		label = "vk_key_41";
+		gpios = <&gpio_mockup_hw 41 GPIO_ACTIVE_HIGH>;
+		linux,code = <KEY_T>;
+	};
+	vk_42 {
+		label = "vk_key_42";
+		gpios = <&gpio_mockup_hw 42 GPIO_ACTIVE_HIGH>;
+		linux,code = <KEY_U>;
+	};
+	vk_43 {
+		label = "vk_key_43";
+		gpios = <&gpio_mockup_hw 43 GPIO_ACTIVE_HIGH>;
+		linux,code = <KEY_V>;
+	};
+	vk_44 {
+		label = "vk_key_44";
+		gpios = <&gpio_mockup_hw 44 GPIO_ACTIVE_HIGH>;
+		linux,code = <KEY_W>;
+	};
+	vk_45 {
+		label = "vk_key_45";
+		gpios = <&gpio_mockup_hw 45 GPIO_ACTIVE_HIGH>;
+		linux,code = <KEY_X>;
+	};
+	vk_46 {
+		label = "vk_key_46";
+		gpios = <&gpio_mockup_hw 46 GPIO_ACTIVE_HIGH>;
+		linux,code = <KEY_Y>;
+	};
+	vk_47 {
+		label = "vk_key_47";
+		gpios = <&gpio_mockup_hw 47 GPIO_ACTIVE_HIGH>;
+		linux,code = <KEY_Z>;
+	};
+
+
+	/* Misc */
+	vk_48 {
+		label = "vk_key_48";
+		gpios = <&gpio_mockup_hw 48 GPIO_ACTIVE_HIGH>;
+		linux,code = <KEY_SYSRQ>;
+	};
+	vk_49 {
+		label = "vk_key_49";
+		gpios = <&gpio_mockup_hw 49 GPIO_ACTIVE_HIGH>;
+		linux,code = <KEY_SCROLLLOCK>;
+	};
+	vk_50 {
+		label = "vk_key_50";
+		gpios = <&gpio_mockup_hw 50 GPIO_ACTIVE_HIGH>;
+		linux,code = <KEY_PAUSE>;
+	};
+
+	/* Cursor Position */
+	vk_51 {
+		label = "vk_key_51";
+		gpios = <&gpio_mockup_hw 51 GPIO_ACTIVE_HIGH>;
+		linux,code = <KEY_INSERT>;
+	};
+	vk_52 {
+		label = "vk_key_52";
+		gpios = <&gpio_mockup_hw 52 GPIO_ACTIVE_HIGH>;
+		linux,code = <KEY_HOME>;
+	};
+	vk_53 {
+		label = "vk_key_53";
+		gpios = <&gpio_mockup_hw 53 GPIO_ACTIVE_HIGH>;
+		linux,code = <KEY_PAGEUP>;
+	};
+
+	vk_54 {
+		label = "vk_key_54";
+		gpios = <&gpio_mockup_hw 54 GPIO_ACTIVE_HIGH>;
+		linux,code = <KEY_DELETE>;
+	};
+	vk_55 {
+		label = "vk_key_55";
+		gpios = <&gpio_mockup_hw 55 GPIO_ACTIVE_HIGH>;
+		linux,code = <KEY_END>;
+	};
+	vk_56 {
+		label = "vk_key_56";
+		gpios = <&gpio_mockup_hw 56 GPIO_ACTIVE_HIGH>;
+		linux,code = <KEY_PAGEDOWN>;
+	};
+
+	vk_57 {
+		label = "vk_key_57";
+		gpios = <&gpio_mockup_hw 57 GPIO_ACTIVE_HIGH>;
+		linux,code = <KEY_UP>;
+	};
+	vk_58 {
+		label = "vk_key_58";
+		gpios = <&gpio_mockup_hw 58 GPIO_ACTIVE_HIGH>;
+		linux,code = <KEY_LEFT>;
+	};
+	vk_59 {
+		label = "vk_key_59";
+		gpios = <&gpio_mockup_hw 59 GPIO_ACTIVE_HIGH>;
+		linux,code = <KEY_DOWN>;
+	};
+	vk_60 {
+		label = "vk_key_60";
+		gpios = <&gpio_mockup_hw 60 GPIO_ACTIVE_HIGH>;
+		linux,code = <KEY_RIGHT>;
+	};
+
+
+	/* Numpad */
+	vk_61 {
+		label = "vk_key_61";
+		gpios = <&gpio_mockup_hw 61 GPIO_ACTIVE_HIGH>;
+		linux,code = <KEY_NUMLOCK>;
+	};
+	vk_62 {
+		label = "vk_key_62";
+		gpios = <&gpio_mockup_hw 62 GPIO_ACTIVE_HIGH>;
+		linux,code = <KEY_KPSLASH>;
+	};
+	vk_63 {
+		label = "vk_key_63";
+		gpios = <&gpio_mockup_hw 63 GPIO_ACTIVE_HIGH>;
+		linux,code = <KEY_KPASTERISK>;
+	};
+	vk_64 {
+		label = "vk_key_64";
+		gpios = <&gpio_mockup_hw 64 GPIO_ACTIVE_HIGH>;
+		linux,code = <KEY_MINUS>;
+	};
+	vk_65 {
+		label = "vk_key_65";
+		gpios = <&gpio_mockup_hw 65 GPIO_ACTIVE_HIGH>;
+		linux,code = <KEY_KPPLUS>;
+	};
+	vk_66 {
+		label = "vk_key_66";
+		gpios = <&gpio_mockup_hw 66 GPIO_ACTIVE_HIGH>;
+		linux,code = <KEY_KPENTER>;
+	};
+	vk_67 {
+		label = "vk_key_67";
+		gpios = <&gpio_mockup_hw 67 GPIO_ACTIVE_HIGH>;
+		linux,code = <KEY_KPDOT>;
+	};
+
+	vk_68 {
+		label = "vk_key_68";
+		gpios = <&gpio_mockup_hw 68 GPIO_ACTIVE_HIGH>;
+		linux,code = <KEY_KP0>;
+	};
+	vk_69 {
+		label = "vk_key_69";
+		gpios = <&gpio_mockup_hw 69 GPIO_ACTIVE_HIGH>;
+		linux,code = <KEY_KP1>;
+	};
+	vk_70 {
+		label = "vk_key_70";
+		gpios = <&gpio_mockup_hw 70 GPIO_ACTIVE_HIGH>;
+		linux,code = <KEY_KP2>;
+	};
+	vk_71 {
+		label = "vk_key_71";
+		gpios = <&gpio_mockup_hw 71 GPIO_ACTIVE_HIGH>;
+		linux,code = <KEY_KP3>;
+	};
+	vk_72 {
+		label = "vk_key_72";
+		gpios = <&gpio_mockup_hw 72 GPIO_ACTIVE_HIGH>;
+		linux,code = <KEY_KP4>;
+	};
+	vk_73 {
+		label = "vk_key_73";
+		gpios = <&gpio_mockup_hw 73 GPIO_ACTIVE_HIGH>;
+		linux,code = <KEY_KP5>;
+	};
+	vk_74 {
+		label = "vk_key_74";
+		gpios = <&gpio_mockup_hw 74 GPIO_ACTIVE_HIGH>;
+		linux,code = <KEY_KP6>;
+	};
+	vk_75 {
+		label = "vk_key_75";
+		gpios = <&gpio_mockup_hw 75 GPIO_ACTIVE_HIGH>;
+		linux,code = <KEY_KP7>;
+	};
+	vk_76 {
+		label = "vk_key_76";
+		gpios = <&gpio_mockup_hw 76 GPIO_ACTIVE_HIGH>;
+		linux,code = <KEY_KP8>;
+	};
+	vk_77 {
+		label = "vk_key_77";
+		gpios = <&gpio_mockup_hw 77 GPIO_ACTIVE_HIGH>;
+		linux,code = <KEY_KP9>;
+	};
+
+	/* Left of a - z */
+	vk_78 {
+		label = "vk_key_78";
+		gpios = <&gpio_mockup_hw 78 GPIO_ACTIVE_HIGH>;
+		linux,code = <KEY_ESC>;
+	};
+	vk_79 {
+		label = "vk_key_79";
+		gpios = <&gpio_mockup_hw 79 GPIO_ACTIVE_HIGH>;
+		linux,code = <KEY_GRAVE>;
+	};
+	vk_80 {
+		label = "vk_key_80";
+		gpios = <&gpio_mockup_hw 80 GPIO_ACTIVE_HIGH>;
+		linux,code = <KEY_TAB>;
+	};
+	vk_81 {
+		label = "vk_key_81";
+		gpios = <&gpio_mockup_hw 81 GPIO_ACTIVE_HIGH>;
+		linux,code = <KEY_CAPSLOCK>;
+	};
+	vk_82 {
+		label = "vk_key_82";
+		gpios = <&gpio_mockup_hw 82 GPIO_ACTIVE_HIGH>;
+		linux,code = <KEY_LEFTSHIFT>;
+	};
+	vk_83 {
+		label = "vk_key_83";
+		gpios = <&gpio_mockup_hw 83 GPIO_ACTIVE_HIGH>;
+		linux,code = <KEY_LEFTCTRL>;
+	};
+	vk_84 {
+		label = "vk_key_84";
+		gpios = <&gpio_mockup_hw 84 GPIO_ACTIVE_HIGH>;
+		linux,code = <KEY_LEFTMETA>;
+	};
+	vk_85 {
+		label = "vk_key_85";
+		gpios = <&gpio_mockup_hw 85 GPIO_ACTIVE_HIGH>;
+		linux,code = <KEY_LEFTALT>;
+	};
+	vk_86 {
+		label = "vk_key_86";
+		gpios = <&gpio_mockup_hw 86 GPIO_ACTIVE_HIGH>;
+		linux,code = <KEY_SPACE>;
+	};
+
+	/* Right of a - z */
+	vk_87 {
+		label = "vk_key_87";
+		gpios = <&gpio_mockup_hw 87 GPIO_ACTIVE_HIGH>;
+		linux,code = <KEY_MINUS>;
+	};
+	vk_88 {
+		label = "vk_key_88";
+		gpios = <&gpio_mockup_hw 88 GPIO_ACTIVE_HIGH>;
+		linux,code = <KEY_EQUAL>;
+	};
+	vk_89 {
+		label = "vk_key_89";
+		gpios = <&gpio_mockup_hw 89 GPIO_ACTIVE_HIGH>;
+		linux,code = <KEY_BACKSPACE>;
+	};
+	vk_90 {
+		label = "vk_key_90";
+		gpios = <&gpio_mockup_hw 90 GPIO_ACTIVE_HIGH>;
+		linux,code = <KEY_LEFTBRACE>;
+	};
+	vk_91 {
+		label = "vk_key_91";
+		gpios = <&gpio_mockup_hw 91 GPIO_ACTIVE_HIGH>;
+		linux,code = <KEY_RIGHTBRACE>;
+	};
+	vk_92 {
+		label = "vk_key_92";
+		gpios = <&gpio_mockup_hw 92 GPIO_ACTIVE_HIGH>;
+		linux,code = <KEY_BACKSLASH>;
+	};
+
+	vk_93 {
+		label = "vk_key_93";
+		gpios = <&gpio_mockup_hw 93 GPIO_ACTIVE_HIGH>;
+		linux,code = <KEY_SEMICOLON>;
+	};
+	vk_94 {
+		label = "vk_key_94";
+		gpios = <&gpio_mockup_hw 94 GPIO_ACTIVE_HIGH>;
+		linux,code = <KEY_APOSTROPHE>;
+	};
+	vk_95 {
+		label = "vk_key_95";
+		gpios = <&gpio_mockup_hw 95 GPIO_ACTIVE_HIGH>;
+		linux,code = <KEY_ENTER>;
+	};
+
+	vk_96 {
+		label = "vk_key_96";
+		gpios = <&gpio_mockup_hw 96 GPIO_ACTIVE_HIGH>;
+		linux,code = <KEY_COMMA>;
+	};
+	vk_97 {
+		label = "vk_key_97";
+		gpios = <&gpio_mockup_hw 97 GPIO_ACTIVE_HIGH>;
+		linux,code = <KEY_DOT>;
+	};
+	vk_98 {
+		label = "vk_key_98";
+		gpios = <&gpio_mockup_hw 98 GPIO_ACTIVE_HIGH>;
+		linux,code = <KEY_SLASH>;
+	};
+	vk_99 {
+		label = "vk_key_99";
+		gpios = <&gpio_mockup_hw 99 GPIO_ACTIVE_HIGH>;
+		linux,code = <KEY_RIGHTSHIFT>;
+	};
+
+	vk_100 {
+		label = "vk_key_100";
+		gpios = <&gpio_mockup_hw 100 GPIO_ACTIVE_HIGH>;
+		linux,code = <KEY_RIGHTALT>;
+	};
+	vk_101 {
+		label = "vk_key_101";
+		gpios = <&gpio_mockup_hw 101 GPIO_ACTIVE_HIGH>;
+		linux,code = <KEY_RIGHTMETA>;
+	};
+	vk_102 {
+		label = "vk_key_102";
+		gpios = <&gpio_mockup_hw 102 GPIO_ACTIVE_HIGH>;
+		linux,code = <KEY_COMPOSE>;
+	};
+	vk_103 {
+		label = "vk_key_103";
+		gpios = <&gpio_mockup_hw 103 GPIO_ACTIVE_HIGH>;
+		linux,code = <KEY_RIGHTCTRL>;
+	};
+};
-- 
2.39.5


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/2] dt-bindings vnc virtual input
  2025-07-29  6:43 ` [PATCH 1/2] dt-bindings vnc virtual input marlonwu
@ 2025-07-29  7:33   ` Krzysztof Kozlowski
  0 siblings, 0 replies; 6+ messages in thread
From: Krzysztof Kozlowski @ 2025-07-29  7:33 UTC (permalink / raw)
  To: marlonwu, robh, dmitry.torokhov, krzk+dt
  Cc: linux-input, devicetree, MenglongWoo

On 29/07/2025 08:43, marlonwu@126.com wrote:
> From: Menglong Wu <marlonwu@126.com>

Please use subject prefixes matching the subsystem. You can get them for
example with `git log --oneline -- DIRECTORY_OR_FILE` on the directory
your patch is touching. For bindings, the preferred subjects are
explained here:
https://www.kernel.org/doc/html/latest/devicetree/bindings/submitting-patches.html#i-for-patch-submitters

> 
> Add documentation for virtual GPIO keys to enable full ANSI keyboard
> emulation via VNC on embedded devices without physical keyboards.
> 
> - vnc-virtual-input.txt: Usage scenario and implementation details
> - vnc-virtual-input.yaml: Formal DT binding specification
> - MAINTAINERS: Add entry for VNC virtual input support
> 
> The solution registers virtual GPIOs (starting from 400) to avoid conflicts
> with physical GPIOs while supporting standard Linux input codes.
> 
> Signed-off-by: Menglong Wu <marlonwu@126.com>
> ---
>  .../bindings/input/vnc-virtual-input.txt      | 153 ++++++++++++++++++
>  .../bindings/input/vnc-virtual-input.yaml     |  86 ++++++++++
>  MAINTAINERS                                   |   7 +
>  3 files changed, 246 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/input/vnc-virtual-input.txt

We do not take txt bindings anymore, sorry.

>  create mode 100644 Documentation/devicetree/bindings/input/vnc-virtual-input.yaml
> 
> diff --git a/Documentation/devicetree/bindings/input/vnc-virtual-input.txt b/Documentation/devicetree/bindings/input/vnc-virtual-input.txt
> new file mode 100644
> index 000000000000..77d12308c553
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/input/vnc-virtual-input.txt
> @@ -0,0 +1,153 @@
> +Register virtual GPIO keys for VNC
> +==========================
> +
> +# Purpose
> +
> +To emulate a full ANSI keyboard on embedded devices without physical
> +keyboards.The server responds to key events via x11vnc.
> +This resolves the limitation where embedded systems only register a few
> +GPIO keys, making them unable to process full keyboard inputs.
> +
> +documented in Documentation/devicetree/bindings/input/vnc-virtual-input.yaml

I don't understand the placement of this file in bindings. What are you
writing bindings for here?


> diff --git a/Documentation/devicetree/bindings/input/vnc-virtual-input.yaml b/Documentation/devicetree/bindings/input/vnc-virtual-input.yaml
> new file mode 100644
> index 000000000000..8b5414cb2bea
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/input/vnc-virtual-input.yaml
> @@ -0,0 +1,86 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/input/a.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: VNC Virtual GPIO Keys
> +
> +maintainers:
> +  - Menglong Wu <marlonwu@126.com>
> +
> +description: |
> +  This binding describes a virtual GPIO key input node for VNC remote
> +  input.

Describe the hardware, not the binding...

> +  It is based on the standard gpio-keys binding.
> +
> +select: false
> +
> +allOf:
> +  - $ref: gpio-keys.yaml#
> +
> +properties:
> +  compatible:
> +    const: gpio-keys

So this is all completely redundant and not needed. Drop the bindings.

> +
> +  status:
> +    enum:
> +      - okay
> +      - disabled

Do you see any bindings with this?

Srsly, it's second bindings today. I think you send some AI slops to us.

Please confirm:

Did you use any AI tool to generate this file?

Best regards,
Krzysztof

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 0/2] Register virtual GPIO keys for VNC
  2025-07-29  6:43 [PATCH 0/2] Register virtual GPIO keys for VNC marlonwu
  2025-07-29  6:43 ` [PATCH 1/2] dt-bindings vnc virtual input marlonwu
  2025-07-29  6:43 ` [PATCH 2/2] ARM: dts: Add virtual GPIO input for VNC keyboard marlonwu
@ 2025-07-29  7:39 ` Krzysztof Kozlowski
  2 siblings, 0 replies; 6+ messages in thread
From: Krzysztof Kozlowski @ 2025-07-29  7:39 UTC (permalink / raw)
  To: marlonwu, robh, dmitry.torokhov, krzk+dt
  Cc: linux-input, devicetree, MenglongWoo

On 29/07/2025 08:43, marlonwu@126.com wrote:
> From: Menglong Wu <marlonwu@126.com>
> 
> Test platform
> -------------
> Kernel: 4.14.98

Really? That's ancient kernel.

We cannot take any of this. You need to rebase and test on patches on
the latest kernel. Not some ancient, buggy thing.

Best regards,
Krzysztof

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 2/2] ARM: dts: Add virtual GPIO input for VNC keyboard
  2025-07-29  6:43 ` [PATCH 2/2] ARM: dts: Add virtual GPIO input for VNC keyboard marlonwu
@ 2025-07-29  7:52   ` Krzysztof Kozlowski
  0 siblings, 0 replies; 6+ messages in thread
From: Krzysztof Kozlowski @ 2025-07-29  7:52 UTC (permalink / raw)
  To: marlonwu, robh, dmitry.torokhov, krzk+dt
  Cc: linux-input, devicetree, MenglongWoo

On 29/07/2025 08:43, marlonwu@126.com wrote:
> From: Menglong Wu <marlonwu@126.com>
> 
> Implements a complete ANSI keyboard solution for VNC remote input
> on ARM devices by:
> 
> 1. Adding a device tree include file (vnc-virtual-input.dtsi) that:
>    - Defines a gpio-mockup controller with 104 virtual GPIOs
>    (startingfrom 400)
>    - Maps all standard keyboard keys
>    (F1-F12, alphanumeric, modifiers, etc.)
>    - Follows Linux input event codes for key mappings
> 
> 2. Updating MAINTAINERS to track the new dtsi file
> 
> The virtual GPIO approach allows embedded systems without physical
> keyboards to receive full keyboard input via VNC while avoiding
> conflicts with realGPIO numbering.
> 
> Signed-off-by: Menglong Wu <marlonwu@126.com>
> ---
>  MAINTAINERS                              |   1 +
>  arch/arm/boot/dts/vnc-virtual-input.dtsi | 569 +++++++++++++++++++++++

This is a dead, no-op, impossible to test code.

Also, does not follow any upstream coding style.

Best regards,
Krzysztof

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2025-07-29  7:52 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-29  6:43 [PATCH 0/2] Register virtual GPIO keys for VNC marlonwu
2025-07-29  6:43 ` [PATCH 1/2] dt-bindings vnc virtual input marlonwu
2025-07-29  7:33   ` Krzysztof Kozlowski
2025-07-29  6:43 ` [PATCH 2/2] ARM: dts: Add virtual GPIO input for VNC keyboard marlonwu
2025-07-29  7:52   ` Krzysztof Kozlowski
2025-07-29  7:39 ` [PATCH 0/2] Register virtual GPIO keys for VNC Krzysztof Kozlowski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).