Re: [PATCH v3] platform/x86: ideapad-laptop: switch platform profiles using thermal management key

From: Gergo Koteles
Date: Thu Apr 04 2024 - 11:11:28 EST


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