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

From: Ilpo Järvinen

Date: Mon Nov 09 2026 - 09:26:01 EST


On Mon, 9 Nov 2026, Konrad Dybcio wrote:

> On 11/9/26 11:49 AM, Rahul Pon wrote:
> > 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.
>
> [...]
>
> > +What: /sys/bus/i2c/devices/<bus>-0076/kbd_backlight_level
> > +Date: September 2026
> > +KernelVersion: 7.4
> > +Contact: Rahul Pon <theflyingrahul@xxxxxxxxx>
> > +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
>
> [...]
>
>
> > +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.

--
i.