Received: by 2002:a05:7412:2a91:b0:fc:a2b0:25d7 with SMTP id u17csp506808rdh; Wed, 14 Feb 2024 03:41:20 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCV6CeGt4ZwFBpbdpNs2XVb7unPH5XlJwKe3k01m+I3+PTU3VV4Gz06JIMJdXiGBgCZaHPXh+pELEfbIxBhXAsTDgjoISIhsoFrAAm5tXQ== X-Google-Smtp-Source: AGHT+IEuwac8O7j7SoTzTBRLI0vFQ53Mxs9A/wsvOE7sHsKeBGlfb1tbAoQOV6SucuEPKdyz0k6/ X-Received: by 2002:a17:906:a451:b0:a3c:8585:22d1 with SMTP id cb17-20020a170906a45100b00a3c858522d1mr1711591ejb.54.1707910880317; Wed, 14 Feb 2024 03:41:20 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707910880; cv=pass; d=google.com; s=arc-20160816; b=csCWSLOJ0PuqZ7boH1KXHGYQ0jsPCK3MAn4WWzUBGKrfuZ7c0MtWRtg0FcDxmd5Rr8 KpqVmxoiE8sT4Fgp7VOOpkLbFoPDeKX6qgPuaNSvJzQl0YfQrSWI08LIfdTQTl8arQcA 8R994H8A9QlX4Nk3vPyXxwQtBbH1qszz3aaYkz8Susuvbkp+9D6HYFX/i+xXgKj993bu JI5V4R3KtTWzq8McoQtayHZnv4td/9jiV+4SWEjdlCgXc9Hu++1mZ2l+U7MyYbACL918 iuTNe7rbs5eoCFxzFfowDQRBzHZNt+yKhLl/Go28dCPsTUZKgDUPDM8RolX/HCkERfu9 6jrg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-id:mime-version:list-unsubscribe:list-subscribe:list-id :precedence:references:message-id:in-reply-to:subject:cc:to:date :from:dkim-signature; bh=GeoCJwoLv7nQm9U9O3k4ZPQwj1TmTOshXnwy4PWfP04=; fh=0j0zeH5ztpF/wU6k/RtbWIM/bcHRlhNnAc8/HA2DyL0=; b=WG4QYMZwJivfT7Sy8wws2ME+NpRXV7G8nx8n3+axVbAGUeZwcJF2cILZjxIz8ruWmg QxTLEzkldHmlDDRQ1IiOf3C1FZ6DEJRKoy1/QOnh9PA0/66dD8d2Ww1m03DAKv+rYiWm 1b++k602z2JBNYZJkJiDIraunSGXlSAKkOgfynwDiZOCx1WSkCwruK8b108fPqZXXwky vPs6oV/PMS1eCn49uzaFVuPE3YPy/fQrHTWH5YzAw5EIzU1PtJtrTsztbN9G16UFudB7 7CM90wNkW4uSKb74AT68enw4l6HPCzdG0SXCCfaCp8ze20+2o+N7eFVdLpPwt7ysk9Eq X/dQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=BhsLx1tf; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-65040-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-65040-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com X-Forwarded-Encrypted: i=2; AJvYcCV67Ujl6EUoGAQu+U7nqqF+0j2NpKfKTG4KQ7iVOTehNxCUHD1AE+gmpftg1VdxnGEXhIf3hU0QQEvh3EqbLvp/7jw5ezbmVMLOxmY0gg== Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id gf15-20020a170906e20f00b00a3d597e5d0esi285170ejb.296.2024.02.14.03.41.20 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Feb 2024 03:41:20 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-65040-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=BhsLx1tf; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-65040-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-65040-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com 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 8DB041F29BBC for ; Wed, 14 Feb 2024 10:23:24 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 587C51757A; Wed, 14 Feb 2024 10:23:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="BhsLx1tf" Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.19]) (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 2D663C2C6; Wed, 14 Feb 2024 10:23:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.19 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707906196; cv=none; b=AvJ9EoC9ykW6LEQhG5HnFoW/QQXzpvEP5aTdc95fLvSZZ2tQcQZnyUhDGkyh6yPCd2rgnHH4Vx5k3hazf/221LzInUx52YfVUHBBVcezwxVzx4kSuDiYaWHzQsaEGD7diz5ZsdISJpwCiaOsQPrDbm8dVpR+xz9dgKxL0xzBAAY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707906196; c=relaxed/simple; bh=QMaqZlJchyH8KIu//1PefAMMgtRPF4A6MlkANLCH/AI=; h=From:Date:To:cc:Subject:In-Reply-To:Message-ID:References: MIME-Version:Content-Type; b=gnNFukRQWBwjwzxkACkh79/6qjwoo6WELFfXNHpMpUpOqAF6R6E/RVXYRmYmKV3O2BF1CFdshYVBjY7C7GC4hZwi43DBnTlzvWWCLmQR6rr1Ubg8syG3q4CFkQnC8Ux4PsQYQSa2R61Gr+Af5qGfwfK8tJ0s/DPPHeESxJC2nuc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=BhsLx1tf; arc=none smtp.client-ip=198.175.65.19 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1707906195; x=1739442195; h=from:date:to:cc:subject:in-reply-to:message-id: references:mime-version:content-id; bh=QMaqZlJchyH8KIu//1PefAMMgtRPF4A6MlkANLCH/AI=; b=BhsLx1tf+XhdsHOHKeKwy2f65zl9QGXeg8HBWDK34WSXTSG/KiJgtu6m KKWddMIP7QQQ3Kg1Eo6ZjQ3sHw7HV8OSkiDqQ9Qccgd7yt9+5LujGDy/c Ui/DTdpVirEuRHbqhnpYg0bTeV1CfVzBDB/y1cbP42OexxIofqDe2OcvM gblQKhpoXyk58xnOCyrwS0jUJQt6D5an2zjkrVkm32XWGSPqwz1DBPVEt h2KsteijzX37omO+OSoMLjDvDoBLYfH56+4lwfERgoVA/vtUUtQXpydUT iwxK2+zdsQoKfb+7S9nD/J1T1wxHkPRYPNxWe5SEltEs+w50Dn76ldKG6 A==; X-IronPort-AV: E=McAfee;i="6600,9927,10982"; a="1794801" X-IronPort-AV: E=Sophos;i="6.06,159,1705392000"; d="scan'208";a="1794801" Received: from fmviesa007.fm.intel.com ([10.60.135.147]) by orvoesa111.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Feb 2024 02:23:15 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.06,159,1705392000"; d="scan'208";a="3055604" Received: from ijarvine-desk1.ger.corp.intel.com (HELO localhost) ([10.246.33.229]) by fmviesa007-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Feb 2024 02:23:12 -0800 From: =?UTF-8?q?Ilpo=20J=C3=A4rvinen?= Date: Wed, 14 Feb 2024 12:22:57 +0200 (EET) To: Vishnu Sankar cc: Hans de Goede , platform-driver-x86@vger.kernel.org, LKML , Mark Pearson , vsankar@lenovo.com Subject: Re: [PATCH 2/2] platform/x86: thinkpad_acpi: Fix to correct wrong temp reporting on some ThinkPads In-Reply-To: <20240214052959.8550-2-vishnuocv@gmail.com> Message-ID: <97fb005c-92bc-790b-80b0-75149a799b4b@linux.intel.com> References: <20240214052959.8550-1-vishnuocv@gmail.com> <20240214052959.8550-2-vishnuocv@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: multipart/mixed; BOUNDARY="8323328-2051631955-1707905357=:7959" Content-ID: This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --8323328-2051631955-1707905357=:7959 Content-Type: text/plain; CHARSET=ISO-8859-15 Content-Transfer-Encoding: QUOTED-PRINTABLE Content-ID: <7a7d916c-733b-6bf9-216b-a3ebf981ddf0@linux.intel.com> On Wed, 14 Feb 2024, Vishnu Sankar wrote: > Added non-standard thermal register support for some ThinkPads. >=20 > Some of the Thinkpads use a non-standard ECFW which use different > thermal register addresses. > This is a fix to correct the wrong temperature reporting on > those systems. >=20 > Tested on Lenovo ThinkPad L13 Yoga Gen2 >=20 > Suggested-by: Mark Pearson > Signed-off-by: Vishnu Sankar > --- > -Improvements as requested. > -Improved the readability in case TPACPI_THERMAL_TPEC_12. > -idx < 8 from idx idx <=3D7 to match idx =3D 8 > -KILO used from linux/units.h instead of 1000. > static enum thermal_access_mode thermal_read_mode; > static bool thermal_use_labels; > +static bool thermal_with_ns_address;=09/*Non-standard thermal reg addres= s*/ Comment is missing spaces. > @@ -6239,6 +6267,20 @@ static int thermal_get_sensor(int idx, s32 *value) > =09=09} > =09=09break; > =20 > +=09/* The Non-standard EC uses 12 Thermal areas */ > +=09case TPACPI_THERMAL_TPEC_12: > +=09=09if (idx >=3D 12) > +=09=09=09return -EINVAL; > + > +=09=09t =3D idx < 8 ? TP_EC_THERMAL_TMP0_NS + idx : > +=09=09=09=09TP_EC_THERMAL_TMP8_NS + (idx - 8); > + > +=09=09if (!acpi_ec_read(t, &tmp)) > +=09=09=09return -EIO; > + > +=09=09*value =3D tmp * KILO; Hmm, MILLI would be much more approriate here? But if this relates to=20 degrees, there is MILLIDEGREE_PER_DEGREE? Reviewed-by: Ilpo J=E4rvinen --=20 i. --8323328-2051631955-1707905357=:7959--