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: 12881990 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 4F171C43334 for ; Wed, 15 Jun 2022 09:49:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:CC:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=n8S9S3qtUISEPq33YfKEsZp55qw6R1mlFg204S0aMIc=; b=pdXMRzmLbN0EuL PPJ12CZPsgRoYdWMZk+uN+bbhH82rd632gEUa5lkw84YuUIMKW5b9jIMaBQiAD3hEPrVJi9R3s0DF zyMWTDARBKSULrWSD/aEiDVm7qleCNMTqX8hA44jhnygJbKtIDMV73rVaf7a9YhubTBT35l0J6fKg S9Ci9UXAthEZgLC78JgvBxNv1DmCpFKLD5g2kAH/3vYUaszgZ8NrAkAsbBM6AwZwS07s0wiBvavzS Hy9bpsZU0aR+eq9wj2NnWSMKQ0G6Xn6Z0fZdZrjXoXj696/jCF+HJVHycDhwyOBWmFIMTO0IPYDXs RnewR3yegu9tF6Z4nYKg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1o1PdY-00DYzm-Q6; Wed, 15 Jun 2022 09:48:32 +0000 Received: from de-smtp-delivery-113.mimecast.com ([194.104.109.113]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1o1PdL-00DYvd-Jb for linux-arm-kernel@lists.infradead.org; Wed, 15 Jun 2022 09:48:21 +0000 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: yIcpwDR/OicJxOCOIRtZ2Pv2Y9A1CRJt7vjD0vSjmhmlrbFoXAakU/Vot8FCM57RPpKzX7urjdgKqvg3C08ln6PFn2nYDinw5VwBFDRDrqcD6Zdy0aSNpNfPLBFwXTeNQ++3Wjgbp8Er5Zz/nijX0ZeI9BlLxFbVwH27W653W5Mls3HEHaVCZ3FPEi0h5qkk/712nxGom9M6WzHKchXYA2dqFguKC161cxmh7nX8ExWrfYkocN764yEe/lbsrBUYS4T4kfCvgm4hKqwzdFMLpaAYBAtqdMDxfZAeXe869IIVvOGZcYV81kt8KcK/7NStPlbgCVxgXAZckwk/U5cI0YsPPBqpX6EnO7sLCRFopoHPEGz01EV7JCi75hAnVrZi/ELLgdhYZRrQQb+MC50o6rYsQ3gc7Cs/9vyrijzEy9NxWJY1StZH66e9ywc4TaoZP1fFzXYU4D8sN/NPq0kgcA4v/1cipHjH1CiuTZ7pCY+dFJ6l+UlYLOthKT6mAI1XkQ/w6HOalMv+OhzDB3TGGekm/Pska1T9Mzt8bEnpcxTf6qSnlK6iuPjwAnAg9K1rivIy/SwwcrJ6Cw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LKLQc+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-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220615_024820_004495_A15272A9 X-CRM114-Status: GOOD ( 14.91 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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