Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp1087431rwd; Thu, 25 May 2023 07:55:10 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5DAnLEVM9vulJf+JfuWo6XYxsif2XcA97vGHnd0W23NXlazMcL0fJR7qweLf8zk6LaaGl3 X-Received: by 2002:a17:902:a386:b0:1a6:b23c:3bf2 with SMTP id x6-20020a170902a38600b001a6b23c3bf2mr2052679pla.10.1685026510303; Thu, 25 May 2023 07:55:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685026510; cv=none; d=google.com; s=arc-20160816; b=spmjzydfHOw/RrvW8GWKfnwOVtLXPhewzgJCjfpLx5UrNNILfgVqxlD6crmqqr30BL cBHEEK4QN3NqedwU3y9nWMJZKOlNsuNX3McTUpT8DMR8f66I8iJHQFtnNw3Kr1GnpFk/ QWn4AX37s4so2KdP+PIO9uof1ALEyz6rpWOW9lloi4stsMLK7kEyg0/m51oDx1O9Y/JY Z6hOOJZjo/T74TOfjO/BRcK7FCJyacfHjI4N6iwvqPG5QzL1PM0WeJn4BCZ3VoNsmnNT SuEE8/q9oEYJtp8VS0QCfRLVXFTNkRaqm6XWATHCRdK95sXqFqZGAzePQw9Ig+aTzR8b Orhw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=xlMjiYWjIod1M5ysecwWR9Zw02vJku0YSHje4x3URRI=; b=D3HQRaS7z0l6jj/43Kp5ldGDg+zJPkjw/EPdni2Dy/3uhAbUqiQNi8KOjwma2B8Ayn 56SfJVavJB6F26tV7u0xLGEkDcKFT44PUTNWHfBQTXWVUY04FUohu6PC8/QADmmMLp7l TwQYKgg3D2r0p5E2qwvfOcehyHS4zpHj3uG67W2L0Sp/+MeKqsbrjvY7dbr9EwQhPy5n 3uB2jbs4vGclowlNLQE7LtiRrKxzKMB3avUJYSq7lvABpDS749wHPFrofK7kzz8eAnPb 4t67nrS1O1EG+KD/5yNzz7K4ZLim9sSVhiAML+ePpCIFKlKHzgkP4pGDi+3CkZO1zy0k wWxg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=w1RsQ+st; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x5-20020a1709028ec500b001a6ee332903si1487000plo.347.2023.05.25.07.54.56; Thu, 25 May 2023 07:55:10 -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; dkim=pass header.i=@linaro.org header.s=google header.b=w1RsQ+st; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241537AbjEYODA (ORCPT + 99 others); Thu, 25 May 2023 10:03:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42196 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241531AbjEYOCs (ORCPT ); Thu, 25 May 2023 10:02:48 -0400 Received: from mail-wr1-x431.google.com (mail-wr1-x431.google.com [IPv6:2a00:1450:4864:20::431]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E942E1B0 for ; Thu, 25 May 2023 07:02:18 -0700 (PDT) Received: by mail-wr1-x431.google.com with SMTP id ffacd0b85a97d-30a95ec7744so2115259f8f.3 for ; Thu, 25 May 2023 07:02:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1685023331; x=1687615331; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=xlMjiYWjIod1M5ysecwWR9Zw02vJku0YSHje4x3URRI=; b=w1RsQ+stlMrNo0+vFPex2i/zi2qhFPU+CG+4wI4u4KpQiT7VBQ6e3KEg8o5ksT22h5 2rWiRy33QN4BFcZxdsBLNxdSk0xC4y6NjDXQYitf8YgGuLluXosBbSmIKQA8ph9Fl45R oTIPz/Od566ZvOtUFKDcJn3tBUsIjj6LxWHBEYAwkJfh8sVd2xc0lRvTwoMYDLgSw5XN uSlV7pXP3ezzS56NM2yclfL5Q+71pi3xDuWsMCLCDcHsq2ZtebcR4QGrsWcoLm6nNVqa S8+V+FKrddJIkmwQVwgEnPYxzRJWSz6xCRwKMnpi56Ip1M6a6Z2WWNs+9jb2S9wG/83c aBJg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685023331; x=1687615331; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=xlMjiYWjIod1M5ysecwWR9Zw02vJku0YSHje4x3URRI=; b=AJ+cr6et718rPdnqMo2et/McXnSVe3Mo14kk3CQMDTd3jW8yWSfgIAuSQEBdfpdG5q ZzA8j/UbnhXUqI1MsyM4P1In8uAifqmdbi9hc4OB2v0O2GN/uQofy0hEhBtHKps2EVF3 Yic+3lDqz31z4rIsWoJgQdftbtJOQH+AZFcQdah7mc/IE2JDR2Lh9zgWUSNxUnnXxapA tV2owLY3+42YZFdzqDlcus6j0FX+BlZMt0Vxz9t7O7BVdd3fh6HbTe1m+rhEHX+nnKN/ B/7GOzt8Ws68pT3p5XqRMp1MhpNEMiXUw36rL7Rp25Tgi7LNM3/cZoMk40lwkdP/s1hp 3T+w== X-Gm-Message-State: AC+VfDwWdj3JgcabllYO2tLCfsdR4mIeWlYEXkIQHn+krwLaSlbaRaoe N75J6UoMEAnCpKIOvZTV+WtKvA== X-Received: by 2002:adf:f348:0:b0:306:3381:67fe with SMTP id e8-20020adff348000000b00306338167femr2737955wrp.27.1685023331567; Thu, 25 May 2023 07:02:11 -0700 (PDT) Received: from mai.box.freepro.com ([2a05:6e02:1041:c10:5aef:8608:89d7:7961]) by smtp.gmail.com with ESMTPSA id u4-20020adfdd44000000b003063176ef09sm1944866wrm.6.2023.05.25.07.02.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 May 2023 07:02:11 -0700 (PDT) From: Daniel Lezcano To: daniel.lezcano@linaro.org, rafael@kernel.org Cc: linux-pm@vger.kernel.org, thierry.reding@gmail.com, Amit Kucheria , Zhang Rui , linux-kernel@vger.kernel.org (open list) Subject: [PATCH 8/8] thermal/core: Move the thermal zone structure to the private core header Date: Thu, 25 May 2023 16:01:35 +0200 Message-Id: <20230525140135.3589917-9-daniel.lezcano@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230525140135.3589917-1-daniel.lezcano@linaro.org> References: <20230525140135.3589917-1-daniel.lezcano@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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 The code in the different drivers have been sanitized and they no longer access the thermal zone structure internals. This one is just a pointer passed around to the thermal core code as a handler. Move the structure definition to the private core code header to self-encapsulate the core code. No functional changes intented. Signed-off-by: Daniel Lezcano --- drivers/thermal/thermal_core.h | 75 ++++++++++++++++++++++++++++++++++ include/linux/thermal.h | 75 ---------------------------------- 2 files changed, 75 insertions(+), 75 deletions(-) diff --git a/drivers/thermal/thermal_core.h b/drivers/thermal/thermal_core.h index c27a9930f904..b93386640799 100644 --- a/drivers/thermal/thermal_core.h +++ b/drivers/thermal/thermal_core.h @@ -18,6 +18,81 @@ #warning This header can only be included by the thermal core code #endif +/** + * struct thermal_zone_device - structure for a thermal zone + * @id: unique id number for each thermal zone + * @type: the thermal zone device type + * @device: &struct device for this thermal zone + * @trip_temp_attrs: attributes for trip points for sysfs: trip temperature + * @trip_type_attrs: attributes for trip points for sysfs: trip type + * @trip_hyst_attrs: attributes for trip points for sysfs: trip hysteresis + * @mode: current mode of this thermal zone + * @devdata: private pointer for device private data + * @trips: an array of struct thermal_trip + * @num_trips: number of trip points the thermal zone supports + * @trips_disabled; bitmap for disabled trips + * @passive_delay_jiffies: number of jiffies to wait between polls when + * performing passive cooling. + * @polling_delay_jiffies: number of jiffies to wait between polls when + * checking whether trip points have been crossed (0 for + * interrupt driven systems) + * @temperature: current temperature. This is only for core code, + * drivers should use thermal_zone_get_temp() to get the + * current temperature + * @last_temperature: previous temperature read + * @emul_temperature: emulated temperature when using CONFIG_THERMAL_EMULATION + * @passive: 1 if you've crossed a passive trip point, 0 otherwise. + * @prev_low_trip: the low current temperature if you've crossed a passive + trip point. + * @prev_high_trip: the above current temperature if you've crossed a + passive trip point. + * @need_update: if equals 1, thermal_zone_device_update needs to be invoked. + * @ops: operations this &thermal_zone_device supports + * @tzp: thermal zone parameters + * @governor: pointer to the governor for this thermal zone + * @governor_data: private pointer for governor data + * @thermal_instances: list of &struct thermal_instance of this thermal zone + * @ida: &struct ida to generate unique id for this zone's cooling + * devices + * @lock: lock to protect thermal_instances list + * @node: node in thermal_tz_list (in thermal_core.c) + * @poll_queue: delayed work for polling + * @notify_event: Last notification event + */ +struct thermal_zone_device { + int id; + char type[THERMAL_NAME_LENGTH]; + struct device device; + struct attribute_group trips_attribute_group; + struct thermal_attr *trip_temp_attrs; + struct thermal_attr *trip_type_attrs; + struct thermal_attr *trip_hyst_attrs; + enum thermal_device_mode mode; + void *devdata; + struct thermal_trip *trips; + int num_trips; + unsigned long trips_disabled; /* bitmap for disabled trips */ + unsigned long passive_delay_jiffies; + unsigned long polling_delay_jiffies; + int temperature; + int last_temperature; + int emul_temperature; + int passive; + int prev_low_trip; + int prev_high_trip; + atomic_t need_update; + struct thermal_zone_device_ops *ops; + struct thermal_zone_params *tzp; + struct thermal_governor *governor; + void *governor_data; + struct list_head thermal_instances; + struct ida ida; + struct mutex lock; + struct list_head node; + struct delayed_work poll_queue; + enum thermal_notify_event notify_event; +}; + /* Default Thermal Governor */ #if defined(CONFIG_THERMAL_DEFAULT_GOV_STEP_WISE) #define DEFAULT_THERMAL_GOVERNOR "step_wise" diff --git a/include/linux/thermal.h b/include/linux/thermal.h index 83937256a01c..0ea2da5c33ac 100644 --- a/include/linux/thermal.h +++ b/include/linux/thermal.h @@ -112,81 +112,6 @@ struct thermal_cooling_device { struct list_head node; }; -/** - * struct thermal_zone_device - structure for a thermal zone - * @id: unique id number for each thermal zone - * @type: the thermal zone device type - * @device: &struct device for this thermal zone - * @trip_temp_attrs: attributes for trip points for sysfs: trip temperature - * @trip_type_attrs: attributes for trip points for sysfs: trip type - * @trip_hyst_attrs: attributes for trip points for sysfs: trip hysteresis - * @mode: current mode of this thermal zone - * @devdata: private pointer for device private data - * @trips: an array of struct thermal_trip - * @num_trips: number of trip points the thermal zone supports - * @trips_disabled; bitmap for disabled trips - * @passive_delay_jiffies: number of jiffies to wait between polls when - * performing passive cooling. - * @polling_delay_jiffies: number of jiffies to wait between polls when - * checking whether trip points have been crossed (0 for - * interrupt driven systems) - * @temperature: current temperature. This is only for core code, - * drivers should use thermal_zone_get_temp() to get the - * current temperature - * @last_temperature: previous temperature read - * @emul_temperature: emulated temperature when using CONFIG_THERMAL_EMULATION - * @passive: 1 if you've crossed a passive trip point, 0 otherwise. - * @prev_low_trip: the low current temperature if you've crossed a passive - trip point. - * @prev_high_trip: the above current temperature if you've crossed a - passive trip point. - * @need_update: if equals 1, thermal_zone_device_update needs to be invoked. - * @ops: operations this &thermal_zone_device supports - * @tzp: thermal zone parameters - * @governor: pointer to the governor for this thermal zone - * @governor_data: private pointer for governor data - * @thermal_instances: list of &struct thermal_instance of this thermal zone - * @ida: &struct ida to generate unique id for this zone's cooling - * devices - * @lock: lock to protect thermal_instances list - * @node: node in thermal_tz_list (in thermal_core.c) - * @poll_queue: delayed work for polling - * @notify_event: Last notification event - */ -struct thermal_zone_device { - int id; - char type[THERMAL_NAME_LENGTH]; - struct device device; - struct attribute_group trips_attribute_group; - struct thermal_attr *trip_temp_attrs; - struct thermal_attr *trip_type_attrs; - struct thermal_attr *trip_hyst_attrs; - enum thermal_device_mode mode; - void *devdata; - struct thermal_trip *trips; - int num_trips; - unsigned long trips_disabled; /* bitmap for disabled trips */ - unsigned long passive_delay_jiffies; - unsigned long polling_delay_jiffies; - int temperature; - int last_temperature; - int emul_temperature; - int passive; - int prev_low_trip; - int prev_high_trip; - atomic_t need_update; - struct thermal_zone_device_ops *ops; - struct thermal_zone_params *tzp; - struct thermal_governor *governor; - void *governor_data; - struct list_head thermal_instances; - struct ida ida; - struct mutex lock; - struct list_head node; - struct delayed_work poll_queue; - enum thermal_notify_event notify_event; -}; - /** * struct thermal_governor - structure that holds thermal governor information * @name: name of the governor -- 2.34.1