Skip to contentSkip to conversation

platform: arm64: HP OmniBook 5 16 embedded controller

PATCH In review Rahul Pon 5 participants 8 messages Nov 9

Subsystems (5)
lore
Share & tools
lore

Rahul Pon

author
#0 lore raw

cover platform: arm64: HP OmniBook 5 16 embedded controller

This series adds a binding and a driver for the embedded controller of the HP OmniBook 5 Laptop 16-bf1xxx, a laptop with the Snapdragon X2 Plus/Elite SoC.

The EC sits on I2C at 0x76 and takes commands through a mailbox. Its protocol and its command and event codes follow HP's ACPI methods on this laptop. The driver exposes the fan speed and four thermistors through hwmon (the thermistors can also serve as thermal sensors for skin temperature zones), the mute and mic mute LEDs, the keyboard backlight timeout and level, and the F9 and F11 hotkeys, which only the EC reports.

The board device tree that uses this binding will follow in a separate series to the Qualcomm maintainers.

Testing: the driver has run on the laptop since late September, on Qualcomm's qcom-next (7.3, latest qcom-next-7.3-20261031). On next-20261105 the series builds with W=1 and passes dt_binding_check.

Rahul Pon (2):
dt-bindings: embedded-controller: Add HP OmniBook 5 16 EC
platform: arm64: Add HP OmniBook 5 16 embedded controller driver

 .../ABI/testing/sysfs-driver-hp-omnibook-5-ec |  19 +
 .../hp,omnibook-5-16-bf1xxx-ec.yaml           |  49 ++
 MAINTAINERS                                   |   8 +
 drivers/platform/arm64/Kconfig                |  17 +
 drivers/platform/arm64/Makefile               |   1 +
 drivers/platform/arm64/hp-omnibook-5-ec.c     | 417 ++++++++++++++++++
 6 files changed, 511 insertions(+)
 create mode 100644 Documentation/ABI/testing/sysfs-driver-hp-omnibook-5-ec
 create mode 100644 Documentation/devicetree/bindings/embedded-controller/hp,omnibook-5-16-bf1xxx-ec.yaml
 create mode 100644 drivers/platform/arm64/hp-omnibook-5-ec.c

base-commit: ddfe51b0a0f5dc9e415cc2c8ad8db17532dd426b

Signature · 1 line
2.53.0
author
#1 lore raw

PATCH 1/2 dt-bindings: embedded-controller: Add HP OmniBook 5 16 EC

The HP OmniBook 5 16 (Snapdragon X2) has an embedded controller on I2C at address 0x76. It runs the fan and the keyboard backlight and reports the fan speed and its thermistor temperatures.

---
 .../hp,omnibook-5-16-bf1xxx-ec.yaml           | 49 +++++++++++++++++++
 1 file changed, 49 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/embedded-controller/hp,omnibook-5-16-bf1xxx-ec.yaml
Documentation/devicetree/bindings/embedded-controller/hp,omnibook-5-16-bf1xxx-ec.yaml new file +49 -0
new file mode 100644
index 0000000000..be4c845067
@@ -0,0 +1,49 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/embedded-controller/hp,omnibook-5-16-bf1xxx-ec.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: HP OmniBook 5 16 Embedded Controller
+
+maintainers:
+  - Rahul Pon <[email protected]>
+
+description:
+  The embedded controller of the HP OmniBook 5 16 (Snapdragon X2), on an
+  I2C bus. It runs the fan and the keyboard backlight and reports the fan
+  speed and its thermistor temperatures. Its four thermistors can serve
+  as thermal sensors, indexed 0 to 3.
+
+properties:
+  compatible:
+    const: hp,omnibook-5-16-bf1xxx-ec
+
+  reg:
+    const: 0x76
+
+  interrupts:
+    maxItems: 1
+
+  "#thermal-sensor-cells":
+    const: 1
+
+required:
+  - compatible
+  - reg
+
+additionalProperties: false
+
+examples:
+  - |
+    i2c {
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        embedded-controller@76 {
+            compatible = "hp,omnibook-5-16-bf1xxx-ec";
+            reg = <0x76>;
+            #thermal-sensor-cells = <1>;
+        };
+    };
+...
Signature · 1 line
2.53.0
author
#4 lore raw

PATCH 2/2 platform: arm64: Add HP OmniBook 5 16 embedded controller driver

In reply to Rahul Pon

The embedded controller of the HP OmniBook 5 16 (Snapdragon X2) sits on I2C at address 0x76 and takes commands through a mailbox: wait for an idle status (0xef), write the command and sub-command (0xed), wait for completion, then read the 32-byte reply (0xee). Its interrupt line signals events, read from register 0x00 and acknowledged by writing 0 back, as HP's ACPI does.

Expose:
- the fan speed and the four thermistors HP's thermal zones use, through hwmon;
- the two EC LEDs HP's mute LED WMI methods drive, as the mute and mic mute LEDs;
- the keyboard backlight timeout (30 s, 3 min or always on) and the current backlight level as sysfs attributes; the EC runs the backlight itself, and its backlight events notify the level attribute;
- the F9 (mic mute) and F11 (programmable) hotkeys, which only the EC reports, as input events, using HP's WMI key codes as hp-wmi maps them.

The command codes, event codes and reply formats are the ones HP's ACPI methods use on this laptop.

---
 .../ABI/testing/sysfs-driver-hp-omnibook-5-ec |  19 +
 MAINTAINERS                                   |   8 +
 drivers/platform/arm64/Kconfig                |  17 +
 drivers/platform/arm64/Makefile               |   1 +
 drivers/platform/arm64/hp-omnibook-5-ec.c     | 417 ++++++++++++++++++
 5 files changed, 462 insertions(+)
 create mode 100644 Documentation/ABI/testing/sysfs-driver-hp-omnibook-5-ec
 create mode 100644 drivers/platform/arm64/hp-omnibook-5-ec.c
Documentation/ABI/testing/sysfs-driver-hp-omnibook-5-ec new file +19 -0
new file mode 100644
index 0000000000..4c6f5cb20e
@@ -0,0 +1,19 @@
+What:		/sys/bus/i2c/devices/<bus>-0076/kbd_backlight_timeout
+Date:		September 2026
+KernelVersion:	7.4
+Contact:	Rahul Pon <[email protected]>
+Description:
+		(RW) How long the keyboard backlight of the HP OmniBook 5 16
+		stays on after the last key press, as the embedded controller
+		applies it: "30s", "3min" or "always". The Fn key still turns
+		the backlight on and off.
+
+What:		/sys/bus/i2c/devices/<bus>-0076/kbd_backlight_level
+Date:		September 2026
+KernelVersion:	7.4
+Contact:	Rahul Pon <[email protected]>
+Description:
+		(RO) The keyboard backlight level of the HP OmniBook 5 16:
+		0 (off), 1 or 2. Only the backlight key changes it, inside the
+		embedded controller. The attribute is notified when the EC
+		reports a change.
MAINTAINERS +8 -0
index aa647f5d37..d043a2f8f6 100644
@@ -12284,6 +12284,14 @@ L:	[email protected]
 S:	Orphan
 F:	drivers/platform/x86/hp/tc1100-wmi.c
 
+HP OMNIBOOK 5 16 EMBEDDED CONTROLLER DRIVER
+M:	Rahul Pon <[email protected]>
+L:	[email protected]
+S:	Maintained
+F:	Documentation/ABI/testing/sysfs-driver-hp-omnibook-5-ec
+F:	Documentation/devicetree/bindings/embedded-controller/hp,omnibook-5-16-bf1xxx-ec.yaml
+F:	drivers/platform/arm64/hp-omnibook-5-ec.c
+
 HP WMI HARDWARE MONITOR DRIVER
 M:	James Seo <[email protected]>
 L:	[email protected]
drivers/platform/arm64/Kconfig +17 -0
index 3f879410b3..2b34f5ab1b 100644
@@ -48,6 +48,23 @@ config EC_ASUS_GLYMUR
 	  temperature sensors readout, fan monitoring, keyboard and EC event
 	  reporting.
 
+config EC_HP_OMNIBOOK5
+	tristate "HP OmniBook 5 16 Embedded Controller driver"
+	depends on ARCH_QCOM || COMPILE_TEST
+	depends on I2C
+	depends on HWMON
+	depends on INPUT
+	select INPUT_SPARSEKMAP
+	select LEDS_CLASS
+	select NEW_LEDS
+	help
+	  Driver for the Embedded Controller in the Snapdragon X2-based HP
+	  OmniBook 5 16, which reports the fan speed, thermistor
+	  temperatures and hotkeys, and drives the mute LEDs and the
+	  keyboard backlight timeout.
+
+	  Say M or Y here to include this support.
+
 config EC_HUAWEI_GAOKUN
 	tristate "Huawei Matebook E Go Embedded Controller driver"
 	depends on ARCH_QCOM || COMPILE_TEST
drivers/platform/arm64/Makefile +1 -0
index 3bc3d4669c..6c72726eae 100644
@@ -7,6 +7,7 @@
 
 obj-$(CONFIG_EC_ACER_ASPIRE1)	+= acer-aspire1-ec.o
 obj-$(CONFIG_EC_ASUS_GLYMUR) += asus-glymur-ec.o
+obj-$(CONFIG_EC_HP_OMNIBOOK5)	+= hp-omnibook-5-ec.o
 obj-$(CONFIG_EC_HUAWEI_GAOKUN)	+= huawei-gaokun-ec.o
 obj-$(CONFIG_EC_LENOVO_YOGA_C630) += lenovo-yoga-c630.o
 obj-$(CONFIG_EC_LENOVO_THINKPAD_T14S) += lenovo-thinkpad-t14s.o
drivers/platform/arm64/hp-omnibook-5-ec.c new file +417 -0

417 lines not on this page · raw message

Signature · 1 line
2.53.0
#2 lore raw

Re: [PATCH 1/2] dt-bindings: embedded-controller: Add HP OmniBook 5 16 EC

In reply to Rahul Pon
Sashiko has reviewed this patch and found no issues.
Quoted 5 lines

The HP OmniBook 5 16 (Snapdragon X2) has an embedded controller on I2C at address 0x76. It runs the fan and the keyboard backlight and reports the fan speed and its thermistor temperatures.

Sashiko has reviewed this patch and found no issues.

Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1
#5 lore raw

Re: [PATCH 2/2] platform: arm64: Add HP OmniBook 5 16 embedded controller driver

In reply to Rahul Pon
Thank you for your contribution! Sashiko AI review found 2 potential issues to consider: - [Medium] platform: arm64: hpec_command() skips reading HPEC_REPLY when reply is NULL - [Low] platform…

Thank you for your contribution! Sashiko AI review found 2 potential issues to consider:
- [Medium] platform: arm64: hpec_command() skips reading HPEC_REPLY when reply is NULL
- [Low] platform: arm64: hp-omnibook-5-ec: direct hwmon registration in hpec_probe()
--

commit 9e10721f812ce769072addab8eb2bcaf582e4091
Author: Rahul Pon <[email protected]>

platform: arm64: Add HP OmniBook 5 16 embedded controller driver

This commit adds an I2C driver for the HP OmniBook 5 16 embedded controller, exposing fan and thermistor monitoring via hwmon, mute LEDs, keyboard backlight attributes, and hotkeys.

Quoted 6 lines
drivers/platform/arm64/hp-omnibook-5-ec.c new file +0 -0
new file mode 100644
index 0000000000000..bfe20e12aafdf
@@ -0,0 +1,417 @@

[ ... ]

Quoted 17 lines
drivers/platform/arm64/hp-omnibook-5-ec.c new file +17 -0
+static int hpec_command(struct hpec *ec, u8 cmd, u8 sub, u8 reply[HPEC_REPLY_LEN])
+{
+	u8 request[] = { cmd, sub };
+	int ret;
+
+	guard(mutex)(&ec->lock);
+
+	ret = hpec_wait(ec, HPEC_STATUS_IDLE);
+	if (ret)
+		return ret;
+
+	ret = i2c_smbus_write_i2c_block_data(ec->client, HPEC_REQUEST,
+					     sizeof(request), request);
+	if (ret)
+		return ret;
+
+	ret = hpec_wait(ec, HPEC_STATUS_DONE);

drivers/platform/arm64/hp-omnibook-5-ec.c line 149

Quoted 10 lines
drivers/platform/arm64/hp-omnibook-5-ec.c new file +10 -0
+	if (ret || !reply)
+		return ret;
+
+	ret = i2c_smbus_read_i2c_block_data(ec->client, HPEC_REPLY,
+					    HPEC_REPLY_LEN, reply);
+	if (ret < 0)
+		return ret;
+
+	return ret == HPEC_REPLY_LEN ? 0 : -EIO;
+}

[Severity: Medium]
Does the EC require reading HPEC_REPLY to return HPEC_STATUS from HPEC_STATUS_DONE to HPEC_STATUS_IDLE?

The file header describes a four-step mailbox protocol ending with reading the reply, but hpec_command() returns right after HPEC_STATUS reaches HPEC_STATUS_DONE when reply is NULL (as in hpec_led_set() and kbd_backlight_timeout_store()). If the EC only clears HPEC_STATUS_DONE once HPEC_REPLY is read, the next hpec_command() call will time out in hpec_wait(ec, HPEC_STATUS_IDLE).

[ ... ]

Quoted 2 lines
drivers/platform/arm64/hp-omnibook-5-ec.c new file +2 -0
+static int hpec_probe(struct i2c_client *client)
+{

[ ... ]

drivers/platform/arm64/hp-omnibook-5-ec.c line 372

Quoted 4 lines
drivers/platform/arm64/hp-omnibook-5-ec.c new file +4 -0
+	hwmon = devm_hwmon_device_register_with_info(dev, "hp_omnibook_ec", ec,
+						     &hpec_hwmon_chip, NULL);
+	if (IS_ERR(hwmon))
+		return PTR_ERR(hwmon);

[Severity: Low]
New hardware monitoring drivers belong in drivers/hwmon/ rather than registering hwmon devices directly from outside that directory. Since this EC is a multi-function device, should the hwmon functionality be split out into an auxiliary device driver under drivers/hwmon/?

Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=2
#6 lore raw

Re: [PATCH 2/2] platform: arm64: Add HP OmniBook 5 16 embedded controller driver

In reply to Rahul Pon
Quoted 6 lines · Rahul Pon

The embedded controller of the HP OmniBook 5 16 (Snapdragon X2) sits on I2C at address 0x76 and takes commands through a mailbox: wait for an idle status (0xef), write the command and sub-command (0xed), wait for completion, then read the 32-byte reply (0xee). Its interrupt line signals events, read from register 0x00 and acknowledged by writing 0 back, as HP's ACPI does.

[...]

Documentation/ABI/testing/sysfs-driver-hp-omnibook-5-ec line 19

Quoted 9 lines
Documentation/ABI/testing/sysfs-driver-hp-omnibook-5-ec new file +9 -0
+What:		/sys/bus/i2c/devices/<bus>-0076/kbd_backlight_level
+Date:		September 2026
+KernelVersion:	7.4
+Contact:	Rahul Pon <[email protected]>
+Description:
+		(RO) The keyboard backlight level of the HP OmniBook 5 16:
+		0 (off), 1 or 2. Only the backlight key changes it, inside the
+		embedded controller. The attribute is notified when the EC
+		reports a change.

That's already reported in <led_subdevice_path>/brightness

[...]

drivers/platform/arm64/hp-omnibook-5-ec.c line 224

Quoted 9 lines
drivers/platform/arm64/hp-omnibook-5-ec.c new file +9 -0
+static enum led_brightness hpec_led_get(struct led_classdev *cdev)
+{
+	struct hpec_led *led = container_of(cdev, struct hpec_led, cdev);
+	u8 reply[HPEC_REPLY_LEN];
+
+	if (hpec_command(led->ec, HPEC_LED, HPEC_LED_GET, reply))
+		return LED_OFF;
+
+	return (reply[1] >> (led->index - hpec_leds[0].index)) & 1;

"& 1" -> "& BIT(0)"

Konrad

maintainer
#7 lore raw

Re: [PATCH 2/2] platform: arm64: Add HP OmniBook 5 16 embedded controller driver

Quoted 25 lines · Konrad Dybcio
Quoted 6 lines · Rahul Pon

The embedded controller of the HP OmniBook 5 16 (Snapdragon X2) sits on I2C at address 0x76 and takes commands through a mailbox: wait for an idle status (0xef), write the command and sub-command (0xed), wait for completion, then read the 32-byte reply (0xee). Its interrupt line signals events, read from register 0x00 and acknowledged by writing 0 back, as HP's ACPI does.

[...]

Documentation/ABI/testing/sysfs-driver-hp-omnibook-5-ec line 19

Quoted 9 lines
Documentation/ABI/testing/sysfs-driver-hp-omnibook-5-ec new file +9 -0
+What:		/sys/bus/i2c/devices/<bus>-0076/kbd_backlight_level
+Date:		September 2026
+KernelVersion:	7.4
+Contact:	Rahul Pon <[email protected]>
+Description:
+		(RO) The keyboard backlight level of the HP OmniBook 5 16:
+		0 (off), 1 or 2. Only the backlight key changes it, inside the
+		embedded controller. The attribute is notified when the EC
+		reports a change.

That's already reported in <led_subdevice_path>/brightness

[...]

Quoted 11 lines

drivers/platform/arm64/hp-omnibook-5-ec.c line 224

Quoted 9 lines
drivers/platform/arm64/hp-omnibook-5-ec.c new file +9 -0
+static enum led_brightness hpec_led_get(struct led_classdev *cdev)
+{
+	struct hpec_led *led = container_of(cdev, struct hpec_led, cdev);
+	u8 reply[HPEC_REPLY_LEN];
+
+	if (hpec_command(led->ec, HPEC_LED, HPEC_LED_GET, reply))
+		return LED_OFF;
+
+	return (reply[1] >> (led->index - hpec_leds[0].index)) & 1;

"& 1" -> "& BIT(0)"

If that could be named with a define, even better.

Signature · 1 line
 i.
#3 lore raw

Re: [PATCH 1/2] dt-bindings: embedded-controller: Add HP OmniBook 5 16 EC

In reply to Rahul Pon
Quoted 35 lines · Rahul Pon

The HP OmniBook 5 16 (Snapdragon X2) has an embedded controller on I2C at address 0x76. It runs the fan and the keyboard backlight and reports the fan speed and its thermistor temperatures.

---
 .../hp,omnibook-5-16-bf1xxx-ec.yaml           | 49 +++++++++++++++++++
 1 file changed, 49 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/embedded-controller/hp,omnibook-5-16-bf1xxx-ec.yaml
Documentation/devicetree/bindings/embedded-controller/hp,omnibook-5-16-bf1xxx-ec.yaml new file +19 -0
new file mode 100644
index 0000000000..be4c845067
@@ -0,0 +1,49 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/embedded-controller/hp,omnibook-5-16-bf1xxx-ec.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: HP OmniBook 5 16 Embedded Controller
+
+maintainers:
+  - Rahul Pon <[email protected]>
+
+description:
+  The embedded controller of the HP OmniBook 5 16 (Snapdragon X2), on an
+  I2C bus. It runs the fan and the keyboard backlight and reports the fan
+  speed and its thermistor temperatures. Its four thermistors can serve
+  as thermal sensors, indexed 0 to 3.
+
+properties:
+  compatible:

Documentation/devicetree/bindings/embedded-controller/hp,omnibook-5-16-bf1xxx-ec.yaml line 29

Quoted 10 lines
Documentation/devicetree/bindings/embedded-controller/hp,omnibook-5-16-bf1xxx-ec.yaml new file +10 -0
+    const: hp,omnibook-5-16-bf1xxx-ec
+
+  reg:
+    const: 0x76
+
+  interrupts:
+    maxItems: 1
+
+  "#thermal-sensor-cells":
+    const: 1

Looks incomplete, test your DTS. Your driver mentions interrupt.

Best regards,
Krzysztof