From: Tzung-Bi Shih <tzungbi@kernel.org>
To: Gwendal Grignou <gwendal@chromium.org>
Cc: chrome-platform@lists.linux.dev, Gwendal Grignou <gwendal@google.com>
Subject: Re: [PATCH v2 1/2] platform: chrome: lightbar: Report number of segments
Date: Tue, 27 Jan 2026 08:17:08 +0000 [thread overview]
Message-ID: <aXh0hEZNk2gmLncI@google.com> (raw)
In-Reply-To: <20260127063434.789047-1-gwendal@google.com>
On Mon, Jan 26, 2026 at 10:34:33PM -0800, Gwendal Grignou wrote:
> Add attribue `num_segments` to return the number of exposed LED segments
> in the lightbar. It can be smaller than the number of physical leds in
> the lightbar.
>
> Test: Check the attribute is present and returns a value when read.
>
> Signed-off-by: Gwendal Grignou <gwendal@google.com>
> ---
> Changes in v2:
> - Put local variables at beginning of num_segments_show()
> - Cleanup return logic.
>
> drivers/platform/chrome/cros_ec_lightbar.c | 43 +++++++++++++++++++
> .../linux/platform_data/cros_ec_commands.h | 11 +++++
The patch generally looks good to me. We have to wait the header change
landed in firmware.
> +static ssize_t num_segments_show(struct device *dev,
> + struct device_attribute *attr, char *buf)
> +{
> + struct ec_params_lightbar *param;
> + struct ec_response_lightbar *resp;
> + struct cros_ec_command *msg;
> + struct cros_ec_dev *ec = to_cros_ec_dev(dev);
> + uint32_t num = 0;
> + int ret;
> +
> + ret = lb_throttle();
> + if (ret)
> + return ret;
> +
> + msg = alloc_lightbar_cmd_msg(ec);
> + if (!msg)
> + return -ENOMEM;
> +
> + param = (struct ec_params_lightbar *)msg->data;
> + param->cmd = LIGHTBAR_CMD_GET_PARAMS_V3;
> + msg->outsize = sizeof(param->cmd);
> + msg->result = sizeof(resp->get_params_v3);
^^^^^^ insize
It seems you missed the comment from v1.
next prev parent reply other threads:[~2026-01-27 8:17 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-27 6:34 [PATCH v2 1/2] platform: chrome: lightbar: Report number of segments Gwendal Grignou
2026-01-27 6:34 ` [PATCH v2 2/2] platform: chrome: lightbar: Add support for large sequence Gwendal Grignou
2026-01-27 8:17 ` Tzung-Bi Shih [this message]
2026-01-28 2:38 ` [PATCH v2 1/2] platform: chrome: lightbar: Report number of segments Gwendal Grignou
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=aXh0hEZNk2gmLncI@google.com \
--to=tzungbi@kernel.org \
--cc=chrome-platform@lists.linux.dev \
--cc=gwendal@chromium.org \
--cc=gwendal@google.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