From patchwork Tue May 16 08:37:44 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Peng Fan \(OSS\)" X-Patchwork-Id: 682831 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E5774C77B7F for ; Tue, 16 May 2023 08:33:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231367AbjEPIdI (ORCPT ); Tue, 16 May 2023 04:33:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51276 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231363AbjEPIdH (ORCPT ); Tue, 16 May 2023 04:33:07 -0400 Received: from EUR04-VI1-obe.outbound.protection.outlook.com (mail-vi1eur04on2055.outbound.protection.outlook.com [40.107.8.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6CA581BFD; Tue, 16 May 2023 01:33:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=I4nGj1t5HrX9ecuDa1FFLUSsSwI9VRe2jbSXWP+L2hvaawgdOV58kGjCZNMQp0eZLvfPEPlXmUnDbE2Xt4fWMBAJOT7rPH1WRIK/r0ZBah7JRCmoA+Vx2bxsm8rfCAV4LyeW9lOjzdDGmw+FhXIwZZtSz5oKdvNDG+nkpULkCGfwSGAT+/K9IF+D6kjW0dTIPohrg2oN7US5/W+E7pNcuQHDLiXSjgMqcmcGyM5p4zSQrz5GeROzo8bSwfR0jP9apVc+uaZCGdVxucEEYpHECl1HW8pLUgEpLDjcZL4YgiLa4RW0E1Ek/iZ1awBa39vSzuc5KBEVp2dkV2ujXOJSQA== 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=Jc5Pk0e2JJ4AxW4OTi/UD4axguCWtZINOgyMB51+n4s=; b=JJh42MhHBCyILCZOT7vfuV83k5TpjNho5WmFz6axyp9mqbEl2Pdw4Y0nfKqQBDrriejaf+lvbVoxOWJ4G0RIr2DuyZdayAkAp4JGgHCTdnOYcs2Zowq4RS9E78UPP8wQ6T1sks/W/vSkYtJ+nGMRFeEcJbJ78CalEmA23cpc+zbkl2Gm60uWb+DhGMfNWo2OWQpvS91Kx5UUACRxFRLxwv5Eih6D85V1Kc1YQtBECPGxEvys4x7jh/3tjoO4R5EuiDG0rSukCLmhw+MEU4CUfV1aIEUPHP3vKs2Ste1ulYvLFjleCBA8W4OO3Rm7IkxFnWlwqLA9bWhnZH0l3qt5/Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oss.nxp.com; dmarc=pass action=none header.from=oss.nxp.com; dkim=pass header.d=oss.nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=NXP1.onmicrosoft.com; s=selector2-NXP1-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Jc5Pk0e2JJ4AxW4OTi/UD4axguCWtZINOgyMB51+n4s=; b=U/v9MCLs9WIOK+Zfp/FS83LnA/2vhM5NH+WQStLINBrm9yUWcs3GgxbKhv8m5wBDqhevW2C7VeHpXEqryiTRk+wUFJ5Ori7NLWt1rODxC19bqoM1nNVkYeYN4QcT3CnVM9kkMOrkfA5eepBP55+RFBFCYvrnGzbb7zEmnghKYkI= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=oss.nxp.com; Received: from DU0PR04MB9417.eurprd04.prod.outlook.com (2603:10a6:10:358::11) by DBBPR04MB7644.eurprd04.prod.outlook.com (2603:10a6:10:20c::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6387.33; Tue, 16 May 2023 08:33:01 +0000 Received: from DU0PR04MB9417.eurprd04.prod.outlook.com ([fe80::b999:f2c6:a8cc:7b4]) by DU0PR04MB9417.eurprd04.prod.outlook.com ([fe80::b999:f2c6:a8cc:7b4%6]) with mapi id 15.20.6387.030; Tue, 16 May 2023 08:33:01 +0000 From: "Peng Fan (OSS)" To: rafael@kernel.org, daniel.lezcano@linaro.org, shawnguo@kernel.org, s.hauer@pengutronix.de Cc: amitk@kernel.org, rui.zhang@intel.com, andrew.smirnov@gmail.com, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com, linux-arm-kernel@lists.infradead.org, alice.guo@nxp.com, Pankit Garg , Peng Fan Subject: [PATCH 1/3] thermal: qoriq_thermal: No need to program site adjustment register Date: Tue, 16 May 2023 16:37:44 +0800 Message-Id: <20230516083746.63436-2-peng.fan@oss.nxp.com> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20230516083746.63436-1-peng.fan@oss.nxp.com> References: <20230516083746.63436-1-peng.fan@oss.nxp.com> X-ClientProxiedBy: SG2PR03CA0099.apcprd03.prod.outlook.com (2603:1096:4:7c::27) To DU0PR04MB9417.eurprd04.prod.outlook.com (2603:10a6:10:358::11) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DU0PR04MB9417:EE_|DBBPR04MB7644:EE_ X-MS-Office365-Filtering-Correlation-Id: 7c09bfa8-a2da-4df2-4dd2-08db55e82890 X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 82J6zjxFEYzdL8MDQ+XeZE7kwoS9SfCZs9skHMXPXuTeqeZSClG//huL1WeZ827MhWTRdqid2bE8RCvK3E+1L4rgjG6nC3R7Kp0mpuxnE8G303VXIf0Xf39yI7jnzTg8c1FZFVNOTBkNyTCfJ0Bv9to3z1+4/FzGorx6AOpnVUHy36QJvUxWsGOVHxg74dvIfXmOLdpHzlbUDd3Qf4478zwVxmJBmLUzyXNM3uGe1d0HTa/+3Fbzds97Z03dWxnLhh2xqPsnC3Rc+4+xi6GddES3H0eUZRQljU5nTo1JbmylFKDJhjvBhvVGjbOVkJuxDcuFe0/3cglPhlPX2NNiVrjU9Wb3aXrr3gKHmDDT9vvKsdtF9dxzpE8Fp4xBrv6gG2wEOuap/myvqKQmHyBZzi07Syo+1gbwlNLpdrVjIATEhnzMxAGUjIUXp+3TYIJh3PFZWD/GOg+uNlVSCe88c6XKQrWXbLPR/D9Odjue6n5MLoiIz0I04sLYcqpLulzCFsIcZpGwZgQ/KI1bRbFlKPCYI+TyLo2Nl8QTUh5NpXneSYKoiwaPBtDpceq54JHOfDmwwEiZY8JysIhsIBT6V4mYnT9UKdY9RZknKI+xKxjg/ptIDqd3R0hH/Cmk4lYW X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DU0PR04MB9417.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230028)(4636009)(346002)(376002)(396003)(39860400002)(366004)(136003)(451199021)(52116002)(66556008)(66476007)(66946007)(478600001)(4326008)(316002)(54906003)(86362001)(83380400001)(6506007)(6512007)(1076003)(2616005)(186003)(26005)(6486002)(41300700001)(8936002)(8676002)(5660300002)(7416002)(2906002)(6666004)(38350700002)(38100700002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: yVP1BOKPHAgRXo6skd0iDWvr4dp553J5F0tgnTOttnihj5fww/vJs66LWSDoCc8I3eooH2PztssjjzqtffU+o1D947NJ5UKNQRxGBXrC92Ip4qnqDaEDt+Tuo/jwRPwv7TKykiC0Qt3MhxbovMNXkowF6yPIXiFgLK3YJ3a4Halzk2t7U35Nehevs+7dpNT26FsNnGfZ7SgaCZAf2rab2O3teedSEusEbvJBWfcSOffh7jNKT1e33X435P0dc0pKKm9x8M0oRkFnQPRmWGIiwv4D4mLowvk/Z0tJLn/2O27wNcLGlwGKxyYJ9sCQ+/Mi0U/FZpSTkxQuxf9zvAte5QuNaSkEgrFUA+qwxE9Oh0fHaRrxUo18Hd/7ZWM/LgnpqZjQ8dZpu+AZ+z7b8Tm6/6x+brgbPvZ1tuaCOkIbjM51xyAoeY3munwsEaN+7mM93rYj5BFRo4qphxb2Y2t4JbRZLcBMwkalDDJNb998V2KrJle3DADlkl3lwAxbSMgNHwXASudwQlLJSElenFs/GcR1tw+aWS34tyng8JRXjqgmDyw6gfNLqFu8ubBUVxkRMMk5Bfn8ywnoHPox90cXRQDnCNCgIjBkvAx/1BefHuDCl1Qq+4RTt33v+O7c2EWickbFPiUEgP5wjfIwFgHDogszCKImkbXNszWtdrHI6Wl/4zm1ddmS/4HBEh4NZMi6vmlpGH3Vi4llhJYfvr0TKt3vEv2Xwfg6k8rkew2obSpDBTvKbGYjVaH29hbFnYQCDI9tHgvlH2DeLq5+W38ZZ9vPEzbLN1NoFssI8/lCulhgbWDHzRsxRyTILVSf9onyCJMiylonDnYY8GL2DsKiYmOTm6wsZDwQZYMqo2zVFDy9eTj3wyo+iAuvrOjuxcBVpioJThmqFRaqBOiIr6958hOkupFkzFIce3II5IFCKkmz4JkC2VcAkXgmvgqwpJoeubf19HYhYKo98ns18zetTQ7VSuxGllbyCqVRPJWXoMUjxYC4QpgvU+FeGKllRVEML/vC8Okrq7EDYBshT4mAe8UO9NyR8SzMvOnl2rtkkVAgR5Xr8r1YkP5bZBk1Xtei3nO2rr1hhqWA3ae/X71jme5Grtyxx7nrkmQgZ0kkuovPZXC87vIbYBAdjXW6c/8btGG84wZkYqb4PEy5Rab+ISRnVUkRhMQeL5+O//KsbETR5n8qfUjRONSt1ld1/gv6bzKfNPi/kDcWxq4D10Q+teVgACPkOfnq1r/wygARiRfsbANPY3Z7Z/1i06W+xKyoTJcw58JbeW5NsQWq3BppCQy1eo6xQUxDZWFlWWDkIpqqpOBeAqF05lr1hP7Fqt6OcM0H5sXxJM+9dVXVnJg7+y1w+D/1u7dkeSY43+E7OHjcQpnbCPEdSvcqFH5r1kGtpXk6brN6DgrGvY3Hl/eBsxfzKGaoINQF2u5XNQpKxqqfch0IOt27jMnFiKwxZcQwM1dmhwGuKh1GCOZ4ezTO2UsP/y28hl6sB/P6y9R2UWrRfYIR8omIdWW5dI0BwVW22shhMid6sOWN2lFJPdCNhuJBVDT7uRjbvCAroG0O9qOlDICWq2065Qy1QIOYwiPz X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7c09bfa8-a2da-4df2-4dd2-08db55e82890 X-MS-Exchange-CrossTenant-AuthSource: DU0PR04MB9417.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 May 2023 08:33:00.8600 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: g2LeXsNXwEcw8Z437xI006lfoVoViO5Zq8Rf41ZDdseIZe2CJPoaOqsuP59/B8veoPRM5ygJpLb7zSMY8HGziA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR04MB7644 Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org From: Pankit Garg No need to program site adjustment register, as programming these registers do not give accurate value and also these registers are not mentioned in Reference Manual. Signed-off-by: Pankit Garg Signed-off-by: Peng Fan --- drivers/thermal/qoriq_thermal.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/drivers/thermal/qoriq_thermal.c b/drivers/thermal/qoriq_thermal.c index e58756323457..b806a0929459 100644 --- a/drivers/thermal/qoriq_thermal.c +++ b/drivers/thermal/qoriq_thermal.c @@ -208,8 +208,6 @@ static int qoriq_tmu_calibration(struct device *dev, static void qoriq_tmu_init_device(struct qoriq_tmu_data *data) { - int i; - /* Disable interrupt, using polling instead */ regmap_write(data->regmap, REGS_TIER, TIER_DISABLE); @@ -220,8 +218,6 @@ static void qoriq_tmu_init_device(struct qoriq_tmu_data *data) } else { regmap_write(data->regmap, REGS_V2_TMTMIR, TMTMIR_DEFAULT); regmap_write(data->regmap, REGS_V2_TEUMR(0), TEUMR0_V2); - for (i = 0; i < SITES_MAX; i++) - regmap_write(data->regmap, REGS_V2_TMSAR(i), TMSARA_V2); } /* Disable monitoring */ From patchwork Tue May 16 08:37:45 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Peng Fan \(OSS\)" X-Patchwork-Id: 683197 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 45717C77B7F for ; Tue, 16 May 2023 08:33:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231453AbjEPIdX (ORCPT ); Tue, 16 May 2023 04:33:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51662 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231685AbjEPIdR (ORCPT ); Tue, 16 May 2023 04:33:17 -0400 Received: from EUR04-VI1-obe.outbound.protection.outlook.com (mail-vi1eur04on2079.outbound.protection.outlook.com [40.107.8.79]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7792A3C01; Tue, 16 May 2023 01:33:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FLX/OlxedYLQo4Bj9yKSTcsToyuFrHoSsv/YjW//g492atFT1mtENM9jX6G+b5vAJSBamhVID4SzAWy9MNen1YItRBaOOGLAZ5skT/Jf1nD5yUzp2nwErDkyDuBmCL3psjMncFxjGqTeOZ2Ql/RdkrIjDoWgfR4CRQ8v+OxlqSxLzkOOWmp4uS7SCktP+SOg+J9NJn1u867ZOENSkoH7Kdysvmr/Mvn/XalZMxvuRZP8pj24axVJryhf3gy88UxWFVxxfdgscNKfrR5P+MzgUUQT7lO/V6eNRf3lbCFVWCBCaoXf6ahnB9Vuh3vnGrZs4p7T6L/PNQs2RzYfQAKgIQ== 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=NlKTHXOziId6LQ8cWVoLEmTl1D3ynNMFsB9JUxtVvQg=; b=EKenF515sNJot3nY0MkHcbwfcZj2zoyyesT6O5bTiR8+gcQ1Cb4x9jQRVVUkeBDZXFD9xbl2Lo+qWSNGMwVIUu52ZzHGHzIP4h1EeT4u9b6PO2wVXP3FsFZ5Cp4JcHuk/yYPNVf3Bt98Hxf+34/RrfM29gHtjs7OEEQEvNTQlIbGEjdyB4fagJsH4ulUxwdNkfIsmmgDk23saTmED6twhaCYbt9mJpHdTmQEQuH6l6IXJmnrkp7doeR5s+TTCuT5hcUdRWyV16/SbCdcOYG8mRLH1QuKAvTNxS8Jyjc78ixkVdng3V2tu0eRoNnenpBSGslJ6oeILzdzOvlIA9ToxQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oss.nxp.com; dmarc=pass action=none header.from=oss.nxp.com; dkim=pass header.d=oss.nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=NXP1.onmicrosoft.com; s=selector2-NXP1-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=NlKTHXOziId6LQ8cWVoLEmTl1D3ynNMFsB9JUxtVvQg=; b=kXeWPfpJU9uzaWRcdAgJwqgaD0cm4502ALT/P8LNOCPHyvxCszHI52/tub7hSvL6IVDUub2LF5bZYbtNX9YdR+u4+Cdf8QcmmbLE7Anqw5uRPurR8BruXOPG0FrfZsUyteyKRbXodZNWD6Oh8niz7uucaml+q5JGmkmQFPz72QE= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=oss.nxp.com; Received: from DU0PR04MB9417.eurprd04.prod.outlook.com (2603:10a6:10:358::11) by DBBPR04MB7644.eurprd04.prod.outlook.com (2603:10a6:10:20c::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6387.33; Tue, 16 May 2023 08:33:06 +0000 Received: from DU0PR04MB9417.eurprd04.prod.outlook.com ([fe80::b999:f2c6:a8cc:7b4]) by DU0PR04MB9417.eurprd04.prod.outlook.com ([fe80::b999:f2c6:a8cc:7b4%6]) with mapi id 15.20.6387.030; Tue, 16 May 2023 08:33:06 +0000 From: "Peng Fan (OSS)" To: rafael@kernel.org, daniel.lezcano@linaro.org, shawnguo@kernel.org, s.hauer@pengutronix.de Cc: amitk@kernel.org, rui.zhang@intel.com, andrew.smirnov@gmail.com, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com, linux-arm-kernel@lists.infradead.org, alice.guo@nxp.com, Peng Fan Subject: [PATCH 2/3] thermal: qoriq_thermal: only enable supported sensors Date: Tue, 16 May 2023 16:37:45 +0800 Message-Id: <20230516083746.63436-3-peng.fan@oss.nxp.com> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20230516083746.63436-1-peng.fan@oss.nxp.com> References: <20230516083746.63436-1-peng.fan@oss.nxp.com> X-ClientProxiedBy: SG2PR03CA0099.apcprd03.prod.outlook.com (2603:1096:4:7c::27) To DU0PR04MB9417.eurprd04.prod.outlook.com (2603:10a6:10:358::11) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DU0PR04MB9417:EE_|DBBPR04MB7644:EE_ X-MS-Office365-Filtering-Correlation-Id: a273cce4-c2dc-4fa3-d9c0-08db55e82bcd X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: /vMaMLs0KY02/g49zTtBF0DI95K7EeUij7xj+HNJ1S57jN5T8Xg/tlHNpls45KkcZFJ+PSbHKylB+nEK+qPnhie4Q+/Cd8C0lH31GQdujDGgzNtjCqW9e1rtE51VKT8UB6NYOtsJasWCQrhV9cOUyJtj1jcUTyESj7ozdUHprUclbHYTl9XJQSlvt397G9C4SBSSSm0nIhvY54TMg5RS0yOAk354E4TGJfET+hm9IfTKOJ/f5iP1WEeAS44Jk3P3LBFExYU5LPnfP58z0RyoLCe37TPBr+00UsSLYRQRCm8xhQ32GiEKwMGOhsT/NsnaKMOPA+NigvMejaSxN8FdbZ9ER3ShqNRCVXqYO9uEqAPUknYrLV73I5cdtTM+uKpWPj9V3RJYR8nYl37MPfWEG/iw952bDgrbfBj3ufXGo+rz52I4q+PgAfpCQXGCs4Te7il0yUoVQUa7ixW3TMsvzcEQsL4buGNuV/zu6tWf3NMNIR+v+EekN0HsfWaoiER/63nqX2/0bvT/DBrCCprwx70pL7FI+gYMUU37fkrZ7u9oDlQLUMkACUkP02uaOz80WV5JBYanqTSLvqyzDuC2xW4Z4rQbxQC5LfT5BGcMAS0cNL6I+kQVRUCgQljX57fw X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DU0PR04MB9417.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230028)(4636009)(346002)(376002)(396003)(39860400002)(366004)(136003)(451199021)(52116002)(66556008)(66476007)(66946007)(478600001)(4326008)(316002)(86362001)(83380400001)(6506007)(6512007)(1076003)(2616005)(186003)(26005)(6486002)(41300700001)(8936002)(8676002)(5660300002)(7416002)(2906002)(6666004)(38350700002)(38100700002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 0UAsRi8QkKLZ9i5jfYUQ3J7JLpiKmGOFDfkCftwMTGmnCY+PzeicLPfuMTy1iIoUXQdgMqtGTH0a8PaUViO/09AmeFdfm0ePXJrKk19NBv+x7zXW1z3iLGWuN25JxJ+Ag5eoPfvsmHbr3aOu364N41zW2royLY7Uu2y3pXYl4UcZk/hQbPFukofFtQYXIuFoGbbtTGtaLjJwov/gAm0nKXQRhjPYWUjXw8UyGlordXB1WOo90TJfNKCBnJd5lB8pWkwm3LgB786Vr2ZYIckNTZkWzGSnU+zFXawnDSJptdbO1aIHgWd7WPCdEZUL4q3BpYw7cdXOiNIrvm38lYT0AHw4ub4atmuchcqxJdaU/dU8CElYGRj1SNDoJ8FMzKiw6cr9GuN9ficBBZd7iSIQZG8+bZPhg7xoLQVa6J+P2RPkjYm0vcW+DtX5OtK0kKSeFOy66IhV7jf9xVS/XjE1z9mOIe134aN+ZB3//TIc2NxLOXjK2TtsL5V7klkmZkz3rMeoTfz7DaATlWCL9fDonuC8y31t2Da9EjHK1QgYMwhiEGrZNOd7QvtTrA9BF6Sao+VylEp7xdbeScIx9nGHXoTroNLxQRjuI0UXrESXzLYJmhKuvJVMdz+sc5sfUH6/8XxrJshbk7klAVY0Fr7WxQK0wTq6jDfWnAD3nVl7I8WIcJvba0IjLQGywHZUwKcOLC1sI9CJJC1nE7BpPyJMDGPkx8TZEVaU506jlL6O8hbwRsud2xECaC5hb6JxBlAuSDy4JQpkQncFxf1z6METOJ3sP+LrqXV7irprxVkZBq6EAz9ZpqvdBdQjtnDWKbX5BKzCUy8d/2DfYR8Q+8C4mWShOVqS+9F6umjsIKOvR3mr7ysF8Tx9ZXjTJdkON0jnBXv/tSwsxD6GU9E9TnEsG00zecjUPkVjPKQyvb24YMw4fVlkdBiugt2b17SrKQu6LXFbsI0IivYtBu0/MvnccbxsysQmPvHeTQQgEwXgRmAstRAvOqW1QDoUApT7+Vp4IA9e5S4+a7NVjfqfA4lHkh+KqIwSFe+/Fpg5GhLq34gsgYOY3GA2zaBeqTIK57aWbDj0Q9NyU/qFImJo8kUiuyU5b41jL2MFDTaaSo0O8QI3YiQjDeXaY2ymhF/CBxjcgxST4bntN7h9fG2WWUqINgpiitIBdXlfzINYWvLtQzGTO+JNxSAxtaLvxYQo3xFdc9E1slNdslM9nDlZOwVu7SxrBpKldwpnybfKPZiFP03RdZQE3Zh9spHnGY3q+UPFHQeSaXRrw9ugUL+WcF2nqQpHbHTNCoKGtzUeXzL7ewESTbLowCgd8mPhI0bF2W5ItKU4/QW4IrYsBt6Cw1ErgkySNObzdj7TqxEsm0yNgavJS5cqpbS2+FsZHH4RuO7hf5d4ESwow9vimToRGG8mOPKo0f1G7A+M6GvzKwTn371GoWA2fgOszvhBK9AfjJDQpk0S0z+18ZgI6e+iqbjuCWphfcY4DQpKKV5/4m/3RtEu2pnpnOQdDibXcwiVI7A1E1RUQSon0CKI5R3PqkW838MJ40LPiLiHu83srWBXQ1jcdBR+r79xUsFiMZ6C/Epw X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: a273cce4-c2dc-4fa3-d9c0-08db55e82bcd X-MS-Exchange-CrossTenant-AuthSource: DU0PR04MB9417.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 May 2023 08:33:06.1545 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: tJ/ZHohGvo9au6ASm8biL46fU09aAgX6QOJgAFfoNvtHKH2PplFlw98OZ457D2gH8X+Vcl/KgyKvIKw83/EDLw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR04MB7644 Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org From: Peng Fan There are MAX 16 sensors, but not all of them supported. Such as i.MX8MQ, there are only 3 sensors. Enabling all 16 sensors will touch reserved bits from i.MX8MQ reference mannual, and TMU will stuck, temperature will not update anymore. Fixes: 45038e03d633 ("thermal: qoriq: Enable all sensors before registering them") Signed-off-by: Peng Fan --- drivers/thermal/qoriq_thermal.c | 30 +++++++++++++++++++----------- 1 file changed, 19 insertions(+), 11 deletions(-) diff --git a/drivers/thermal/qoriq_thermal.c b/drivers/thermal/qoriq_thermal.c index b806a0929459..53748c4a5be1 100644 --- a/drivers/thermal/qoriq_thermal.c +++ b/drivers/thermal/qoriq_thermal.c @@ -31,7 +31,6 @@ #define TMR_DISABLE 0x0 #define TMR_ME 0x80000000 #define TMR_ALPF 0x0c000000 -#define TMR_MSITE_ALL GENMASK(15, 0) #define REGS_TMTMIR 0x008 /* Temperature measurement interval Register */ #define TMTMIR_DEFAULT 0x0000000f @@ -105,6 +104,11 @@ static int tmu_get_temp(struct thermal_zone_device *tz, int *temp) * within sensor range. TEMP is an 9 bit value representing * temperature in KelVin. */ + + regmap_read(qdata->regmap, REGS_TMR, &val); + if (!(val & TMR_ME)) + return -EAGAIN; + if (regmap_read_poll_timeout(qdata->regmap, REGS_TRITSR(qsensor->id), val, @@ -128,15 +132,7 @@ static const struct thermal_zone_device_ops tmu_tz_ops = { static int qoriq_tmu_register_tmu_zone(struct device *dev, struct qoriq_tmu_data *qdata) { - int id; - - if (qdata->ver == TMU_VER1) { - regmap_write(qdata->regmap, REGS_TMR, - TMR_MSITE_ALL | TMR_ME | TMR_ALPF); - } else { - regmap_write(qdata->regmap, REGS_V2_TMSR, TMR_MSITE_ALL); - regmap_write(qdata->regmap, REGS_TMR, TMR_ME | TMR_ALPF_V2); - } + int id, sites = 0; for (id = 0; id < SITES_MAX; id++) { struct thermal_zone_device *tzd; @@ -153,14 +149,26 @@ static int qoriq_tmu_register_tmu_zone(struct device *dev, if (ret == -ENODEV) continue; - regmap_write(qdata->regmap, REGS_TMR, TMR_DISABLE); return ret; } + if (qdata->ver == TMU_VER1) + sites |= 0x1 << (15 - id); + else + sites |= 0x1 << id; + if (devm_thermal_add_hwmon_sysfs(dev, tzd)) dev_warn(dev, "Failed to add hwmon sysfs attributes\n"); + } + if (sites) { + if (qdata->ver == TMU_VER1) { + regmap_write(qdata->regmap, REGS_TMR, TMR_ME | TMR_ALPF | sites); + } else { + regmap_write(qdata->regmap, REGS_V2_TMSR, sites); + regmap_write(qdata->regmap, REGS_TMR, TMR_ME | TMR_ALPF_V2); + } } return 0; From patchwork Tue May 16 08:37:46 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Peng Fan \(OSS\)" X-Patchwork-Id: 682830 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 11A9AC77B7A for ; Tue, 16 May 2023 08:33:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231329AbjEPIdZ (ORCPT ); Tue, 16 May 2023 04:33:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51656 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231515AbjEPIdU (ORCPT ); Tue, 16 May 2023 04:33:20 -0400 Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-db5eur01on2075.outbound.protection.outlook.com [40.107.15.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6005E5257; Tue, 16 May 2023 01:33:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DPQ9dY8uo+x7nMNkLt2wERn5lU+ZE08YQyKfrxKoVLVVcLM8DeEJtVrtqFWRp7BUxL2T4uP4FEZnF6pv1ITyzL8fzMW+fSTOcKvon0AVMbCeahroScPuIy5EXBJ38zegoULmMvGNuC6vKEHUAYT9SBJDiqerIokFe67akspV0WCbi4n1j5XDuDrdupHRC9YJEt+mt6uPupQ/9tPGydoTNSBuJATgW3OmuOgAOUBMvy4W050RlM+TMbJIxuT6n5I9MXivn+51XaluAzrdA39mC9VERc9UoDlF1pV0NaUN4l0xRuFHPE9twrnQ2u7WUj6qIOs12ZPztvh3WRnW4n64oA== 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=CXmpYfYENdTQaHXkt3X7QJd0fUYmUEb3poP++8q5lfw=; b=lpCStfQD/L41hllDtPri7bfAn5SKOgZh5rxs40CcymT/NN2mbneniCYfKAPztBk2AMtcGP8lq/xQkfrdmIrOb98HYAR4cdApMQfQTlAG1cHhlM1q3V2uYmiKk/erEwn8ZRwd+B0m7EwJfaGz5dWmkI5QkmHi7gTGQGc+EfZRwDzWcmPQFg75t3J7UMGwXCFedi+zMVA4MBA7gDCdv07HlSwtQ4I2PLCc6YEyQkNl7m3LQcGxMqz7qFyqDGM4EiOr5v8eI+uboWzuipG4OmxSOGjsIe1jDIJf5GEMd1MJbUoFohNs7oH+hBxGlIMWGtfyxN/3i+T1EQqdVZ4hGsbHZQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oss.nxp.com; dmarc=pass action=none header.from=oss.nxp.com; dkim=pass header.d=oss.nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=NXP1.onmicrosoft.com; s=selector2-NXP1-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=CXmpYfYENdTQaHXkt3X7QJd0fUYmUEb3poP++8q5lfw=; b=bgq+e2Sj42qazbvv/9bQhFf17kwJUr+smXqHDQSro2GqdDGr2Mdyh2+jF3oMwHYnb3uKKgOHXQAq8/iKcZZMpCrg8aMjWTXYmHW5s3OszMQLLEv2ZBY3Pq8EsVTvWg2a8rWvq+kyQW9HQ1XFYLDQWodb+XsiEf5SgikqeivCZD0= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=oss.nxp.com; Received: from DU0PR04MB9417.eurprd04.prod.outlook.com (2603:10a6:10:358::11) by DBBPR04MB7644.eurprd04.prod.outlook.com (2603:10a6:10:20c::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6387.33; Tue, 16 May 2023 08:33:11 +0000 Received: from DU0PR04MB9417.eurprd04.prod.outlook.com ([fe80::b999:f2c6:a8cc:7b4]) by DU0PR04MB9417.eurprd04.prod.outlook.com ([fe80::b999:f2c6:a8cc:7b4%6]) with mapi id 15.20.6387.030; Tue, 16 May 2023 08:33:11 +0000 From: "Peng Fan (OSS)" To: rafael@kernel.org, daniel.lezcano@linaro.org, shawnguo@kernel.org, s.hauer@pengutronix.de Cc: amitk@kernel.org, rui.zhang@intel.com, andrew.smirnov@gmail.com, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com, linux-arm-kernel@lists.infradead.org, alice.guo@nxp.com, Peng Fan Subject: [PATCH 3/3] thermal: qoriq: support version 2.1 Date: Tue, 16 May 2023 16:37:46 +0800 Message-Id: <20230516083746.63436-4-peng.fan@oss.nxp.com> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20230516083746.63436-1-peng.fan@oss.nxp.com> References: <20230516083746.63436-1-peng.fan@oss.nxp.com> X-ClientProxiedBy: SG2PR03CA0099.apcprd03.prod.outlook.com (2603:1096:4:7c::27) To DU0PR04MB9417.eurprd04.prod.outlook.com (2603:10a6:10:358::11) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DU0PR04MB9417:EE_|DBBPR04MB7644:EE_ X-MS-Office365-Filtering-Correlation-Id: 81b06c07-b0eb-4b27-8024-08db55e82ec1 X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: jJVN3aduUd3UaCD+vMwGr2PV4jEwl7Fpx9Z1CBW812M3V3fZPbdQaTnXk7RYab0AuhZfhpBWnYqSVcwSWMird2nt9ZjTb0wWSby/v8eNBL8Dc6B16jCL3eC+7piEwTmIQD0vy6juyEXsGY1aQ9joJEHraBzmuDHPRuBhECWadO4qW+Uu9ONtw32wsO3GdOR6w7Fxb4aH3MplnNrPKw0L7CDJS/eHGYz9Sd2BMDh9uyJyqIEJNtRT2MGH6T6KxlIRTlqiBk0nxikEGPPB4h0uVtI+OsYL/RHEHA/CgLAtmUNgJbIxuXYNpyD/C3seE2B+uCZnjZzzerCqMBO6rffqrAQl4DJ8pNaopKVVCFPeEftqFK5WmrEEkAmAMhvLqco0faZydDc2Hzt6bVbw778re/U816cf+SFFgBumvdBkBS3JsVBs/y8274Vf/vUF8U79p5OKvV+ilDerOlVplsi4nLD7yVOaNTOBoj2BE7VmkfCcHSeWZuyfIfUQ44qOjO0IIzmzasq4olNhVp1pYwzMJrEcMa72pH2ux3rRf6FKhkGq6KGKbxrmp9f1S6ph3oKkQ2CQqsvhwOxxvBWL2c8T0G+cNbyWd7wmcYK2soQTIHaO+bkE3aY71ItkHhkGb+Ew X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DU0PR04MB9417.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230028)(4636009)(346002)(376002)(396003)(39860400002)(366004)(136003)(451199021)(52116002)(66556008)(66476007)(66946007)(478600001)(4326008)(316002)(86362001)(83380400001)(6506007)(6512007)(1076003)(2616005)(186003)(26005)(6486002)(41300700001)(8936002)(8676002)(5660300002)(7416002)(2906002)(6666004)(38350700002)(38100700002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: aSjUQhVkLhLvubiYrkWPO+M09EEjOVz6oJuZiFcVWi45RF0ZaQvEY0hzCFfR/F/dvkbUEJB5hAmtYIYaINxoZXOFUfNv8CoOb8kdS1vc1gR4cZ9EMHjZm9NcsmcJli5zS6oS5Z5lLXBCgLPcPcwRnQ1KYbT4UpAWMGIhGQHG/xi/aqI14u33i36c+wbsUSnNM2cRbVzzBLxOT3ge8PSPdSHPpu7bFYXYqN4mYC3MVLsMmupzt047Tgaa0Jg+NS0Sjb0ge/G9YGGUlks3TBn2l+LF+rBmIRscM6nc7NMbVIcP9+jUha/zy6SMo5Awg0imsjsjE2GW3wVp6YApX2BEBYNUi5darbH0PggY0DasDB+F3+Pr3ZSJks/ee0Y8Dw3dYfwtO3rQhui2fuWPsqEeSkaGqbjByVLtzidD2sX7fEjbTdbGuhFh7Aio8piycc7x4bhu6+dLeJtJpr/OxLbZ4hYKTcdal1f2uis7kqcsY6bCo7tH4zw5SbdNLoJ8i7PkgzIgkUTtHfrl/m1Pro9okeLanhN/wgH1oEjgO5ed8p8Zwg0i4Fb6P2l2I79THAcE7St4+/062IEnhmhDqsEPwJ4rfhsdEMYHOipGNsEbrWV/g0sSlu0eXEBH3kwh0OIIqi5VLeZoCvKHY9Kn9o++9CVaDu0Of6C5/6Ah/8+CejXPd0VlG1583z9RrNlKGBhYUE3gxsBlQiLokbvOMSQNU3svxz6ut4iZ+YLzM61FqhAYOnqYSw6XNnI+Pn2qfdYxNfE/Dx4bQgz7epWXCzOo8ewnjlcioBIIp1hIQzS18xG03rU7EMA+oAXKToN4nyseu0QSJlK9Tbpz8CipowFpDQ/Pk5bKCJrRrmlbyA+mXbkfqmI3niB97F8N7QuHhd+03UtEog9O/OW7qqJD1axvcKQfifrMxmAUvMcyoKw/kbufB7GxpQZIRMFEdBglZUXCHoeu6Ot5hPLJ6rzJPGjGpEHBdgzcrWVELBtBZRik1D93Kke9Uah96XI6Rne7TQIjPTe8aRxP18SDzs9TiI0Hsu4A1nxguWdnUPTppY/9/aSaJj1LH6+1Yp3CG+zVWhfURA0UiZ2/TfbBAsFevTHC5WbsjvWVc9NfjGGkr+Sdk4ARcpUpe/HXj0VFz8DdFxm4fxtu1ogow2lu8XFJco3KCjdCfhQIxLnzJ2RRaAeOfLm4gcg60CekBqrtVHM5QT1klENTw3GrQZRVgq+dAmH3L/QVK0Zxr1TNnH6lf8p+9ifbnI/oIere+Eyuz6T/1VXkSHRnnL1M10wr/F+mYRlJkjROyVi36iw4ZWEZCmEGrBPErHijYAUiSJU4SnY+0Ch/P4DcTBAHXj/s12PunQm5j6pF0CK7384es6DXGuED7RkNiv1uh6fqY9Dbj9iwtYlOeLfS58EyBmG/fybSxkGKqQUZdd33UHI7aUSkhXczqM6mSLce4g96oxeYp+Cs640/mz/R5vMFtqlRFb+9q4BMlUDor9OPZUJaZ76cGDJW9Ul0AzXW19Qj9yyjMIP1x9LnNeQkH5EsCtdF7kW65XlMUePxw9/EfJ4bbUZ3Fz+Yda1z8ngzqu0/blVWRifO5Y22 X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 81b06c07-b0eb-4b27-8024-08db55e82ec1 X-MS-Exchange-CrossTenant-AuthSource: DU0PR04MB9417.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 May 2023 08:33:11.1063 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: Pb0ZDV0X3DeKTMlfcRpMNUnbyhbJT6lbUhuAGOQJ79V6jvLaGZSQHSZX2DHlWN8yJEuwzdyXBoJPNJ8GpOraOQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR04MB7644 Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org From: Peng Fan i.MX93 use TMU version 2.1, which supports: - TRITSR_TP5(When this field is 1, you must add 0.5 K to the temperature that TEMP reports. For example, if TEMP is 300 K and TP5=1, then the final temperature is 300.5 K.) - Has 16 TTRCR register: Temperature Range Control (TTRCR0 - TTRCR15) This patch is to add this support. Signed-off-by: Peng Fan --- drivers/thermal/qoriq_thermal.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/drivers/thermal/qoriq_thermal.c b/drivers/thermal/qoriq_thermal.c index 53748c4a5be1..c710449b0c50 100644 --- a/drivers/thermal/qoriq_thermal.c +++ b/drivers/thermal/qoriq_thermal.c @@ -50,6 +50,7 @@ * Site Register */ #define TRITSR_V BIT(31) +#define TRITSR_TP5 BIT(9) #define REGS_V2_TMSAR(n) (0x304 + 16 * (n)) /* TMU monitoring * site adjustment register */ @@ -117,10 +118,15 @@ static int tmu_get_temp(struct thermal_zone_device *tz, int *temp) 10 * USEC_PER_MSEC)) return -ENODATA; - if (qdata->ver == TMU_VER1) + if (qdata->ver == TMU_VER1) { *temp = (val & GENMASK(7, 0)) * MILLIDEGREE_PER_DEGREE; - else - *temp = kelvin_to_millicelsius(val & GENMASK(8, 0)); + } else { + if (val & TRITSR_TP5) + *temp = milli_kelvin_to_millicelsius((val & GENMASK(8, 0)) * + MILLIDEGREE_PER_DEGREE + 500); + else + *temp = kelvin_to_millicelsius(val & GENMASK(8, 0)); + } return 0; } @@ -234,7 +240,7 @@ static void qoriq_tmu_init_device(struct qoriq_tmu_data *data) static const struct regmap_range qoriq_yes_ranges[] = { regmap_reg_range(REGS_TMR, REGS_TSCFGR), - regmap_reg_range(REGS_TTRnCR(0), REGS_TTRnCR(3)), + regmap_reg_range(REGS_TTRnCR(0), REGS_TTRnCR(15)), regmap_reg_range(REGS_V2_TEUMR(0), REGS_V2_TEUMR(2)), regmap_reg_range(REGS_V2_TMSAR(0), REGS_V2_TMSAR(15)), regmap_reg_range(REGS_IPBRR(0), REGS_IPBRR(1)),