From patchwork Wed Jun 15 09:47:55 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Francesco Dolcini X-Patchwork-Id: 582161 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 6B453C433EF for ; Wed, 15 Jun 2022 09:48:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347754AbiFOJsi convert rfc822-to-8bit (ORCPT ); Wed, 15 Jun 2022 05:48:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59550 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243327AbiFOJsT (ORCPT ); Wed, 15 Jun 2022 05:48:19 -0400 Received: from de-smtp-delivery-113.mimecast.com (de-smtp-delivery-113.mimecast.com [194.104.109.113]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 0C79B46C81 for ; Wed, 15 Jun 2022 02:48:17 -0700 (PDT) Received: from CHE01-GV0-obe.outbound.protection.outlook.com (mail-gv0che01lp2047.outbound.protection.outlook.com [104.47.22.47]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id de-mta-23-RqphdaogNVWFegoWSJIB5A-1; Wed, 15 Jun 2022 11:48:14 +0200 X-MC-Unique: RqphdaogNVWFegoWSJIB5A-1 Received: from ZRAP278MB0495.CHEP278.PROD.OUTLOOK.COM (2603:10a6:910:2e::8) by GVAP278MB0392.CHEP278.PROD.OUTLOOK.COM (2603:10a6:710:3d::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5332.13; Wed, 15 Jun 2022 09:48:12 +0000 Received: from ZRAP278MB0495.CHEP278.PROD.OUTLOOK.COM ([fe80::2879:acb:62c8:4987]) by ZRAP278MB0495.CHEP278.PROD.OUTLOOK.COM ([fe80::2879:acb:62c8:4987%8]) with mapi id 15.20.5353.013; Wed, 15 Jun 2022 09:48:12 +0000 From: Francesco Dolcini To: Daniel Lezcano , Rob Herring , "Rafael J. Wysocki" , Krzysztof Kozlowski , Shawn Guo , Marco Felsch , Anson Huang CC: Francesco Dolcini , Amit Kucheria , Zhang Rui , linux-pm@vger.kernel.org, devicetree@vger.kernel.org, Pengutronix Kernel Team , Sascha Hauer , Fabio Estevam , NXP Linux Team , linux-arm-kernel@lists.infradead.org Subject: [PATCH v1 0/9] imx: thermal: Allow trip point configuration from DT Date: Wed, 15 Jun 2022 11:47:55 +0200 Message-ID: <20220615094804.388280-1-francesco.dolcini@toradex.com> X-Mailer: git-send-email 2.25.1 X-ClientProxiedBy: MR1P264CA0129.FRAP264.PROD.OUTLOOK.COM (2603:10a6:501:51::17) To ZRAP278MB0495.CHEP278.PROD.OUTLOOK.COM (2603:10a6:910:2e::8) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 956e8808-a572-43d0-8ac6-08da4eb429b3 X-MS-TrafficTypeDiagnostic: GVAP278MB0392:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0 X-Microsoft-Antispam-Message-Info: LeyOCdmS0hjhO5dlvpsdY6mQgG7unc5L+vPR0c2T5evyiPV6QJlUcQFvPC/pQj7+Ag4TqX2wPWXDYG8xjVW1lSspUx8RSlzA6UQZg0YpWKFF3V8FKgKxTScJIwOZoAEd7NzOBT5ZxX7AHf5TtEdxnKSeSZgWNRD//A4CS9rRTNecdVA79YSxIyaT/WAFXH/nKAzEka245/ujP0EGNUWvUtdkhQC5sogrP/8NBtdYAFMnsLF+fqkddld740nBIK1Yw+WUj4nOtKfXrYeIlIDf7uCCCIxZgI/KGjdy41hS6/IO3A/UDPm8owMMycUOIwxCFe2CzWEo9NfP491knB3OT99Ca9lqHK77dD1iMCFPQ+NiJHDzDbUh0RTzph0ro1d21z0ko5UfdgXg8WIJH4SAtL5o2BaMV8ra0tgWRjiH7+YFjOPaOP8EMzHfkqtVa+48BFELtPMxt11PTzQIzGg1qQBdoSKqRYUrLwRHUr7/L5l3eA6Rg6Fh9wO1sJqyY5ZElQ2dPHSwbxHK+gLArYPYNd5tIjZh9M8WFmSgKC7rkXLR31T7e6IJeFUV8aHcpgsl5F6FFtDxtfEEcvPyL0ZPcUQw7RMF3OYVuUqOIn6h7e+srCBI7ZygOQk9avO63RpM1yNT9VGcbN3SeR8kzo1O17P7fexiUbtdEVutdMhsdzMla50LA9krpkp3rFK/5UC0nLEUqp5DlyAPgInlimTPj3PUfp/CX+UNASuHifM3eoT0qwm4m8H96FEMjcx5NXSdkx3vonYY1LsKI401iHDTF9RR8V3Pr/Fx5Bq9abyEGMU= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:ZRAP278MB0495.CHEP278.PROD.OUTLOOK.COM; PTR:; CAT:NONE; SFS:(13230016)(4636009)(136003)(396003)(39850400004)(346002)(366004)(1076003)(41300700001)(2616005)(8676002)(110136005)(8936002)(6666004)(316002)(66946007)(508600001)(4326008)(86362001)(66556008)(54906003)(66476007)(26005)(52116002)(6512007)(6506007)(36756003)(2906002)(38350700002)(966005)(83380400001)(38100700002)(44832011)(5660300002)(6486002)(186003)(7416002); DIR:OUT; SFP:1102 X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: Yp2M7ClJ7gJhnB55i8Tk0phArTI5jKrkc66P8hLF7QMqt85HbEEL6kkB7pfIM+51jDykfINqfXUbbUyScwNqf76AZSNdHlehaULGDOOwZQc+jXXHORL3+3KX8YvtgXpxoIWRPbai1Y5XJ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C395omM8zW5QPRbKFcOb1YG7jn44gVeuA3jHjIXpYTJMR3QoMLJ9J59rww7UivlTF9hFQdqECPa9xIkbeMNsZRd1BtQZiL0QTmVGNJbqwSpMiR0Elxps6Ethag0nKc1lE3EijsvKILyBCLSlN/lW3lt9JiiVt9B1W4mCJ6uKFsl2XVt9vd/Sd3RBrDscaGegOyWC3S72Ymb9+roXYFpIYwIzVPNqYRM2zAhbUhbJak/E+VvPIStUCUkkpeOu5sE5zKFEri3yOc509RTcs8HjeueUOlQKYHqgMbxh+AcI+31ZyUgcn9FMOeUDImPjSsjlIQG8FPJojhq0qatWHwnaS/88SRjBY+Zd+HMTaMwbc2xgjx80ZwvAEKDagI4uDg3S2LSOAXUyngOI0nnSEs58tWCVU047GYbHImRQ80uq6tWOkx7ljwDrF89mo/W/exw2NDk44fTLDV8V0zChVpnxAqDBYwbqKwADhoxJMxH7iy1WaEJZA8/ETDbStpZLLzWF84Vi1DuIqenc5kvN9ti4o6cWd/2UwVCpiXLCreI8Q19dEeN/15Qi8k= X-OriginatorOrg: toradex.com X-MS-Exchange-CrossTenant-Network-Message-Id: 956e8808-a572-43d0-8ac6-08da4eb429b3 X-MS-Exchange-CrossTenant-AuthSource: ZRAP278MB0495.CHEP278.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Jun 2022 09:48:12.7995 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: d9995866-0d9b-4251-8315-093f062abab4 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: pmCPKpPz2xYSWHv/gjruDplj3qAxcy3K809om/dp41BSjz8XvNjllsAILyGrSfymmIYJnHC8apr01kuWf0peDUgUkD9PW7fyglieKwbjVYk= X-MS-Exchange-Transport-CrossTenantHeadersStamped: GVAP278MB0392 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CDE13A77 smtp.mailfrom=francesco.dolcini@toradex.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: toradex.com Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org This series allows to specify the imx thermal drivers trip point from the device tree, without this change the threshold are hard-coded and this might not be correct given the thermal design of the final system. This change is backward compatible with the existing device tree, and even with this change in by default the thresholds are the same as before. Toradex board are also updated to use a system-specific thresholds. Discussion on the current design is here: https://lore.kernel.org/all/4ba1d7d2-3e8c-ba60-37fd-9598f415c076@linaro.org/ One side note, after this change the dtbs checker starts complaining with this message ``` linux/arch/arm/boot/dts/imx6dl-alti6p.dtb: tempmon: '#thermal-sensor-cells' does not match any of the regexes: '^(automotive|commercial|extended-commercial|industrial)-thermal$', 'pinctrl-[0-9]+' From schema: linux/Documentation/devicetree/bindings/thermal/imx-thermal.yaml ``` to my understanding this is just a side effect, '#thermal-sensor-cells' is not changed in any way by this series. I can fix that, I wonder if I should remove the property from the imx dtsi files or add it to the binding yaml definition, not sure about it. Anybody can advise? Francesco Dolcini (9): dt-bindings: thermal: Define trips node in $defs thermal: thermal: Export OF trip helper function dt-bindings: thermal: imx: Add trips point imx: thermal: Configure trip point from DT ARM: dts: imx[67]: Add trips points ARM: dts: imx6qdl-apalis: Set CPU critical trip point ARM: dts: imx7-colibri: Set CPU critical trip point ARM: dts: imx6ull-colibri: Set CPU critical trip point ARM: dts: imx6qdl-colibri: Set CPU critical trip point .../bindings/thermal/imx-thermal.yaml | 27 ++++ .../bindings/thermal/thermal-zones.yaml | 130 +++++++++--------- arch/arm/boot/dts/imx-thermal.dtsi | 61 ++++++++ arch/arm/boot/dts/imx6qdl-apalis.dtsi | 12 ++ arch/arm/boot/dts/imx6qdl-colibri.dtsi | 12 ++ arch/arm/boot/dts/imx6qdl.dtsi | 2 + arch/arm/boot/dts/imx6sl.dtsi | 2 + arch/arm/boot/dts/imx6sll.dtsi | 2 + arch/arm/boot/dts/imx6sx.dtsi | 2 + arch/arm/boot/dts/imx6ul.dtsi | 2 + arch/arm/boot/dts/imx6ull-colibri.dtsi | 12 ++ arch/arm/boot/dts/imx7-colibri.dtsi | 12 ++ arch/arm/boot/dts/imx7s.dtsi | 2 + drivers/thermal/imx_thermal.c | 49 +++++++ drivers/thermal/thermal_core.h | 7 + drivers/thermal/thermal_of.c | 5 +- 16 files changed, 274 insertions(+), 65 deletions(-) create mode 100644 arch/arm/boot/dts/imx-thermal.dtsi