public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>
To: "Luke D. Jones" <luke@ljones.dev>
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 6/9] platform/x86: asus-wmi: add panel-fhd functionality
Date: Tue, 28 May 2024 12:18:35 +0300 (EEST)	[thread overview]
Message-ID: <53da23e6-deb5-dc4f-057f-afafaa9455aa@linux.intel.com> (raw)
In-Reply-To: <20240528013626.14066-7-luke@ljones.dev>

On Tue, 28 May 2024, Luke D. Jones wrote:

> Exposes the FHD panel toggle avavilable on new ASUS Duo laptops.

available

> Signed-off-by: Luke D. Jones <luke@ljones.dev>
> ---
>  .../ABI/testing/sysfs-platform-asus-wmi       |  9 +++++++++
>  drivers/platform/x86/asus-wmi.c               | 20 +++++++++++++++++++
>  include/linux/platform_data/x86/asus-wmi.h    |  1 +
>  3 files changed, 30 insertions(+)
> 
> diff --git a/Documentation/ABI/testing/sysfs-platform-asus-wmi b/Documentation/ABI/testing/sysfs-platform-asus-wmi
> index 984a04f32fd0..3b4eeea75b7b 100644
> --- a/Documentation/ABI/testing/sysfs-platform-asus-wmi
> +++ b/Documentation/ABI/testing/sysfs-platform-asus-wmi
> @@ -217,3 +217,12 @@ Description:
>  		Set if the MCU can go in to low-power mode on system sleep
>  			* 0 - False,
>  			* 1 - True
> +
> +What:		/sys/devices/platform/<platform>/panel_fhd
> +Date:		Apr 2024
> +KernelVersion:	6.11
> +Contact:	"Luke Jones" <luke@ljones.dev>
> +Description:
> +		Set panel to UHD or FHD mode
> +			* 0 - UHD,
> +			* 1 - FHD

I'd prefer this to be more forward-looking, the filename is based on fhd, 
which is one of the options and the values seem "wrong way" around too 
(FHD < UHD but here you have FHD=1 after UHD=0).

> diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wmi.c
> index 260548aa6a42..4b045f1828f1 100644
> --- a/drivers/platform/x86/asus-wmi.c
> +++ b/drivers/platform/x86/asus-wmi.c
> @@ -798,6 +798,23 @@ WMI_ATTR_SIMPLE_RW(panel_od, 0, 1, ASUS_WMI_DEVID_PANEL_OD);
>  WMI_ATTR_SIMPLE_RW(boot_sound, 0, 1, ASUS_WMI_DEVID_BOOT_SOUND);
>  WMI_ATTR_SIMPLE_RO(charge_mode, ASUS_WMI_DEVID_CHARGE_MODE);
>  
> +static ssize_t panel_fhd_store(struct device *dev,
> +	struct device_attribute *attr, const char *buf, size_t count)
> +{
> +	struct asus_wmi *asus = dev_get_drvdata(dev);
> +	int err;
> +
> +	err = rog_tunable_store(asus, &attr->attr, buf, count,
> +				0, 1, -1, NULL, ASUS_WMI_DEVID_PANEL_FHD);
> +	if (err < 0)
> +		return err;
> +
> +	pr_info("Panel UHD/FHD display mode changed, reboot required\n");
> +	return count;
> +}
> +WMI_SIMPLE_SHOW(panel_fhd, "%d\n", ASUS_WMI_DEVID_PANEL_FHD);
> +static DEVICE_ATTR_RW(panel_fhd);
> +
>  /* Tablet mode ****************************************************************/
>  
>  static void asus_wmi_tablet_mode_get_state(struct asus_wmi *asus)
> @@ -4040,6 +4057,7 @@ static struct attribute *platform_attributes[] = {
>  	&dev_attr_mcu_powersave.attr,
>  	&dev_attr_boot_sound.attr,
>  	&dev_attr_panel_od.attr,
> +	&dev_attr_panel_fhd.attr,
>  	&dev_attr_mini_led_mode.attr,
>  	&dev_attr_available_mini_led_mode.attr,
>  	NULL
> @@ -4111,6 +4129,8 @@ static umode_t asus_sysfs_is_visible(struct kobject *kobj,
>  		devid = ASUS_WMI_DEVID_BOOT_SOUND;
>  	else if (attr == &dev_attr_panel_od.attr)
>  		devid = ASUS_WMI_DEVID_PANEL_OD;
> +	else if (attr == &dev_attr_panel_fhd.attr)
> +		devid = ASUS_WMI_DEVID_PANEL_FHD;
>  	else if (attr == &dev_attr_mini_led_mode.attr)
>  		ok = asus->mini_led_dev_id != 0;
>  	else if (attr == &dev_attr_available_mini_led_mode.attr)
> diff --git a/include/linux/platform_data/x86/asus-wmi.h b/include/linux/platform_data/x86/asus-wmi.h
> index 79a50102440d..6c51d41ffc20 100644
> --- a/include/linux/platform_data/x86/asus-wmi.h
> +++ b/include/linux/platform_data/x86/asus-wmi.h
> @@ -72,6 +72,7 @@
>  #define ASUS_WMI_DEVID_LID_FLIP_ROG	0x00060077
>  #define ASUS_WMI_DEVID_MINI_LED_MODE	0x0005001E
>  #define ASUS_WMI_DEVID_MINI_LED_MODE2	0x0005002E
> +#define ASUS_WMI_DEVID_PANEL_FHD	0x0005001C
>  
>  /* Storage */
>  #define ASUS_WMI_DEVID_CARDREADER	0x00080013
> 

-- 
 i.


  reply	other threads:[~2024-05-28  9:18 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-28  1:36 [PATCH 0/9] platform-x86-asus-wmi: multiple fixes, improvements, features Luke D. Jones
2024-05-28  1:36 ` [PATCH 1/9] platform/x86: asus-wmi: add debug print in more key places Luke D. Jones
2024-05-28  1:36 ` [PATCH 2/9] platform/x86: asus-wmi: don't fail if platform_profile already registered Luke D. Jones
2024-05-28  1:36 ` [PATCH 3/9] platform/x86: asus-wmi: add macros and expose min/max sysfs for ppt tunables Luke D. Jones
2024-05-28  8:50   ` Ilpo Järvinen
2024-06-04  5:14   ` kernel test robot
2024-05-28  1:36 ` [PATCH 4/9] platform/x86: asus-wmi: reduce code duplication with macros Luke D. Jones
2024-05-28  8:55   ` Ilpo Järvinen
2024-05-28  9:03   ` Ilpo Järvinen
2024-05-28  1:36 ` [PATCH 5/9] platform/x86: asus-wmi: use WMI_SIMPLE_SHOW in more places Luke D. Jones
2024-05-28  9:06   ` Ilpo Järvinen
2024-05-28  1:36 ` [PATCH 6/9] platform/x86: asus-wmi: add panel-fhd functionality Luke D. Jones
2024-05-28  9:18   ` Ilpo Järvinen [this message]
2024-05-28  1:36 ` [PATCH 7/9] platform/x86: asus-wmi: add enable/disable CPU cores Luke D. Jones
2024-05-28  9:27   ` Ilpo Järvinen
2024-05-28 21:37     ` Luke Jones
2024-05-28  1:36 ` [PATCH 8/9] platform/x86: asus-wmi: add apu_mem setting Luke D. Jones
2024-05-28  2:19   ` Limonciello, Mario
2024-05-28  2:40     ` Luke Jones
2024-05-28 13:27       ` Mario Limonciello
2024-05-28 21:04         ` Luke Jones
2024-05-28 21:16           ` Mario Limonciello
2024-05-28 21:34             ` Luke Jones
2024-05-28 21:36               ` Mario Limonciello
2024-05-28 21:37               ` Mario Limonciello
2024-05-28  1:36 ` [PATCH 9/9] platform/x86: asus-wmi: add setting dGPU TGP Luke D. Jones

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=53da23e6-deb5-dc4f-057f-afafaa9455aa@linux.intel.com \
    --to=ilpo.jarvinen@linux.intel.com \
    --cc=corentin.chary@gmail.com \
    --cc=hdegoede@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luke@ljones.dev \
    --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