From patchwork Wed Jun 15 09:47:56 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Francesco Dolcini X-Patchwork-Id: 1643556 Return-Path: X-Original-To: incoming-dt@patchwork.ozlabs.org Delivered-To: patchwork-incoming-dt@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=2620:137:e000::1:20; helo=out1.vger.email; envelope-from=devicetree-owner@vger.kernel.org; receiver=) Received: from out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by bilbo.ozlabs.org (Postfix) with ESMTP id 4LNL963Wkfz9vFp for ; Wed, 15 Jun 2022 19:48:42 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344127AbiFOJsk convert rfc822-to-8bit (ORCPT ); Wed, 15 Jun 2022 05:48:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59580 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347544AbiFOJsV (ORCPT ); Wed, 15 Jun 2022 05:48:21 -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 25A9F46152 for ; Wed, 15 Jun 2022 02:48:19 -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-5Gm0WjbeOoyZIhzSSzAsLg-2; Wed, 15 Jun 2022 11:48:16 +0200 X-MC-Unique: 5Gm0WjbeOoyZIhzSSzAsLg-2 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:13 +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:13 +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 1/9] dt-bindings: thermal: Define trips node in $defs Date: Wed, 15 Jun 2022 11:47:56 +0200 Message-ID: <20220615094804.388280-2-francesco.dolcini@toradex.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220615094804.388280-1-francesco.dolcini@toradex.com> References: <20220615094804.388280-1-francesco.dolcini@toradex.com> X-ClientProxiedBy: MR2P264CA0074.FRAP264.PROD.OUTLOOK.COM (2603:10a6:500:32::14) 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: e798e596-538a-4aab-d844-08da4eb429c1 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: tMmZJDRnqEA8YQQD3RVIsV+v7XqhI2z7FXKjKi1wfdHNZHi4a7bnDX5USXZiPYB6r3iCvaIypNtmnJQlsHFe7YEQt9T6/VPM1RrTWdzPVu3Mz5KBZOb04Cbi3DL07Uv4xwZ1GZUEe4hE64BvODNFuO7OpywKKgR+h3BDUb+FOzgYV+nH4dZVaRUkoI/NKXVVZ0wNOTiu+X+41aJ9w6LuKSF+aA9B7nkWyDwgpwlCDdLyMyfbIiUIkFc85CaKAnUl3BpxCazfLYhtpl9u7tmOaa+xH8RYfOKpj3jMwYOzVimvWQpDiiwh0VZDSv8B4mnHzF0Ra7bD0/BHcYaJh6pYrTDXCUO97/o2x4NkcYDdjW9yOEPfpPTnvygcfrDpDbFTEHuv9RM19q3wzWQZKyICaNH+RnvGzCrDtYYUbCKXTzg3Hf/Rrm4g+SZfYt7NRHIuwlZLkGpZ8mjt5hAy7t8wODkHZUp3PF+/EBKT9PS/xf9zCDm2/S3PDe3kvYpCy5+qIg5ZBiQLrvcfenvdl7HAioac3vjTe9XfwByIdlC1vmV8Z3AQIwZJC4S0TdI9Bc0jpz6oA4T+G0oPLkYFh7PV3PCRXMJm2lgxDWnbOYEmtWDUIvB7j6UKDwVz4P4uoYbYMKgpUADBvGtkbYSGgZMhLtiC2OZaLpa1D08Qom8YtbBdmS0+2ILk/ZKlIG6bWtVsQHY1SIHZ8s/iCXtUsfjqDg== 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)(83380400001)(38100700002)(44832011)(5660300002)(6486002)(186003)(7416002);DIR:OUT;SFP:1102 X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: yIcpw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ytUCoQugzhVNkZBOz7PoxtGLMH+7O2xks599PnHDU88fR5X1/OM1NJqykgQdqdeSpVAmL4nRFMsY/5snk6+qe/99aOXhIBhJy6qDkh781/VYfJQlFUlMAc9ZmUznzy4wabWeRxtGB3xCtUXQtXJ0H9w/6PBodCm5vVURSCbV1k/MU1ktRuCsz72SvVSjrm5qY1EN3vjBN/Qr1XBRJLWr58iElGwrZE/za7nHGvGgGgBjh0yYQMQwi05BMiEpIqzmKr688hViW6w1rrZ2ZPmUpM/cMMacfY3LMPfY1KmrplyzB5PrplrItcF6Ni3UhpVokelEM/vOaROwoE7R153DRk7znBWVqymBS2gldTLqrWEE6BiYhgNkMJXklDt3jjhVTU0pyKBU+Av/jUHQAKt3ysvnBKELDzKVBaVV7sKa4pcg8GmBdM1PmTiUORcHXo+xpQGw8tRO2U1SRIzi5BBek/KMZScDYo1bEopYog5X5pwHkpM++mwk6yZbCm0WYhpSsZJXOXzjEaK3W7HpQ2dfjW8bUtzxHRUbwZMbD2VoNeFpkGClZ3AGvQ70MvGE6GUu9/MmEzI0AHO7O/n52qVERLwhLKLQc+NZsLwZU5wPk/dHGoivkmTEYFh3Y4Iu7tvOE4NDype0gLhgZ+wExvl7pv06+6RzjdLpH5lyetUGpnWkOy1ud/IIBLrENPAx4k= X-OriginatorOrg: toradex.com X-MS-Exchange-CrossTenant-Network-Message-Id: e798e596-538a-4aab-d844-08da4eb429c1 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.9245 (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: ve1LTIvPR5BZTh8K0pD37sbAjTXexppto12E0EMNH2fZtLmX+DrsVMZ++7TMGtswjvge6lOfkJnEo0jPQVcARwZ5wUX8AroHAM8x7YmX/rE= 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 X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: devicetree@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 --- .../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