Received: by 2002:ac0:de83:0:0:0:0:0 with SMTP id b3csp1377977imk; Mon, 4 Jul 2022 01:41:23 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vkSKrQEPeN4BmxhesdPYmYmy9AI6WGQdqkCgkZ5KGNHfDP6YkEwllrNC49oAp97SseSlGh X-Received: by 2002:a17:906:4ccc:b0:6fe:9155:47ae with SMTP id q12-20020a1709064ccc00b006fe915547aemr26856136ejt.246.1656924082799; Mon, 04 Jul 2022 01:41:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656924082; cv=none; d=google.com; s=arc-20160816; b=XydQvgLZV2ZSpF40TNdKpZv/Wtkb0C8J30VVJHnyTaDyr8RwiGPDS/Bdl3f07LCmlk sPnVn0CQzcR/uoUaCwn6ASkGZeR6O+7Nfy94kJJ2ZRhH3HN+l/rGhDc/eFWnFZLYjSyl yG9uvo88dLrmS8249l+C/KP8DTxsjHzyUVJ67vG3XP0/CSInK9z2JE3MpPWP1QGKI2xh GT14s9/KCa05o18UqI75EkG+63raShj39iRRGBa32qo98ESkO5rLAo01Z1ctHMAa5bUo 5jI7cxyarjxQekPir1dN3z6eN8yBBr/kB3oGXTrfV5arVebqQEeNLZfjxIwuMvPu8du6 D6KA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=oEjzqJSebeNnlMCyi9QI2NsnvSFrxxUkyQZmO4rXCFk=; b=zebZH9gOz12jVA8vthDNg0hRCeLodYFZv99jmwKx2K9VrhJallkp+n66cXN5wgu3c+ lYInT/aUO0u/iFOwtmEPpfPJpHaLaRfvf5EIQlw+7bY0bJfJpX1eOxdsNYHJUZ8K4eV8 slXNXFSubJHGMLN4QxwfvmSWihjVU1LBnzYFNyD9v3aUbWXMS1/BgFtdFEL9GwdxDQMx quCzWOscanVa8+KO0CaJ7Sl1svUlmkzBXejRnPBtF3LdM7Jd5CxkuVHx2jF9JHUFV2kf 6c2H4WQjZsovNeXqmrJ9bozuoae3AY4sSsfuM+CP2sttgCIrwmXWEyu45Ombbhazoufy leDQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i6-20020a1709064fc600b00707ad2d64edsi23434706ejw.98.2022.07.04.01.40.58; Mon, 04 Jul 2022 01:41:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233122AbiGDIgA (ORCPT + 99 others); Mon, 4 Jul 2022 04:36:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42550 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230233AbiGDIgA (ORCPT ); Mon, 4 Jul 2022 04:36:00 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 4DED1B482; Mon, 4 Jul 2022 01:35:59 -0700 (PDT) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 473CC23A; Mon, 4 Jul 2022 01:35:59 -0700 (PDT) Received: from [192.168.33.14] (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 707583F792; Mon, 4 Jul 2022 01:35:57 -0700 (PDT) Message-ID: <5142343f-6792-a358-d049-cbaeb8c07726@arm.com> Date: Mon, 4 Jul 2022 09:35:48 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.1 Subject: Re: [PATCH v3 08/12] thermal/core: Add thermal_trip in thermal_zone Content-Language: en-US To: Daniel Lezcano , daniel.lezcano@linaro.org Cc: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, khilman@baylibre.com, abailon@baylibre.com, Amit Kucheria , Zhang Rui , rafael@kernel.org References: <20220703183059.4133659-1-daniel.lezcano@linexp.org> <20220703183059.4133659-9-daniel.lezcano@linexp.org> From: Lukasz Luba In-Reply-To: <20220703183059.4133659-9-daniel.lezcano@linexp.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham 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: linux-kernel@vger.kernel.org On 7/3/22 19:30, Daniel Lezcano wrote: > The thermal trip points are properties of a thermal zone and the > different sub systems should be able to save them in the thermal zone > structure instead of having their own definition. > > Give the opportunity to the drivers to create a thermal zone with > thermal trips which will be accessible directly from the thermal core > framework. > > Cc: Alexandre Bailon > Cc: Kevin Hilman > Cc; Eduardo Valentin > Signed-off-by: Daniel Lezcano > --- > drivers/thermal/thermal_core.h | 10 ++++++++++ > include/linux/thermal.h | 1 + > 2 files changed, 11 insertions(+) > > diff --git a/drivers/thermal/thermal_core.h b/drivers/thermal/thermal_core.h > index c991bb290512..84e341c1e0fc 100644 > --- a/drivers/thermal/thermal_core.h > +++ b/drivers/thermal/thermal_core.h > @@ -113,6 +113,16 @@ int thermal_build_list_of_policies(char *buf); > /* Helpers */ > void thermal_zone_set_trips(struct thermal_zone_device *tz); > > +static inline struct thermal_trip *thermal_zone_get_trips(struct thermal_zone *tz) > +{ > + return tz->trips; > +} > + > +static inline int thermal_zone_get_ntrips(struct thermal_zone *tz) > +{ > + return tz->ntrips; 'num_trips' ? > +} > + > /* sysfs I/F */ > int thermal_zone_create_device_groups(struct thermal_zone_device *, int); > void thermal_zone_destroy_device_groups(struct thermal_zone_device *); > diff --git a/include/linux/thermal.h b/include/linux/thermal.h > index 3a57878a2a6c..3733e23b6359 100644 > --- a/include/linux/thermal.h > +++ b/include/linux/thermal.h Missing doc comment new line for this new field. > @@ -179,6 +179,7 @@ struct thermal_zone_device { > struct thermal_zone_device_ops *ops; > struct thermal_zone_params *tzp; > struct thermal_governor *governor; > + struct thermal_trip *trips; I would group together two lines: struct thermal_trip *trips; int num_trips; > void *governor_data; > struct list_head thermal_instances; > struct ida ida;