Received: by 2002:ab2:60d1:0:b0:1f7:5705:b850 with SMTP id i17csp31968lqm; Tue, 30 Apr 2024 11:46:34 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXCm7H89/laUQL5GjlCYHBN8RgrZhNTG0Yl//VfRXpK1AHXwPiG3fmP1QVZRAGyw5r/THXCTiEZt+yMjokRhdypT/CAa6jsR3fvszw/6A== X-Google-Smtp-Source: AGHT+IFySrcDcmYvraMKcbaGw6NCY3faxfd+qdPCb+q43tdxpkLoXfiW7C4Hn/6zVOVnlNCXgJmd X-Received: by 2002:a17:903:4296:b0:1e7:89af:f267 with SMTP id ju22-20020a170903429600b001e789aff267mr250024plb.37.1714502794497; Tue, 30 Apr 2024 11:46:34 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714502794; cv=pass; d=google.com; s=arc-20160816; b=Sbr2+SYwbIylwPeJmNe4h0aYC1CqJxJNKnlqtBz1MftW5shrjZVjiJ7dF4Cv6IKqDT PZVowm/labm35ALM++ezcyKDnHVo6nTZcrStJ+4sslsC5xilTtp9Wn7kBDX+t1xaBxom iSrE8me/kTj0WluWUyjPoonZ2BzJD8TKqgHt5DXIYK33kHvk5o9lqM4IFJoa+e3m5EFY 8k1OrusmeNv4d+L+jbeky95dypMDlw8qBqopXXHvLVy6G23TTq/kUju9lyn+OhwMKclG v9XrGxKMHYeIKVO9JDOACOYz+EoHQF0jMmLvNIyWEy1igN8fUmX5qdQKy8nVbpXKywfP 143w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:subject:cc:to:from:date:references :in-reply-to:message-id:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:user-agent:feedback-id:dkim-signature :dkim-signature; bh=htMlaiKAEHd46q3bkXM/XEl9g3l+/DJfYlU33y1M7ss=; fh=LHePzG5L8PNJL39AkUazCnAItBaYO3DkUYb7ZKGNizU=; b=kJfoBOw4Ke62roZOMCgsEXB9B9MqWuWOySbTSDl54PRVXxB6rMffI9+lFN/b8FsBCC CJHSyN2SSG/querowbvQfj8HwbgEeltfaSNqAbBwQgb14MIGnfOH+8QRkGqxysaOhfuH PWaACV6nnJZfIpwjFFfSqJsLZAlDUffnv56mUa7EiVKWTnudf+/2BlPUniiNm2xN9vFx JEwuPUOdef8QH0Oti0grJXAQ1uU0uMh/JqDou0n4+uFo/id4NKb3STLYtIAicUZDDPm8 sY5DA62/khXMawJXtOqreu/UEH8oeaoDy64W6RCgY3S5HN43rVEyk4LsWEh/LVGKjBBw HaJA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@lyndeno.ca header.s=fm2 header.b=snV3ggZQ; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=jHuC3a8a; arc=pass (i=1 spf=pass spfdomain=lyndeno.ca dkim=pass dkdomain=lyndeno.ca dkim=pass dkdomain=messagingengine.com dmarc=pass fromdomain=lyndeno.ca); spf=pass (google.com: domain of linux-kernel+bounces-164603-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-164603-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=lyndeno.ca Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id h6-20020a170902680600b001ec7f90a86csi271025plk.11.2024.04.30.11.46.33 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Apr 2024 11:46:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-164603-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@lyndeno.ca header.s=fm2 header.b=snV3ggZQ; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=jHuC3a8a; arc=pass (i=1 spf=pass spfdomain=lyndeno.ca dkim=pass dkdomain=lyndeno.ca dkim=pass dkdomain=messagingengine.com dmarc=pass fromdomain=lyndeno.ca); spf=pass (google.com: domain of linux-kernel+bounces-164603-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-164603-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=lyndeno.ca 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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 37940B23722 for ; Tue, 30 Apr 2024 18:42:18 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 180B3184120; Tue, 30 Apr 2024 18:39:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=lyndeno.ca header.i=@lyndeno.ca header.b="snV3ggZQ"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="jHuC3a8a" Received: from fhigh2-smtp.messagingengine.com (fhigh2-smtp.messagingengine.com [103.168.172.153]) (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 52A0D23C9; Tue, 30 Apr 2024 18:38:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.168.172.153 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714502339; cv=none; b=TxAUFIeH8p3/Q8ypy+I1e/suS+czM7STuq5kYN3S2umH+bU+2ry8VYJ1lWgT7AnP7fB1vspMp/nmww22HMHKht919uPvzdKShnqeAu3WVm8vtRBp2aO21vfqvguBdKG7taV22uMYuhvOvFiYJJmsP5ndTH90xyW4SUesKJqoOro= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714502339; c=relaxed/simple; bh=BUbM4t3oqiVAbDg956xtEKGQp/WUp0rlclFojITBMIo=; h=MIME-Version:Message-Id:In-Reply-To:References:Date:From:To:Cc: Subject:Content-Type; b=j/5dBzJfBlPR1PCzL/Jmm25E0advL4Z2RmxdA/TLfzOXZgqdfuDCrRmI3sO3ouzE6FX80ZOaflExFA4Brtx10qfL6Px0M8AfWaSKImBVPo0ZAsTQDhtIRjTZXJpLFgIbweThyoRjJLhiXNrVzlpfx/NAF5F7I9qAP0Ss02EBrR8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=lyndeno.ca; spf=pass smtp.mailfrom=lyndeno.ca; dkim=pass (2048-bit key) header.d=lyndeno.ca header.i=@lyndeno.ca header.b=snV3ggZQ; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=jHuC3a8a; arc=none smtp.client-ip=103.168.172.153 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=lyndeno.ca Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=lyndeno.ca Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailfhigh.nyi.internal (Postfix) with ESMTP id 468D51140121; Tue, 30 Apr 2024 14:38:56 -0400 (EDT) Received: from imap52 ([10.202.2.102]) by compute5.internal (MEProxy); Tue, 30 Apr 2024 14:38:56 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lyndeno.ca; 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=fm2; t=1714502336; x=1714588736; bh=htMlaiKAEHd46q3bkXM/XEl9g3l+/DJfYlU33y1M7ss=; b= snV3ggZQloW1SbwN3bhfuky5cnOO6iHOBI8EsE3rI0DNnntu/ls89gnidtY6Es7/ VuuT2BmjhL8T3uGXW2n5Z7s/C+ELENV/G9gcNBJnxj/fLYnseStqsgWqXeRo0598 E+3iciGKfJsea5+/o0xV+ZnF92qp7+l0FcInzma2R+SiMv7avksqNRHyTK5L9hkY dQdcOTLfCLADyKqP+KyD2gm+agmdq8gY1hw03U/5Efhqk+YJGtjNiXtYFGwhg8K4 Rs8v7rp9vC73XgGE9pwIGS2MzE5f/redxnBppMRab0+eyJJfOxzaDI/LCLXeTA0C 3DBej73GpqVNEwJfAvvuEw== 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=fm3; t=1714502336; x= 1714588736; bh=htMlaiKAEHd46q3bkXM/XEl9g3l+/DJfYlU33y1M7ss=; b=j HuC3a8a/6ww/EYErsO4yuPdTipO3S47yuIGQWUzmF7tTwXAkGPj5pL2u9aQNrcfP 2RsmQLyTBwQOssBVB8X2xnoamzSTYcR0u25RDLsZBEN8Qxc20d5qdIUl/EPKVBQZ wNTJ/mdzp1XYGjxUiu0fei7vhcEPzM6tjpt1Xf/RAhgY4IL6kV13+awol7M8Oi8Q +gR5jwHcdnmNg16Ujy26Fimj83BkKpuAnwyJtndLGaqzACQWXxdxUh0XzNtFnTUM +RQZsWE9AdEDpRjtR2ftra9FgCOSZVaEBBLqjzcvZcGQ07xSz7nA1zlo/gk7Mluv 2YOA5Dn2yb0P+No3odOBg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrvddufedguddvhecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefofgggkfgjfhffhffvvefutgfgsehtqhertderreejnecuhfhrohhmpedf nfihnhguohhnucfurghntghhvgdfuceolhhsrghntghhvgeslhihnhguvghnohdrtggrqe enucggtffrrghtthgvrhhnpeehfefgveejieevvdekgfeftddugfetgfetueelieduffet ieelheetieevvdefkeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrih hlfhhrohhmpehlshgrnhgthhgvsehlhihnuggvnhhordgtrg X-ME-Proxy: Feedback-ID: i1719461a:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id C6ABAC60098; Tue, 30 Apr 2024 14:38:55 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.11.0-alpha0-416-g2c1796742e-fm-20240424.001-g2c179674 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <992f3688-fff9-4970-a5f4-103fd868551d@app.fastmail.com> In-Reply-To: <6075bdd1-324c-ced7-4424-826b50767afc@linux.intel.com> References: <20240425172758.67831-1-lsanche@lyndeno.ca> <20240429164844.7544-2-lsanche@lyndeno.ca> <6075bdd1-324c-ced7-4424-826b50767afc@linux.intel.com> Date: Tue, 30 Apr 2024 12:38:35 -0600 From: "Lyndon Sanche" To: =?UTF-8?Q?Ilpo_J=C3=A4rvinen?= Cc: mario.limonciello@amd.com, pali@kernel.org, W_Armin@gmx.de, srinivas.pandruvada@linux.intel.com, "Matthew Garrett" , "Hans de Goede" , platform-driver-x86@vger.kernel.org, LKML , Dell.Client.Kernel@dell.com Subject: Re: [PATCH v3] platform/x86: dell-laptop: Implement platform_profile Content-Type: text/plain;charset=utf-8 Content-Transfer-Encoding: quoted-printable On Tue, Apr 30, 2024, at 4:31 AM, Ilpo J=C3=A4rvinen wrote: > On Mon, 29 Apr 2024, Lyndon Sanche wrote: >> + */ >> + >> +#define DELL_ACC_GET_FIELD GENMASK(19, 16) >> +#define DELL_ACC_SET_FIELD GENMASK(11, 8) >> +#define DELL_THERMAL_SUPPORTED GENMASK(3, 0) > > Please align these with tabs. > Agreed. >> +enum thermal_mode_bits { >> + DELL_BALANCED =3D BIT(0), >> + DELL_COOL_BOTTOM =3D BIT(1), >> + DELL_QUIET =3D BIT(2), >> + DELL_PERFORMANCE =3D BIT(3), > > You need #include for BIT(). > Agreed. >> + } >> +} >> + >> +static int thermal_platform_profile_get(struct platform_profile_hand= ler *pprof, >> + enum platform_profile_option *profile) >> +{ >> + int ret =3D thermal_get_mode(); >> + >> + if (ret < 0) > > I think I already mentioned about this, change to: > > int ret; > > ret =3D thermal_get_mode(); > if (ret < 0) > I missed this. >> + return ret; >> + >> + switch (ret) { >> + case DELL_BALANCED: >> + *profile =3D PLATFORM_PROFILE_BALANCED; >> + break; >> + case DELL_PERFORMANCE: >> + *profile =3D PLATFORM_PROFILE_PERFORMANCE; >> + break; >> + case DELL_COOL_BOTTOM: >> + *profile =3D PLATFORM_PROFILE_COOL; >> + break; >> + case DELL_QUIET: >> + *profile =3D PLATFORM_PROFILE_QUIET; >> + break; >> + default: >> + return -EINVAL; >> + } >> + >> + return 0; >> +} >> + >> +int thermal_init(void) >> +{ >> + int ret; >> + int supported_modes; >> + >> + ret =3D thermal_get_supported_modes(&supported_modes); >> + if (ret || !supported_modes) >> + return 0; > > I think you should propagate the error code differently from nothing=20 > supported: > > if (ret < 0) > return ret; > if (!supported_modes) > return 0; > Agreed. Thank you for your feedback. Lyndon