Received: by 2002:a89:d88:0:b0:1fa:5c73:8e2d with SMTP id eb8csp2480318lqb; Tue, 28 May 2024 00:37:54 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCW65fq/Nklqc3U4+o20K6/U8IcrlolJfeWoR4iSEz8P7MfXZZpolALx4p8XLl939KuwNIsfa/Gm4q/LO7spXRKMr8b4iuqBcTMIFNyIIg== X-Google-Smtp-Source: AGHT+IGs2eo+ITQ/mjFU08UBBqvJcuzk2MhEBmsLkBx/0eu6YP01oCqkNrK2ly5V6j7s4V2vneB4 X-Received: by 2002:a17:906:c113:b0:a62:a9ca:2111 with SMTP id a640c23a62f3a-a62a9ca25admr684619066b.11.1716881874786; Tue, 28 May 2024 00:37:54 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716881874; cv=pass; d=google.com; s=arc-20160816; b=XQHj5GJ4X9hFFDiIBcCR9UAFCsvzTKCbJu/T2DQ/BVks8Nn6xj5RB+px8K1DT8P/xW iTxvu0Oc1SvgNEqD5E4Ndd3wPhuq3LXPcjf2RbJI2MFsqRZ4cTo7ctkzE6ykMDpfSjKN jzzmCJShGGEaLct9sZxkTUoviv+wcoqBXJnyXC3QYnGeWEP1PJhyAs+FrU5UMZozyK4C rImLDnMOkRf3NKevMmiBJc0oRDT2Bqfn1d4AHtXVNPvMK8VtosQaf/Oyf7oO+527+RHC ebnJTEN0a8b2OWiMKCjyfsUENyH4XW9q0PyqPwfBNMrpjNrrHXKr0GubnYUusudy53qd cRKA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:feedback-id:dkim-signature:dkim-signature; bh=kwPWX6tvrCbhVRU7E4dBQZXhLYs4bJ8/JTWq8BfSECA=; fh=KBOOsaW3YEneVcYsdRdNlUHz1Q41m6vPI9Uc3mM7Mz4=; b=rZdK/YEEzb795EGXDMjc3coChoKkzwAXhI1EG2SWYKpWhxsgEG3aLG8sz/DoUrTGFU qjA16EWI5aQUTfSvHz1sgnrCrkmzaLdcPKhBE6a0inVTYghr+GH82FLJgHksCQ2dVG5w z/cj7ZsoXoujSCvv10aQnS9HTunrOUJ0cbUGpvE/aieeAHxIKKYbIHlJQXlQ3ZsXcN23 oFUqj7DlEO9j/+kMP3/40CWLQ6wqM+nKHV1iXhfdXGw3QDl9r5Ah1xyh6HQ90wyR00g5 UQqr84w2Tik2OUPYBFueXdNqH4D9AQxqxqnw6PjWvbTAE+/rCxAARfyCLWJoBWxswZPh re7A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@ljones.dev header.s=fm2 header.b=cHIueFw4; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=WjrlEKKt; arc=pass (i=1 dkim=pass dkdomain=ljones.dev dkim=pass dkdomain=messagingengine.com); spf=pass (google.com: domain of linux-kernel+bounces-191617-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-191617-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id a640c23a62f3a-a626cd959c0si472521066b.852.2024.05.28.00.37.54 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 May 2024 00:37:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-191617-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@ljones.dev header.s=fm2 header.b=cHIueFw4; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=WjrlEKKt; arc=pass (i=1 dkim=pass dkdomain=ljones.dev dkim=pass dkdomain=messagingengine.com); spf=pass (google.com: domain of linux-kernel+bounces-191617-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-191617-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id B89261F23122 for ; Tue, 28 May 2024 01:38:30 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 93F612A1D5; Tue, 28 May 2024 01:36:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ljones.dev header.i=@ljones.dev header.b="cHIueFw4"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="WjrlEKKt" Received: from fout2-smtp.messagingengine.com (fout2-smtp.messagingengine.com [103.168.172.145]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DD31322313; Tue, 28 May 2024 01:36:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.168.172.145 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716860217; cv=none; b=tzBJOL3RsQ2nEPMD10IhsQ0LxPY5nkgkJ2nkmbRaRYc0Hety5qg8LfnlPUyImwIJA/xQHD5pJi+VJFypSwUVyqy6eqzxc7z4/+i3hFR4mNQfOnjLui2fXYzo0p/soExh5uRFvCMBqaYyeSJStcXXdn6tpVJJbmtSYzesjiPZBTk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716860217; c=relaxed/simple; bh=zOvd3Ay0azx5vH/QyN7mBktkv8CR/XnOIiqvECdvHVw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=haSzOqB5fOlfBT8+6x8CRZk8CMvqWlPegld8yBNsLAs3WoLs9LMpLyrzz9FNk2ENh5TDwAZCXBbd9wEVEcEV/5QvMsOv0/ZCbcZoYuryig8ekM8kmhnCX855ikgP6Ke89jtH/iPQla1bzRRlGjJxAsXYFdyR8tkire63eVOEq7Q= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ljones.dev; spf=none smtp.mailfrom=ljones.dev; dkim=pass (2048-bit key) header.d=ljones.dev header.i=@ljones.dev header.b=cHIueFw4; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=WjrlEKKt; arc=none smtp.client-ip=103.168.172.145 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ljones.dev Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=ljones.dev Received: from compute6.internal (compute6.nyi.internal [10.202.2.47]) by mailfout.nyi.internal (Postfix) with ESMTP id F3102138013D; Mon, 27 May 2024 21:36:54 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Mon, 27 May 2024 21:36:54 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ljones.dev; h=cc :cc:content-transfer-encoding:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to; s=fm2; t=1716860214; x= 1716946614; bh=kwPWX6tvrCbhVRU7E4dBQZXhLYs4bJ8/JTWq8BfSECA=; b=c HIueFw4tmcsP3Unsn1qs9wdhUSV69yCh9YBw8NqYP+icm9Yx4vVBvAXWagQygkfN jbOqddgkWK59L2J5t2+R0do8+6wUt/XvsCC234S7fY8fHXB16EAENqgBRiRFju9a PvVtapmZNIDlQZvKBEMbtXrdC5+RlIsJL5BIeGiHjJuklCw277cnwvXq0dQkVcJ9 p+JoFOJ0nwdB+OMX6JG6CtZdNN7vdJyyhcIo9vLZj4KnsgbA+7PVBwzerWOu/Wm8 9QtWIbIvRRm0PJmwkl/2n74Ayor7snAcg25KlqEWGb6l7RUhBvIRj1wl9VyZgXJu u6SyI3jRA9z7Ejd/1AJdA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1716860214; x= 1716946614; bh=kwPWX6tvrCbhVRU7E4dBQZXhLYs4bJ8/JTWq8BfSECA=; b=W jrlEKKtC1XHKgRdNBCrRRMX4Nj1ycxd1U7NMrXHdLFGsIUuD+bIpAzGJkUeoJWkn 7kix+L/AIUl2iSpMksXSkvjc3BfG/TEPsKRZlojKCklqxFb7wFOZ/P9mHBvPZxW0 R8u5K1QxxCVBEhc/Rj1Jzv+dGj6hM8gLjWN3HY+BgW39CLamFghtgaa+CXRsLTdm tq4uXM82jdry8+nFXt1W0/QZDnS3GiYas61YqmqXWQMB3846H2s5nonpcVDchqXH 3cmawF/jrkhs5wxL5rD0h7efYJaJMFRpAhAPYuD4PRbTGN8ni15LjJH1S1A5IJN1 UsHA1YeP9ctV+hM0mpScQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrvdejhedggeekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvfevufffkffojghfggfgsedtke ertdertddtnecuhfhrohhmpedfnfhukhgvucffrdculfhonhgvshdfuceolhhukhgvsehl jhhonhgvshdruggvvheqnecuggftrfgrthhtvghrnhepgfetfedugfetudeuheetjefhue fggfelleetvdevtefhueeujeefvdegleevhefgnecuvehluhhsthgvrhfuihiivgepvden ucfrrghrrghmpehmrghilhhfrhhomheplhhukhgvsehljhhonhgvshdruggvvh X-ME-Proxy: Feedback-ID: i5ec1447f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 27 May 2024 21:36:52 -0400 (EDT) From: "Luke D. Jones" To: hdegoede@redhat.com Cc: ilpo.jarvinen@linux.intel.com, corentin.chary@gmail.com, platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org, "Luke D. Jones" Subject: [PATCH 6/9] platform/x86: asus-wmi: add panel-fhd functionality Date: Tue, 28 May 2024 13:36:23 +1200 Message-ID: <20240528013626.14066-7-luke@ljones.dev> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20240528013626.14066-1-luke@ljones.dev> References: <20240528013626.14066-1-luke@ljones.dev> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Exposes the FHD panel toggle avavilable on new ASUS Duo laptops. Signed-off-by: Luke D. Jones --- .../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//panel_fhd +Date: Apr 2024 +KernelVersion: 6.11 +Contact: "Luke Jones" +Description: + Set panel to UHD or FHD mode + * 0 - UHD, + * 1 - FHD 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 -- 2.45.1