From: Gergo Koteles <soyer@irl.hu>
To: "Daniel Lezcano" <daniel.lezcano@linaro.org>,
"Ike Panhc" <ike.pan@canonical.com>,
"Hans de Goede" <hdegoede@redhat.com>,
"Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>
Cc: platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3] platform/x86: ideapad-laptop: switch platform profiles using thermal management key
Date: Thu, 04 Apr 2024 17:05:29 +0200 [thread overview]
Message-ID: <b5ad9ab4e1785266fbf9f9b9e68b41bec95e5820.camel@irl.hu> (raw)
In-Reply-To: <45f12590-4f79-4875-a497-cbb1ac3deb38@linaro.org>
Hi Daniel,
On Thu, 2024-04-04 at 15:27 +0200, Daniel Lezcano wrote:
> > Cycling is done through modulo.
> >
> > Quick and dirty example:
> >
> > static int profiles[] = {
> > PLATFORM_PROFILE_LOW_POWER,
> > PLATFORM_PROFILE_BALANCED,
> > PLATFORM_PROFILE_PERFORMANCE
> > };
> >
> > static int current_profile_index = 0;
> >
> > static void dytc_profile_cycle(struct ideapad_private *priv)
> > {
> > current_profile_index++
> >
> > current_profile_index =
> > current_profile_index % ARRAY_SIZE(profiles);
> >
> > dytc_profile_set(&priv->dytc->pprof,
> > profiles[current_profile_index]);
> >
> > platform_profile_notify();
> > }
> >
Thanks for your suggestions. I thought about it.
It would make this module complicated, but something like this fits
well in the platform_profile module.
I will implement the cycle there in v4.
Best regards,
Gergo
prev parent reply other threads:[~2024-04-04 15:10 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-04 13:10 [PATCH v3] platform/x86: ideapad-laptop: switch platform profiles using thermal management key Gergo Koteles
2024-04-04 13:27 ` Daniel Lezcano
2024-04-04 15:05 ` Gergo Koteles [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=b5ad9ab4e1785266fbf9f9b9e68b41bec95e5820.camel@irl.hu \
--to=soyer@irl.hu \
--cc=daniel.lezcano@linaro.org \
--cc=hdegoede@redhat.com \
--cc=ike.pan@canonical.com \
--cc=ilpo.jarvinen@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).