Received: by 2002:ab2:1149:0:b0:1f3:1f8c:d0c6 with SMTP id z9csp2403480lqz; Tue, 2 Apr 2024 17:10:14 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUm/SARZ+F4IKkI2RR/VMFDn2zE9/Eh2r3fUNx49V9ohmj0UbYXAt6DAkdmiC9NdczN80xcoJLZtFjESF6qbDPZPdivJQfmMxHJaHaBrA== X-Google-Smtp-Source: AGHT+IGM78hWWt7Sf86u+8GY5uV+rD21B6Pz3aunsMKp8fDQHjST9QDaCu0XjUyX7NNajEzyaOI8 X-Received: by 2002:a17:906:c2cf:b0:a46:e377:1468 with SMTP id ch15-20020a170906c2cf00b00a46e3771468mr9416622ejb.31.1712103014153; Tue, 02 Apr 2024 17:10:14 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712103014; cv=pass; d=google.com; s=arc-20160816; b=tuLpNanOoJjSMHb5/0nKPuPVrfgnY9it41L29Geew2QsI38NUgM0AYncehRHBB7XFg 5u3Qfo1yFtoWY9FSfTaNZoqLnlc5fhCM3geAonnd6nsHNpw4Y9pZZLHEfyzxEBWhRbZS C+kCZ+vNZcn6cmKM3GHBBX8TbXYettTQY4KfshJyvYi//6o/kAXNGUallv6GzS+x4yAT sx1C+IiK2IgiBr2O+AJ78m8Z+8qWMDjrXUvoVF2jhjArftZbKKjg4/1A9odeD4IS9ZSo 97vMwa4y+Q7mYFtt8R1U/syMPziZHEqzJU9rebwe34ifnlVSRkLRmNGssXX04V8FdmKa nkIA== 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=XfyaUGyBhBfXhWq9WDJJ4hLODydb5vyZB4n7KWoqrDM=; fh=kKYk81rpG8dGLvYOQUau4f0iAUdWAcWVZPCHrOqA7ic=; b=eiohY876d9SDUSvcJXSHaVgg4HP+tSK2LGgJ7kdWD4wPyQI7ffSdbAPZHmcG5sX3HV Ea99x05DG+dDUn0ljDH2xKbCpP0vEbIt2Zois4auMmPCriRL4O+uMvg53g18IxrbSqfd IEZCe0FnIF2gi1KT59zq6SZSiZW87jV3B1EzFJdXFmDurZ1o+oUJSjJl58BE0U0VYUd1 N+GXGKZJ/COpTDvjKD3DUxzpUO3sEubnU7r9d7DM7n0gY6y3OEf8VGysfJ6a2Gm6K0J7 LJNboE8khe8Ckztvtxf9aJmfhz0NNq5jIiLPqoCNcPf3vTUU4d/YIdpItJHJbf08t5er Desw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@ljones.dev header.s=fm3 header.b=lRVZqSD+; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=clzF2kFJ; arc=pass (i=1 dkim=pass dkdomain=ljones.dev dkim=pass dkdomain=messagingengine.com); spf=pass (google.com: domain of linux-kernel+bounces-128849-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-128849-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 p3-20020a170906604300b00a46328866d0si6073854ejj.508.2024.04.02.17.10.14 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Apr 2024 17:10:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-128849-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=fm3 header.b=lRVZqSD+; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=clzF2kFJ; arc=pass (i=1 dkim=pass dkdomain=ljones.dev dkim=pass dkdomain=messagingengine.com); spf=pass (google.com: domain of linux-kernel+bounces-128849-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-128849-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 B8B641F23CEB for ; Wed, 3 Apr 2024 00:10:13 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 803E11361; Wed, 3 Apr 2024 00:10:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ljones.dev header.i=@ljones.dev header.b="lRVZqSD+"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="clzF2kFJ" Received: from fhigh4-smtp.messagingengine.com (fhigh4-smtp.messagingengine.com [103.168.172.155]) (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 9D653635; Wed, 3 Apr 2024 00:10:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.168.172.155 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712103007; cv=none; b=hfC6oDGUU9t+VKSNHiuqxws4KnfdJwFp0gZh3kHOnM/7/wId0lvQImcEYyw5tnm3V2+VWzxShu827BgsoRoo65RUmDHjA8eM4pJy2o+M9gC/09uNVLlk8Yc6/Bo3jYztrQjpy6iQKLu6JxOIAmY6AbaVY3ccJsVkDEntB76NkJY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712103007; c=relaxed/simple; bh=NWTYbgj84aSXH8c2vB0NZyKdb9P/11YTqUctL5sXQxo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=AMg8/pBO6Qo1gGmZMu7VT6/WaErUHu8qcA9E1V+2Gg81vH5iR/Scx7zDooi8ycnVYICOQs8i/mJGgL5bG93t+oA7ZMUMBKPYsQTxJTIWmBQiSChnExlwuOmmWfUmJqjz5ZR3i3rXyeaKvLr4It2wQgV9IZu8glFlIk3Xg3b4KOQ= 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=lRVZqSD+; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=clzF2kFJ; arc=none smtp.client-ip=103.168.172.155 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 compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailfhigh.nyi.internal (Postfix) with ESMTP id 977EF11400EF; Tue, 2 Apr 2024 20:10:04 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Tue, 02 Apr 2024 20:10:04 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ljones.dev; h=cc :cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm3; t=1712103004; x=1712189404; bh=XfyaUGyBhBfXhWq9WDJJ4hLODydb5vyZB4n7KWoqrDM=; b= lRVZqSD+f8li0k2KUaMMh6pk1gmn7OG7Bxs2VkJSmdRbkmecGiDMvrj9Q9c1fbQ+ sjmnx3e0bScpzN3Rllv7FfhXBd+tHjxKvCI6Gnv8TlCiIMCnrKy7Pj9TLdMsbF3Z AgpGj5DkmkFaXRwlqTflCvL9lxa9LLXAGeq5o4UuXP3/i7zeXgYm8H7kYoTSqaiL YQmBw7OsYlJYm7MzfE7BNq9gDYUZMZ4aaMdm8brds1naTKLnH7oGdwdpPkbpnxxT PAH3q0+pA5pqXb2Pqd+TduzF+dvnb/HNOtRymp6YKZW6CtigDXa2LQ9vulTKKCy/ ToBisyldul2xuEsDtnb39w== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type: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=fm2; t=1712103004; x= 1712189404; bh=XfyaUGyBhBfXhWq9WDJJ4hLODydb5vyZB4n7KWoqrDM=; b=c lzF2kFJOG/s8Z+GBfpJ5uMndgW3kXcXQSePHexZJEjkm/Nuk3rW3JIYNprkBKLDD s+kaDpMCYvCs16dP5vSN9qNOl+dkuaUWCcbTOTCkM7rDq0OmPSNSbL8UrF2AOLmR QQmaO0+DHRq1nAKA6YbHih4Zjo8nZQp6ohGknCzHjdEz1EZGGPgUi/BeKioRWhaS k7SnOlaiv75I4GK7EdBiL7N+uYmSdnyRSrPOM2ZfMsrLIiej/Bl8OCOdzzjwY7Ln 9w4S7SL6z9eW/tc0g1YRlVylYPyA49nVeRyaGI6RS+MU5cmSY+htIE6tHnGoJtO6 UoT5J0bWSbRlNF0anJfIg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrudeffedgfeduucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvvefufffkjghfggfgtgesthhqredttddtjeenucfhrhhomhepnfhukhgv ucflohhnvghsuceolhhukhgvsehljhhonhgvshdruggvvheqnecuggftrfgrthhtvghrnh ephfeugfegvdeitdefgeevvdelgedutdejueefkeffieevueduhedtueektdffjeeunecu vehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheplhhukhgvse hljhhonhgvshdruggvvh X-ME-Proxy: Feedback-ID: i5ec1447f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 2 Apr 2024 20:10:02 -0400 (EDT) From: Luke Jones To: Ilpo =?ISO-8859-1?Q?J=E4rvinen?= Cc: Hans de Goede , corentin.chary@gmail.com, platform-driver-x86@vger.kernel.org, LKML 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 Message-ID: <4555327.yiUUSuA9gR@fedora> In-Reply-To: <89b0c0ea-30ce-28c6-19d2-ebd113b17935@linux.intel.com> References: <20240402022607.34625-1-luke@ljones.dev> <20240402022607.34625-6-luke@ljones.dev> <89b0c0ea-30ce-28c6-19d2-ebd113b17935@linux.intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" On Tuesday, 2 April 2024 11:49:50=E2=80=AFPM NZDT Ilpo J=C3=A4rvinen wrote: > On Tue, 2 Apr 2024, Luke D. Jones wrote: > > Laptops with any of the ppt or nv tunables default to the minimum setti= ng > > on boot so we can safely assume a stored value is correct. > >=20 > > 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 "_available" bool is removed and > > `asus_sysfs_is_visible()` uses the `ASUS_WMI_DEVID_` directly. > >=20 > > Signed-off-by: Luke D. Jones > > --- > >=20 > > drivers/platform/x86/asus-wmi.c | 127 +++++++++++++++++++++++++------- > > 1 file changed, 99 insertions(+), 28 deletions(-) > >=20 > > diff --git a/drivers/platform/x86/asus-wmi.c > > b/drivers/platform/x86/asus-wmi.c index b795f9c1941f..c80afa385532 1006= 44 > > --- a/drivers/platform/x86/asus-wmi.c > > +++ b/drivers/platform/x86/asus-wmi.c > > @@ -262,13 +262,13 @@ struct asus_wmi { > >=20 > > u32 gpu_mux_dev; > > =09 > > /* Tunables provided by ASUS for gaming laptops */ > >=20 > > - 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; > >=20 > > u32 kbd_rgb_dev; > > bool kbd_rgb_state_available; > >=20 > > @@ -1020,11 +1020,21 @@ static ssize_t ppt_pl2_sppt_store(struct device > > *dev,>=20 > > return -EIO; > > =09 > > } > >=20 > > + asus->ppt_pl2_sppt =3D value; > >=20 > > sysfs_notify(&asus->platform_device->dev.kobj, NULL,=20 "ppt_pl2_sppt"); > > =09 > > return count; > > =20 > > } > >=20 > > -static DEVICE_ATTR_WO(ppt_pl2_sppt); > > + > > +static ssize_t ppt_pl2_sppt_show(struct device *dev, > > + struct device_attribute=20 *attr, > > + char *buf) > > +{ > > + struct asus_wmi *asus =3D dev_get_drvdata(dev); > > + > > + return sysfs_emit(buf, "%d\n", asus->ppt_pl2_sppt); >=20 > 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=20 hope this was okay.