Received: by 2002:a05:6500:2018:b0:1fb:9675:f89d with SMTP id t24csp781288lqh; Fri, 31 May 2024 17:34:57 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWrPs0gVtWC4yaxaX9jCoKrwimsmhffWjtAa5p0LE9beVr2arSqBm994bgnLbMFfIb3s8fqr0izbh6DXNel++bp8znJ4MI31SzbYqvrzQ== X-Google-Smtp-Source: AGHT+IHlgZ7kj2jOq3bSZ+3g3jajTyiu0pVvSm/xTuA3Xe/wem7sqwGXFZDiezWRGCsl41NxXjzF X-Received: by 2002:a05:622a:1b8d:b0:43e:d87:e8e with SMTP id d75a77b69052e-43febf9963bmr112926571cf.18.1717202097041; Fri, 31 May 2024 17:34:57 -0700 (PDT) Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id d75a77b69052e-43ff259e5f7si33891311cf.630.2024.05.31.17.34.56 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 31 May 2024 17:34:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-197620-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@outlook.com header.s=selector1 header.b=pP93GMMB; arc=fail (signature failed); spf=pass (google.com: domain of linux-kernel+bounces-197620-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-197620-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=outlook.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 ny.mirrors.kernel.org (Postfix) with ESMTPS id AF6511C2183E for ; Sat, 1 Jun 2024 00:34:56 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4C9C54687; Sat, 1 Jun 2024 00:34:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=outlook.com header.i=@outlook.com header.b="pP93GMMB" Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11olkn2045.outbound.protection.outlook.com [40.92.19.45]) (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 85E3017FF; Sat, 1 Jun 2024 00:34:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.92.19.45 ARC-Seal:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717202088; cv=fail; b=aHO3M5g4jBQVEGPKS7fu8lkyfKqN0ZOov6pmom7eHdo1TuijBoIp6cGiZVW+/vQoohsvty9BFQa784LPYZWItqFKhzk03SYhB7X65vKnHuQLooLZDDlJPX51Lhr6xeNOh+NOLZ66HqfbI0NnYqUBZMgcg7rrypmOZUixjTwk0qI= ARC-Message-Signature:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717202088; c=relaxed/simple; bh=UUp3zOHELAzk2ejzLoqesWFb4ASbeIcqiagB683fc/E=; h=Date:From:To:Cc:Subject:Message-ID:References:Content-Type: Content-Disposition:In-Reply-To:MIME-Version; b=e4hB3ZIOczx2syK8uNz19PZCxMi1ladP9Gltgx9o7PdgaDHpDKwenGJ9d00ylev0YmBElIyjpBJEsCUxp9ZoMv0SyYXzQ/VJZCO4IDMjkO1llNawy0X8IULvJId04QXIGK+5Gn9BKjHoB206oGWrNpuGj6jvKSrENro6/cyuJZg= ARC-Authentication-Results:i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=outlook.com; spf=pass smtp.mailfrom=outlook.com; dkim=pass (2048-bit key) header.d=outlook.com header.i=@outlook.com header.b=pP93GMMB; arc=fail smtp.client-ip=40.92.19.45 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=outlook.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=outlook.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=BvJsQ+k3TAgQHtye1gsEDQz5cMUN25YUz2Y10xWlu7tJx/9Gc79Bv87GIpLfVtWYsOLu0A9BzB+A9FyJyOypjBazZ5CRSS9FSVLI9gms5tqh5USuS5M5DmYxCUfpwdGEudCw2b1FiROSw2KjT3bMRDbNNQ9rnx1DoirWXu9PN4Mn5A3qUWbqmCb0Sq8W5pMuaZmZ0DL2lo80kcSskXQEc+nhaBp05seFN8MQW6XGKhkGgydf6GQuLg8GjYA655Rv/OIhbo2bqnrx56wpK6TsCa1E8yk+kKsMwpjUKqzgXiM8V1PJQ2pBM2xGrlaPjlDlLLuFvrmbiDfq6Hrt4MytmA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=YihQBVyXclUgfsxPVeL93sGTTwxjm4OzDsK076sk8wU=; b=VqGOgMBp4rH33ludLiNaTuWZb22/vk97VTfX2R3dqZ7eLq+UtrsY/A00sosTMnAE6LtFJ0y6AVk1VafZbUiJdyg4lgtAHCoRWheYW8pUob9L9L0iAAZaOJRODPKSC8NLlKlFfIf7LzK2wBTF7Yr02CQv323tIKNKxDXpD1hbHwWl+UZUnuN8f/9O6/flSJrTvYJbuXtu+vvW7RxEiiswb43OdeEhuEn+TxWvRnOihsbTb/R9za4pJvMG4DOuo4nK++iQc9E/JARAAwTe7F8RPgsicOVyZqRJrjaO/0ExwsGibrRK8NN3tl8KdEOFduIgPp82Y+5/p4qQ4U6+WcN8OQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outlook.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=YihQBVyXclUgfsxPVeL93sGTTwxjm4OzDsK076sk8wU=; b=pP93GMMBFekCqJY03G6FvfuOJJanFak18EBFNBjubmIoimxwJVQ2SM/xIgp2s2fbTGTCjEWjxEQ0/0auBfOUKXfhqiGYdVbWnDZqhOPu9BhY53vFgYx1V1UKEu1yyCUUHnTXW5tazw5gwdc7SZ7PVXRMz0/J7tiWevsmsYkKToYOtLXFmiDYBWE/OJNxbCd6CYrPZQiA0MZ6I2EkON5dw5MTI23WzJP557OXJe2TvWiCnPGyrogqlxBqn/F8soJV4k9WakTLsNvOTLPIfrS7SUB/kNrPPlnf3gvLPqRdWURLfOZfDeO3LhLJFnTrXw0vgpuJCzJIVS/4/DsLuTA4SQ== Received: from IA1PR20MB4953.namprd20.prod.outlook.com (2603:10b6:208:3af::19) by BY1PR20MB7509.namprd20.prod.outlook.com (2603:10b6:a03:4a8::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.22; Sat, 1 Jun 2024 00:34:41 +0000 Received: from IA1PR20MB4953.namprd20.prod.outlook.com ([fe80::ab0b:c0d3:1f91:d149]) by IA1PR20MB4953.namprd20.prod.outlook.com ([fe80::ab0b:c0d3:1f91:d149%6]) with mapi id 15.20.7633.021; Sat, 1 Jun 2024 00:34:41 +0000 Date: Sat, 1 Jun 2024 08:34:23 +0800 From: Inochi Amaoto To: Haylen Chu , Inochi Amaoto , "Rafael J. Wysocki" , Daniel Lezcano , Zhang Rui , Lukasz Luba , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Chen Wang , Paul Walmsley , Palmer Dabbelt , Albert Ou , Jisheng Zhang Cc: linux-pm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org Subject: Re: [PATCH 3/3] thermal: cv180x: Add cv180x thermal driver support Message-ID: References: Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-TMN: [SINP3Fmt+RUNu9TEIc1/YqjmpV4Aa/ALwMhOkxcdOGc=] X-ClientProxiedBy: PS2PR01CA0059.apcprd01.prod.exchangelabs.com (2603:1096:300:57::23) To IA1PR20MB4953.namprd20.prod.outlook.com (2603:10b6:208:3af::19) X-Microsoft-Original-Message-ID: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: IA1PR20MB4953:EE_|BY1PR20MB7509:EE_ X-MS-Office365-Filtering-Correlation-Id: 56ac9706-139a-4fe5-9d5e-08dc81d2a066 X-Microsoft-Antispam: BCL:0;ARA:14566002|461199019|440099019|3412199016|1710799017; X-Microsoft-Antispam-Message-Info: Kl+PDBCBPVk+Fo6c+Bb3dy+oUPB0qpMvbXfAICzAHRSH328pK6v2ZMZwkG1DZosnbrLEx2pKLyaZ1t1bBXJ7zXgz+lseYnYw1gRizFoKo4nDSPFrL6M1WxZDkALnOqXAcxyQySIibMBlgRdGVBFIYXGmjAKYWwZ2GiEu/wOiRu/nKts2h3Er7+TB6AvAxRgPUulZ7jaBc8v1t72KiSDqzdW4kenNfnpSz8wiox923aCqB/vN2XmpzldjJHLJAgKQToPwUAF4hx84IJM7Uc+OU6fd1Tznyj+XN5w3iHMAD5w8z4W3y1FtcoLyukEyXXbTn49zH5RkDBL/mCW1AHU2Q9Xt/1EYcby1xYKYin2wvvsva2t7TsRMgrGEMQmPMuKB8PTiXIHFI5ZbHg68faiIjSGvQOkXT+Wvvz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j7SftseFyrOzdW3DZbav?= =?us-ascii?Q?5GpyxtVTGtJjFsf7k+29zHShOCmva0g2ZxrhrwDDNluOVlsMuoY/ibK2Gj/K?= =?us-ascii?Q?lxD7CYO4gjQMdB9CzowSSVChXc0lie8WX+r+cntkzE7fllEKOig1NxGJc/Dg?= =?us-ascii?Q?Q4n1PGRhFuS3hlxI4YSQF8SZ5Ic/kzOorNRGPb5TZHcLe7kaci3Dpctwt7MY?= =?us-ascii?Q?pw73CRb/cOpYqS49qtaRZ2YYCIqhlfiCKLYb4/BD7Mh4KzoQWL0Yx+9J210y?= =?us-ascii?Q?lH5oqxi/jDS1eNwyDDbqktGFZ9ovzdV+WdExunrS9EBZm7RjpE+hKoBCmezN?= =?us-ascii?Q?xlNMGWeosw08WrA6mObfaE3Elw0gGAVCav0NobVvc5MdhCWSPCfpX1I0/yvi?= =?us-ascii?Q?HlW5NPiLAIqE96gybelwyiUxk+EeJvdHhY3c1PTPkPsw8UzI/wwt8CsO9VMs?= =?us-ascii?Q?ew4lV99u5QHYBu5/DH/YxWvgeGfVgEoYCfBvdVqdAuS9eBVAF3FjEx3ulB6A?= =?us-ascii?Q?KLRhNySWpENvq9b497HLR81lGXebRTC3zc3HfLqGsBZiCzLcaOn4n8bJ0SlY?= =?us-ascii?Q?3Fv62Th9zEuGsxpYcBfKGnDOBMuO1A8qvGFwSx+1Zy1do97yTJW0hl7ZpQ92?= =?us-ascii?Q?f4yeJx2l6Td4M8aQDxnl?= X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 56ac9706-139a-4fe5-9d5e-08dc81d2a066 X-MS-Exchange-CrossTenant-AuthSource: IA1PR20MB4953.namprd20.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Jun 2024 00:34:41.6594 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY1PR20MB7509 On Fri, May 31, 2024 at 01:37:01PM GMT, Haylen Chu wrote: > Sorry, I forgot add cc and to in the last email. This is a resend. > > On Fri, May 31, 2024 at 07:45:37AM +0800, Inochi Amaoto wrote: > > The sensors of CV1800 support various periods, I think you should add > > support for all of them and let user select them. The configuration > > you use now can be left as the default. > > I will make sample period configurable in next revision. > > > > +{ > > > + return ((result * 1000) * 716 / 2048 - 273000); > > > +} > > > > Why these magic number, I have not see any info in the document. > > Actually, there is no document of calculating real temperature from raw > register value. The equation above is extracted from code provided by > Sophgo. > > I have figured out meaning of part of the equation and could add some > comments to document it. > I think you misunderstood. I did not only ask for the document, but also a formula that respects the configuration. It is pretty weird to use all fix magic number to calculate the temp value since the sensors itself supports various configuration, right?