Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 55 additions & 0 deletions Documentation/ABI/testing/dev-g6ts-heat
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
What: /dev/g6ts-heat
Date: August 2026
KernelVersion: 7.2
Contact: linux-input@vger.kernel.org
Description:
Binary raw-frame stream for the Microsoft Surface G6 touch/pen
processor. HEAT reports 0x0b, 0x0c, 0x0d, and 0x1a plus optional
opaque sideband reports 0x07 and 0x6e are exported in transport
order before the touch-readiness filter is applied. Sideband
records are not cycle members or pen-presence notifications.

Only one reader may open the misc character device at a time. A
blocking read waits for a complete record. O_NONBLOCK returns
-EAGAIN when empty. Every successful read returns exactly one
whole record; a buffer smaller than record_len returns -EMSGSIZE
without consuming it. poll(2) reports POLLIN while records are
queued and POLLHUP after device removal.

The first 32 bytes are struct g6ts_heat_record_header from
<linux/g6ts_heat.h>, followed by content_len bytes copied exactly
from the HID-over-SPI content (the report ID is not repeated in the
payload). All multibyte fields are little-endian:

======= ===== ==================================================
Offset Size Meaning
======= ===== ==================================================
0 4 Magic 0x31483647 (ASCII bytes "G6H1")
4 2 ABI version (1)
6 2 Header length (32)
8 4 Total record length
12 4 Transport generation
16 8 CLOCK_MONOTONIC timestamp in nanoseconds
24 4 Enqueue sequence, including boundary records
28 2 Content length (maximum 4349)
30 1 HID report ID, or zero for a boundary record
31 1 G6TS_HEAT_RECORD_F_* flags
======= ===== ==================================================

Generation starts at one. A panel reset, suspend, or transport
fault increments it, flushes queued frames, and enqueues a zero-data
boundary record. RESET, SUSPEND, or TRANSPORT_FAULT in that record
tells userspace to release pen state immediately. Queue overflow
drops the oldest record so retained records remain ordered and current.
Because overflow can drop the boundary record itself, readers must
also treat every generation change or sequence gap as a discontinuity,
release pen state immediately, and discard any partial measurement
cycle.

G6TS_HEAT_IOC_GET_INFO returns the ABI/header sizes, maximum content
length, queue capacity, and supported flags in struct
g6ts_heat_info. G6TS_HEAT_IOC_GET_STATS returns the generation,
queue depth, enqueue/drop/flush counters, oversize drops, and the
four core HEAT report counts in struct g6ts_heat_stats. Both ioctl
structures begin with ABI version and structure size and reserve
zero-filled space for compatible extension.
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/input/touchscreen/microsoft,mshw0485.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Microsoft Surface G6 MSHW0485 touchscreen

maintainers:
- Leon Silcott <leon@boasi.io>

description:
The MSHW0485 is a HID-over-SPI touchscreen used by the Microsoft Surface
Pro 11. It uses a protocol-9 Qualcomm GENI controller in quad-SPI mode.

allOf:
- $ref: touchscreen.yaml#
- $ref: /schemas/spi/spi-peripheral-props.yaml#

properties:
compatible:
const: microsoft,mshw0485

reg:
maxItems: 1

interrupts:
maxItems: 1

interrupt-gpios:
maxItems: 1

power-gpios:
maxItems: 1

reset-gpios:
maxItems: 1

microsoft,enable-heat-frame-abi:
type: boolean
description:
Opt in to the optional raw heat-frame misc-device ABI. The matching
kernel configuration must also be enabled.

microsoft,enable-iptsd-bridge:
type: boolean
description:
Opt in to the optional HIDRAW-only DFT bridge used by iptsd. The
matching kernel configuration must also be enabled.

spi-max-frequency:
maximum: 40000000

required:
- compatible
- reg
- interrupts
- interrupt-gpios
- power-gpios
- reset-gpios
- spi-max-frequency

additionalProperties: false

examples:
- |
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/interrupt-controller/irq.h>

spi {
#address-cells = <1>;
#size-cells = <0>;

touchscreen@0 {
compatible = "microsoft,mshw0485";
reg = <0>;
spi-max-frequency = <40000000>;

interrupt-parent = <&tlmm>;
interrupts = <51 IRQ_TYPE_LEVEL_LOW>;
interrupt-gpios = <&tlmm 51 GPIO_ACTIVE_LOW>;
power-gpios = <&tlmm 64 GPIO_ACTIVE_HIGH>;
reset-gpios = <&tlmm 48 GPIO_ACTIVE_HIGH>;

microsoft,enable-heat-frame-abi;
microsoft,enable-iptsd-bridge;
};
};
...
14 changes: 14 additions & 0 deletions Documentation/devicetree/bindings/spi/qcom,spi-geni-qcom.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,13 @@ description:
allOf:
- $ref: /schemas/spi/spi-controller.yaml#
- $ref: /schemas/soc/qcom/qcom,se-common-props.yaml#
- if:
required:
- qcom,geni-qspi
then:
required:
- dmas
- dma-names

properties:
compatible:
Expand Down Expand Up @@ -64,6 +71,13 @@ properties:
power-domains:
maxItems: 1

qcom,geni-qspi:
type: boolean
description:
Select protocol-9 quad-SPI operation for the Microsoft Denali touch
controller. The serial engine firmware must already be loaded by the
platform firmware and the DMA channels must use QCOM_GPI_QSPI.

reg:
maxItems: 1

Expand Down
9 changes: 9 additions & 0 deletions MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -17929,6 +17929,15 @@ F: Documentation/driver-api/surface_aggregator/clients/dtx.rst
F: drivers/platform/surface/surface_dtx.c
F: include/uapi/linux/surface_aggregator/dtx.h

MICROSOFT SURFACE G6 TOUCHSCREEN DRIVER
M: Leon Silcott <leon@boasi.io>
L: linux-input@vger.kernel.org
S: Maintained
F: Documentation/ABI/testing/dev-g6ts-heat
F: Documentation/devicetree/bindings/input/touchscreen/microsoft,mshw0485.yaml
F: drivers/input/touchscreen/mshw0485_touch.c
F: include/uapi/linux/g6ts_heat.h

MICROSOFT SURFACE SENSOR FAN DRIVER
M: Maximilian Luz <luzmaximilian@gmail.com>
M: Ivor Wanders <ivor@iwanders.net>
Expand Down
56 changes: 56 additions & 0 deletions arch/arm64/boot/dts/qcom/x1-microsoft-denali.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -716,6 +716,10 @@
};
};

&gpi_dma1 {
status = "okay";
};

&gpu {
status = "okay";
};
Expand Down Expand Up @@ -1064,6 +1068,38 @@
vdd3-supply = <&vreg_l8b_3p0>;
};

&spi10 {
qcom,geni-qspi;

dmas = <&gpi_dma1 0 2 QCOM_GPI_QSPI>,
<&gpi_dma1 1 2 QCOM_GPI_QSPI>;
dma-names = "tx", "rx";

pinctrl-0 = <&qup_spi10_data_clk>,
<&qup_spi10_cs>,
<&g6ts_qspi_data23>;
pinctrl-names = "default";

status = "okay";

touchscreen@0 {
compatible = "microsoft,mshw0485";
reg = <0>;
spi-max-frequency = <40000000>;

interrupt-parent = <&tlmm>;
interrupts = <51 IRQ_TYPE_LEVEL_LOW>;
interrupt-gpios = <&tlmm 51 GPIO_ACTIVE_LOW>;
power-gpios = <&tlmm 64 GPIO_ACTIVE_HIGH>;
reset-gpios = <&tlmm 48 GPIO_ACTIVE_HIGH>;
microsoft,enable-heat-frame-abi;
microsoft,enable-iptsd-bridge;

pinctrl-0 = <&g6ts_interrupt>, <&g6ts_reset_power>;
pinctrl-names = "default";
};
};

&swr0 {
status = "okay";

Expand Down Expand Up @@ -1099,6 +1135,26 @@
gpio-reserved-ranges = <44 4>, /* SPI (TPM) */
<238 1>; /* UFS Reset */

g6ts_interrupt: g6ts-interrupt-state {
pins = "gpio51";
function = "gpio";
bias-pull-up;
};

g6ts_qspi_data23: g6ts-qspi-data23-state {
pins = "gpio49", "gpio50";
function = "qup1_se2";
drive-strength = <6>;
bias-disable;
};

g6ts_reset_power: g6ts-reset-power-state {
pins = "gpio48", "gpio64";
function = "gpio";
drive-strength = <2>;
bias-disable;
};

hall_int_n_default: hall-int-n-state {
pins = "gpio2";
function = "gpio";
Expand Down
3 changes: 3 additions & 0 deletions debian.qcom-x1e/config/annotations
Original file line number Diff line number Diff line change
Expand Up @@ -12144,6 +12144,9 @@ CONFIG_TOUCHSCREEN_MC13783 policy<{'arm64': 'm'}>
CONFIG_TOUCHSCREEN_MELFAS_MIP4 policy<{'arm64': 'm'}>
CONFIG_TOUCHSCREEN_MMS114 policy<{'arm64': 'm'}>
CONFIG_TOUCHSCREEN_MSG2638 policy<{'arm64': 'm'}>
CONFIG_TOUCHSCREEN_MSHW0485 policy<{'arm64': 'm'}>
CONFIG_TOUCHSCREEN_MSHW0485_HEAT_FRAME policy<{'arm64': 'y'}>
CONFIG_TOUCHSCREEN_MSHW0485_IPTSD policy<{'arm64': 'y'}>
CONFIG_TOUCHSCREEN_MTOUCH policy<{'arm64': 'm'}>
CONFIG_TOUCHSCREEN_NOVATEK_NVT_TS policy<{'arm64': 'm'}>
CONFIG_TOUCHSCREEN_PENMOUNT policy<{'arm64': 'm'}>
Expand Down
Loading