mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>
To: Rahul Pon <theflyingrahul@gmail.com>
Cc: Hans de Goede <hansg@kernel.org>,
	 Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>,
	 Bryan O'Donoghue <bryan.odonoghue@linaro.org>,
	 Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	 Conor Dooley <conor+dt@kernel.org>,
	Guenter Roeck <linux@roeck-us.net>,
	 platform-driver-x86@vger.kernel.org, devicetree@vger.kernel.org,
	 linux-hwmon@vger.kernel.org, linux-arm-msm@vger.kernel.org,
	 LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 2/2] platform: arm64: Add HP OmniBook 5 16 embedded controller driver
Date: Mon, 9 Nov 2026 16:16:50 +0200 (EET)	[thread overview]
Message-ID: <ada64bce-bf80-37a1-a483-048c0d64131f@linux.intel.com> (raw)
In-Reply-To: <08a43e54-6f54-489d-9ba7-6cfc6eb173c4@oss.qualcomm.com>

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@gmail.com>
> > +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.


      reply	other threads:[~2026-11-09 14:16 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-09 10:49 [PATCH 0/2] platform: arm64: HP OmniBook 5 16 embedded controller Rahul Pon
2026-11-09 10:49 ` [PATCH 1/2] dt-bindings: embedded-controller: Add HP OmniBook 5 16 EC Rahul Pon
2026-11-09 14:17   ` Krzysztof Kozlowski
2026-11-09 10:49 ` [PATCH 2/2] platform: arm64: Add HP OmniBook 5 16 embedded controller driver Rahul Pon
2026-11-09 14:12   ` Konrad Dybcio
2026-11-09 14:16     ` Ilpo Järvinen [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ada64bce-bf80-37a1-a483-048c0d64131f@linux.intel.com \
    --to=ilpo.jarvinen@linux.intel.com \
    --cc=bryan.odonoghue@linaro.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=hansg@kernel.org \
    --cc=konrad.dybcio@oss.qualcomm.com \
    --cc=krzk+dt@kernel.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-hwmon@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=platform-driver-x86@vger.kernel.org \
    --cc=robh@kernel.org \
    --cc=theflyingrahul@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®