public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Luke Jones <luke@ljones.dev>
To: "Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>
Cc: Hans de Goede <hdegoede@redhat.com>,
	corentin.chary@gmail.com, platform-driver-x86@vger.kernel.org,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2 5/9] platform/x86: asus-wmi: store a min default for ppt options
Date: Wed, 03 Apr 2024 13:09:59 +1300	[thread overview]
Message-ID: <4555327.yiUUSuA9gR@fedora> (raw)
In-Reply-To: <89b0c0ea-30ce-28c6-19d2-ebd113b17935@linux.intel.com>

On Tuesday, 2 April 2024 11:49:50 PM NZDT Ilpo Järvinen wrote:
> On Tue, 2 Apr 2024, Luke D. Jones wrote:
> > Laptops with any of the ppt or nv tunables default to the minimum setting
> > on boot so we can safely assume a stored value is correct.
> > 
> > This patch adds storing of those values in the local struct, and enables
> > reading of those values back. To prevent creating a series of byte holes
> > in the struct the "<name>_available" bool is removed and
> > `asus_sysfs_is_visible()` uses the `ASUS_WMI_DEVID_<name>` directly.
> > 
> > Signed-off-by: Luke D. Jones <luke@ljones.dev>
> > ---
> > 
> >  drivers/platform/x86/asus-wmi.c | 127 +++++++++++++++++++++++++-------
> >  1 file changed, 99 insertions(+), 28 deletions(-)
> > 
> > diff --git a/drivers/platform/x86/asus-wmi.c
> > b/drivers/platform/x86/asus-wmi.c index b795f9c1941f..c80afa385532 100644
> > --- a/drivers/platform/x86/asus-wmi.c
> > +++ b/drivers/platform/x86/asus-wmi.c
> > @@ -262,13 +262,13 @@ struct asus_wmi {
> > 
> >  	u32 gpu_mux_dev;
> >  	
> >  	/* Tunables provided by ASUS for gaming laptops */
> > 
> > -	bool ppt_pl2_sppt_available;
> > -	bool ppt_pl1_spl_available;
> > -	bool ppt_apu_sppt_available;
> > -	bool ppt_plat_sppt_available;
> > -	bool ppt_fppt_available;
> > -	bool nv_dyn_boost_available;
> > -	bool nv_temp_tgt_available;
> > +	u32 ppt_pl2_sppt;
> > +	u32 ppt_pl1_spl;
> > +	u32 ppt_apu_sppt;
> > +	u32 ppt_platform_sppt;
> > +	u32 ppt_fppt;
> > +	u32 nv_dynamic_boost;
> > +	u32 nv_temp_target;
> > 
> >  	u32 kbd_rgb_dev;
> >  	bool kbd_rgb_state_available;
> > 
> > @@ -1020,11 +1020,21 @@ static ssize_t ppt_pl2_sppt_store(struct device
> > *dev,> 
> >  		return -EIO;
> >  	
> >  	}
> > 
> > +	asus->ppt_pl2_sppt = value;
> > 
> >  	sysfs_notify(&asus->platform_device->dev.kobj, NULL, 
"ppt_pl2_sppt");
> >  	
> >  	return count;
> >  
> >  }
> > 
> > -static DEVICE_ATTR_WO(ppt_pl2_sppt);
> > +
> > +static ssize_t ppt_pl2_sppt_show(struct device *dev,
> > +				       struct device_attribute 
*attr,
> > +				       char *buf)
> > +{
> > +	struct asus_wmi *asus = dev_get_drvdata(dev);
> > +
> > +	return sysfs_emit(buf, "%d\n", asus->ppt_pl2_sppt);
> 
> Use %u for u32 values. This applies to all sysfs_emits in this patch.

Thought checkpatch or the compiler would catch that. Done.

I've added your reviewed tag due to the simplicity of the change requested. I 
hope this was okay.





  reply	other threads:[~2024-04-03  0:10 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-02  2:25 [PATCH v2 0/9] asus-wmi: add new features, clean up, fixes Luke D. Jones
2024-04-02  2:25 ` [PATCH v2 1/9] platform/x86: asus-wmi: add support for 2024 ROG Mini-LED Luke D. Jones
2024-04-02 10:43   ` Ilpo Järvinen
2024-04-02 23:59     ` Luke Jones
2024-04-02  2:26 ` [PATCH v2 2/9] platform/x86: asus-wmi: add support for Vivobook GPU MUX Luke D. Jones
2024-04-02 10:44   ` Ilpo Järvinen
2024-04-02  2:26 ` [PATCH v2 3/9] platform/x86: asus-wmi: add support variant of TUF RGB Luke D. Jones
2024-04-02 10:45   ` Ilpo Järvinen
2024-04-02  2:26 ` [PATCH v2 4/9] platform/x86: asus-wmi: support toggling POST sound Luke D. Jones
2024-04-02 10:47   ` Ilpo Järvinen
2024-04-03  0:06     ` Luke Jones
2024-04-02  2:26 ` [PATCH v2 5/9] platform/x86: asus-wmi: store a min default for ppt options Luke D. Jones
2024-04-02 10:49   ` Ilpo Järvinen
2024-04-03  0:09     ` Luke Jones [this message]
2024-04-03  8:21       ` Ilpo Järvinen
2024-04-02  2:26 ` [PATCH v2 6/9] platform/x86: asus-wmi: adjust formatting of ppt-<name>() functions Luke D. Jones
2024-04-02 10:51   ` Ilpo Järvinen
2024-04-02  2:26 ` [PATCH v2 7/9] platform/x86: asus-wmi: ROG Ally increase wait time, allow MCU powersave Luke D. Jones
2024-04-02  2:26 ` [PATCH v2 8/9] platform/x86: asus-wmi: Add support for " Luke D. Jones
2024-04-02 11:01   ` Ilpo Järvinen
2024-04-02 23:30     ` Luke Jones
2024-04-03  8:31       ` Ilpo Järvinen
2024-04-02  2:26 ` [PATCH v2 9/9] platform/x86: asus-wmi: cleanup main struct to avoid some holes Luke D. Jones
2024-04-02 11:02   ` Ilpo Järvinen

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=4555327.yiUUSuA9gR@fedora \
    --to=luke@ljones.dev \
    --cc=corentin.chary@gmail.com \
    --cc=hdegoede@redhat.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