From: Hans de Goede <hansg@kernel.org>
To: "Jelle van der Waa" <jvanderwaa@redhat.com>,
"Jonathan Woithe" <jwoithe@just42.net>,
"Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>
Cc: platform-driver-x86@vger.kernel.org
Subject: Re: [PATCH 2/2] platform/x86: fujitsu: clamp charge_control_end_threshold values to 50
Date: Mon, 9 Jun 2025 12:38:16 +0200 [thread overview]
Message-ID: <03f5964a-24ff-414c-b0d1-a7e940545ed5@kernel.org> (raw)
In-Reply-To: <20250609102115.36936-3-jvanderwaa@redhat.com>
Hi,
On 9-Jun-25 12:21 PM, Jelle van der Waa wrote:
> Follow the sysfs ABI documentation that drivers should round written
> values to the nearest supported value instead of returning an error.
>
> Tested on a Fujitsu Lifebook U7720.
>
> Signed-off-by: Jelle van der Waa <jvanderwaa@redhat.com>
Thanks, patch looks good to me:
Reviewed-by: Hans de Goede <hansg@kernel.org>
Regards,
Hans
> ---
> drivers/platform/x86/fujitsu-laptop.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/platform/x86/fujitsu-laptop.c b/drivers/platform/x86/fujitsu-laptop.c
> index c8aeb28a783c..f6a4a02e8d44 100644
> --- a/drivers/platform/x86/fujitsu-laptop.c
> +++ b/drivers/platform/x86/fujitsu-laptop.c
> @@ -187,9 +187,12 @@ static ssize_t charge_control_end_threshold_store(struct device *dev,
> if (ret)
> return ret;
>
> - if (value < 50 || value > 100)
> + if (value > 100)
> return -EINVAL;
>
> + if (value < 50)
> + value = 50;
> +
> cc_end_value = value * 0x100 + 0x20;
> s006_cc_return = call_fext_func(fext, FUNC_S006_METHOD,
> CHARGE_CONTROL_RW, cc_end_value, 0x0);
next prev parent reply other threads:[~2025-06-09 10:38 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-09 10:21 [PATCH 0/2] platform/x86: clamp charge thresholds on fujitsu Jelle van der Waa
2025-06-09 10:21 ` [PATCH 1/2] platform/x86: fujitsu: use unsigned int for kstrtounit Jelle van der Waa
2025-06-09 10:36 ` Hans de Goede
2025-06-13 10:14 ` Ilpo Järvinen
2025-06-09 10:21 ` [PATCH 2/2] platform/x86: fujitsu: clamp charge_control_end_threshold values to 50 Jelle van der Waa
2025-06-09 10:38 ` Hans de Goede [this message]
2025-06-09 10:47 ` [PATCH 0/2] platform/x86: clamp charge thresholds on fujitsu Jonathan Woithe
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=03f5964a-24ff-414c-b0d1-a7e940545ed5@kernel.org \
--to=hansg@kernel.org \
--cc=ilpo.jarvinen@linux.intel.com \
--cc=jvanderwaa@redhat.com \
--cc=jwoithe@just42.net \
--cc=platform-driver-x86@vger.kernel.org \
/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