From patchwork Fri Jun 17 07:14:03 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Francesco Dolcini X-Patchwork-Id: 12885177 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 193F4C433EF for ; Fri, 17 Jun 2022 07:19:04 +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=PRGPfAAbHAhEA8mU/OuAKmU7OvLt+/mtVnUJfJ/0VgQ=; b=RT5s48E8wUYtve XVpGUfqGIM/Xvy9sA+9LjiTVgDAOttHZOLpT1eIpFA2Q8AdeO62+Axl5SuGdg/ijsJ+5PBDlUg+Z6 BMLxD7l1NnR3Y6A/mtgGx2TSbxZ3BUt+nvJejYMzOYT0dTrcu1+O8dmI2kstVjdR4vmM/Sefy3l2o b7u9njR5SHmEAVky2nUOmdXEJ0J6rfgEJy5pU2jPPyG/oYCBrAp5uj11hmrHR2sXIxS2QqxF3qAWH Fpebzac/OnHQyBHXED+agfTeaKKLsBLauULrSLm/9Um+NfQyB29MxEkUWOtwC7k9RZTZOeTc5yTj/ HUikGtv+VCaVDKe57oNg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1o26Eb-005tz5-Ig; Fri, 17 Jun 2022 07:17:38 +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 1o26BQ-005sar-C0 for linux-arm-kernel@lists.infradead.org; Fri, 17 Jun 2022 07:14:23 +0000 Received: from CHE01-ZR0-obe.outbound.protection.outlook.com (mail-zr0che01lp2112.outbound.protection.outlook.com [104.47.22.112]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id de-mta-11-vtkNLl0MNjWlE6NYCSBtCw-2; Fri, 17 Jun 2022 09:14:17 +0200 X-MC-Unique: vtkNLl0MNjWlE6NYCSBtCw-2 Received: from ZRAP278MB0495.CHEP278.PROD.OUTLOOK.COM (2603:10a6:910:2e::8) by GVAP278MB0438.CHEP278.PROD.OUTLOOK.COM (2603:10a6:710:3e::6) 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:14:14 +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:14:14 +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: [RESEND PATCH v2 1/9] dt-bindings: thermal: Define trips node in $defs Date: Fri, 17 Jun 2022 09:14:03 +0200 Message-ID: <20220617071411.187542-2-francesco.dolcini@toradex.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220617071411.187542-1-francesco.dolcini@toradex.com> References: <20220617071411.187542-1-francesco.dolcini@toradex.com> X-ClientProxiedBy: MR1P264CA0168.FRAP264.PROD.OUTLOOK.COM (2603:10a6:501:55::16) 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: a6310d4b-ea5b-484d-2608-08da5030fb95 X-MS-TrafficTypeDiagnostic: GVAP278MB0438: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: GEh68tqCZjv/A5tLd9S2V345v+Qu+jQmHP90H12m38Qwv3FUkEuBq4GM0+/8ycRbAqCPLTd54w4tIABs9NkktEvLky7T8tQg5EmNJ0VmTTaK3e+QDlUan1rXRvnyQk2+hrvarS72h0GqMF5thw8RJlGu7/EqemHFdcRdAFSgHyskGA8s0LKpuHXVVjGeRLVrNVrdia5to7E8KUyEK8yORZbB5EOjQRlJdIRleWp07A1QWcAhOCybnfgWVJlDH4Hrg4/Qt6KaXTLlWsRWoG9bDvpG181jogx6C5YvYIwAJziPJdzcC8QobFkjIE3pnhTwvnfBy0dbIgBGJmpNglR/tGQJPJQjZZxVCO0v3etSNI9ztWE68c11gkyEafGm/KIQcb32MpNGx76/FQvibKWMBRnoDAaOVLpcacMUQ2pqRKBQrUUluuYv2RjAQCSdVslFCUGSt1+/zZpsAYFv5GddgwxssavEcDXbQVDYhh+S4Ppuc2c41GxXngPokQqPY9N2a/HVZxv5cTgad2GKSls0JdLtjBwZx7tjFKkcaAIWU69UwYUxDjIpsoenH19uI7yPUzpiKLU3ZltEocRKS60YP+buQezfviIvDHw40CA1jYkqcsIpFGfe7NuWhBQCEfYRlimXUv8SsVoqkCVcGcebmwSntFyBYvsFQdwyUdfaNzKmd7b0DWYmVOeY3npNSoXW0FHVjtQjZgAT+f3j2i42Bw== 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)(396003)(366004)(136003)(39850400004)(346002)(52116002)(38100700002)(38350700002)(6506007)(2906002)(8676002)(8936002)(6666004)(6486002)(316002)(66946007)(86362001)(7416002)(508600001)(5660300002)(44832011)(83380400001)(110136005)(41300700001)(2616005)(26005)(6512007)(36756003)(66556008)(54906003)(4326008)(66476007)(186003)(1076003);DIR:OUT;SFP:1102 X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: u2i6Et2EgTj1S8/WtUZoDD3lyR+eLgORnjJ+j+dY4E9Q1GXFv2AGt5QjqCqoKZEVHh4qUCe9p6K3zfw0nzWr3xmD+hSP8bxo1NbWU4BrqYOckwoRfjN04tJu/mqPfwhToMGnNSHy4cz121xAryJ9+ZvAiCHBJhEkpz1h6qzxkFnlrn2VJDtxunUH5xDjEvFSXbUMcFR9v631Qo7VcJ2a6bfqnD5RLI/XXjbmowgqjfQxjyjLr5iBpSF3ix3I4waQrS2vQOGhaPZlQdRu174dwJq0EB0tX8Z0XUFUeNdFBMhYS3fthpz+6ho7rzZwsoBXjo+jBr+fm0r/qP5wh0OSnkh9uY3MU5sCO3AmrHoz/VmuD+uLf+ZSr8zqZhO2qZwjIpLGV86G/Twy56+7J5OiprcizSVUEllM5FE3DERLMHp0P4MXySk9XvzDj3oJOI4qatHZ/UsOGJWlkqES3i/2Q4HLToNh1Yw+qCbJWAjsTYesjk5mMGSF/iN3QDJ7TheSEm3ik2BZJXfVq9VVMuAVNb3EKQCaiqw4qHFgnnYwUJ0B0rjRvVDfp4LOeax2QRyGxA/NKnivOm5qY/HYKXWyXHMCo4fXCQsEb+34RM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qk0rN+eUzL5dTmA5psPRIRaQl+w1dYEab/5MMsjsdQsg7ioCq7TmwFiO5T4NtIVv56HyoY= X-OriginatorOrg: toradex.com X-MS-Exchange-CrossTenant-Network-Message-Id: a6310d4b-ea5b-484d-2608-08da5030fb95 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:14:13.6948 (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: WLNgkCT6eXpwBoZsQ8zSmmE5Z6bhl4tRxJLCbV7/EgegYwy9YPuR43HLGHdJVRwDeu25f+UC/fO9JNp2jiPefrTf18Z2IMr/Sr055zHmmfw= X-MS-Exchange-Transport-CrossTenantHeadersStamped: GVAP278MB0438 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-20220617_001420_737303_F2AC07FE X-CRM114-Status: GOOD ( 14.49 ) 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 --- 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