From patchwork Fri Jun 17 07:08:39 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Francesco Dolcini X-Patchwork-Id: 12885145 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 14492C43334 for ; Fri, 17 Jun 2022 07:09:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1380520AbiFQHJZ convert rfc822-to-8bit (ORCPT ); Fri, 17 Jun 2022 03:09:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46446 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1380512AbiFQHJI (ORCPT ); Fri, 17 Jun 2022 03:09:08 -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 1CFD864BC5 for ; Fri, 17 Jun 2022 00:09:00 -0700 (PDT) Received: from CHE01-GV0-obe.outbound.protection.outlook.com (mail-gv0che01lp2043.outbound.protection.outlook.com [104.47.22.43]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id de-mta-31-6SI1p9w7M8KLL0ipN7mrjQ-2; Fri, 17 Jun 2022 09:08:57 +0200 X-MC-Unique: 6SI1p9w7M8KLL0ipN7mrjQ-2 Received: from ZRAP278MB0495.CHEP278.PROD.OUTLOOK.COM (2603:10a6:910:2e::8) by GVAP278MB0263.CHEP278.PROD.OUTLOOK.COM (2603:10a6:710:3d::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5353.15; Fri, 17 Jun 2022 07:08:51 +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.016; Fri, 17 Jun 2022 07:08:51 +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 v2 1/9] dt-bindings: thermal: Define trips node in $defs Date: Fri, 17 Jun 2022 09:08:39 +0200 Message-ID: <20220617070847.186876-2-francesco.dolcini@toradex.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220617070847.186876-1-francesco.dolcini@toradex.com> References: <20220617070847.186876-1-francesco.dolcini@toradex.com> X-ClientProxiedBy: MR2P264CA0116.FRAP264.PROD.OUTLOOK.COM (2603:10a6:500:33::32) 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: a4f854aa-8c9c-4739-4e89-08da50303b31 X-MS-TrafficTypeDiagnostic: GVAP278MB0263: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: me1WG8aupkuS4f0WTnZYCMt5nnsDDuphqKiR8z2/wj8yXJuj+ggGLXg+m/wNDrWotSrOG09Q75Z3FZElH1BrhCugYKj06ShCOojhwqxl3dWWRaQY0cDSixLQSMPbJd5R4IbvqROV4rDf+qlrYg+TQPOq79V6x/Rt7XbDfy1lG0Jsy0ygu1pnpkwN/jOFTfxz++e81M/qzQ3S/FDcwEG9ccAYyx/Tsm++ehk42M7emw4LCzcRYYMoY+/jHT3E47DBdvGYl25ZZwRwN3BGYFwNiKp0BOZZ2fmLKevvXMg/uwZ7XIEQH4WbLCYI6cVKeefxSyju7wIqm9U2Qf6IRAwlu/vkoQtB2dhcUOJuUr8cUVD/dLg+W6lSTAuX1OSBTSKfgA/MmcgVw9+xWWN1EDYKNDgrAC9yt9jZuEgXT025iWo0exJjJBA8cBYe+CYX14AvijdJfDve3y4s0NhhBOU4xbSB4atd2U9CJ2P7xzhcHAlydAZtp4C1cG1eQyGPQiPsCT2oxQzd6l2zwLqjKcKEgP024uzunNuKIFop61/gZG5tdx7FQaQSja8ZKUqFN0Of+KlXfZUdZKbdyOJeVt6fro8wa00g6Pf3p7Su6+f1i0KICgHagD1xs8qZM13G207MU/mWMFP+wnA0PYnUF5BW5qJd3c/5LnIJ0WhNs/rKOAeVCrzZ8rFQPSsKO8HEdVoJieZYkGIgVSXEPox159jHDA== 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)(39840400004)(346002)(136003)(396003)(366004)(38100700002)(6506007)(52116002)(8936002)(6666004)(6512007)(6486002)(26005)(83380400001)(2906002)(110136005)(5660300002)(54906003)(316002)(36756003)(86362001)(1076003)(2616005)(41300700001)(66556008)(4326008)(44832011)(8676002)(186003)(66476007)(38350700002)(508600001)(66946007)(7416002);DIR:OUT;SFP:1102 X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: aQsLJcqqGeE+NcY9eBMYg3MD5mta17lfoAFuwUE7Rea/GaZTJL8ObbUVeHF3s058/oYPZLW+t+JzQ0XMPk5OHDA+1t7/c+L6JGjmcVYtjYJod2bkwBAEpsm7sfidw8QsuSxfrT16dN3NoLCZj9p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9yMhkaIGk2uaeFGHFNheCPEH9MoLunMboJkib8kQT4e+2/fLxhw4yxE6n4phYE1E8sM+vqf+uFweFhZq+Lg2P2tMZseD4DCKyiJG2wzFYu3atEm7bg3kMVItKNSokAY5OfXA++Yrdo9f3lUgqJCg4qOA64vffJF3sGnGGmWO186u0UQmglHa3m5O17jtIg5myZ9DVDUY3eeG21bZcvNYHyThaZg/Haf1QeASjzthXs0R44n3iSKWMz4QXUTpP3qJnwBkbyLdVZfk7o7IuAkUrCOFhvdMTG+7RQ3Zq+88wr+r03xaKCEaXSyDa/CoqCMOIubOyHpZ4OrMI40BNnv3U0aKNcV+HxweIJDK5z8TVXNt4RlNxs1cthLdviUk2ulIap1BvURpVYKWDeZA6tlNNlAkNOwUjvn6HU1dJ+LkR+gZHQX5QRZVSY+wTK7DMzFqru32eTIY+s2fhaHea3xS/stR/2shRXvhlu5mhIklMqgvzZgi/mYHJ9iU6OYPxgncDvGMRsAuUM5iv/7Y8WG+umMcoY8LVJ/0AIMGuHQ= X-OriginatorOrg: toradex.com X-MS-Exchange-CrossTenant-Network-Message-Id: a4f854aa-8c9c-4739-4e89-08da50303b31 X-MS-Exchange-CrossTenant-AuthSource: ZRAP278MB0495.CHEP278.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Jun 2022 07:08:50.9491 (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: yx6oFfSHoC0w4azkdFDZJ+Ib7UG2qZmNzT3b5Z9NGIiMC9SlvcfA99CvRFqoBljXRI/cm5oYiCbzxlUAPbEhYu/2jdyDVuP521PxKm/XScE= X-MS-Exchange-Transport-CrossTenantHeadersStamped: GVAP278MB0263 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: toradex.com Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org Move `trips` definition to `#/$defs/trips-base` and just reference it from the trips node. This allows to easily re-use this binding from another binding file. No functional changes expected. Signed-off-by: Francesco Dolcini --- v2: no changes --- .../bindings/thermal/thermal-zones.yaml | 130 +++++++++--------- 1 file changed, 67 insertions(+), 63 deletions(-) diff --git a/Documentation/devicetree/bindings/thermal/thermal-zones.yaml b/Documentation/devicetree/bindings/thermal/thermal-zones.yaml index 2d34f3ccb257..ba84233d20b7 100644 --- a/Documentation/devicetree/bindings/thermal/thermal-zones.yaml +++ b/Documentation/devicetree/bindings/thermal/thermal-zones.yaml @@ -10,6 +10,72 @@ title: Thermal zone binding maintainers: - Amit Kucheria +$defs: + trips-base: + type: object + description: + This node describes a set of points in the temperature domain at + which the thermal framework needs to take action. The actions to + be taken are defined in another node called cooling-maps. + + patternProperties: + "^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$": + type: object + + properties: + temperature: + $ref: /schemas/types.yaml#/definitions/int32 + minimum: -273000 + maximum: 200000 + description: + An integer expressing the trip temperature in millicelsius. + + hysteresis: + $ref: /schemas/types.yaml#/definitions/uint32 + description: + An unsigned integer expressing the hysteresis delta with + respect to the trip temperature property above, also in + millicelsius. Any cooling action initiated by the framework is + maintained until the temperature falls below + (trip temperature - hysteresis). This potentially prevents a + situation where the trip gets constantly triggered soon after + cooling action is removed. + + type: + $ref: /schemas/types.yaml#/definitions/string + enum: + - active # enable active cooling e.g. fans + - passive # enable passive cooling e.g. throttling cpu + - hot # send notification to driver + - critical # send notification to driver, trigger shutdown + description: | + There are four valid trip types: active, passive, hot, + critical. + + The critical trip type is used to set the maximum + temperature threshold above which the HW becomes + unstable and underlying firmware might even trigger a + reboot. Hitting the critical threshold triggers a system + shutdown. + + The hot trip type can be used to send a notification to + the thermal driver (if a .notify callback is registered). + The action to be taken is left to the driver. + + The passive trip type can be used to slow down HW e.g. run + the CPU, GPU, bus at a lower frequency. + + The active trip type can be used to control other HW to + help in cooling e.g. fans can be sped up or slowed down + + required: + - temperature + - hysteresis + - type + additionalProperties: false + + additionalProperties: false + description: | Thermal management is achieved in devicetree by describing the sensor hardware and the software abstraction of cooling devices and thermal zones required to @@ -105,69 +171,7 @@ patternProperties: 10-inch tablet is around 4500mW. trips: - type: object - description: - This node describes a set of points in the temperature domain at - which the thermal framework needs to take action. The actions to - be taken are defined in another node called cooling-maps. - - patternProperties: - "^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$": - type: object - - properties: - temperature: - $ref: /schemas/types.yaml#/definitions/int32 - minimum: -273000 - maximum: 200000 - description: - An integer expressing the trip temperature in millicelsius. - - hysteresis: - $ref: /schemas/types.yaml#/definitions/uint32 - description: - An unsigned integer expressing the hysteresis delta with - respect to the trip temperature property above, also in - millicelsius. Any cooling action initiated by the framework is - maintained until the temperature falls below - (trip temperature - hysteresis). This potentially prevents a - situation where the trip gets constantly triggered soon after - cooling action is removed. - - type: - $ref: /schemas/types.yaml#/definitions/string - enum: - - active # enable active cooling e.g. fans - - passive # enable passive cooling e.g. throttling cpu - - hot # send notification to driver - - critical # send notification to driver, trigger shutdown - description: | - There are four valid trip types: active, passive, hot, - critical. - - The critical trip type is used to set the maximum - temperature threshold above which the HW becomes - unstable and underlying firmware might even trigger a - reboot. Hitting the critical threshold triggers a system - shutdown. - - The hot trip type can be used to send a notification to - the thermal driver (if a .notify callback is registered). - The action to be taken is left to the driver. - - The passive trip type can be used to slow down HW e.g. run - the CPU, GPU, bus at a lower frequency. - - The active trip type can be used to control other HW to - help in cooling e.g. fans can be sped up or slowed down - - required: - - temperature - - hysteresis - - type - additionalProperties: false - - additionalProperties: false + $ref: "#/$defs/trips-base" cooling-maps: type: object