From patchwork Thu Dec 21 12:48:00 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AngeloGioacchino Del Regno X-Patchwork-Id: 182183 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:2483:b0:fb:cd0c:d3e with SMTP id q3csp383860dyi; Thu, 21 Dec 2023 04:49:40 -0800 (PST) X-Google-Smtp-Source: AGHT+IGzKQkV4u3S4Gg7bYogvWBeV7dZIOYvDbpeLdDAipmGAJjQ8wUOO1l432u9aVPo96rsy41u X-Received: by 2002:a05:6a21:3286:b0:18f:c339:3fd9 with SMTP id yt6-20020a056a21328600b0018fc3393fd9mr658611pzb.73.1703162980418; Thu, 21 Dec 2023 04:49:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703162980; cv=none; d=google.com; s=arc-20160816; b=DKSxN26lcrCfUa3tJoIWHxQbhBgV2+lvixzJzT0LlhiPLXHCuMp5kZGLBUSV+6CUTX EbmAcbV0c+MZSzcAikCPPEF7b4X6Woxf4sWWtZlL0/kHj4ytnLOohcRtsMctDmkTbCAo 2DNjXyj32QoZ3UrdSAY6WctmnlHzy8fjfmcQKTvX4+Tul60Ncqt2A46TP2DJobDVNyIP r1iErKSlH6JU4QXaXgXvsfZ9v0NT7+EEJ7zmvEEscN9qabkY2MEIXTrPvUEl9wu0bNiP 31HlpJ43pWroUyGejrqxYKgXblYKaW6sWYkkRw0tvz58UlanfXSb8S0Kwy+mOiNxYI8P cEbw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=YZyFFwdcu1o9xTxjmDE9a9tt5jMcjXFBIHVP1HTc3L8=; fh=tj3vwvS1joPqVAqhm025RI9FzN3aC+9rlGGIIVsXGr8=; b=GdKu5zPU5DBCXcU2bSMYgYCdN5V+RtBJPQlcCkiIhZ09uBqrrdPwzk4a/XgnSCjax1 SfLYgtvgF5r3paf2nq/fO6irYshcy8qpDl49DKVZei3iXPsMlhYD2kbHzI19X4p2924S /6WBAkI9tpO1hUR2GmxQ4IY2uNgaUBSBHpLBZCNVAsBjbK96vOb1SCbHJJhHCNg3rArD /ThEzVbZurnRyGu0JDUkM8OI8VInQNybYtx4q2ALGGMuDiG9IGbNwzheUNk+ilBGTmv7 AaZhDjbJm76bgxVE0Vf7xNcIb39TMOQdCGP5vbo1ZgYb7+m4RXS0qRYig9nXb1M+ZH48 Zn8g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=e8l1ENh8; spf=pass (google.com: domain of linux-kernel+bounces-8368-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-8368-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id a20-20020a1709027d9400b001d33c368c1bsi1415139plm.126.2023.12.21.04.49.40 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Dec 2023 04:49:40 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-8368-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=e8l1ENh8; spf=pass (google.com: domain of linux-kernel+bounces-8368-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-8368-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 47E1F283670 for ; Thu, 21 Dec 2023 12:49:24 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id EC73D7608B; Thu, 21 Dec 2023 12:48:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="e8l1ENh8" X-Original-To: linux-kernel@vger.kernel.org Received: from madrid.collaboradmins.com (madrid.collaboradmins.com [46.235.227.194]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C09CF6EB7D; Thu, 21 Dec 2023 12:48:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1703162913; bh=hcDq139jNITXi7r1QTykVkAgtjt/plMZnUyanP1kC/U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=e8l1ENh83KKQ/+FT8K1P+/H6Xa+pRFRhXZr8kTT7IWCG83QKpHY8zyph3lc+rP0ZC 9QpdiUeZ21PyJLZIZ3eqbqM30af5qZUJLOeRaCPCaLHidHrRHYufkw4CeWtyTnneVm ELdd6MwZ132kX9JyLMM5/w8k1PVLJ8Vxrbo99Nzfq58J3rgeWUGrsce5QFi2cUCjUM MpHYEHRUC4vcyZt7qzP8AxHGgzEWm7pfPVyJhpDtb02hjLAhSWTkHVwFwOAL0uRQKp YGAQmg+AxwSdtnKlmpRkOkXF+QzEZW/FCbZ7mba7xBw2nX4JrH6Ydpk5TmXfy0ZUWT 4J0vesx0hvB9w== Received: from IcarusMOD.eternityproject.eu (cola.collaboradmins.com [195.201.22.229]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: kholk11) by madrid.collaboradmins.com (Postfix) with ESMTPSA id 86E773781F84; Thu, 21 Dec 2023 12:48:32 +0000 (UTC) From: AngeloGioacchino Del Regno To: daniel.lezcano@linaro.org Cc: rafael@kernel.org, rui.zhang@intel.com, lukasz.luba@arm.com, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, AngeloGioacchino Del Regno , kernel@collabora.com Subject: [RFC PATCH 01/26] thermal: Introduce thermal_zone_device_register() and params structure Date: Thu, 21 Dec 2023 13:48:00 +0100 Message-ID: <20231221124825.149141-2-angelogioacchino.delregno@collabora.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231221124825.149141-1-angelogioacchino.delregno@collabora.com> References: <20231221124825.149141-1-angelogioacchino.delregno@collabora.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1785895825780372523 X-GMAIL-MSGID: 1785895825780372523 In preparation for extending the thermal zone devices to actually have a name and disambiguation of thermal zone types/names, introduce a new thermal_zone_device_params structure which holds all of the parameters that are necessary to register a thermal zone device, then add a new function thermal_zone_device_register(). The latter takes as parameter the newly introduced structure and is made to eventually replace all usages of the now deprecated function thermal_zone_device_register_with_trips() and of thermal_tripless_zone_device_register(). Signed-off-by: AngeloGioacchino Del Regno --- drivers/thermal/thermal_core.c | 27 +++++++++++++++++++++++++++ include/linux/thermal.h | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 60 insertions(+) diff --git a/drivers/thermal/thermal_core.c b/drivers/thermal/thermal_core.c index e5434cdbf23b..6be508eb2d72 100644 --- a/drivers/thermal/thermal_core.c +++ b/drivers/thermal/thermal_core.c @@ -1235,6 +1235,8 @@ EXPORT_SYMBOL_GPL(thermal_zone_get_crit_temp); * whether trip points have been crossed (0 for interrupt * driven systems) * + * This function is deprecated. See thermal_zone_device_register(). + * * This interface function adds a new thermal zone device (sensor) to * /sys/class/thermal folder as thermal_zone[0-*]. It tries to bind all the * thermal cooling devices registered at the same time. @@ -1409,6 +1411,7 @@ thermal_zone_device_register_with_trips(const char *type, struct thermal_trip *t } EXPORT_SYMBOL_GPL(thermal_zone_device_register_with_trips); +/* This function is deprecated. See thermal_zone_device_register(). */ struct thermal_zone_device *thermal_tripless_zone_device_register( const char *type, void *devdata, @@ -1420,6 +1423,30 @@ struct thermal_zone_device *thermal_tripless_zone_device_register( } EXPORT_SYMBOL_GPL(thermal_tripless_zone_device_register); +/** + * thermal_zone_device_register() - register a new thermal zone device + * @tzdp: Parameters of the new thermal zone device + * See struct thermal_zone_device_register. + * + * This interface function adds a new thermal zone device (sensor) to + * /sys/class/thermal folder as thermal_zone[0-*]. It tries to bind all the + * thermal cooling devices registered at the same time. + * thermal_zone_device_unregister() must be called when the device is no + * longer needed. The passive cooling depends on the .get_trend() return value. + * + * Return: a pointer to the created struct thermal_zone_device or an + * in case of error, an ERR_PTR. Caller must check return value with + * IS_ERR*() helpers. + */ +struct thermal_zone_device *thermal_zone_device_register(struct thermal_zone_device_params *tzdp) +{ + return thermal_zone_device_register_with_trips(tzdp->type, tzdp->trips, tzdp->num_trips, + tzdp->mask, tzdp->devdata, tzdp->ops, + &tzdp->tzp, tzdp->passive_delay, + tzdp->polling_delay); +} +EXPORT_SYMBOL_GPL(thermal_zone_device_register); + void *thermal_zone_device_priv(struct thermal_zone_device *tzd) { return tzd->devdata; diff --git a/include/linux/thermal.h b/include/linux/thermal.h index 98957bae08ff..c6ed33a7e468 100644 --- a/include/linux/thermal.h +++ b/include/linux/thermal.h @@ -258,6 +258,33 @@ struct thermal_zone_params { int offset; }; +/** + * struct thermal_zone_device_params - parameters for a thermal zone device + * @type: the thermal zone device type + * @tzp: thermal zone platform parameters + * @ops: standard thermal zone device callbacks + * @devdata: private device data + * @trips: a pointer to an array of thermal trips, if any + * @num_trips: the number of trip points the thermal zone support + * @mask: a bit string indicating the writeablility of trip points + * @passive_delay: number of milliseconds to wait between polls when + * performing passive cooling + * @polling_delay: number of milliseconds to wait between polls when checking + * whether trip points have been crossed (0 for interrupt + * driven systems) + */ +struct thermal_zone_device_params { + const char *type; + struct thermal_zone_params tzp; + struct thermal_zone_device_ops *ops; + void *devdata; + struct thermal_trip *trips; + int num_trips; + int mask; + int passive_delay; + int polling_delay; +}; + /* Function declarations */ #ifdef CONFIG_THERMAL_OF struct thermal_zone_device *devm_thermal_of_zone_register(struct device *dev, int id, void *data, @@ -310,6 +337,8 @@ struct thermal_zone_device *thermal_tripless_zone_device_register( struct thermal_zone_device_ops *ops, const struct thermal_zone_params *tzp); +struct thermal_zone_device *thermal_zone_device_register(struct thermal_zone_device_params *tzdp); + void thermal_zone_device_unregister(struct thermal_zone_device *tz); void *thermal_zone_device_priv(struct thermal_zone_device *tzd); @@ -372,6 +401,10 @@ static inline struct thermal_zone_device *thermal_tripless_zone_device_register( const struct thermal_zone_params *tzp) { return ERR_PTR(-ENODEV); } +static inline struct thermal_zone_device *thermal_zone_device_register( + struct thermal_zone_device_params *tzdp) +{ return ERR_PTR(-ENODEV); } + static inline void thermal_zone_device_unregister(struct thermal_zone_device *tz) { } From patchwork Thu Dec 21 12:48:01 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AngeloGioacchino Del Regno X-Patchwork-Id: 182184 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:2483:b0:fb:cd0c:d3e with SMTP id q3csp383967dyi; Thu, 21 Dec 2023 04:49:52 -0800 (PST) X-Google-Smtp-Source: AGHT+IFnn7a53dW0LjJaenZsAUkFG9vjrysy2WKO6HuhzGPqLcXOHcgLo3lgDNmjcXjWGl7LG8Qg X-Received: by 2002:a17:902:988e:b0:1d0:6ffd:836a with SMTP id s14-20020a170902988e00b001d06ffd836amr8700466plp.117.1703162992053; Thu, 21 Dec 2023 04:49:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703162992; cv=none; d=google.com; s=arc-20160816; b=UlzSeyrHaqTTLjjnT4DaL41v1qWr0GtrDw3jr3fpzIEJ22aY3PCA4qnMb5qVesnAFB fIHwclnf5ENcfbvPGsgmJI3M/852ZiSfQXs1dlrj1y2mrxsmgEt7vqDd7TnOvn4E0P+g TGYugXnEqCc55OPNIGpPCRnJhRzP1AXQj9zhTgLr3x65HuovcrihET/gESLn6LKbgyJL 3M5iMMZYmRmqUR8FVz93u6vnFYr5A1lNofK1Gi6Et9aa7eIHkLk2Nb5bEksfEawQyJhi qPWfF+utGVN8/H2ZPdW7b/MOEUh4U/4BT0HI9gYy1DMfnLNEP/cP+KKLOOGpg33O4ROZ QpgQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=rWfeW/+yHwTm997tobcEwy6oM33o+llz4q4oJVnR3lw=; fh=tj3vwvS1joPqVAqhm025RI9FzN3aC+9rlGGIIVsXGr8=; b=Y1gSaG3PdB7PConVi5xD6QKqizYKs/6l3KMF7MsQPr+2dnWTxJJAuT+Ct9qGLxQsK6 IhAWNgK6OReqzv+17aGe8NfIq+0jRlkQaI9vplKiYqj22kWmhzrkLsBRfB9HDoD6hTmC 1RljqdTs0X/4pA/jTyUC0GhxquVZvdfXN76EwqRanBQBLIj6n+fE8rHTUl0FWe4ghBUT 7nFu2UX3ganPwfj2u4v2xx9O6bjq5wnh2YvwiXKisLVrt43b++VHg0w5ITqLkLG/WGZA WBYDpnbl8hGbnj51/9D2g6ERE6QcCPCimCk0bx5MVrdu4ybPNeu58k7ThPt5lnMFpAZJ sskA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=Yfc+M27n; spf=pass (google.com: domain of linux-kernel+bounces-8369-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-8369-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id bh4-20020a170902a98400b001d0a084b012si1391355plb.558.2023.12.21.04.49.51 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Dec 2023 04:49:52 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-8369-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=Yfc+M27n; spf=pass (google.com: domain of linux-kernel+bounces-8369-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-8369-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 3FBA6288DC1 for ; Thu, 21 Dec 2023 12:49:37 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 968F4768E1; Thu, 21 Dec 2023 12:48:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="Yfc+M27n" X-Original-To: linux-kernel@vger.kernel.org Received: from madrid.collaboradmins.com (madrid.collaboradmins.com [46.235.227.194]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 931E86F602; Thu, 21 Dec 2023 12:48:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1703162913; bh=CUiivx2KB9ULlkM3oFhD369DYLNqb+gWzcXQBgX77n0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Yfc+M27nJq5whbliK87wubRT+rAMmn7gW902W5ZtohEp5acJJgtMJnJ7cjOMEgmJn ZwMXPmkDWHGQz0jl2hKe/E4ViKO8BuF+qqD+26WhFqsFOdXS1gRWEiRVBQVSWhlgwA 0IUiocI1rtAntsh7+IxwtO9gfh3eGl14DX3oer6uyemcrwzbkwo6CvRlnxLXGqSZAT 1kvLm4RbtdxeC1EH3drNQjTZklQsTXnF7b1MuCKrvXSGjyPUjCszbtAHx8cA+Q42J7 DNioY3SS4ZbiW2e4QnY5xewqI04i2nWPBkOWG6U1fJpMAMkenFPISzPcsPH5wmr1jv 5hC6wBSfcyywg== Received: from IcarusMOD.eternityproject.eu (cola.collaboradmins.com [195.201.22.229]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: kholk11) by madrid.collaboradmins.com (Postfix) with ESMTPSA id 514BF3781FFF; Thu, 21 Dec 2023 12:48:33 +0000 (UTC) From: AngeloGioacchino Del Regno To: daniel.lezcano@linaro.org Cc: rafael@kernel.org, rui.zhang@intel.com, lukasz.luba@arm.com, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, AngeloGioacchino Del Regno , kernel@collabora.com Subject: [RFC PATCH 02/26] thermal/of: Migrate to thermal_zone_device_register() Date: Thu, 21 Dec 2023 13:48:01 +0100 Message-ID: <20231221124825.149141-3-angelogioacchino.delregno@collabora.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231221124825.149141-1-angelogioacchino.delregno@collabora.com> References: <20231221124825.149141-1-angelogioacchino.delregno@collabora.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1785895837147889162 X-GMAIL-MSGID: 1785895837147889162 The thermal API has a new thermal_zone_device_register() function which is deprecating the older thermal_zone_device_register_with_trips() and thermal_tripless_zone_device_register(). Migrate to the new thermal zone device registration function. Signed-off-by: AngeloGioacchino Del Regno --- drivers/thermal/thermal_of.c | 37 ++++++++++++++++-------------------- 1 file changed, 16 insertions(+), 21 deletions(-) diff --git a/drivers/thermal/thermal_of.c b/drivers/thermal/thermal_of.c index 1e0655b63259..62a903ad649f 100644 --- a/drivers/thermal/thermal_of.c +++ b/drivers/thermal/thermal_of.c @@ -471,16 +471,12 @@ static struct thermal_zone_device *thermal_of_zone_register(struct device_node * const struct thermal_zone_device_ops *ops) { struct thermal_zone_device *tz; - struct thermal_trip *trips; - struct thermal_zone_params tzp = {}; - struct thermal_zone_device_ops *of_ops; + struct thermal_zone_device_params tzdp; struct device_node *np; - int delay, pdelay; - int ntrips, mask; int ret; - of_ops = kmemdup(ops, sizeof(*ops), GFP_KERNEL); - if (!of_ops) + tzdp.ops = kmemdup(ops, sizeof(*ops), GFP_KERNEL); + if (!tzdp.ops) return ERR_PTR(-ENOMEM); np = of_thermal_zone_find(sensor, id); @@ -490,30 +486,29 @@ static struct thermal_zone_device *thermal_of_zone_register(struct device_node * ret = PTR_ERR(np); goto out_kfree_of_ops; } + tzdp.type = np->name; - trips = thermal_of_trips_init(np, &ntrips); - if (IS_ERR(trips)) { + tzdp.trips = thermal_of_trips_init(np, &tzdp.num_trips); + if (IS_ERR(tzdp.trips)) { pr_err("Failed to find trip points for %pOFn id=%d\n", sensor, id); - ret = PTR_ERR(trips); + ret = PTR_ERR(tzdp.trips); goto out_kfree_of_ops; } - ret = thermal_of_monitor_init(np, &delay, &pdelay); + ret = thermal_of_monitor_init(np, &tzdp.polling_delay, &tzdp.passive_delay); if (ret) { pr_err("Failed to initialize monitoring delays from %pOFn\n", np); goto out_kfree_trips; } - thermal_of_parameters_init(np, &tzp); + thermal_of_parameters_init(np, &tzdp.tzp); - of_ops->bind = thermal_of_bind; - of_ops->unbind = thermal_of_unbind; + tzdp.ops->bind = thermal_of_bind; + tzdp.ops->unbind = thermal_of_unbind; + tzdp.mask = GENMASK_ULL((tzdp.num_trips) - 1, 0); + tzdp.devdata = data; - mask = GENMASK_ULL((ntrips) - 1, 0); - - tz = thermal_zone_device_register_with_trips(np->name, trips, ntrips, - mask, data, of_ops, &tzp, - pdelay, delay); + tz = thermal_zone_device_register(&tzdp); if (IS_ERR(tz)) { ret = PTR_ERR(tz); pr_err("Failed to register thermal zone %pOFn: %d\n", np, ret); @@ -531,9 +526,9 @@ static struct thermal_zone_device *thermal_of_zone_register(struct device_node * return tz; out_kfree_trips: - kfree(trips); + kfree(tzdp.trips); out_kfree_of_ops: - kfree(of_ops); + kfree(tzdp.ops); return ERR_PTR(ret); } From patchwork Thu Dec 21 12:48:02 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AngeloGioacchino Del Regno X-Patchwork-Id: 182185 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:2483:b0:fb:cd0c:d3e with SMTP id q3csp383975dyi; Thu, 21 Dec 2023 04:49:53 -0800 (PST) X-Google-Smtp-Source: AGHT+IFJEjxsbjWEqCLZ8Bim8PMIt6sl2GC43uxyDchhFpze7ANqw6fODp77O2dr0kU5QL020ydg X-Received: by 2002:a05:6214:ca5:b0:67f:7413:43d5 with SMTP id s5-20020a0562140ca500b0067f741343d5mr3528679qvs.95.1703162993459; Thu, 21 Dec 2023 04:49:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703162993; cv=none; d=google.com; s=arc-20160816; b=KZAha1+ZgZU3w+xED+fKvsYxzYpp8wWM3eDYNhrPAYNfQwXJxk/3sogyzhSHzh2Kru BmQv3HMPSBHh0wnyaNiy5BfF/vU/qVPUd3lpqBJ8NmH6fas55Oa6AjF0hqhOltFG9Q3B CS/z+i8VQVGDiTfAaSuMclFfhlJL+9WOggZcZOR32yXcpsCPZrub8UY/3jZcQph9NZVV 6h6ppjPkm6vyo7IJgcBkz3kY5Vint0dljhW/QfTviVw1IosQ43AlJ0n5H9aLc/3woHAx XNOHICracp4VuNCL/XgsRBcQoMZXf+0PZ+PZ/VrlGe1QZfdjiVue0LrNDNbBkHsBm1y3 fNfA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=519sx5OMPgQwheBzZlRbBw48avRTyLIYYVGY26YwQ/8=; fh=tj3vwvS1joPqVAqhm025RI9FzN3aC+9rlGGIIVsXGr8=; b=ZxZPVH2kz5Q9tVOlGg1HwfTXJTRBDDzeI9tp/XTG6G/3b81PJY1WKrlwSO2ty6x15r cjxZRLqkr8ZgJw1lYZrTw8yLoQxx/5m0FlVsTkB0kqdl4JxzxjUf5YbaMtw4nDOK3yFf S/wQ+r1z8jMMor71D54Ya8hMWQ7uUO3p6bqgvf8BPK55YCv7j7zWA5nZSLgTd0+p5eSq EetU16gxLcUXlCaa1ZnQV/BQmDXwEbkYXvr8dlnNWGznUXf/lE0dMns1iMs5NLXCmfXW Oaa0OD1ltRkKIQQgHDp3zZDiOU4W8GsjPgOo3hliI48NKCmZTt/Ti10e81mptO6JdpcI fZRg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=opAaJfA0; spf=pass (google.com: domain of linux-kernel+bounces-8370-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-8370-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id x22-20020a0cb216000000b0067f29cde805si2024846qvd.312.2023.12.21.04.49.53 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Dec 2023 04:49:53 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-8370-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=opAaJfA0; spf=pass (google.com: domain of linux-kernel+bounces-8370-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-8370-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 38DC41C2094A for ; Thu, 21 Dec 2023 12:49:52 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 47B2076915; Thu, 21 Dec 2023 12:48:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="opAaJfA0" X-Original-To: linux-kernel@vger.kernel.org Received: from madrid.collaboradmins.com (madrid.collaboradmins.com [46.235.227.194]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4CFE973177; Thu, 21 Dec 2023 12:48:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1703162914; bh=fhqcFV2ud7MgROogm/ayFQIpUEXX1NBHic7DYueqc2A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=opAaJfA0u0w2KMoTORO6QOjSNIhpp6XFQJ0q8e1g4NkZbp4NraMMhwKC/M0O9Zclg QSwjDlEq1j61eTDWiyM8a+eb0hhEO81a7P7e76K/aTqL4SiaZ6BnSwmN+b986no0iV DDxIBs41gDXfclttDJbEvKv9SDKNw2bShJ1QrZsx6RkDxsVMoQgYPRunnb7yiQsnFF tSGXQ5vqrimhX+RTvn3z9AZtdB/4Kvpgoqg8aGBu3SrwZYW2+MS0F6X/blN6fm5PQU UH+sbOBBm+/bI1casrDkAk3ki5ttyMDggMmtzjINFdkyrS3VSkZ8QgKJhyTO1RE5nQ H9fl+4MI5L+LA== Received: from IcarusMOD.eternityproject.eu (cola.collaboradmins.com [195.201.22.229]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: kholk11) by madrid.collaboradmins.com (Postfix) with ESMTPSA id 1E49A3782003; Thu, 21 Dec 2023 12:48:34 +0000 (UTC) From: AngeloGioacchino Del Regno To: daniel.lezcano@linaro.org Cc: rafael@kernel.org, rui.zhang@intel.com, lukasz.luba@arm.com, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, AngeloGioacchino Del Regno , kernel@collabora.com Subject: [RFC PATCH 03/26] platform/x86: acerhdf: Migrate to thermal_zone_device_register() Date: Thu, 21 Dec 2023 13:48:02 +0100 Message-ID: <20231221124825.149141-4-angelogioacchino.delregno@collabora.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231221124825.149141-1-angelogioacchino.delregno@collabora.com> References: <20231221124825.149141-1-angelogioacchino.delregno@collabora.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1785895838935537117 X-GMAIL-MSGID: 1785895838935537117 The thermal API has a new thermal_zone_device_register() function which is deprecating the older thermal_zone_device_register_with_trips() and thermal_tripless_zone_device_register(). Migrate to the new thermal zone device registration function. Signed-off-by: AngeloGioacchino Del Regno --- drivers/platform/x86/acerhdf.c | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/drivers/platform/x86/acerhdf.c b/drivers/platform/x86/acerhdf.c index 74bcb3d13104..f7c1710f736c 100644 --- a/drivers/platform/x86/acerhdf.c +++ b/drivers/platform/x86/acerhdf.c @@ -267,14 +267,6 @@ static const struct bios_settings bios_tbl[] __initconst = { {"", "", "", 0, 0, {0, 0}, 0} }; -/* - * this struct is used to instruct thermal layer to use bang_bang instead of - * default governor for acerhdf - */ -static struct thermal_zone_params acerhdf_zone_params = { - .governor_name = "bang_bang", -}; - static int acerhdf_get_temp(int *temp) { u8 read_temp; @@ -669,6 +661,18 @@ static void acerhdf_unregister_platform(void) static int __init acerhdf_register_thermal(void) { + struct thermal_zone_device_params tzdp = { + .type = "acerhdf", + /* + * this struct is used to instruct thermal layer to use + * bang_bang instead of default governor for acerhdf + */ + .tzp = { .governor_name = "bang_bang" }, + .ops = &acerhdf_dev_ops, + .trips = trips, + .num_trips = ARRAY_SIZE(trips), + .polling_delay = kernelmode ? interval * 1000 : 0, + }; int ret; cl_dev = thermal_cooling_device_register("acerhdf-fan", NULL, @@ -677,10 +681,7 @@ static int __init acerhdf_register_thermal(void) if (IS_ERR(cl_dev)) return -EINVAL; - thz_dev = thermal_zone_device_register_with_trips("acerhdf", trips, ARRAY_SIZE(trips), - 0, NULL, &acerhdf_dev_ops, - &acerhdf_zone_params, 0, - (kernelmode) ? interval*1000 : 0); + thz_dev = thermal_zone_device_register(&tzdp); if (IS_ERR(thz_dev)) return -EINVAL; From patchwork Thu Dec 21 12:48:03 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AngeloGioacchino Del Regno X-Patchwork-Id: 182186 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:2483:b0:fb:cd0c:d3e with SMTP id q3csp384215dyi; Thu, 21 Dec 2023 04:50:21 -0800 (PST) X-Google-Smtp-Source: AGHT+IHIpntuC82V+HbB4oIIgO7AkrM5YG2U6Oqobkayg8ZBv+LYjQVprn2Dpum74h6MIBBIGIuy X-Received: by 2002:a17:902:d549:b0:1d0:6ffd:9e22 with SMTP id z9-20020a170902d54900b001d06ffd9e22mr27247281plf.116.1703163021738; Thu, 21 Dec 2023 04:50:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703163021; cv=none; d=google.com; s=arc-20160816; b=L/u+GzCAnzx8ssLLVxjggBnMOMf1OsbUlDakAAeyZFqqfbXJnnGASHnZWDcNCL5Q99 Uo2PBgtjBFOgBlvraVSyPTBEFomsDG7DDx8EPP4tOQrYWAQU4BXTChtT3g0DVOHJvB0z eN7VjiHmIZ9z0OXwmjUBaxdY0D9h3HUVCjFzRLvI02WUGjNmjxioFwXIYYfECANFsSTz xtl6N/DIM9LSYWfVebHe02bHbo/9VKSew16Zw4BOnRaA0fixSdLqibNN8caEKO/Nr1xx CeCdTO9BmZeN0qGKbG51heofacUFHcq56TOROOG9o67eGg3D08N3gzNQtyGTw8xTBleJ ULVw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=oGqKluHGGtMc9u+X/bvzD0M1OrsJxjPdmMCRWMgzeQo=; fh=tj3vwvS1joPqVAqhm025RI9FzN3aC+9rlGGIIVsXGr8=; b=kAXpuUophhMTIm/HBuCnqKnKdHOS2UPikPEu2srCobs0tjpjOp8nKT1tkhXohs02a1 l9p/oloQtAkaAnQwaksfAg0GxP3hZVdFXOfvQUMoqoG/KxdQtgSbM8u2iMQiQ8qRSM3m juDLn5cBq3uzKZicjN9ClkmILM1J7OBJIJl1NLIQj+t81bDf1Lww9HenJ6XJ4NaMW6jR zjb4GyKYm0DWhn4RflJadxojI5g86kwwqE5wrM9cF69jfvIlhIuMmYeQ3iBM3Th3v/Wx MjqYEWTut0+inK391R+FtMmTdxy8yg3up1NMWIS8CXnBBbVOCFY5L3yAPqkNC0uX49mW 6GeA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=eBhoe2sl; spf=pass (google.com: domain of linux-kernel+bounces-8371-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-8371-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id a20-20020a1709027d9400b001d33c368c1bsi1415139plm.126.2023.12.21.04.50.21 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Dec 2023 04:50:21 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-8371-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=eBhoe2sl; spf=pass (google.com: domain of linux-kernel+bounces-8371-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-8371-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id A2A262894F6 for ; Thu, 21 Dec 2023 12:50:07 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1831B76DB9; Thu, 21 Dec 2023 12:48:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="eBhoe2sl" X-Original-To: linux-kernel@vger.kernel.org Received: from madrid.collaboradmins.com (madrid.collaboradmins.com [46.235.227.194]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2E8B974087; Thu, 21 Dec 2023 12:48:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1703162915; bh=wYH99HJxGwYPUgw1yllFolH3TiZQvNSnRw2wR2wMWDc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=eBhoe2sl9Wdo73MB1dJsbH4HO8TSEMWSwSBP4KHs2bTPYVtmc4Jes2HjCmh3jzIU/ jNJJLnsPTG8/T8vKpTSLK+sHpMaqWVnK6WLiDNBYIVf11MHB/kv35RXmxFC5hpyTJW U17OC/+3kgAe1QQRf/Y8bbZ0C3+mLYS6WgG+euz+bEY3NfyDHVS2alE4sbcP9LC9Bj pqxwcQ/rDpQRnjz2j0bLwij5CsPhHhgQGmRnxWhiL8Ann4YwOH1+jNRVpSc7QKXjKm Xa2ymIWDQkHB/Yjir3w/PPKpfRCrAgWcYm1Aff764fYddhQ6/Mfd0FVa+6KN87pcHw JZeywBMMTFOYg== Received: from IcarusMOD.eternityproject.eu (cola.collaboradmins.com [195.201.22.229]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: kholk11) by madrid.collaboradmins.com (Postfix) with ESMTPSA id DD8083782005; Thu, 21 Dec 2023 12:48:34 +0000 (UTC) From: AngeloGioacchino Del Regno To: daniel.lezcano@linaro.org Cc: rafael@kernel.org, rui.zhang@intel.com, lukasz.luba@arm.com, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, AngeloGioacchino Del Regno , kernel@collabora.com Subject: [RFC PATCH 04/26] ACPI: thermal: Migrate to thermal_zone_device_register() Date: Thu, 21 Dec 2023 13:48:03 +0100 Message-ID: <20231221124825.149141-5-angelogioacchino.delregno@collabora.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231221124825.149141-1-angelogioacchino.delregno@collabora.com> References: <20231221124825.149141-1-angelogioacchino.delregno@collabora.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1785895868393080008 X-GMAIL-MSGID: 1785895868393080008 The thermal API has a new thermal_zone_device_register() function which is deprecating the older thermal_zone_device_register_with_trips() and thermal_tripless_zone_device_register(). Migrate to the new thermal zone device registration function. Signed-off-by: AngeloGioacchino Del Regno --- drivers/acpi/thermal.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/drivers/acpi/thermal.c b/drivers/acpi/thermal.c index ee28ca93d983..e4f44e7bb3ec 100644 --- a/drivers/acpi/thermal.c +++ b/drivers/acpi/thermal.c @@ -664,16 +664,18 @@ static int acpi_thermal_register_thermal_zone(struct acpi_thermal *tz, unsigned int trip_count, int passive_delay) { + struct thermal_zone_device_params tzdp = { + .type = "acpitz", + .devdata = tz, + .ops = &acpi_thermal_zone_ops, + .trips = tz->trip_table, + .num_trips = trip_count, + .passive_delay = passive_delay, + .polling_delay = tz->polling_frequency * 100, + }; int result; - tz->thermal_zone = thermal_zone_device_register_with_trips("acpitz", - tz->trip_table, - trip_count, - 0, tz, - &acpi_thermal_zone_ops, - NULL, - passive_delay, - tz->polling_frequency * 100); + tz->thermal_zone = thermal_zone_device_register(&tzdp); if (IS_ERR(tz->thermal_zone)) return PTR_ERR(tz->thermal_zone); From patchwork Thu Dec 21 12:48:04 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AngeloGioacchino Del Regno X-Patchwork-Id: 182187 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:2483:b0:fb:cd0c:d3e with SMTP id q3csp384234dyi; Thu, 21 Dec 2023 04:50:23 -0800 (PST) X-Google-Smtp-Source: AGHT+IE9QbLU92sZ+D2u9i+vNzi7A9ln75eNPI+PLuzEkJypxpj4qNhKNUR/i8z1kZUO9k425sdK X-Received: by 2002:a05:622a:1352:b0:423:7062:8120 with SMTP id w18-20020a05622a135200b0042370628120mr28854515qtk.49.1703163023083; Thu, 21 Dec 2023 04:50:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703163023; cv=none; d=google.com; s=arc-20160816; b=sEBIW9ExwHvrPAYYyBSlHzYd6TpkJiYHDlhgwsyeYO3NWwO0RtYjmDFVZXpa4QkhND IVuxMDG4yF0ByYejup8s8jEajeDu47USmjviZ6r4A8nIrK/ZbbXB4C6ZtXlQd1PIkhZ2 HUQ/v0AXMhh6rUYh8Igdsa4Yg2ySHzsG8snGhho1x/m9OYI2HTR/T3tF4cAtgFyeLZNW g9tvnXUCgccgbF3XxCEcMp5QqlbQJbTDlxfGsmUkv7pgU/ccPAEXSmcvrFY0farLIVZN 0ZXxXwj4XqHKgjBl1Sg2B85fkN7zhv+cZfIp47PbwI4cWXBxVdJ/O4EsMLspwYpD71ju L+8Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=lgwe8OPxC0+WfW87ZaCNGB9zRBo9XLtZg6nzBoJnTJo=; fh=tj3vwvS1joPqVAqhm025RI9FzN3aC+9rlGGIIVsXGr8=; b=ZF+qq5qXsuPDp+mqj4/YTxqXNouwqs9cTssUy+mZUBNrdeUn/iY2E8KOsTx98+JajT vI726hboxz7kDpancPccwLoPiyBYqWhth9KEa+Gqzz2JPY3rVpJg+ijTyNdK9Mth3rFV GBnE+yXRZ71A+uoAGncGYqz1+pfzqeIBscpqLBenlWvqOAQ1QWFXbWL/fHC/fE73lG1s eIVlWOeAtZAx2F6S3pF/PRPAZD21yeq/NVRPvezuCSxiemi9u40MvtgINEdFR/hW2KWj 4DUkJT67xyZPveTxUm4/nV8/HID1E1HHAyrP+uD2hvOwrXjp4ZhFhl5bmp7mPqzcShTr jTng== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=ikf7JBCI; spf=pass (google.com: domain of linux-kernel+bounces-8372-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-8372-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id d13-20020ac85d8d000000b004278fb8875esi2008790qtx.243.2023.12.21.04.50.22 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Dec 2023 04:50:23 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-8372-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=ikf7JBCI; spf=pass (google.com: domain of linux-kernel+bounces-8372-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-8372-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id D64251C23C11 for ; Thu, 21 Dec 2023 12:50:22 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E961976DDE; Thu, 21 Dec 2023 12:48:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="ikf7JBCI" X-Original-To: linux-kernel@vger.kernel.org Received: from madrid.collaboradmins.com (madrid.collaboradmins.com [46.235.227.194]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 02E93745DB; Thu, 21 Dec 2023 12:48:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1703162916; bh=YEdNV8O2ZLegd5j1TKwdVy1YO9G9N8uipcA77IFh0Is=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ikf7JBCIVuDx0XjW6bUxY8Km5aIJDQ0XVnXJ8lQ36aoi766ELdxsB9EjkDO/RXatK ofv6xc4Mu6qQdHFKgX1VE2dG/tQRgRISGBwDP4DZWHvr+xVGEXEsnTVUq5T0BzjVwu gRfmVPYft4GxC12Qh4SIBw9y5C252zsnYFwj/FGg6MXUr8x1MGTJrA16vt/7/Mb2AT 7SOGuT5B4b9sD46GOOVn3nO2zcbfMLXbIEYuqKckclPsSHUgfgXbMcDJx6n2WLATHR 7h9DIEF1E/zrcCkQTYYAnYN1jubLUGdr1yulKU89WZ7duUddfwGvBWMfz7x2xTmYle YoXgaKji/gC0Q== Received: from IcarusMOD.eternityproject.eu (cola.collaboradmins.com [195.201.22.229]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: kholk11) by madrid.collaboradmins.com (Postfix) with ESMTPSA id AB43C3782001; Thu, 21 Dec 2023 12:48:35 +0000 (UTC) From: AngeloGioacchino Del Regno To: daniel.lezcano@linaro.org Cc: rafael@kernel.org, rui.zhang@intel.com, lukasz.luba@arm.com, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, AngeloGioacchino Del Regno , kernel@collabora.com Subject: [RFC PATCH 05/26] thermal/drivers/da9062: Migrate to thermal_zone_device_register() Date: Thu, 21 Dec 2023 13:48:04 +0100 Message-ID: <20231221124825.149141-6-angelogioacchino.delregno@collabora.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231221124825.149141-1-angelogioacchino.delregno@collabora.com> References: <20231221124825.149141-1-angelogioacchino.delregno@collabora.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1785895870049990908 X-GMAIL-MSGID: 1785895870049990908 The thermal API has a new thermal_zone_device_register() function which is deprecating the older thermal_zone_device_register_with_trips() and thermal_tripless_zone_device_register(). Migrate to the new thermal zone device registration function. Signed-off-by: AngeloGioacchino Del Regno --- drivers/thermal/da9062-thermal.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/drivers/thermal/da9062-thermal.c b/drivers/thermal/da9062-thermal.c index 160d64913057..10b1fe74c43e 100644 --- a/drivers/thermal/da9062-thermal.c +++ b/drivers/thermal/da9062-thermal.c @@ -158,6 +158,11 @@ MODULE_DEVICE_TABLE(of, da9062_compatible_reg_id_table); static int da9062_thermal_probe(struct platform_device *pdev) { + struct thermal_zone_device_params tzdp = { + .ops = &da9062_thermal_ops, + .trips = trips, + .num_trips = ARRAY_SIZE(trips), + }; struct da9062 *chip = dev_get_drvdata(pdev->dev.parent); struct da9062_thermal *thermal; const struct of_device_id *match; @@ -196,10 +201,11 @@ static int da9062_thermal_probe(struct platform_device *pdev) INIT_DELAYED_WORK(&thermal->work, da9062_thermal_poll_on); mutex_init(&thermal->lock); - thermal->zone = thermal_zone_device_register_with_trips(thermal->config->name, - trips, ARRAY_SIZE(trips), 0, thermal, - &da9062_thermal_ops, NULL, pp_tmp, - 0); + tzdp.type = thermal->config->name; + tzdp.devdata = thermal; + tzdp.passive_delay = pp_tmp; + + thermal->zone = thermal_zone_device_register(&tzdp); if (IS_ERR(thermal->zone)) { dev_err(&pdev->dev, "Cannot register thermal zone device\n"); ret = PTR_ERR(thermal->zone); From patchwork Thu Dec 21 12:48:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AngeloGioacchino Del Regno X-Patchwork-Id: 182189 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:2483:b0:fb:cd0c:d3e with SMTP id q3csp384587dyi; Thu, 21 Dec 2023 04:51:01 -0800 (PST) X-Google-Smtp-Source: AGHT+IEq9u2BUh55D1AOq1LphTjlI24tD5iNb376U93fBn5SdU8bdqRSI2dZbh3k+599DwxnSGHs X-Received: by 2002:a05:6870:1c8:b0:1f9:e6cb:7eb5 with SMTP id n8-20020a05687001c800b001f9e6cb7eb5mr1832867oad.18.1703163061413; Thu, 21 Dec 2023 04:51:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703163061; cv=none; d=google.com; s=arc-20160816; b=xHd8qgsdnFPvHk3a88AGxnx5h/3MkqTJSi6m03Fx1lf/o2YXKyg9yjJo5+Ex5/cWuw QAa8NQFgB+qEXT/OUHc7kfywfwflSrv8+kKbIlgXv9i44WoOcAR2KWKVTY26j+FFTaci rjquWhfa2otch6aC7QrEycakvRnkv6qgHMpiVf3tZCnpz/tHiV8gHRKDMkyI9/Fe/VJ/ 40ZtO5RAUg7q+hyX6AjK87fylNVILqSQS2GM/DSXh4dmXVKAbb2x603rNhhK+MxRYsdK /tf/3J/Fv66yKcjiTa02ow+oF6NeU8tAXDz83Nf/4JLfrx5I6e926d4xWaIChzZ7II7J 5vsA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=vegmaxzgxoMK+QwZ3PMOGhWm1enk0FFAYfe5j7xy01w=; fh=tj3vwvS1joPqVAqhm025RI9FzN3aC+9rlGGIIVsXGr8=; b=j8RNlKWDX+F79SNZE0ooMBG2X5CZZiUeAjQpaQSC2NDgI7FNHzUaiAHVuQBQAhBmvP 2Rgk0gFILqcRo4z4DCISC9VlbwoIrpYP92r/HILQNEEYxWCF7Hmyc8hN9mhMoiscraMZ v6p7z85655bgctOh4I8oCi+rDjGd+ny9drSmOBm9208rpcNbhmb94NiO6zevA6gVUEXb 8340vztgViXd+hWoTnXIkjFsoXGkLLBc5elsiAAExm0pRzhs47F91colIQZMcjI2KVE4 MSWxjFED1yKlJGHxLyCAXKycfW/WYfqaAHtrcXyGnRPq/Ir95JEZORFTso+eNB5Xp9Zg Q5iQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=ixzJ9PR5; spf=pass (google.com: domain of linux-kernel+bounces-8373-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-8373-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id ca5-20020a056a02068500b005cdde899923si1509164pgb.758.2023.12.21.04.51.01 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Dec 2023 04:51:01 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-8373-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=ixzJ9PR5; spf=pass (google.com: domain of linux-kernel+bounces-8373-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-8373-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 9574928453F for ; Thu, 21 Dec 2023 12:50:36 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 82D0D7763E; Thu, 21 Dec 2023 12:48:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="ixzJ9PR5" X-Original-To: linux-kernel@vger.kernel.org Received: from madrid.collaboradmins.com (madrid.collaboradmins.com [46.235.227.194]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9B38B745FF; Thu, 21 Dec 2023 12:48:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1703162917; bh=7dSyaW0hHfrvS4WptTVuedCjr1NJ6UZhYXzsUhQDe0g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ixzJ9PR5Qvi8/Dv5L2i9OxPhQnafYOqL7SI7PEbPmzcJHbdzy5tgPlVb2yCNW1OuJ IAp1JyD0xcm8bSioyrJyj1W2LbOjlsteD+FeNbBayNoScu473kz4z5Gj5Tbv6g0vHD xKwybpGLgW1CoMtRcTGvij9ahpd7IAxPYSgJRhgVO4VKvMzmC+Yr+K7WVKG243d3U0 oP00LSC6k1jbuPGuvUGWBa8dyHzFBmIt6DdssXnd5Pf+5gStHnE0ZLQW5TmbTwQ5s+ 4w3S76UeVnqpTBbP2C/Xp04tCJurF4yce8a4pRpVyHPdAwSqIXuBlY44aTaUF2DGX/ Vccj3R9MksCdg== Received: from IcarusMOD.eternityproject.eu (cola.collaboradmins.com [195.201.22.229]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: kholk11) by madrid.collaboradmins.com (Postfix) with ESMTPSA id 68CED3782009; Thu, 21 Dec 2023 12:48:36 +0000 (UTC) From: AngeloGioacchino Del Regno To: daniel.lezcano@linaro.org Cc: rafael@kernel.org, rui.zhang@intel.com, lukasz.luba@arm.com, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, AngeloGioacchino Del Regno , kernel@collabora.com Subject: [RFC PATCH 06/26] thermal/drivers/imx: Migrate to thermal_zone_device_register() Date: Thu, 21 Dec 2023 13:48:05 +0100 Message-ID: <20231221124825.149141-7-angelogioacchino.delregno@collabora.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231221124825.149141-1-angelogioacchino.delregno@collabora.com> References: <20231221124825.149141-1-angelogioacchino.delregno@collabora.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1785895910357194096 X-GMAIL-MSGID: 1785895910357194096 The thermal API has a new thermal_zone_device_register() function which is deprecating the older thermal_zone_device_register_with_trips() and thermal_tripless_zone_device_register(). Migrate to the new thermal zone device registration function. Signed-off-by: AngeloGioacchino Del Regno --- drivers/thermal/imx_thermal.c | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/drivers/thermal/imx_thermal.c b/drivers/thermal/imx_thermal.c index 7019c4fdd549..61b332e1b899 100644 --- a/drivers/thermal/imx_thermal.c +++ b/drivers/thermal/imx_thermal.c @@ -599,6 +599,13 @@ static inline void imx_thermal_unregister_legacy_cooling(struct imx_thermal_data static int imx_thermal_probe(struct platform_device *pdev) { + struct thermal_zone_device_params tzdp = { + .type = "imx_thermal_zone", + .ops = &imx_tz_ops, + .mask = BIT(IMX_TRIP_PASSIVE), + .passive_delay = IMX_PASSIVE_DELAY, + .polling_delay = IMX_POLLING_DELAY, + }; struct imx_thermal_data *data; struct regmap *map; int measure_freq; @@ -696,13 +703,11 @@ static int imx_thermal_probe(struct platform_device *pdev) goto legacy_cleanup; } - data->tz = thermal_zone_device_register_with_trips("imx_thermal_zone", - trips, - ARRAY_SIZE(trips), - BIT(IMX_TRIP_PASSIVE), data, - &imx_tz_ops, NULL, - IMX_PASSIVE_DELAY, - IMX_POLLING_DELAY); + tzdp.devdata = data; + tzdp.trips = &trips; + tzdp.num_trips = ARRAY_SIZE(trips); + + data->tz = thermal_zone_device_register(&tzdp); if (IS_ERR(data->tz)) { ret = PTR_ERR(data->tz); dev_err(&pdev->dev, From patchwork Thu Dec 21 12:48:06 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AngeloGioacchino Del Regno X-Patchwork-Id: 182188 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:2483:b0:fb:cd0c:d3e with SMTP id q3csp384562dyi; Thu, 21 Dec 2023 04:50:58 -0800 (PST) X-Google-Smtp-Source: AGHT+IHRb1jMBpzC1pEV7s3NuIXpu5LIol/y06AlYXaCV62yuXc70JK7xvOPg6PLg3s4PWzz7VnS X-Received: by 2002:a05:620a:4249:b0:780:fdfc:af07 with SMTP id w9-20020a05620a424900b00780fdfcaf07mr5863870qko.1.1703163058466; Thu, 21 Dec 2023 04:50:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703163058; cv=none; d=google.com; s=arc-20160816; b=Ku23eXjvsAhbI+6RACfXlMotuPvpCYpYz686lNJ2AHLqMbnCQ8NNpzrHmZoiTpbeLf qjAuZz4kE0rV/x8EmgBhF/osOtnKKxc4UOHTKsmsOrSk4Zje4wKc9OYjIytQSuwV1iHx CILMExsmXToIpXTtV/ztMng5HTGDOeQjrlszrgz8LmWMQ68ccAboWCcjt4cQyMugu7tI A/Fki5umlXBfXeZG8YdWdMaIQUFMALCTnb73ii8ZPSRjAWZqLke7d0OtzN0DuQ/vnb/H 11wRmUmvGlXMI4ZoMQefjP3eKg1a+fl2mqHrI30Hqk2DawgqY0nh+kg3V3O+ECH9fNEx qyjQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=tNkRtNXAXZ0Hd/Kj4S55A6Jw2UJxL6Xqa3B4UhhUl8o=; fh=tj3vwvS1joPqVAqhm025RI9FzN3aC+9rlGGIIVsXGr8=; b=uD9hhoRrE3O9PtsIGZOwV0ZkMWUyQjwhYt0hypfgJc8bG0w/HxH/y/Qi/K6Cp3KI97 PMcyWv4rTdlHPAS6lCC46NTbbNxUARrS/JxFgnSxRDyKapc6g9XxR01abHbPD/7BLieN 5x0HbICua45tm1X87SZsUrKxAnn6XCkpzjKXvAK8y5G/tEQ6eKDlI7Xp7JMPB/yF+ccQ 0fNtbVFk52GBUs35vKLEEcqDYfgdjcH4IE46A0rzsBrTWqL7eYSk8yhkavnQE4hkhQZj OQ+ieOVZ9II+kQkCxe+gXsO4DFXiiHul8s1YiC7xQd/ZRR1Jrx2aMOgR46zjTXt1qWWK pPuw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=X0kpciBk; spf=pass (google.com: domain of linux-kernel+bounces-8374-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-8374-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id j25-20020a05620a147900b0077f2dde6a59si2011368qkl.558.2023.12.21.04.50.58 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Dec 2023 04:50:58 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-8374-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=X0kpciBk; spf=pass (google.com: domain of linux-kernel+bounces-8374-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-8374-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 41B9C1C23B96 for ; Thu, 21 Dec 2023 12:50:58 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 42A3177B21; Thu, 21 Dec 2023 12:48:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="X0kpciBk" X-Original-To: linux-kernel@vger.kernel.org Received: from madrid.collaboradmins.com (madrid.collaboradmins.com [46.235.227.194]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5BFEF760B4; Thu, 21 Dec 2023 12:48:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1703162917; bh=lN2kEBY91fJMh8nUO8EEJ+b8UdVj8nBk40WMG7UhE1I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=X0kpciBkLzwodvPTU/VviekD45Ye51zgVzk4Wh8IaaFSJrjmLzD0A0Yqa9yzgh/hg YgmgDct4djWi3LV1rWVAiwUyo6zoblAKu8v95CacQYYN2dXE0LMtXLbsv9AOhFC+uo 00dn4kDKIODoEYrKSpMDz1NKJ+SGvDgFdIwwYj/vAPM7fOrpEt1UC2undAnn5zmt6r qK4/ArbXmGJqVPgvLUOnk7LiBzZqJ5SgyB1jwcpFd65BQh+3c/Fw7ax/2bfdlafTzh AiDrL1UFLgt/ZrxqR1kWe6Aev7PK1BHumN9xUD0vopvDhGmbMx9qQcYUn0OxkXSvyl 2RcD5mfsqSCoQ== Received: from IcarusMOD.eternityproject.eu (cola.collaboradmins.com [195.201.22.229]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: kholk11) by madrid.collaboradmins.com (Postfix) with ESMTPSA id 3571F378200A; Thu, 21 Dec 2023 12:48:37 +0000 (UTC) From: AngeloGioacchino Del Regno To: daniel.lezcano@linaro.org Cc: rafael@kernel.org, rui.zhang@intel.com, lukasz.luba@arm.com, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, AngeloGioacchino Del Regno , kernel@collabora.com Subject: [RFC PATCH 07/26] thermal/drivers/rcar: Migrate to thermal_zone_device_register() Date: Thu, 21 Dec 2023 13:48:06 +0100 Message-ID: <20231221124825.149141-8-angelogioacchino.delregno@collabora.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231221124825.149141-1-angelogioacchino.delregno@collabora.com> References: <20231221124825.149141-1-angelogioacchino.delregno@collabora.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1785895907238914801 X-GMAIL-MSGID: 1785895907238914801 The thermal API has a new thermal_zone_device_register() function which is deprecating the older thermal_zone_device_register_with_trips() and thermal_tripless_zone_device_register(). Migrate to the new thermal zone device registration function. Signed-off-by: AngeloGioacchino Del Regno --- drivers/thermal/rcar_thermal.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/drivers/thermal/rcar_thermal.c b/drivers/thermal/rcar_thermal.c index feb848d595fa..71bc7353285d 100644 --- a/drivers/thermal/rcar_thermal.c +++ b/drivers/thermal/rcar_thermal.c @@ -488,10 +488,15 @@ static int rcar_thermal_probe(struct platform_device *pdev) dev, i, priv, &rcar_thermal_zone_ops); } else { - priv->zone = thermal_zone_device_register_with_trips( - "rcar_thermal", trips, ARRAY_SIZE(trips), 0, priv, - &rcar_thermal_zone_ops, NULL, 0, - idle); + struct thermal_zone_device_params tzdp = { + .type = "rcar_thermal", + .ops = &rcar_thermal_zone_ops, + .devdata = priv, + .trips = trips, + .num_trips = ARRAY_SIZE(trips), + .polling_delay = idle, + }; + priv->zone = thermal_zone_device_register(&tzdp); ret = thermal_zone_device_enable(priv->zone); if (ret) { From patchwork Thu Dec 21 12:48:07 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AngeloGioacchino Del Regno X-Patchwork-Id: 182190 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:2483:b0:fb:cd0c:d3e with SMTP id q3csp384698dyi; Thu, 21 Dec 2023 04:51:14 -0800 (PST) X-Google-Smtp-Source: AGHT+IGIBJcVjoW/FLVB5Ko1YdQNuyt4IhaEBb0TyQqrJasHOgoDfrCd2utjB85a3O63/AwFYSLS X-Received: by 2002:a50:9515:0:b0:553:6fff:d7d4 with SMTP id u21-20020a509515000000b005536fffd7d4mr3002680eda.51.1703163074769; Thu, 21 Dec 2023 04:51:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703163074; cv=none; d=google.com; s=arc-20160816; b=aMrbEMkiC5zWAvFALwHzskbertBeNitC/ZxeZB+iNIxFEfhAXAN3bLoxKAFHIbtDyS 8UlW6l3Ixhl0iY6/MFIPaqHY8UgZQMpCYBgZLbfthDUQ3ghhZh3Ubo7XJLy//OWaQHPY 5ltbsBIUGj8oIiTKdIXIa00BFGiBmQ8/x4ZGMdl1V/1GY/Xrik9cTWxV9q6Gn2hGmqpX 6fHjKuyHQeJm2cBhShPFPUeJjRC/+xDnejKSgqL9wqtTMzJnuGY7z6OKGxT0hI2GDReH /xFUNtO+/A2yGv/BJAqpmyJsRXX1b/ZyTRXT5KElFEPBJqxseDx9nXD4h7M8KEbTc9N3 Hesg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=tYPUMKNV5r5iwCpNyGf5z+EjApPZ6cJiGsUwoO63g/s=; fh=tj3vwvS1joPqVAqhm025RI9FzN3aC+9rlGGIIVsXGr8=; b=xdhe1sSrL5nAyTbIUhZEB7NAATJNPHlOOElI9xu38iP8EyEkVSn641zoM7UUhVQWIj 42DKaGtQ5KLSt2S0k9/sYU1q4jPyIxVNzNebb+ptAVPTvw4Ma32AFHFBBCcc/eKuBt0W iPZClq/cTtMzogVESnLtBtIAeMWf2Il0+FzcsCNX919sKrpg+ZEB0qsSAQaGrG8y3neF akeg46/KDv3bkBksB3scM5yB4dmflqIaGq7vDDwtDGVGqWq+rKHlyD17o1v+gOtmZTFP Gm++4e3iPLHf/3QJZa5RyYcd/Vue7Q/PaU1mpUr0TMyPCsiCecKAYlgBhBrBkn53oh7L wjSw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b="0rXki/i7"; spf=pass (google.com: domain of linux-kernel+bounces-8375-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-8375-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id dk18-20020a0564021d9200b00553a7472908si834179edb.517.2023.12.21.04.51.14 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Dec 2023 04:51:14 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-8375-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b="0rXki/i7"; spf=pass (google.com: domain of linux-kernel+bounces-8375-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-8375-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 08CD01F230F1 for ; Thu, 21 Dec 2023 12:51:14 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1339677F13; Thu, 21 Dec 2023 12:48:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="0rXki/i7" X-Original-To: linux-kernel@vger.kernel.org Received: from madrid.collaboradmins.com (madrid.collaboradmins.com [46.235.227.194]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1DA6876900; Thu, 21 Dec 2023 12:48:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1703162918; bh=p/EOsjlnUG8TWP5dtPJrrTSLSXOX9zk6B1BSsJtTuDo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=0rXki/i7WMZ5tTuOkWXzYijiL60wn+uxW5CzF708Pd9ZGIjF2XenuOGQKkCDNDz0B Efnzm5IvxZsSzj3O4Qer/vrxpTgxSV3qAHm49rVvPQaI7r6v4QK243V5fwl2Vmzx2k 80mH6QJwBqy7VQxL5b2eS6rc5REF/LcvAc/QAFRksHGudONXupFywD9jpOoXBQdOmq /w7SkHiWLU/gwytAbcZdvZmAA9xGGOaQDhCsXUD9nv4mVM6+pwDJPin3Ij/vZINJ8K go4OIZSOad9kM5Bwv+8blxAjdPdEfwENZ7ixPBxY+hFqd+xOQ25ZMMQI6Zx9iBTjkm LSQjhJhM1pwUw== Received: from IcarusMOD.eternityproject.eu (cola.collaboradmins.com [195.201.22.229]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: kholk11) by madrid.collaboradmins.com (Postfix) with ESMTPSA id F11143782007; Thu, 21 Dec 2023 12:48:37 +0000 (UTC) From: AngeloGioacchino Del Regno To: daniel.lezcano@linaro.org Cc: rafael@kernel.org, rui.zhang@intel.com, lukasz.luba@arm.com, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, AngeloGioacchino Del Regno , kernel@collabora.com Subject: [RFC PATCH 08/26] thermal/drivers/st: Migrate to thermal_zone_device_register() Date: Thu, 21 Dec 2023 13:48:07 +0100 Message-ID: <20231221124825.149141-9-angelogioacchino.delregno@collabora.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231221124825.149141-1-angelogioacchino.delregno@collabora.com> References: <20231221124825.149141-1-angelogioacchino.delregno@collabora.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1785895924206731699 X-GMAIL-MSGID: 1785895924206731699 The thermal API has a new thermal_zone_device_register() function which is deprecating the older thermal_zone_device_register_with_trips() and thermal_tripless_zone_device_register(). Migrate to the new thermal zone device registration function. Signed-off-by: AngeloGioacchino Del Regno --- drivers/thermal/st/st_thermal.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/drivers/thermal/st/st_thermal.c b/drivers/thermal/st/st_thermal.c index 0d6249b36609..ff4fe417a99b 100644 --- a/drivers/thermal/st/st_thermal.c +++ b/drivers/thermal/st/st_thermal.c @@ -143,9 +143,9 @@ int st_thermal_register(struct platform_device *pdev, struct st_thermal_sensor *sensor; struct device *dev = &pdev->dev; struct device_node *np = dev->of_node; + struct thermal_zone_device_params tzdp; const struct of_device_id *match; - int polling_delay; int ret; if (!np) { @@ -197,14 +197,17 @@ int st_thermal_register(struct platform_device *pdev, if (ret) goto sensor_off; - polling_delay = sensor->ops->register_enable_irq ? 0 : 1000; - trip.temperature = sensor->cdata->crit_temp; trip.type = THERMAL_TRIP_CRITICAL; - sensor->thermal_dev = - thermal_zone_device_register_with_trips(dev_name(dev), &trip, 1, 0, sensor, - &st_tz_ops, NULL, 0, polling_delay); + tzdp.type = dev_name(dev); + tzdp.ops = &st_tz_ops; + tzdp.devdata = sensor; + tzdp.trips = &trip; + tzdp.num_trips = 1; + tzdp.polling_delay = sensor->ops->register_enable_irq ? 0 : 1000; + + sensor->thermal_dev = thermal_zone_device_register(&tzdp); if (IS_ERR(sensor->thermal_dev)) { dev_err(dev, "failed to register thermal zone device\n"); ret = PTR_ERR(sensor->thermal_dev); From patchwork Thu Dec 21 12:48:08 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AngeloGioacchino Del Regno X-Patchwork-Id: 182191 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:2483:b0:fb:cd0c:d3e with SMTP id q3csp384971dyi; Thu, 21 Dec 2023 04:51:51 -0800 (PST) X-Google-Smtp-Source: AGHT+IGoo2bC4eLk4jZyHjiAhtm9AZ3qYZC2WixP7NiLXp7CG6/lBCQSceZuaOHAUFjfMbX/ROTb X-Received: by 2002:a17:90b:30d6:b0:28b:f58f:ea99 with SMTP id hi22-20020a17090b30d600b0028bf58fea99mr277151pjb.52.1703163110878; Thu, 21 Dec 2023 04:51:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703163110; cv=none; d=google.com; s=arc-20160816; b=07wlrfXj6k31HO5xDZSz/nqd37FSusZ6WVq8EglR1S/1dpbhYyxULs/Wi8Xlir6T0m y+q8z/MEkOOvVAhtD+mdIXLMMREr5cmcl+xx82Gl2FIr1eEi3h051x2ybsWwjLfuFETM ntLNrsUwIK3xYVPHx+T9OzY6GBrT1OubwSBWjX8HW6q8yzAd/5o4nB45dT35AshJKuIu SFQ2kmLBJC8qTNCpz4Y6ns2NBC6f1CWMiMur5zGUPDbTmOwowiCE5B+MEWGuq3qXeRGx eOfDhsc+yJWOc3xjoBnsSAvprgJUbpljw5e1QK9kwhJv5haRolOMhODMSOj64MZEHZmc Bnmg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=dF3CntZ+RsGzw4wjLBNjUMNZwudSmNvEaPrxRUxlieo=; fh=tj3vwvS1joPqVAqhm025RI9FzN3aC+9rlGGIIVsXGr8=; b=KdStCKIFR62xT1Kf/UPewNW3S6Z8JE8caRPyoaK0RBxVYC3GyirmA5stG1nhCHMXAW lbT8Ef7pTalTiRWiBh+geVZbwKKP6fJdfd+SFV4SIg9o/16taw1a5PelFnCRBOtBUHn+ VIhN6hi7FG/UR8IHoog99cEQuVgb75V0XKfwsnpN11JHh0vHZqlBgIJ9uIQDAYufAgpf TgRjFAQNaTAMxPjC+lzmWr9YPlMsmImcD84bhczgb4lKZS6IDpH2JZklcg9HohJiJHcQ wAk/XP6PkQv9q7ws7R+wL81FvycnU0yz0y0qEz97fUXYwzzRb7vJOhqfDE+3nwEkOv1N 1kmw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=4+r83MQy; spf=pass (google.com: domain of linux-kernel+bounces-8376-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-8376-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id h5-20020a17090ac38500b0028b67355609si1626195pjt.136.2023.12.21.04.51.50 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Dec 2023 04:51:50 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-8376-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=4+r83MQy; spf=pass (google.com: domain of linux-kernel+bounces-8376-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-8376-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 0C3762896A9 for ; Thu, 21 Dec 2023 12:51:34 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C4BA678E64; Thu, 21 Dec 2023 12:48:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="4+r83MQy" X-Original-To: linux-kernel@vger.kernel.org Received: from madrid.collaboradmins.com (madrid.collaboradmins.com [46.235.227.194]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C410776DAA; Thu, 21 Dec 2023 12:48:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1703162919; bh=wnC+dcrhV0iVIaIyTNFPvehYMUi62DJkXerciRSKVSU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=4+r83MQyzpu6fAk2k1xACe732mKnUBZgWFfeM/NfE/jiCilqyNRPfMJo5DU7CYTC9 AjgqIEBnhLWPVtDIgOv0UqPIcPLGdjG7S/Ekt15wOndD2uH65/sSlBKxM6QrT01cPd VRSugMaow5/dqhviYdrBF6jJIje4O/RTyqufwuhgMh8qRL7Z4BfXkJHdU9rwOz92tY LpCqJjFXfDSwQQ87T/JJVVnzDCtnPeIPzAdWVIpoKFjO6oORsxOwHEHjFKagFyGpBu k3fp9OZjzMoSIc/90BhPl4G1Kn/ZzYrIOk+oXO7P+tccTQJZ8WIk+dDnAia/7IaEgx dNRmZAv7Cfhfg== Received: from IcarusMOD.eternityproject.eu (cola.collaboradmins.com [195.201.22.229]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: kholk11) by madrid.collaboradmins.com (Postfix) with ESMTPSA id B92A4378200E; Thu, 21 Dec 2023 12:48:38 +0000 (UTC) From: AngeloGioacchino Del Regno To: daniel.lezcano@linaro.org Cc: rafael@kernel.org, rui.zhang@intel.com, lukasz.luba@arm.com, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, AngeloGioacchino Del Regno , kernel@collabora.com Subject: [RFC PATCH 09/26] thermal: intel: pch_thermal: Migrate to thermal_zone_device_register() Date: Thu, 21 Dec 2023 13:48:08 +0100 Message-ID: <20231221124825.149141-10-angelogioacchino.delregno@collabora.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231221124825.149141-1-angelogioacchino.delregno@collabora.com> References: <20231221124825.149141-1-angelogioacchino.delregno@collabora.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1785895962151398856 X-GMAIL-MSGID: 1785895962151398856 The thermal API has a new thermal_zone_device_register() function which is deprecating the older thermal_zone_device_register_with_trips() and thermal_tripless_zone_device_register(). Migrate to the new thermal zone device registration function. Signed-off-by: AngeloGioacchino Del Regno --- drivers/thermal/intel/intel_pch_thermal.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/drivers/thermal/intel/intel_pch_thermal.c b/drivers/thermal/intel/intel_pch_thermal.c index b3905e34c507..dfc4b206633e 100644 --- a/drivers/thermal/intel/intel_pch_thermal.c +++ b/drivers/thermal/intel/intel_pch_thermal.c @@ -159,6 +159,7 @@ static const char *board_names[] = { static int intel_pch_thermal_probe(struct pci_dev *pdev, const struct pci_device_id *id) { + struct thermal_zone_device_params tzdp = { .ops = &tzd_ops }; enum pch_board_ids board_id = id->driver_data; struct pch_thermal_device *ptd; int nr_trips = 0; @@ -233,10 +234,12 @@ static int intel_pch_thermal_probe(struct pci_dev *pdev, nr_trips += pch_wpt_add_acpi_psv_trip(ptd, nr_trips); - ptd->tzd = thermal_zone_device_register_with_trips(board_names[board_id], - ptd->trips, nr_trips, - 0, ptd, &tzd_ops, - NULL, 0, 0); + tzdp.type = board_names[board_id]; + tzdp.devdata = ptd; + tzdp.trips = ptd->trips; + tzdp.num_trips = nr_trips; + + ptd->tzd = thermal_zone_device_register(&tzdp); if (IS_ERR(ptd->tzd)) { dev_err(&pdev->dev, "Failed to register thermal zone %s\n", board_names[board_id]); From patchwork Thu Dec 21 12:48:09 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AngeloGioacchino Del Regno X-Patchwork-Id: 182192 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:2483:b0:fb:cd0c:d3e with SMTP id q3csp384988dyi; Thu, 21 Dec 2023 04:51:53 -0800 (PST) X-Google-Smtp-Source: AGHT+IHY9xcR7HP47OFV4MT3yn2MIQlKYo+zpuXgoXBwSuhk8D92GTJF1v4jAySIN0kF8uKa1qKw X-Received: by 2002:a2e:b60b:0:b0:2cc:6b59:d34a with SMTP id r11-20020a2eb60b000000b002cc6b59d34amr3901404ljn.81.1703163113524; Thu, 21 Dec 2023 04:51:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703163113; cv=none; d=google.com; s=arc-20160816; b=bEbw7BZayW5w6/LkvK2OZfCux88Ce8ffT+wPQyPrEsywxt5SUggnEaYXn5W/mN3889 brxrJKudSEQwuK0Q2AYb8fi/Zebgi8ezlpVaJvqWG2zYvLhReqWS4GacyBt7bKoMDoZd i1dCCTEYhhBrgFbwea/OVQxvvzUm6BphAOKf+aD6muxPrWAASgDOlOEFQU8ZCFdQrnQg C5VZg2Zavv+q1HdpbnMMB5rx0pVVHm9YlvTSYyHAiPUsEWuUu2+Pim6d4O5MSY2Tf1K6 NR9KTD8nAkP3DWqbjIDqLBT7fAkpYY/rOL74NRWVrZbIj2dzzOhmEelPoefcoSrN//m2 YIYw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=BB3O5syr0Qiyhw4HYuSQ8PPDssLiMKbdNcFOiWq31V8=; fh=tj3vwvS1joPqVAqhm025RI9FzN3aC+9rlGGIIVsXGr8=; b=BRiz5jR8SC/OSQJ+6xtGFj+h8teLKr4V6Bvvi53h7EHehQcAcDwi7Rqv3UWkCstE+m IWSxOGW68RpmTluVd4iBFemvjT7108PceByZZsY4+6uriSjLvjJMFc0xPVoDBK2Oz3wA 2PsMNlJBOG1qL4A4iKifZGnBU/3WKlX3ulFcqs66TPa6QfvgyTU4sYwQvsKMuJ1iYt+d 81io9NdbROCJYPDitu2aARQn5Git9ZqwuFNrGKkI5c3N2magc/376fvPccbt2mubNM0Z T63ihiQLZKN4WXoA471n1RrjUgcRgrIm1M6phR5kU3AaoBJNgnTp2TUIg8l7TwUru7l8 OUEA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=5gsJOMjM; spf=pass (google.com: domain of linux-kernel+bounces-8377-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-8377-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id dk18-20020a0564021d9200b00553a7472908si834179edb.517.2023.12.21.04.51.53 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Dec 2023 04:51:53 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-8377-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=5gsJOMjM; spf=pass (google.com: domain of linux-kernel+bounces-8377-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-8377-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 232251F249F8 for ; Thu, 21 Dec 2023 12:51:53 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7AFFD78E8F; Thu, 21 Dec 2023 12:48:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="5gsJOMjM" X-Original-To: linux-kernel@vger.kernel.org Received: from madrid.collaboradmins.com (madrid.collaboradmins.com [46.235.227.194]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7893276DC5; Thu, 21 Dec 2023 12:48:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1703162920; bh=4bQSiBNgTYsHNVsUGFRKvfMVMntQwjwyam0YGEYDVaU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=5gsJOMjM+R1c++SVL+sieGiuK8C69VmwTXpogKpOQABSM2muR8tPbe8GF5t1/1q8f 5pVBvKJVYMDTcQOEU4M4T5muSmmSJ8sgFDKNP+XvzSG7CtY00hVcZK0/BOhYMHyH0k sqJYD/flhie/WKUmvhzedY12KM0Cp4PRzJC1uU8CTiItEDarkoXT3cYR6WxCQH36hg DPitOMeUvU7BGd2vEnFGplNuylD4Xg2bvW6sH3/xqtDXjHIVf2bJutn41k7yLoxvu4 zCtr4fWtfcuSJU2f4a9xYbet1ZDl7ofwrPgS2yc7FP+MGtGwrnxycBvn4AKdYPsZwX 9SkNk0ml4frjA== Received: from IcarusMOD.eternityproject.eu (cola.collaboradmins.com [195.201.22.229]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: kholk11) by madrid.collaboradmins.com (Postfix) with ESMTPSA id 85E283782012; Thu, 21 Dec 2023 12:48:39 +0000 (UTC) From: AngeloGioacchino Del Regno To: daniel.lezcano@linaro.org Cc: rafael@kernel.org, rui.zhang@intel.com, lukasz.luba@arm.com, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, AngeloGioacchino Del Regno , kernel@collabora.com Subject: [RFC PATCH 10/26] thermal: intel: quark_dts: Migrate to thermal_zone_device_register() Date: Thu, 21 Dec 2023 13:48:09 +0100 Message-ID: <20231221124825.149141-11-angelogioacchino.delregno@collabora.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231221124825.149141-1-angelogioacchino.delregno@collabora.com> References: <20231221124825.149141-1-angelogioacchino.delregno@collabora.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1785895965169491362 X-GMAIL-MSGID: 1785895965169491362 The thermal API has a new thermal_zone_device_register() function which is deprecating the older thermal_zone_device_register_with_trips() and thermal_tripless_zone_device_register(). Migrate to the new thermal zone device registration function. Signed-off-by: AngeloGioacchino Del Regno --- .../thermal/intel/intel_quark_dts_thermal.c | 21 +++++++++++-------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/drivers/thermal/intel/intel_quark_dts_thermal.c b/drivers/thermal/intel/intel_quark_dts_thermal.c index 646ca8bd40a9..aba2db87c140 100644 --- a/drivers/thermal/intel/intel_quark_dts_thermal.c +++ b/drivers/thermal/intel/intel_quark_dts_thermal.c @@ -320,10 +320,14 @@ static void free_soc_dts(struct soc_sensor_entry *aux_entry) static struct soc_sensor_entry *alloc_soc_dts(void) { + struct thermal_zone_device_params tzdp = { + .type = "quark_dts", + .ops = &tzone_ops, + .polling_delay = polling_delay, + }; struct soc_sensor_entry *aux_entry; int err; u32 out; - int wr_mask; aux_entry = kzalloc(sizeof(*aux_entry), GFP_KERNEL); if (!aux_entry) { @@ -339,10 +343,10 @@ static struct soc_sensor_entry *alloc_soc_dts(void) if (out & QRK_DTS_LOCK_BIT) { aux_entry->locked = true; - wr_mask = QRK_DTS_WR_MASK_CLR; + tzdp.mask = QRK_DTS_WR_MASK_CLR; } else { aux_entry->locked = false; - wr_mask = QRK_DTS_WR_MASK_SET; + tzdp.mask = QRK_DTS_WR_MASK_SET; } /* Store DTS default state if DTS registers are not locked */ @@ -368,12 +372,11 @@ static struct soc_sensor_entry *alloc_soc_dts(void) aux_entry->trips[QRK_DTS_ID_TP_HOT].temperature = get_trip_temp(QRK_DTS_ID_TP_HOT); aux_entry->trips[QRK_DTS_ID_TP_HOT].type = THERMAL_TRIP_HOT; - aux_entry->tzone = thermal_zone_device_register_with_trips("quark_dts", - aux_entry->trips, - QRK_MAX_DTS_TRIPS, - wr_mask, - aux_entry, &tzone_ops, - NULL, 0, polling_delay); + tzdp.devdata = aux_entry; + tzdp.trips = aux_entry->trips; + tzdp.num_trips = QRK_MAX_DTS_TRIPS; + + aux_entry->tzone = thermal_zone_device_register(&tzdp); if (IS_ERR(aux_entry->tzone)) { err = PTR_ERR(aux_entry->tzone); goto err_ret; From patchwork Thu Dec 21 12:48:10 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AngeloGioacchino Del Regno X-Patchwork-Id: 182193 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:2483:b0:fb:cd0c:d3e with SMTP id q3csp385222dyi; Thu, 21 Dec 2023 04:52:20 -0800 (PST) X-Google-Smtp-Source: AGHT+IECgpCZlxE//2UNVyjuEzwmfoh3HnJgZK2ozLhfQYW1mKb4RrF76y+6SK9Sq+3KUPBQ13xF X-Received: by 2002:a05:6871:8a3:b0:203:fbeb:dab2 with SMTP id r35-20020a05687108a300b00203fbebdab2mr1508402oaq.46.1703163140449; Thu, 21 Dec 2023 04:52:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703163140; cv=none; d=google.com; s=arc-20160816; b=wFCGFI+jagiAw8/kbHr+fCYztcXjdUgf3brCSQEbPacjlc2hqlkqnHRmkSoZbdoh+T /XtXr8TKsw51DXct9wCHsghO++n0kL7aQmyMIpq5RZv7HJC1H9BYs2MzN8+AeIADNxKe wsyJGTqQDGr0jesPRM+gsMoWN5kwx3s2ajD+2j75HOSkEnfBJd3MTbm6rMyKGBefejcU 7o/+1qUTvu20VKQ9rIvfnx/q5RC0X6Qg5/MJ/6sq2uFQ8O1HTCih+8zeNHTNaOOwfRfX sYVZ+V2E9cYx5aviIG9G4dTzCzdM52/84c4nQL/rgWHSxICMQrc2SjWb0vM+GegTuSsn nsQQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=utnuwvGgSoaibmW0K5wXMq+Y4C4nqbC819M+eOA7d/s=; fh=tj3vwvS1joPqVAqhm025RI9FzN3aC+9rlGGIIVsXGr8=; b=QAODaXmSnbScSfEnZwS+kWWfJCKsUfinM/RD7NaSBzGA5eXeW9Khf8VubK7UFLcp/D xNZU2mThb7yPGGJpSUPJtXLbXJdK7bKqOeqLwyXUcyJ4ya2VENEF7GmtQYi9IL9RVVZz nedVKQVBFm2zKiBbQh6LIRNKPhpAF0FKkm9ghPTdReaRp6Su0q/CbMJVsISh/lp8lcMy YTsEOlmpZ6IG3hFKe9aeS4VYIxpsWjFso2hOM3RDE1jUVv8joEBvcV+2sTy8pOq54IB4 sRukTiKPPYdWlk101WqXKPPXxAy9d5fkES6I0xW/QlBw6G5kx8pxi0XDkL6BLjS/+zfh uknQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=nUYtAkeQ; spf=pass (google.com: domain of linux-kernel+bounces-8378-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-8378-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id x42-20020a056a000bea00b006d93fa631besi1493176pfu.222.2023.12.21.04.52.20 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Dec 2023 04:52:20 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-8378-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=nUYtAkeQ; spf=pass (google.com: domain of linux-kernel+bounces-8378-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-8378-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 8A4E6288C64 for ; Thu, 21 Dec 2023 12:52:09 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2DEAE76DC5; Thu, 21 Dec 2023 12:48:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="nUYtAkeQ" X-Original-To: linux-kernel@vger.kernel.org Received: from madrid.collaboradmins.com (madrid.collaboradmins.com [46.235.227.194]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 312277762A; Thu, 21 Dec 2023 12:48:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1703162920; bh=+Uc91cWhTwL1vrnkQPriFheqqqM+d7m3ZfQlLpU8beI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nUYtAkeQpPKWX3E+VAAwSLCrf+b+NQuQGwd6n3KzAeUG21yVxfO5YyaDxyLkPw5Kg 5URTEaellnolbb+I1Nq04GhdiiAejA/otM2a1Jt9AyRaXCRImM4t+Lq06iVIMH1InQ SnzXEviexiI1mqPXrdhOimHIbT63uG/66aQV6GjeXsc+NaiYn4q4dAXA1oWhAjBzhL 1IH6g4do1u1Ypdm9SbQmlUix4872YxiO2RYqPL0GhIm3VWciVxbtZYqgogFI+xrYP+ X/q/vATQiZkAIFT/m+xUexn3aDwTchmdS/Bqrsmw81WjtwLkmlrypWqzDYVbUagqRa PRmGTd7TdCtnA== Received: from IcarusMOD.eternityproject.eu (cola.collaboradmins.com [195.201.22.229]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: kholk11) by madrid.collaboradmins.com (Postfix) with ESMTPSA id 4FA4B3782013; Thu, 21 Dec 2023 12:48:40 +0000 (UTC) From: AngeloGioacchino Del Regno To: daniel.lezcano@linaro.org Cc: rafael@kernel.org, rui.zhang@intel.com, lukasz.luba@arm.com, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, AngeloGioacchino Del Regno , kernel@collabora.com Subject: [RFC PATCH 11/26] thermal: intel: soc_dts_iosf: Migrate to thermal_zone_device_register() Date: Thu, 21 Dec 2023 13:48:10 +0100 Message-ID: <20231221124825.149141-12-angelogioacchino.delregno@collabora.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231221124825.149141-1-angelogioacchino.delregno@collabora.com> References: <20231221124825.149141-1-angelogioacchino.delregno@collabora.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1785895992818672644 X-GMAIL-MSGID: 1785895992818672644 The thermal API has a new thermal_zone_device_register() function which is deprecating the older thermal_zone_device_register_with_trips() and thermal_tripless_zone_device_register(). Migrate to the new thermal zone device registration function. Signed-off-by: AngeloGioacchino Del Regno --- drivers/thermal/intel/intel_soc_dts_iosf.c | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/drivers/thermal/intel/intel_soc_dts_iosf.c b/drivers/thermal/intel/intel_soc_dts_iosf.c index d00def3c4703..da89e4b492b1 100644 --- a/drivers/thermal/intel/intel_soc_dts_iosf.c +++ b/drivers/thermal/intel/intel_soc_dts_iosf.c @@ -220,8 +220,13 @@ static void remove_dts_thermal_zone(struct intel_soc_dts_sensor_entry *dts) static int add_dts_thermal_zone(int id, struct intel_soc_dts_sensor_entry *dts, bool critical_trip) { + struct thermal_zone_device_params tzdp = { + .ops = &tzone_ops, + .devdata = dts, + .trips = dts->trips, + .num_trips = SOC_MAX_DTS_TRIPS, + }; int writable_trip_cnt = SOC_MAX_DTS_TRIPS; - char name[10]; unsigned long trip; int trip_mask; unsigned long ptps; @@ -253,12 +258,15 @@ static int add_dts_thermal_zone(int id, struct intel_soc_dts_sensor_entry *dts, trip_mask &= ~BIT(i / 8); } dts->trip_mask = trip_mask; - snprintf(name, sizeof(name), "soc_dts%d", id); - dts->tzone = thermal_zone_device_register_with_trips(name, dts->trips, - SOC_MAX_DTS_TRIPS, - trip_mask, - dts, &tzone_ops, - NULL, 0, 0); + + tzdp.type = kasprintf(GFP_KERNEL, "soc_dts%d", id); + if (!tzdp.type) + return -ENOMEM; + + tzdp.mask = trip_mask; + + dts->tzone = thermal_zone_device_register(&tzdp); + kfree(tzdp.type); if (IS_ERR(dts->tzone)) { ret = PTR_ERR(dts->tzone); goto err_ret; From patchwork Thu Dec 21 12:48:11 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AngeloGioacchino Del Regno X-Patchwork-Id: 182195 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:2483:b0:fb:cd0c:d3e with SMTP id q3csp385313dyi; Thu, 21 Dec 2023 04:52:31 -0800 (PST) X-Google-Smtp-Source: AGHT+IFcZlt0Ogge6PVeyGOVqzENiotKJHMeHDQXc0OOJi/HGsplihb45WsJ4NS4ECz75FlFvRzA X-Received: by 2002:a05:651c:514:b0:2cc:1def:18aa with SMTP id o20-20020a05651c051400b002cc1def18aamr10227353ljp.96.1703163151633; Thu, 21 Dec 2023 04:52:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703163151; cv=none; d=google.com; s=arc-20160816; b=bKpP4lB6JfYOv5piopZkuuEtVbOL69AglPVOhaSTwzZjvPoC1ES4Gu3Hn2WKksU/mL /TkegN2Pvy4aJp2D5sSqN+RuDkGK4TMbWMOAIXGS7xfzro/8GH8J0JtjAc33Loag930H fXK80WzGiexUT4Va2qCpCb+c9pNwqDvR9hfM0MYWZwZ6meGfHPQYKRJoczm1TCXYIEDw R6xNdaHrJdCDleLm1/kxWurZ3yiRUqwD2MRmnHIDV7aCBjnxkp3wwOdYcwH6kKH8JemS H61eTINSo/o18MnfZo8rTVLQbp4K9CfCNTt9bTu1jGZKYWegKdZzS6X6g69QVGqk0fpV wJ4w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=Wg02Ka/IIgjxeHAJlbocUELK+p/TZXOhiTWsP+bzg5E=; fh=tj3vwvS1joPqVAqhm025RI9FzN3aC+9rlGGIIVsXGr8=; b=TFecUS6bcG34xhUDklZ+ywQObbGaBmkGopo4SDIObLx1vuwVe6QWDLTJWxzPAv8Vc4 yAyYUmVKeivskDwrHJJxqnOHlAf/AXY5XZ+ZI1Pu4FCwNePCb2AZjPLsUjU6oaPXdgyo mZaWpKdyYYerPg9VOQcbV6T4/TiXcBRt4mK8PHuzH6cpKMXGio/SyHHg3wXLupdNueb/ CQvwTdujn7arLZqyC8HrCHnIngloPgUSqYLgjIRoWrQvX17cZc/DHEqfWY7ral4qvhLK 4LW1Kte76gWlFr9bkQS9waLnVECZgovaS9polk5s2duYcmILygM9SzAVWkg04v5HmN9X eBDA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=tAR+vkKM; spf=pass (google.com: domain of linux-kernel+bounces-8380-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-8380-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id eh19-20020a0564020f9300b0054cc8d2c0d9si823527edb.565.2023.12.21.04.52.31 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Dec 2023 04:52:31 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-8380-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=tAR+vkKM; spf=pass (google.com: domain of linux-kernel+bounces-8380-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-8380-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 3C9361F25D25 for ; Thu, 21 Dec 2023 12:52:31 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E496579951; Thu, 21 Dec 2023 12:48:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="tAR+vkKM" X-Original-To: linux-kernel@vger.kernel.org Received: from madrid.collaboradmins.com (madrid.collaboradmins.com [46.235.227.194]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id F0D0F77650; Thu, 21 Dec 2023 12:48:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1703162921; bh=amWRBEfS8645R/5+LBfYIOcKFJwKDzDQq6B0ItRjNNs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tAR+vkKMQ1u39cVeSDh2DBCkh9XH9qAL22s3UcNkoWfrbVuDHBMY60t4Tor+DLFp6 4geaYoSj0SqKLFS7j+RfsM69lJ8xwkEpMmnwY6S2zIhrjNYLUh0vYTwErGLCwXwjvO foC0mdYFf3hBx2cxqI1Hi8vepM/0RsIUOEEXIhRuzqp5KVjGTqAyLGKWUVnd/754EG xmwNloeo32TNFu9rHHBephIMgTaY1p4dszg/9hoK6hcEpwjbDfPvy0vz9w/5IFjtMH 1YSBUjj/vQibIgSVVuY3zf+nBHGrbEdmcZSY8q20devOG0gsMTigtorTVaqv1dcVEq oQGe1++PdpW/w== Received: from IcarusMOD.eternityproject.eu (cola.collaboradmins.com [195.201.22.229]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: kholk11) by madrid.collaboradmins.com (Postfix) with ESMTPSA id 161803782016; Thu, 21 Dec 2023 12:48:41 +0000 (UTC) From: AngeloGioacchino Del Regno To: daniel.lezcano@linaro.org Cc: rafael@kernel.org, rui.zhang@intel.com, lukasz.luba@arm.com, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, AngeloGioacchino Del Regno , kernel@collabora.com Subject: [RFC PATCH 12/26] thermal: intel: int340x: Migrate to thermal_zone_device_register() Date: Thu, 21 Dec 2023 13:48:11 +0100 Message-ID: <20231221124825.149141-13-angelogioacchino.delregno@collabora.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231221124825.149141-1-angelogioacchino.delregno@collabora.com> References: <20231221124825.149141-1-angelogioacchino.delregno@collabora.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1785896004752012019 X-GMAIL-MSGID: 1785896004752012019 The thermal API has a new thermal_zone_device_register() function which is deprecating the older thermal_zone_device_register_with_trips() and thermal_tripless_zone_device_register(). Migrate to the new thermal zone device registration function. Signed-off-by: AngeloGioacchino Del Regno --- .../int340x_thermal/int340x_thermal_zone.c | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/drivers/thermal/intel/int340x_thermal/int340x_thermal_zone.c b/drivers/thermal/intel/int340x_thermal/int340x_thermal_zone.c index a03b67579dd9..431f09ef65e6 100644 --- a/drivers/thermal/intel/int340x_thermal/int340x_thermal_zone.c +++ b/drivers/thermal/intel/int340x_thermal/int340x_thermal_zone.c @@ -118,19 +118,19 @@ static int int340x_thermal_read_trips(struct acpi_device *zone_adev, return trip_cnt; } -static struct thermal_zone_params int340x_thermal_params = { - .governor_name = "user_space", - .no_hwmon = true, -}; - struct int34x_thermal_zone *int340x_thermal_zone_add(struct acpi_device *adev, int (*get_temp) (struct thermal_zone_device *, int *)) { + struct thermal_zone_device_params tzdp = { + .tzp = { + .governor_name = "user_space", + .no_hwmon = true, + } + }; struct int34x_thermal_zone *int34x_zone; struct thermal_trip *zone_trips; unsigned long long trip_cnt = 0; unsigned long long hyst; - int trip_mask = 0; acpi_status status; int i, ret; @@ -153,7 +153,7 @@ struct int34x_thermal_zone *int340x_thermal_zone_add(struct acpi_device *adev, status = acpi_evaluate_integer(adev->handle, "PATC", NULL, &trip_cnt); if (ACPI_SUCCESS(status)) { int34x_zone->aux_trip_nr = trip_cnt; - trip_mask = BIT(trip_cnt) - 1; + tzdp.mask = BIT(trip_cnt) - 1; } zone_trips = kzalloc(sizeof(*zone_trips) * (trip_cnt + INT340X_THERMAL_MAX_TRIP_COUNT), @@ -183,13 +183,13 @@ struct int34x_thermal_zone *int340x_thermal_zone_add(struct acpi_device *adev, int34x_zone->lpat_table = acpi_lpat_get_conversion_table(adev->handle); - int34x_zone->zone = thermal_zone_device_register_with_trips( - acpi_device_bid(adev), - zone_trips, trip_cnt, - trip_mask, int34x_zone, - int34x_zone->ops, - &int340x_thermal_params, - 0, 0); + tzdp.type = acpi_device_bid(adev); + tzdp.ops = int34x_zone->ops; + tzdp.devdata = int34x_zone; + tzdp.trips = zone_trips; + tzdp.num_trips = trip_cnt; + + int34x_zone->zone = thermal_zone_device_register(&tzdp); if (IS_ERR(int34x_zone->zone)) { ret = PTR_ERR(int34x_zone->zone); goto err_thermal_zone; From patchwork Thu Dec 21 12:48:12 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AngeloGioacchino Del Regno X-Patchwork-Id: 182196 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:2483:b0:fb:cd0c:d3e with SMTP id q3csp385525dyi; Thu, 21 Dec 2023 04:52:57 -0800 (PST) X-Google-Smtp-Source: AGHT+IHQnObMoySAzGi74nGkWW6m0FgxwVczVwJ46TIViU5c7wRFWkX9D0lpwvFzZuO4Flxaq3Og X-Received: by 2002:a50:c316:0:b0:554:3d38:6305 with SMTP id a22-20020a50c316000000b005543d386305mr57675edb.9.1703163177137; Thu, 21 Dec 2023 04:52:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703163177; cv=none; d=google.com; s=arc-20160816; b=JguPQHH5s7vsJYw1nA0uO6YgM4d2Ak1itXcN6F5Tw32vmZ02qoEglR3QOvys0s4vRJ 1ztw+ekhnuwE/wG7ZGyqHPkgowIkniiXxr+7FxgPNudeyPK4+1djj/jXLG8A9MDPwmoT GNZ4rzzReTKoRkoxFll2wUwU2GJOnZtVsig+0E8j0+n0K1sBCt1tO7KHX/qqXhe4CDwJ wUWbS29VKS8B21vkfsSoRYx8iWxmpmfw1TR6GTUsPvLPaSzPLKEzKs96Genc1hCSdpC1 umUEidjE5CRCjPAWPAmX2HgFmR24W6U7xt4DEBDkxatrfqQyrrTCX8GSYIztX2qzF9cA 4mJQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=+f/6CL6DE+fL+D6DLIFIJxWO9QLHFp4vmXoBQUmxtHM=; fh=tj3vwvS1joPqVAqhm025RI9FzN3aC+9rlGGIIVsXGr8=; b=uASjIXcE39Ghyk6q6VBPpBEnvjlwVla/e9cac1o9Cvtdrv8D9SLTQBR8Y/R2FZ2yTa 1q+jWwLuGTLW5GL8EkYlpYmBj2Y2v90JEJ69YkcXghtQO6+G4ZbSEl4oavL6CbfBbbHh Wn0dZIdZRKvyeDg9U0XDJVhYVMHdw+5Mfdnc7CJ/YhJT4CsdtjWaKl73KeiTFxubTyKq GGUT6Dhib6Fsgl4Z4SUlfNEfey5BGz4yq9KJTU3UoTjMAxZO8NYoz1gc4PmV1fiBNw2k L3tAwQVFYl/4NYJC4yciOizQtkXDN8S+XVNyxE0QPhLt1elsqjvAJoGQbR0gPGlxW3rE 48qQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=qVC94pb6; spf=pass (google.com: domain of linux-kernel+bounces-8382-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-8382-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id c20-20020a05640227d400b0055344c8cfccsi845148ede.567.2023.12.21.04.52.56 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Dec 2023 04:52:57 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-8382-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=qVC94pb6; spf=pass (google.com: domain of linux-kernel+bounces-8382-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-8382-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id BB9371F25F29 for ; Thu, 21 Dec 2023 12:52:56 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E91FE7A20D; Thu, 21 Dec 2023 12:48:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="qVC94pb6" X-Original-To: linux-kernel@vger.kernel.org Received: from madrid.collaboradmins.com (madrid.collaboradmins.com [46.235.227.194]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id F3EBD73183; Thu, 21 Dec 2023 12:48:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1703162922; bh=ets5nsuLlL8i2zc6z+9zFMpYPN9x47J3B6r/zyrf0o0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qVC94pb6NlGn9J1easJVCRLh0S7amPjKMQr1Hz0ix0GAY1zpO8002qwQ4e+yEcwiT Uh/+Lm2zTx6s6uSsb/GV6X8/oXMSgEGdbBwdjk9BfhAt6fylqZWPlwQBQh/ftLnVyT 6Ux63gwR4HWGbOGvDLBRxfX9senJxLWhGCbLLfQCxSjwpjZhyBlxiK5PiUovHK0EJ1 YVjzXD7ZbzRZY2DkMWAHlGumKiRmCbHzAzO+5LHgijH7zGTBBANkPN9xk1xXRpZytz pXq5mR2+L1xtFxgOcqcXuydCj+lVO72M9DA0ZkHKKUd6Wiv3C3+mbaLEfnjDXhYE0T yZQ5l3sS30BCw== Received: from IcarusMOD.eternityproject.eu (cola.collaboradmins.com [195.201.22.229]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: kholk11) by madrid.collaboradmins.com (Postfix) with ESMTPSA id D1843378201A; Thu, 21 Dec 2023 12:48:41 +0000 (UTC) From: AngeloGioacchino Del Regno To: daniel.lezcano@linaro.org Cc: rafael@kernel.org, rui.zhang@intel.com, lukasz.luba@arm.com, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, AngeloGioacchino Del Regno , kernel@collabora.com Subject: [RFC PATCH 13/26] thermal: int340x: processor: Migrate to thermal_zone_device_register() Date: Thu, 21 Dec 2023 13:48:12 +0100 Message-ID: <20231221124825.149141-14-angelogioacchino.delregno@collabora.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231221124825.149141-1-angelogioacchino.delregno@collabora.com> References: <20231221124825.149141-1-angelogioacchino.delregno@collabora.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1785896031912470564 X-GMAIL-MSGID: 1785896031912470564 The thermal API has a new thermal_zone_device_register() function which is deprecating the older thermal_zone_device_register_with_trips() and thermal_tripless_zone_device_register(). Migrate to the new thermal zone device registration function. Signed-off-by: AngeloGioacchino Del Regno --- .../processor_thermal_device_pci.c | 23 +++++++++++-------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/drivers/thermal/intel/int340x_thermal/processor_thermal_device_pci.c b/drivers/thermal/intel/int340x_thermal/processor_thermal_device_pci.c index d7495571dd5d..1e7b9172e11d 100644 --- a/drivers/thermal/intel/int340x_thermal/processor_thermal_device_pci.c +++ b/drivers/thermal/intel/int340x_thermal/processor_thermal_device_pci.c @@ -242,13 +242,17 @@ static struct thermal_zone_device_ops tzone_ops = { .set_trip_temp = sys_set_trip_temp, }; -static struct thermal_zone_params tzone_params = { - .governor_name = "user_space", - .no_hwmon = true, -}; - static int proc_thermal_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id) { + struct thermal_zone_device_params tzdp = { + .type = "TCPU_PCI", + .tzp = { + .governor_name = "user_space", + .no_hwmon = true, + }, + .ops = &tzone_ops, + .mask = 1, + }; struct proc_thermal_device *proc_priv; struct proc_thermal_pci *pci_info; int irq_flag = 0, irq, ret; @@ -289,10 +293,11 @@ static int proc_thermal_pci_probe(struct pci_dev *pdev, const struct pci_device_ psv_trip.temperature = get_trip_temp(pci_info); - pci_info->tzone = thermal_zone_device_register_with_trips("TCPU_PCI", &psv_trip, - 1, 1, pci_info, - &tzone_ops, - &tzone_params, 0, 0); + tzdp.devdata = pci_info; + tzdp.trips = &psv_trip; + tzdp.num_trips = 1; + + pci_info->tzone = thermal_zone_device_register(&tzdp); if (IS_ERR(pci_info->tzone)) { ret = PTR_ERR(pci_info->tzone); goto err_del_legacy; From patchwork Thu Dec 21 12:48:13 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AngeloGioacchino Del Regno X-Patchwork-Id: 182197 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:2483:b0:fb:cd0c:d3e with SMTP id q3csp385677dyi; Thu, 21 Dec 2023 04:53:16 -0800 (PST) X-Google-Smtp-Source: AGHT+IEZv7sojk4NlnHuikoFrAFRAHK1gIylup9yqQMPun3bOWL2tPkGyNv4pj1RLepS5Oz6wYh0 X-Received: by 2002:a05:6a20:1824:b0:18f:97c:825b with SMTP id bk36-20020a056a20182400b0018f097c825bmr747376pzb.101.1703163196482; Thu, 21 Dec 2023 04:53:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703163196; cv=none; d=google.com; s=arc-20160816; b=sFAH5GLc/mp0IzJ0F6l7gH82Gn7nkj0ZsNCtnzTwRJNpRQox+U4IC9lr4ktMuqQnyN trIypN22hQtBvbR6NnAuawrdkzZWac1t4+7DwWALhaA2L0KS2sP0eQfdEYf9RLH/i8cm J0BZGiZI78jD7V0+WhZpC3/81ozdgaJemklPEqSsHml8GQUcxuCTks+hHmq3CLEi+RQe 00mH/EeTvIhNgN5iqknDaGQ9WtNzIO0ZC5AeeQLDyB/XoXc/ZG1dpDXHF9CyGt0wdRB5 I3zyJkHEYcEuSPkOfHSOi6FG1XrAtWR0I90U7ussOJleNW4kRUsn7B98+WIMXMCK7Sb+ Zyrg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=SyDQUOqrpkGhVYTHpB+STnq4Eqx2IPAr9OrUik4dGb8=; fh=tj3vwvS1joPqVAqhm025RI9FzN3aC+9rlGGIIVsXGr8=; b=hQGM+/1Rsk+qJoP+NAsMqWhlQwcabDlDOceEJAjneStjXZpf4Q+cvdYT7OfTd7SYdb dcboNaf0TJC+OJGqHUJrr30a3noiYmsNUZzGg+zyDZoekGUw+MnXTlP8zgNvS/vK94wx e76nCE7ZVOQARtU4Y1p9fNY4xS4kHwSwibBjYTXToGTCAS6OJMo6Z6PgSXKBaof7amnf yTg3ZOjXRmdyIQcSNfsWXLDSgMTlqgIbonwDxWpHS7XciF8HrSBvFP2X08hjPApXta5H IYVTzUNW6b7TxVz/4J7OncIF6mjush7ZiDHnciRxYUvsLAgXmG/FhGmhU3iYsaGCFWbA cMgQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b="qicGfq/R"; spf=pass (google.com: domain of linux-kernel+bounces-8383-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-8383-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id bh4-20020a170902a98400b001d0a084b012si1391355plb.558.2023.12.21.04.53.16 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Dec 2023 04:53:16 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-8383-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b="qicGfq/R"; spf=pass (google.com: domain of linux-kernel+bounces-8383-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-8383-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 4464F2832E2 for ; Thu, 21 Dec 2023 12:53:16 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D862E7AE60; Thu, 21 Dec 2023 12:48:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="qicGfq/R" X-Original-To: linux-kernel@vger.kernel.org Received: from madrid.collaboradmins.com (madrid.collaboradmins.com [46.235.227.194]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DE99678E6A; Thu, 21 Dec 2023 12:48:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1703162923; bh=0ZHYzhTVEyHVYGEu0Vbtv3RzxoA8W7+Bwiowr0GjFQ8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qicGfq/RblLFSM9Pq53+m0knm05zAUH9HGX+bxyrbFDrUna7hNhaCyIjgX8Wz1odN /3Nz9U2MJkq3B1mlKoFZIf0leMIITRNe/54GLLcnLfSOo/WpP182iaLos9RZrUUO3T v79xf5mSj7IZSwLKM9XqmNcVkziLa7HEuFWmL6v0buUcub17GdMYl7ELBddarnEauH Uc8cUy7Hic0AJR5n/5GAs3IQOHquCEVERD5ep0qzjo3RkKCvBqHMVjz8QgmXHI4phg VRHxyZs6aM4ciEiASZ+ypVZLGd++LBRpJcxL1bixrr68AtqhD48ttWrryEkmoX0LR5 Ei4e3xqd8Rhvg== Received: from IcarusMOD.eternityproject.eu (cola.collaboradmins.com [195.201.22.229]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: kholk11) by madrid.collaboradmins.com (Postfix) with ESMTPSA id 99818378201D; Thu, 21 Dec 2023 12:48:42 +0000 (UTC) From: AngeloGioacchino Del Regno To: daniel.lezcano@linaro.org Cc: rafael@kernel.org, rui.zhang@intel.com, lukasz.luba@arm.com, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, AngeloGioacchino Del Regno , kernel@collabora.com Subject: [RFC PATCH 14/26] thermal: intel: x86_pkg_temp: Migrate to thermal_zone_device_register() Date: Thu, 21 Dec 2023 13:48:13 +0100 Message-ID: <20231221124825.149141-15-angelogioacchino.delregno@collabora.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231221124825.149141-1-angelogioacchino.delregno@collabora.com> References: <20231221124825.149141-1-angelogioacchino.delregno@collabora.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1785896052106202941 X-GMAIL-MSGID: 1785896052106202941 The thermal API has a new thermal_zone_device_register() function which is deprecating the older thermal_zone_device_register_with_trips() and thermal_tripless_zone_device_register(). Migrate to the new thermal zone device registration function. Signed-off-by: AngeloGioacchino Del Regno --- drivers/thermal/intel/x86_pkg_temp_thermal.c | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/drivers/thermal/intel/x86_pkg_temp_thermal.c b/drivers/thermal/intel/x86_pkg_temp_thermal.c index 11a7f8108bbb..8fdab44d28df 100644 --- a/drivers/thermal/intel/x86_pkg_temp_thermal.c +++ b/drivers/thermal/intel/x86_pkg_temp_thermal.c @@ -57,10 +57,6 @@ struct zone_device { struct cpumask cpumask; }; -static struct thermal_zone_params pkg_temp_tz_params = { - .no_hwmon = true, -}; - /* Keep track of how many zone pointers we allocated in init() */ static int max_id __read_mostly; /* Array of zone pointers */ @@ -312,6 +308,11 @@ static struct thermal_trip *pkg_temp_thermal_trips_init(int cpu, int tj_max, int static int pkg_temp_thermal_device_add(unsigned int cpu) { + struct thermal_zone_device_params tzdp = { + .type = "x86_pkg_temp", + .tzp = { .no_hwmon = true }, + .ops = &tzone_ops, + }; int id = topology_logical_die_id(cpu); u32 eax, ebx, ecx, edx; struct zone_device *zonedev; @@ -344,10 +345,13 @@ static int pkg_temp_thermal_device_add(unsigned int cpu) INIT_DELAYED_WORK(&zonedev->work, pkg_temp_thermal_threshold_work_fn); zonedev->cpu = cpu; - zonedev->tzone = thermal_zone_device_register_with_trips("x86_pkg_temp", - zonedev->trips, thres_count, - (thres_count == MAX_NUMBER_OF_TRIPS) ? 0x03 : 0x01, - zonedev, &tzone_ops, &pkg_temp_tz_params, 0, 0); + + tzdp.devdata = zonedev; + tzdp.trips = zonedev->trips; + tzdp.num_trips = thres_count; + tzdp.mask = (thres_count == MAX_NUMBER_OF_TRIPS) ? 0x03 : 0x01; + + zonedev->tzone = thermal_zone_device_register(&tzdp); if (IS_ERR(zonedev->tzone)) { err = PTR_ERR(zonedev->tzone); goto out_kfree_trips; From patchwork Thu Dec 21 12:48:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AngeloGioacchino Del Regno X-Patchwork-Id: 182198 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:2483:b0:fb:cd0c:d3e with SMTP id q3csp385792dyi; Thu, 21 Dec 2023 04:53:33 -0800 (PST) X-Google-Smtp-Source: AGHT+IEo/UePiYf2oHcA5coPs4myW423ojTWpnhXXTehxTO4c+FBTuke6dw1L5S39EuxfcDZGUPH X-Received: by 2002:a05:6e02:1a43:b0:35f:ae92:4995 with SMTP id u3-20020a056e021a4300b0035fae924995mr9488027ilv.56.1703163212782; Thu, 21 Dec 2023 04:53:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703163212; cv=none; d=google.com; s=arc-20160816; b=O5rN2aNnnW9DKR+3ELcGWMKOjcGQYDCKzI1Z0hXnOCBK2R44qQJtDbdXB8I2qpAFuo ZXFHOIGFmVLtISDbro5ggtU8hU0IWSItgReuSFVwrip15EC48x2MMBRz/XF0AwBLwDRX yMpQBiy3mwtUxEQzuf5+e4HB02q3ckoSMOMG8W6zuQ49EkOsCuECYlG1DR8uYKuo8hJ5 DQp5qGXz9OeQIrW81AdvtNhM0s75hro/fioJ9g7pBcYUtYjjHYmk7SMp0T3Sw4L9Itkl v8EJaaky+oEcj6CZ4oN0AJ14EtejI5c5KnOQXaLLQPyN0a84WxuA3fUf64vVZb1Oo4vI r79g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=/66MTpL18FcTcPXqnzLzdx3ruB6BwtIA2z3Ql9YQdMo=; fh=tj3vwvS1joPqVAqhm025RI9FzN3aC+9rlGGIIVsXGr8=; b=QdbSrj5P1W7bxG6/tkBfGeVjRwguBVF8CX5Ze8xVC+zFavIRGwiD1XfQIGOLtfu79i AhqQJs5qiknPWrYjMc9qdQvyPLTePSeVyJwuQljkR0mzX4YJic5d/ryDMBDo9Y021QJS mznE8weqf/K4ixGhZhLhdZW6rpHe0lkVCLVKDhdaTyy1QRfiiwu4UiJj/DR+7S/mBVnM SVfYGIfRMgL6+5BC+ztRJBlvDDBcr1G35j3YjKAqKGAcL3BNaW1kWxVnI4U+/PrTzSQV XtaEOEb8Vyt26mkCP2td0oifPFWUZQJuWCps6LowyChNoJoso0dFSZmEieeU6+LSWT0r bBYA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=QicB7AJB; spf=pass (google.com: domain of linux-kernel+bounces-8384-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-8384-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id w188-20020a6362c5000000b005cd8d760e3dsi1525803pgb.635.2023.12.21.04.53.32 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Dec 2023 04:53:32 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-8384-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=QicB7AJB; spf=pass (google.com: domain of linux-kernel+bounces-8384-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-8384-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 81F302828AF for ; Thu, 21 Dec 2023 12:53:32 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 753CE7AE8D; Thu, 21 Dec 2023 12:48:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="QicB7AJB" X-Original-To: linux-kernel@vger.kernel.org Received: from madrid.collaboradmins.com (madrid.collaboradmins.com [46.235.227.194]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8937F78E91; Thu, 21 Dec 2023 12:48:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1703162924; bh=VcggBe2EeLqiQDA9strzfLU3yta4SiXSv2ot71tu2xk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QicB7AJBvJbAbnQ8IX/E4WBw6nkBbaAxDgxJIHc8Li/4XOq1epT9EBbL4M4wvloeg MkPxtwMcjO5rxdNpYFFTZ/04Mi+c35VpvKOXrk5jEdVXqiuQ+pIbfQg3Pz9GciRKYQ 9Lt0QysUjcngt2jfNX+z/LsR8rIwQPkzweqiHgKdB0zNQk3ZwHuH68Ljunq1VFwDA5 Hb5GF6nFWO43TOZl7m2fSRy58CvA/C+NOV6CPDf3/sEDpt1paAhfsqp6GbuS3lTA6+ hvNlWFYeN+58RnnTzguYtbNsoxUoNVlJM2a35sBT18UNfKbthwmmhx2+CHUTW22rXy 9/I5oKmGi9QPg== Received: from IcarusMOD.eternityproject.eu (cola.collaboradmins.com [195.201.22.229]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: kholk11) by madrid.collaboradmins.com (Postfix) with ESMTPSA id 6135B3782021; Thu, 21 Dec 2023 12:48:43 +0000 (UTC) From: AngeloGioacchino Del Regno To: daniel.lezcano@linaro.org Cc: rafael@kernel.org, rui.zhang@intel.com, lukasz.luba@arm.com, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, AngeloGioacchino Del Regno , kernel@collabora.com Subject: [RFC PATCH 15/26] power: supply: core: Migrate to thermal_zone_device_register() Date: Thu, 21 Dec 2023 13:48:14 +0100 Message-ID: <20231221124825.149141-16-angelogioacchino.delregno@collabora.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231221124825.149141-1-angelogioacchino.delregno@collabora.com> References: <20231221124825.149141-1-angelogioacchino.delregno@collabora.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1785896069006862839 X-GMAIL-MSGID: 1785896069006862839 The thermal API has a new thermal_zone_device_register() function which is deprecating the older thermal_zone_device_register_with_trips() and thermal_tripless_zone_device_register(). Migrate to the new thermal zone device registration function. Signed-off-by: AngeloGioacchino Del Regno --- drivers/power/supply/power_supply_core.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/drivers/power/supply/power_supply_core.c b/drivers/power/supply/power_supply_core.c index 73265001dd4b..d656a2e39157 100644 --- a/drivers/power/supply/power_supply_core.c +++ b/drivers/power/supply/power_supply_core.c @@ -1297,6 +1297,12 @@ static struct thermal_zone_device_ops psy_tzd_ops = { static int psy_register_thermal(struct power_supply *psy) { + struct thermal_zone_device_params tzdp = { + /* Prefer our hwmon device and avoid duplicates */ + .tzp = { .no_hwmon = IS_ENABLED(CONFIG_POWER_SUPPLY_HWMON) }, + .ops = &psy_tzd_ops, + .devdata = psy + }; int ret; if (psy->desc->no_thermal) @@ -1304,12 +1310,8 @@ static int psy_register_thermal(struct power_supply *psy) /* Register battery zone device psy reports temperature */ if (psy_has_property(psy->desc, POWER_SUPPLY_PROP_TEMP)) { - /* Prefer our hwmon device and avoid duplicates */ - struct thermal_zone_params tzp = { - .no_hwmon = IS_ENABLED(CONFIG_POWER_SUPPLY_HWMON) - }; - psy->tzd = thermal_tripless_zone_device_register(psy->desc->name, - psy, &psy_tzd_ops, &tzp); + tzdp.name = psy->desc->name; + psy->tzd = thermal_zone_device_register(&tzdp); if (IS_ERR(psy->tzd)) return PTR_ERR(psy->tzd); ret = thermal_zone_device_enable(psy->tzd); From patchwork Thu Dec 21 12:48:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AngeloGioacchino Del Regno X-Patchwork-Id: 182199 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:2483:b0:fb:cd0c:d3e with SMTP id q3csp385911dyi; Thu, 21 Dec 2023 04:53:49 -0800 (PST) X-Google-Smtp-Source: AGHT+IGgQC7mmWCgd1GLDKThrP30K9Ly+uxLbRKVHjqP4Y0Ij3UpT5f9Dx3AchSIAk1EEnL4Ril3 X-Received: by 2002:a50:c281:0:b0:553:d584:152c with SMTP id o1-20020a50c281000000b00553d584152cmr1456167edf.9.1703163228913; Thu, 21 Dec 2023 04:53:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703163228; cv=none; d=google.com; s=arc-20160816; b=Ay8lB8Wo7COaTntU/RhseYe99fgW6yECxlyvBSQXD+s+NcjwtA6AI30+g+NqHlDs9+ c/0h+KRwrz0c8zRgF96vo8YLqUp0ag9gFmG9iJw1RQ2dxlE2SxpZaSptbTJPcpsR7p4k a19gXF+e7sE6zXQ/gu0zcWOho1LKB3W3+BkOP0YHW+iy0PK/uh6GPbOm1rk60FtOf2lQ KWpIVNmSsaf/819JLVZGmKXnRZNZR8XIqS1Bzto4k/FMLzxyRkRKYGWC1vsAKWCRwAvf HheUQfgicHFNRdz9ORAW1is9tKGXlz7QqQ73hRas4XqPfXkKNeZNuYyuSAxouFP50Uo3 MspQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=NckmytK5fdyMArIVq5aYY8zu8Ee0BPFr6sx06wm7Yh4=; fh=tj3vwvS1joPqVAqhm025RI9FzN3aC+9rlGGIIVsXGr8=; b=sjk+oUiJoo7DraINFuzHjtQNRyCcjkNHOZTHAZlWJiOWTzC0tYvQz0eM4hWoL+iYoc t9criT5sg389XLGCoCv5IeOFpfPg00Qdb2cZagSu3iuJEv0LMeAsl+gV4O9liRCUttLR CUKn7Xp8ozBMU3MB9yESxivPxqOQacBPgIro2ULJmvE6dwIbctxsuDv6PPOUXBKB59pS mfrcHC+sWH7w3/AAy1IqSX9fk49t2fXBwPia9xIEwTTVyF/6wutLQeHz4xgQWtI6T72H Epk/TIu8pQ55uAEA9Bdnmu+ssbOVV72UmH4SObP8WMS8uvI8gYN0yYp5incLABOz9kj4 0O+Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=cv7ptrkk; spf=pass (google.com: domain of linux-kernel+bounces-8385-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-8385-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id cz21-20020a0564021cb500b00553dcc76ed2si809257edb.456.2023.12.21.04.53.48 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Dec 2023 04:53:48 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-8385-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=cv7ptrkk; spf=pass (google.com: domain of linux-kernel+bounces-8385-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-8385-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 85C191F260CC for ; Thu, 21 Dec 2023 12:53:48 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 05FB77B3AD; Thu, 21 Dec 2023 12:48:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="cv7ptrkk" X-Original-To: linux-kernel@vger.kernel.org Received: from madrid.collaboradmins.com (madrid.collaboradmins.com [46.235.227.194]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 16EBE79475; Thu, 21 Dec 2023 12:48:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1703162924; bh=93ZKOVlrTVJQ0RvWV6bc6BLDjs7S1OZ1L+ZoHQabC8w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cv7ptrkksutYRmpo8MnHwHmsY5ObfJ0q5g3+GHNYYFwn/gC0NK1AJBYKaz9fMQDWo Kl+LvuNPs2fCdiEsiRZaSCf0ehJaB9DtBAnsSAwOV3QaA6yFrUS3D4rMZqDVE9Xyto 0FrCEpdRAnn02ZBfF+We1e1oO5XRNBD89hYxdrhszU17vYtuppLJNzso/4UNnNzUT0 M8E1oUWLT01uLwKdHm2JxnpqWNXREkJpT3drdAnOC1JhEzvKDI1gi+rh9gQcVNyJMT xfwsqW7g2LUwrRAZEDjTOn4eaBNktswoccjnkGDg9kfCoRh8V63BKjaLyd+CYtudxa nJpraJBEM1YrA== Received: from IcarusMOD.eternityproject.eu (cola.collaboradmins.com [195.201.22.229]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: kholk11) by madrid.collaboradmins.com (Postfix) with ESMTPSA id 2ACA53781F84; Thu, 21 Dec 2023 12:48:44 +0000 (UTC) From: AngeloGioacchino Del Regno To: daniel.lezcano@linaro.org Cc: rafael@kernel.org, rui.zhang@intel.com, lukasz.luba@arm.com, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, AngeloGioacchino Del Regno , kernel@collabora.com Subject: [RFC PATCH 16/26] thermal/drivers/armada: Migrate to thermal_zone_device_register() Date: Thu, 21 Dec 2023 13:48:15 +0100 Message-ID: <20231221124825.149141-17-angelogioacchino.delregno@collabora.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231221124825.149141-1-angelogioacchino.delregno@collabora.com> References: <20231221124825.149141-1-angelogioacchino.delregno@collabora.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1785896086138898236 X-GMAIL-MSGID: 1785896086138898236 The thermal API has a new thermal_zone_device_register() function which is deprecating the older thermal_zone_device_register_with_trips() and thermal_tripless_zone_device_register(). Migrate to the new thermal zone device registration function. Signed-off-by: AngeloGioacchino Del Regno --- drivers/thermal/armada_thermal.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/drivers/thermal/armada_thermal.c b/drivers/thermal/armada_thermal.c index f783547ef964..f48a776af147 100644 --- a/drivers/thermal/armada_thermal.c +++ b/drivers/thermal/armada_thermal.c @@ -864,8 +864,14 @@ static int armada_thermal_probe(struct platform_device *pdev) * into it, which requires the use of regmaps across all the driver. */ if (IS_ERR(syscon_node_to_regmap(pdev->dev.parent->of_node))) { + struct thermal_zone_device_params tzdp = { + .ops = &legacy_ops, + .devdata = priv + }; + /* Ensure device name is correct for the thermal core */ armada_set_sane_name(pdev, priv); + tzdp.type = priv->zone_name; ret = armada_thermal_probe_legacy(pdev, priv); if (ret) @@ -876,9 +882,7 @@ static int armada_thermal_probe(struct platform_device *pdev) /* Wait the sensors to be valid */ armada_wait_sensor_validity(priv); - tz = thermal_tripless_zone_device_register(priv->zone_name, - priv, &legacy_ops, - NULL); + tz = thermal_zone_device_register(&tzdp); if (IS_ERR(tz)) { dev_err(&pdev->dev, "Failed to register thermal zone device\n"); From patchwork Thu Dec 21 12:48:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AngeloGioacchino Del Regno X-Patchwork-Id: 182210 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:2483:b0:fb:cd0c:d3e with SMTP id q3csp387181dyi; Thu, 21 Dec 2023 04:56:24 -0800 (PST) X-Google-Smtp-Source: AGHT+IErDzXqI3ukLlAIk0tKWu3uL622wbaim/az1srXAJMct/bWgCZQbZvwp+8FaUl/9Fsue3AJ X-Received: by 2002:a05:6a20:431a:b0:187:a4df:4e57 with SMTP id h26-20020a056a20431a00b00187a4df4e57mr970824pzk.20.1703163384251; Thu, 21 Dec 2023 04:56:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703163384; cv=none; d=google.com; s=arc-20160816; b=esHQDVhLeMK9U7eLyH6cD2FF/mdRvSdI0vIv8/ahaTdPPd3Kg3TLqyD6eWTJByF2aM xlkqdDPDQZRZT9HQHKVRkygCrBuRkx3zmpHpGLhUrjNpPwr9nZaWjJC/gLinG1EOKHrR 6WcY0ePUqXqi5QSF0RfrxWSUPWZnhX3N6igLvHvAaGnwehRllAY3XJFObsIDbv3vUhCi Ef7yf61JxH4rATHVpIQJtN62/aFdH2BfIUS7pl18w9WTf9Y8srEcELH9UBlQ8+g5Uj94 EcHmU/S++7rp0mTjcywl0Ogpf5dIj4G3CccR4z4y+2oahZrmRPb6iMrAOVCsNY7R1Ug5 yc8Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=cP0GcV9tuKuaYHqA4tdvV7b4r4Zk7Z414X5t6mEP/l8=; fh=tj3vwvS1joPqVAqhm025RI9FzN3aC+9rlGGIIVsXGr8=; b=JoSjCFfQan/vP13PAwbdVohoYoVpKtHN4ha4YyQ5fJURonWJnbYDbj49v5NekCJLl1 s2qhKRGNqVEL2Iim7ibZcwPbcYnQ6X4V1KddS+XKQAUY/ctWbM6dARZvVJWF7oViNhK8 tuuNYJZhfcaM9Y+Bqm2vO+j7ovVxvtmHkZbXOSiT0c+9lJyBucl2gGBkGZZadK+tfwtr 6J61jCUUIS51UXIhMf53dQ73DAwq3xp7Wk97Aas0auq10sDewAlFd8qqcDDPrIS/3ZSX CvQbSx/7qep+vnbcmz2/RXfWnTc3vOlRCa8EZL7AxS6oyEQoTkinMUkRRRlpc/Itu7Kh c9ww== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b="HdlNm/lr"; spf=pass (google.com: domain of linux-kernel+bounces-8386-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-8386-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id x19-20020a170902b41300b001d05aa54912si1441058plr.504.2023.12.21.04.56.23 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Dec 2023 04:56:24 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-8386-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b="HdlNm/lr"; spf=pass (google.com: domain of linux-kernel+bounces-8386-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-8386-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 35AF6B2369F for ; Thu, 21 Dec 2023 12:54:07 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E3DB47B3D4; Thu, 21 Dec 2023 12:48:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="HdlNm/lr" X-Original-To: linux-kernel@vger.kernel.org Received: from madrid.collaboradmins.com (madrid.collaboradmins.com [46.235.227.194]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0A73F7995E; Thu, 21 Dec 2023 12:48:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1703162925; bh=L31yIrmZZhUrsQD11ECO7zUb5b6T40l2nXIhxFSEcLk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HdlNm/lrnFfpEGr9id8D7nnqQIUw+fEXiRCLGINaeB80x0WrR9HSKLWAcFtEX9DNY MgFF/FT5bK/5RobU0AdeNvLpFOn0bwZTJdUd+H/B0ZJuGPJOBOmRq9b63ECVOZ4WzP 4MXqmVSIiqpWMNcF01PS+8VNt/0gQdmaYuVAvzszOaqQTamG5iC3KXdjMA39vnUgR/ IB4AtxXb9ScySAWL9inb9dfEk6KoqIuo394r5bgKmyKcS0D0EVYjGUhCiGYU62lRO2 iUi97mgYim9aVtgGDRmRwN8NwXSLZPay5SpUGqGT5XZKMGQcArwhD5I9rzXx79V3f/ ufuSOdsMfDcNQ== Received: from IcarusMOD.eternityproject.eu (cola.collaboradmins.com [195.201.22.229]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: kholk11) by madrid.collaboradmins.com (Postfix) with ESMTPSA id E604E3782017; Thu, 21 Dec 2023 12:48:44 +0000 (UTC) From: AngeloGioacchino Del Regno To: daniel.lezcano@linaro.org Cc: rafael@kernel.org, rui.zhang@intel.com, lukasz.luba@arm.com, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, AngeloGioacchino Del Regno , kernel@collabora.com Subject: [RFC PATCH 17/26] thermal/drivers/dove: Migrate to thermal_zone_device_register() Date: Thu, 21 Dec 2023 13:48:16 +0100 Message-ID: <20231221124825.149141-18-angelogioacchino.delregno@collabora.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231221124825.149141-1-angelogioacchino.delregno@collabora.com> References: <20231221124825.149141-1-angelogioacchino.delregno@collabora.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1785896248532185643 X-GMAIL-MSGID: 1785896248532185643 The thermal API has a new thermal_zone_device_register() function which is deprecating the older thermal_zone_device_register_with_trips() and thermal_tripless_zone_device_register(). Migrate to the new thermal zone device registration function. Signed-off-by: AngeloGioacchino Del Regno --- drivers/thermal/dove_thermal.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/thermal/dove_thermal.c b/drivers/thermal/dove_thermal.c index ac30de3c0a5f..09ed02395d12 100644 --- a/drivers/thermal/dove_thermal.c +++ b/drivers/thermal/dove_thermal.c @@ -117,6 +117,10 @@ static const struct of_device_id dove_thermal_id_table[] = { static int dove_thermal_probe(struct platform_device *pdev) { + struct thermal_zone_device_params tzdp = { + .type = "dove_thermal", + .ops = &ops + }; struct thermal_zone_device *thermal = NULL; struct dove_thermal_priv *priv; int ret; @@ -139,8 +143,8 @@ static int dove_thermal_probe(struct platform_device *pdev) return ret; } - thermal = thermal_tripless_zone_device_register("dove_thermal", priv, - &ops, NULL); + tzdp.devdata = priv; + thermal = thermal_zone_device_register(&tzdp); if (IS_ERR(thermal)) { dev_err(&pdev->dev, "Failed to register thermal zone device\n"); From patchwork Thu Dec 21 12:48:17 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AngeloGioacchino Del Regno X-Patchwork-Id: 182201 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:2483:b0:fb:cd0c:d3e with SMTP id q3csp386175dyi; Thu, 21 Dec 2023 04:54:19 -0800 (PST) X-Google-Smtp-Source: AGHT+IEwfOrSn0bVpaelydrvD/HXHXnSyamQmzjaraO++H9sgFd580Xc2qVwXoAYbmZls8PBxnIj X-Received: by 2002:ac8:598b:0:b0:427:838f:5ef1 with SMTP id e11-20020ac8598b000000b00427838f5ef1mr785355qte.17.1703163259262; Thu, 21 Dec 2023 04:54:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703163259; cv=none; d=google.com; s=arc-20160816; b=l9x8UvhbMEOF5bvtPXy3RgPw6+vyGPWMlqETYR12vFYFwJHWHiyd305Ph2/ethmTBb QU+Jh9ZGR+2JnZtuXc3N8KkIa3mDqI7wHdCj6IfAnuf54ZXNHnuwhn2S7gJD5vUr8sGf +ejQBRw1l/EuY9h0L4tEm355rXEue9DStf6We7PKs0tNDkiVG+k0QzGuIyd7YlwMDYZf dt0hHuj16LIu+qO/HyCfHh3YPW2NboudLmOkWpG063EaMmN1P+v49yiLQtCwg7dcQjwP 1QKHoK78JpRcmic0JiajEETES5R1yt6V78GsnZJNvIqGoniEtXkfhkqM+ewtiVMmamWm 8/9g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=B+XEMKHMJUnNXoTd2gepP9Lx7zj9hEPoSPP/aCule9Y=; fh=tj3vwvS1joPqVAqhm025RI9FzN3aC+9rlGGIIVsXGr8=; b=XZh7WvBlmGcy2DLbbQbZTfr4suJHN7zQMcykI6PjGrTCbzxoonsDfpGbT1oVjaxTqS bYoiqk4IWs9V/pKy4fGRnyKVqRZDQ2URtQu3w6z0gg3NgWIItFafzRmZZSu5Xae50ur5 0j9BdyoycMEtY0g4Qn2JqrozVLEhGSfZ52kQ3c6o9flLmDFLqmi6+D4f8tIQPorJjvZj 87D7PwDAzQ5T0fbXHwNMoo0gymh9IR0jRgSAWgNxRX/WRHsAjEM4ob6U8FuIa3i0/y75 cLdV5pGjFaitbX1W6nfchiFvbFRXaGXxxBZEP6T2+JrWYUdi5ZKT9bL1n3satnVjZwJC HgIw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=JspRYnmA; spf=pass (google.com: domain of linux-kernel+bounces-8388-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-8388-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id e14-20020ac8598e000000b00427781fd7e2si2149627qte.137.2023.12.21.04.54.19 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Dec 2023 04:54:19 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-8388-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=JspRYnmA; spf=pass (google.com: domain of linux-kernel+bounces-8388-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-8388-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 127E41C257AF for ; Thu, 21 Dec 2023 12:54:19 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7D3347BEEC; Thu, 21 Dec 2023 12:48:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="JspRYnmA" X-Original-To: linux-kernel@vger.kernel.org Received: from madrid.collaboradmins.com (madrid.collaboradmins.com [46.235.227.194]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A49D873179; Thu, 21 Dec 2023 12:48:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1703162926; bh=/tP0vOAcAPktGngh+MT0OZObQF+qtxH8HNQl/CdWeXc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JspRYnmAD49OSoc7E/ls2xadn/4qZ1yf84DDeK4ry7w6vz7aLjgsOOq0NC+cJYuhi lhx+4Hazgdr4BXudJdZcehwWLsuJRGQ7q4xGPrfmPzEV+EmT2rHoqiWdrKPWhRtd/C xKirkwG6PyHT+6g80f/H3h1TA7GVxZqqsM1bEtMs1csSpnDKLT0+FZExUfSHSUw/Ns WkMi8dw1xzMGMU9R5OxshZsgAKEQlHC0JuaO9r7IeQ+OehWQYo8xs1pgxNvJ6xOkIt 4QHiIr/lAISzs2awTTF8bX2TbS0siDPWezpnFlxgvjcRDEzAh2U4qKviSBGcK2NTQ9 j3NjH3XPrmXgw== Received: from IcarusMOD.eternityproject.eu (cola.collaboradmins.com [195.201.22.229]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: kholk11) by madrid.collaboradmins.com (Postfix) with ESMTPSA id AC41B3782001; Thu, 21 Dec 2023 12:48:45 +0000 (UTC) From: AngeloGioacchino Del Regno To: daniel.lezcano@linaro.org Cc: rafael@kernel.org, rui.zhang@intel.com, lukasz.luba@arm.com, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, AngeloGioacchino Del Regno , kernel@collabora.com Subject: [RFC PATCH 18/26] thermal/drivers/kirkwood: Migrate to thermal_zone_device_register() Date: Thu, 21 Dec 2023 13:48:17 +0100 Message-ID: <20231221124825.149141-19-angelogioacchino.delregno@collabora.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231221124825.149141-1-angelogioacchino.delregno@collabora.com> References: <20231221124825.149141-1-angelogioacchino.delregno@collabora.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1785896117809603599 X-GMAIL-MSGID: 1785896117809603599 The thermal API has a new thermal_zone_device_register() function which is deprecating the older thermal_zone_device_register_with_trips() and thermal_tripless_zone_device_register(). Migrate to the new thermal zone device registration function. Signed-off-by: AngeloGioacchino Del Regno --- drivers/thermal/kirkwood_thermal.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/thermal/kirkwood_thermal.c b/drivers/thermal/kirkwood_thermal.c index a18158ebe65f..a9ccb27b5906 100644 --- a/drivers/thermal/kirkwood_thermal.c +++ b/drivers/thermal/kirkwood_thermal.c @@ -59,6 +59,10 @@ static const struct of_device_id kirkwood_thermal_id_table[] = { static int kirkwood_thermal_probe(struct platform_device *pdev) { + struct thermal_zone_device_params tzdp = { + .type = "kirkwood_thermal", + .ops = &ops + }; struct thermal_zone_device *thermal = NULL; struct kirkwood_thermal_priv *priv; int ret; @@ -71,8 +75,8 @@ static int kirkwood_thermal_probe(struct platform_device *pdev) if (IS_ERR(priv->sensor)) return PTR_ERR(priv->sensor); - thermal = thermal_tripless_zone_device_register("kirkwood_thermal", - priv, &ops, NULL); + tzdp.devdata = priv; + thermal = thermal_zone_device_register(&tzdp); if (IS_ERR(thermal)) { dev_err(&pdev->dev, "Failed to register thermal zone device\n"); From patchwork Thu Dec 21 12:48:18 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AngeloGioacchino Del Regno X-Patchwork-Id: 182202 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:2483:b0:fb:cd0c:d3e with SMTP id q3csp386296dyi; Thu, 21 Dec 2023 04:54:36 -0800 (PST) X-Google-Smtp-Source: AGHT+IE/2j1593umwCvlUgS0TrwU6/oRSu8yNx2lR6BeeJQW/ZKGPqJhDkdBvGbioFSHyJ0mVnPS X-Received: by 2002:a17:902:ce84:b0:1d0:b1a0:8a0e with SMTP id f4-20020a170902ce8400b001d0b1a08a0emr25800818plg.40.1703163276535; Thu, 21 Dec 2023 04:54:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703163276; cv=none; d=google.com; s=arc-20160816; b=YdTWSHemx++K3wbE2IiYo/NoIAGkErMhZSfn6cNz9FDhOAsoxRV6JAQa/FcZHjpqbb lN0EmXaOvy+mbN7vZMnTqkdL10ZfenT8QFzA9DEogiqT02DYo27o8pKfSAMW8UX7BJDi JmUVqheV2qVjJQA1i8geUlqNXT/JkKOQlxq/vUAhGr76rzbgoftxqrHx3WKy+HQS7jho l7wqfuNoNytlRFoxR1cA7ZbZ/XfYIjlrK8iLzM1zqGmY0efjgB1HALmLuVkxsuttxwO5 vmiLIqqwEb20Fj9c7HtQCGakpx9RN+I0mbqWXgPZZgQipCjD1ktbOca2+uThcpNfY/aw NGWw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=vKE0YS56ZOrKVc3KYdcf8enzQuY7UZSUbojJdGagHiU=; fh=tj3vwvS1joPqVAqhm025RI9FzN3aC+9rlGGIIVsXGr8=; b=o0bI10gnOSxmhtNLLHF6MMIWZU3ZxFRfRVUiwVPrAk0QGUQ1vCxxNEwVoS/JfvQmZH 991wJQcWlveskuT34utdtIXhYF1TBvJSqpOrJRjdibhl1GsFwsUzOVouAZFjcKULGxpZ IEa58dHBY08lYbMsPqyCZtukYl/Woeh+k/OgvEVvyXrxwBVj/OK/vObP6eoB7rg1y69a i+dv17orG6hncdpJs8TX8vBz3ocCo7pzdDsMfiTuA99LHW8DKAr6+dwP2B3AC3jPVfXT /RD26V0cfjwxAP4F4eM92iAtXeDA8o/ySEqNw8damlG9KpTNbKQYieQxKwve//SRlYI+ 3oyQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=k1b6+140; spf=pass (google.com: domain of linux-kernel+bounces-8389-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-8389-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id bc7-20020a170902930700b001d3a6cb519dsi1415637plb.543.2023.12.21.04.54.36 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Dec 2023 04:54:36 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-8389-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=k1b6+140; spf=pass (google.com: domain of linux-kernel+bounces-8389-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-8389-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id B0B64286863 for ; Thu, 21 Dec 2023 12:54:28 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 34FB77BF07; Thu, 21 Dec 2023 12:48:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="k1b6+140" X-Original-To: linux-kernel@vger.kernel.org Received: from madrid.collaboradmins.com (madrid.collaboradmins.com [46.235.227.194]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 543937A21E; Thu, 21 Dec 2023 12:48:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1703162927; bh=yEz5ZSUTt9k77CyhKIIQY02ps3ES7aiNgr3GDZOP2uI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=k1b6+140QQcj6UqlnfmAOTCoRj/GwOZfrBGDSeAgaCLa1n7BL4CNeAJKJDJxT7S3S gKlKax+3MdDOtBqepo3nOZnso66aLDsC/Tlx94B/I1O+XnVus+09x6HmPjoTNrIwbl 80n19xvgUibKxikr+XVOMT4SjiSjExroqLUVvVtXveuXwHD0FdKSqpJx5hmJQOateG ckYjE6SmjWtE4pO9xovWzEp5F2ZC5b+YmSORLoIHIl/KWlCDwPC6Z9sUocEToNmvq5 cAY2B5hCfk+CI7Lnouu1W0V6Pu2FE/PIRz7qFc8pvTs+Gak1NjDXETopvbf5s4qHDf s6uK2eYy69wag== Received: from IcarusMOD.eternityproject.eu (cola.collaboradmins.com [195.201.22.229]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: kholk11) by madrid.collaboradmins.com (Postfix) with ESMTPSA id 6BCC63782009; Thu, 21 Dec 2023 12:48:46 +0000 (UTC) From: AngeloGioacchino Del Regno To: daniel.lezcano@linaro.org Cc: rafael@kernel.org, rui.zhang@intel.com, lukasz.luba@arm.com, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, AngeloGioacchino Del Regno , kernel@collabora.com Subject: [RFC PATCH 19/26] thermal/drivers/spear: Migrate to thermal_zone_device_register() Date: Thu, 21 Dec 2023 13:48:18 +0100 Message-ID: <20231221124825.149141-20-angelogioacchino.delregno@collabora.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231221124825.149141-1-angelogioacchino.delregno@collabora.com> References: <20231221124825.149141-1-angelogioacchino.delregno@collabora.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1785896135837718113 X-GMAIL-MSGID: 1785896135837718113 The thermal API has a new thermal_zone_device_register() function which is deprecating the older thermal_zone_device_register_with_trips() and thermal_tripless_zone_device_register(). Migrate to the new thermal zone device registration function. Signed-off-by: AngeloGioacchino Del Regno --- drivers/thermal/spear_thermal.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/thermal/spear_thermal.c b/drivers/thermal/spear_thermal.c index 60a871998b07..07006957acd5 100644 --- a/drivers/thermal/spear_thermal.c +++ b/drivers/thermal/spear_thermal.c @@ -88,6 +88,10 @@ static SIMPLE_DEV_PM_OPS(spear_thermal_pm_ops, spear_thermal_suspend, static int spear_thermal_probe(struct platform_device *pdev) { + struct thermal_zone_device_params tzdp = { + .type = "spear_thermal", + .ops = &ops + }; struct thermal_zone_device *spear_thermal = NULL; struct spear_thermal_dev *stdev; struct device_node *np = pdev->dev.of_node; @@ -122,8 +126,8 @@ static int spear_thermal_probe(struct platform_device *pdev) stdev->flags = val; writel_relaxed(stdev->flags, stdev->thermal_base); - spear_thermal = thermal_tripless_zone_device_register("spear_thermal", - stdev, &ops, NULL); + tzdp.devdata = stdev; + spear_thermal = thermal_zone_device_register(&tzdp); if (IS_ERR(spear_thermal)) { dev_err(&pdev->dev, "thermal zone device is NULL\n"); ret = PTR_ERR(spear_thermal); From patchwork Thu Dec 21 12:48:19 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AngeloGioacchino Del Regno X-Patchwork-Id: 182203 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:2483:b0:fb:cd0c:d3e with SMTP id q3csp386442dyi; Thu, 21 Dec 2023 04:54:56 -0800 (PST) X-Google-Smtp-Source: AGHT+IGPOC93EZnaLk7KwD+WTQxx+qWidIrzpGnS4fxfKIqP1SMhYII2qSFpByJewE4zjtcL6lfw X-Received: by 2002:a50:d796:0:b0:553:98b5:6816 with SMTP id w22-20020a50d796000000b0055398b56816mr2699185edi.65.1703163296572; Thu, 21 Dec 2023 04:54:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703163296; cv=none; d=google.com; s=arc-20160816; b=rl3Q0C2igbs99z0Z6LTfeuCPMAUuT0wYJfYlN6HndBlpCHYtp7hVD03XIE1xNQ45Mq 4yvcD2+SjhB75G/TOQW3WRMU5HppJGo0wFJJQ8j7JZaLKvz+7ro/yxMj5bwFTDrtiU6m nfb5Z5w7krlXpqy5F7qdANsjjayfvd6g7QrX5/KnoSVjSdsN3ZUUFAiiPIMEg13q5RBF xWBVL/a9+wxOofWDEdqLj/0lCq3jxySQkPwjj4OFhVKsOicg5AMP88cKEAR1oFaVRd3V 9nV9dUDiF/hfGdpVjtaUJOBPAkPTE5MVX6Wl1LZuKEzNB9A0vepGo/+mlBDFhxtVdXg+ 66fQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=HAVPUbouOr/j/NNwDU030IhLcF1/1clc5YIxGA8yhKE=; fh=tj3vwvS1joPqVAqhm025RI9FzN3aC+9rlGGIIVsXGr8=; b=QH4/aN0ed37tywG7204id31TFas1xqAy4qei8z6Gm690A+Xj2cScKfxK8FDIRm3qHY pWlWC7J4rdxQ23Bgb8rYe3WA8DIC/timXkqVhMMOhVPNyD5tvCRviWlvU3V2DfZQKlG6 2vs9QWBnvCju4L6BGUmcEPBx3LDxxjOXvtP7if+fpxN339paX1LU4B+r8Kdtj+zCPV9m aOmY434mASnLaWDVxWvcWenKA8q/XSbQ2uS5VuDkT8KPWNMOQb1zz2HpJm1OkjzITRIO 6bvmgbdyvtFQUEk3VWguMiaBdTC9Q3Owa6ohqxQ3z/ZSYCN/Covi96GdYdW0NTsjAOlS v9vQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=PVPjgZyC; spf=pass (google.com: domain of linux-kernel+bounces-8390-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-8390-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id dk18-20020a0564021d9200b00553a7472908si834179edb.517.2023.12.21.04.54.56 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Dec 2023 04:54:56 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-8390-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=PVPjgZyC; spf=pass (google.com: domain of linux-kernel+bounces-8390-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-8390-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 329511F263D5 for ; Thu, 21 Dec 2023 12:54:56 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D674A7C66D; Thu, 21 Dec 2023 12:48:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="PVPjgZyC" X-Original-To: linux-kernel@vger.kernel.org Received: from madrid.collaboradmins.com (madrid.collaboradmins.com [46.235.227.194]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 414227AE7B; Thu, 21 Dec 2023 12:48:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1703162927; bh=IzGXP7pU6vgksVmgOm8IVqKNTU11eGk4o8LGz/dSNic=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PVPjgZyCfYFO033Aa4w6Zfpat7VbZzivozeRdDK8DYjwtiY3sdwdXsNJ3Qev1liTs vxBXJOUuuzacj3D8cWibZLDKmIo4bk/NXeGNNbS7Vok9imkK8wV/dLLudEq8cf0oTf /brH2cIXgJANZ8JFbicSX7exL1Jrp7RWvakS83ANrzpAITAuXKzC1v0MQtO0Nn4+JD sVvXB5SsYq1ugaiSRaA47IGXEQJ/uL7iz3BzN34tauZwR8vuJXz5dfsm0iN4hLQkXA XrK5t2o1WmFlYKs5g5gYb5Nt1lG/Bxhl0vijrC+EoTuFNfCdgwrE6R7F6SuuvZMM+L YT/jmQwkwaRUA== Received: from IcarusMOD.eternityproject.eu (cola.collaboradmins.com [195.201.22.229]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: kholk11) by madrid.collaboradmins.com (Postfix) with ESMTPSA id 30282378200A; Thu, 21 Dec 2023 12:48:47 +0000 (UTC) From: AngeloGioacchino Del Regno To: daniel.lezcano@linaro.org Cc: rafael@kernel.org, rui.zhang@intel.com, lukasz.luba@arm.com, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, AngeloGioacchino Del Regno , kernel@collabora.com Subject: [RFC PATCH 20/26] thermal/drivers/int340x: Migrate to thermal_zone_device_register() Date: Thu, 21 Dec 2023 13:48:19 +0100 Message-ID: <20231221124825.149141-21-angelogioacchino.delregno@collabora.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231221124825.149141-1-angelogioacchino.delregno@collabora.com> References: <20231221124825.149141-1-angelogioacchino.delregno@collabora.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1785896156621748428 X-GMAIL-MSGID: 1785896156621748428 The thermal API has a new thermal_zone_device_register() function which is deprecating the older thermal_zone_device_register_with_trips() and thermal_tripless_zone_device_register(). Migrate to the new thermal zone device registration function. Signed-off-by: AngeloGioacchino Del Regno --- .../intel/int340x_thermal/int3400_thermal.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/drivers/thermal/intel/int340x_thermal/int3400_thermal.c b/drivers/thermal/intel/int340x_thermal/int3400_thermal.c index 427d370648d5..87bfc1f9a5a4 100644 --- a/drivers/thermal/intel/int340x_thermal/int3400_thermal.c +++ b/drivers/thermal/intel/int340x_thermal/int3400_thermal.c @@ -536,11 +536,6 @@ static struct thermal_zone_device_ops int3400_thermal_ops = { .change_mode = int3400_thermal_change_mode, }; -static struct thermal_zone_params int3400_thermal_params = { - .governor_name = "user_space", - .no_hwmon = true, -}; - static void int3400_setup_gddv(struct int3400_thermal_priv *priv) { struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL }; @@ -571,6 +566,14 @@ static void int3400_setup_gddv(struct int3400_thermal_priv *priv) static int int3400_thermal_probe(struct platform_device *pdev) { + struct thermal_zone_device_params tzdp = { + .type = "INT3400 Thermal", + .tzp = { + .governor_name = "user_space", + .no_hwmon = true + }, + .ops = &int3400_thermal_ops + }; struct acpi_device *adev = ACPI_COMPANION(&pdev->dev); struct int3400_thermal_priv *priv; int result; @@ -609,9 +612,7 @@ static int int3400_thermal_probe(struct platform_device *pdev) evaluate_odvp(priv); - priv->thermal = thermal_tripless_zone_device_register("INT3400 Thermal", priv, - &int3400_thermal_ops, - &int3400_thermal_params); + priv->thermal = thermal_zone_device_register(&tzdp); if (IS_ERR(priv->thermal)) { result = PTR_ERR(priv->thermal); goto free_art_trt; From patchwork Thu Dec 21 12:48:20 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AngeloGioacchino Del Regno X-Patchwork-Id: 182206 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:2483:b0:fb:cd0c:d3e with SMTP id q3csp386903dyi; Thu, 21 Dec 2023 04:55:51 -0800 (PST) X-Google-Smtp-Source: AGHT+IGGdRjgSmKwHxn2LqJ4/8nVwT2wlJJcgG1qJ7JpYUDMLlFaCz4JvKbF8iBhWmaEQfm90cF4 X-Received: by 2002:a05:6a00:896:b0:6ce:2731:a086 with SMTP id q22-20020a056a00089600b006ce2731a086mr24230544pfj.53.1703163351675; Thu, 21 Dec 2023 04:55:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703163351; cv=none; d=google.com; s=arc-20160816; b=n2gPQ6KbXGPPdUKVI9+O1hNNGPDif27+jE1Mk/FXRoLM3CC7X+zD6oHO9Yl2WgnIVU T7xLy7yxSOjCaTCAUsdvIRy73Hgo9PJtfsd8NSFX/kdFkeV3lRLuE3hv80lNcZ5A8a5h viRXMZ3ciuKDZvkLdqqTM5kyRiRcInb6ktj9+ab8j90zqYlvM4FSRh8H/eLv2429S8tK CFbeCcRoFI4EeiqyVhiJ3tinGLWKzIY7SFKeeoSEBRngq5KNnpXxUS6dLWa2AtzA8Did l+G2uCv6SJ9t+YAhgUkhZkLA/HfFzxLbZARWphSoVUgaH+9nM5cXh32oyBk+zfyRzoyO zJEg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=Zy8h5j1Lf8AGxYG0+depN/L/QDDyqbiwjeqHy333jFQ=; fh=tj3vwvS1joPqVAqhm025RI9FzN3aC+9rlGGIIVsXGr8=; b=gNJGKQwtykJ8nS5fkbFGrOILn4h8SvqQL3YEQDTLWM3FsHu8ex6/4TTyIs1JkZJj0K z5ZvqOiYUa9bR11GQg0JLoqIPfsUNJ7mMe5Cf/hercvB2CnrOljCmm38wFG6sq7/MkCo 4Xs39x2lgsZYHb9utxhsJ9yJAQU2WQjiGq/38F+pZcjTvMTnaLjZEW7atG9Bil9i9I0Y 3B72hy/qQqvC+xQWWd5dd3jc6SU6yGTnaj24wXseXVXqj9JHdWabiOWIuSeNVGfnsRAO XMX9WVWkplWTsHX/DxH0fKDEtyVzR39oCAdkjbYAoqxNv40xZjS8OldjcSLlezinQMn2 WhTQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=vL4wvS9+; spf=pass (google.com: domain of linux-kernel+bounces-8393-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-8393-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id x4-20020a63db44000000b005c1b316d768si1523051pgi.664.2023.12.21.04.55.51 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Dec 2023 04:55:51 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-8393-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=vL4wvS9+; spf=pass (google.com: domain of linux-kernel+bounces-8393-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-8393-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 73442284BF9 for ; Thu, 21 Dec 2023 12:55:51 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2D0237D60B; Thu, 21 Dec 2023 12:48:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="vL4wvS9+" X-Original-To: linux-kernel@vger.kernel.org Received: from madrid.collaboradmins.com (madrid.collaboradmins.com [46.235.227.194]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7EC627BEEF; Thu, 21 Dec 2023 12:48:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1703162928; bh=V38Z9HnmY0IrWbFobu25Eju6bXU79J2Cvnfm9VP0Vr0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vL4wvS9+XJ9f1gis+v3R4vYAWlxDG1u1X1posyjFEsH17a1fbM/gQGhhM+csylOBs Sj6ll2vdiO1ZbaSZudEq4krn9PY5Yj549Z1BOkKaUdO58reXlzi1SjCqCN/p2CgMYq DSe72DNXaPrBvTQAwU+Ae/jsJMA0grnJ1wwjkZ8uxChZHWhAfnnLnzwVmrL+HL9dAY oVpjU+SpwDodKvcBVW6mHGr9F1C7EUCszMC3ydQAxw9jy5yk3VHM8xakUZTNBgINmO csofa+MMn7z044sf8P7uQGqhVOKbh0dHJ41JpnHpYofYfWOrVwRqPt5+t5RY8m7CGF d5cbLIkJElycQ== Received: from IcarusMOD.eternityproject.eu (cola.collaboradmins.com [195.201.22.229]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: kholk11) by madrid.collaboradmins.com (Postfix) with ESMTPSA id EBF35378200E; Thu, 21 Dec 2023 12:48:47 +0000 (UTC) From: AngeloGioacchino Del Regno To: daniel.lezcano@linaro.org Cc: rafael@kernel.org, rui.zhang@intel.com, lukasz.luba@arm.com, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, AngeloGioacchino Del Regno , kernel@collabora.com Subject: [RFC PATCH 21/26] wifi: iwlwifi: mvm: Migrate to thermal_zone_device_register() Date: Thu, 21 Dec 2023 13:48:20 +0100 Message-ID: <20231221124825.149141-22-angelogioacchino.delregno@collabora.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231221124825.149141-1-angelogioacchino.delregno@collabora.com> References: <20231221124825.149141-1-angelogioacchino.delregno@collabora.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1785896214662413481 X-GMAIL-MSGID: 1785896214662413481 The thermal API has a new thermal_zone_device_register() function which is deprecating the older thermal_zone_device_register_with_trips() and thermal_tripless_zone_device_register(). Migrate to the new thermal zone device registration function. Signed-off-by: AngeloGioacchino Del Regno --- drivers/net/wireless/intel/iwlwifi/mvm/tt.c | 27 ++++++++++++--------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/tt.c b/drivers/net/wireless/intel/iwlwifi/mvm/tt.c index dee9c367dcd3..268ff6ca3cac 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/tt.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/tt.c @@ -674,8 +674,14 @@ static struct thermal_zone_device_ops tzone_ops = { static void iwl_mvm_thermal_zone_register(struct iwl_mvm *mvm) { int i, ret; - char name[16]; static atomic_t counter = ATOMIC_INIT(0); + struct thermal_zone_device_params tzdp = { + .ops = &tzone_ops, + .devdata = mvm, + .trips = mvm->tz_device.trips, + .num_trips = IWL_MAX_DTS_TRIPS, + .mask = IWL_WRITABLE_TRIPS_MSK, + }; if (!iwl_mvm_is_tt_in_fw(mvm)) { mvm->tz_device.tzone = NULL; @@ -683,28 +689,25 @@ static void iwl_mvm_thermal_zone_register(struct iwl_mvm *mvm) return; } - BUILD_BUG_ON(ARRAY_SIZE(name) >= THERMAL_NAME_LENGTH); + tzdp.type = kasprintf("iwlwifi_%u", atomic_inc_return(&counter) & 0xFF); + if (!tzdp.type) + return -ENOMEM; - sprintf(name, "iwlwifi_%u", atomic_inc_return(&counter) & 0xFF); - mvm->tz_device.tzone = thermal_zone_device_register_with_trips(name, - mvm->tz_device.trips, - IWL_MAX_DTS_TRIPS, - IWL_WRITABLE_TRIPS_MSK, - mvm, &tzone_ops, - NULL, 0, 0); + mvm->tz_device.tzone = thermal_zone_device_register(&tzdp); + kfree(tzdp.type); if (IS_ERR(mvm->tz_device.tzone)) { IWL_DEBUG_TEMP(mvm, "Failed to register to thermal zone (err = %ld)\n", PTR_ERR(mvm->tz_device.tzone)); mvm->tz_device.tzone = NULL; - return; + goto err_free; } ret = thermal_zone_device_enable(mvm->tz_device.tzone); if (ret) { IWL_DEBUG_TEMP(mvm, "Failed to enable thermal zone\n"); thermal_zone_device_unregister(mvm->tz_device.tzone); - return; + goto err_free; } /* 0 is a valid temperature, @@ -714,6 +717,8 @@ static void iwl_mvm_thermal_zone_register(struct iwl_mvm *mvm) mvm->tz_device.trips[i].temperature = INT_MIN; mvm->tz_device.trips[i].type = THERMAL_TRIP_PASSIVE; } + + return; } static int iwl_mvm_tcool_get_max_state(struct thermal_cooling_device *cdev, From patchwork Thu Dec 21 12:48:21 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AngeloGioacchino Del Regno X-Patchwork-Id: 182204 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:2483:b0:fb:cd0c:d3e with SMTP id q3csp386785dyi; Thu, 21 Dec 2023 04:55:33 -0800 (PST) X-Google-Smtp-Source: AGHT+IFmtkr5DsCztaXgfWadyrxGIrSJZZ5PLV8lHAEnA05JO+lDUSMNJ/CWlKqW5TeclJBS5HgA X-Received: by 2002:a50:9519:0:b0:553:739e:bfa0 with SMTP id u25-20020a509519000000b00553739ebfa0mr2331646eda.34.1703163333493; Thu, 21 Dec 2023 04:55:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703163333; cv=none; d=google.com; s=arc-20160816; b=UzEV5zm5avdY6QIUD/SB4kjuzhSisibmrJ5A8iokiCuB9JP60Zob/lLO7/mGFakUwr 5Jgx/Q1BK9Lwx5AbV6TCUwfOFFHLEHwN9FeE/V5wAwNvsLjstyjr11sozxIovcX7mnlH hX7FWYHbplx0ca+ozBMqjJhljncNNGD3MOqe7Ug/DjLSmg1we0pisamIjEC1Q6lUrVhq Mc0bWPoo6XoTEtRFW9twubyV6M9l7MbzlolwY/X++NjPBZCe+gp5f6h+QlPLFgcsIHV0 K8e1QQL+kjv+PHcspl/GJWDu1ue0Mq6XrSBfzrdLIEnsojuApxwa3t83FLPfDpHecckv YzsA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=1feJ4cDSQb1wtIeBlIUgbQ3Am9S73gIQoPNBcu4wk7k=; fh=tj3vwvS1joPqVAqhm025RI9FzN3aC+9rlGGIIVsXGr8=; b=z4laaBpRsD3RqMElPtiDWS1jI+4ydNXXPaB3hgSpuQRaqRGNjO8jxs0vLQ2vKF9lWF mMX6IJnzFuIO0vce6IpD8gUlhOOrM/wvLyykNymUUoD5qesasUqAaGgpWvFeNK88V4h3 hQXs4M1W3de3ZfCGcDAwepNGrV+5Ijoxddbdo2LnpYx/svDjithSs3EwWbAtRJvrDFeX /PxC6hyZyUHRSKMdPB24LWZ7h70qKidR/RkV+WTs4jJAztHASE6ER4SS01sxuBtxyLHR sl0CzihKFK6Eb4KU9USzHP6FIq0H6GjtZtd6pfL7ix5OoOp9MmRJ+nABlMhwupgBxo96 x0ZQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=ZMitHe2c; spf=pass (google.com: domain of linux-kernel+bounces-8391-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-8391-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id z8-20020a056402274800b005541f5ef014si525293edd.430.2023.12.21.04.55.33 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Dec 2023 04:55:33 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-8391-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=ZMitHe2c; spf=pass (google.com: domain of linux-kernel+bounces-8391-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-8391-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id E2BE01F26678 for ; Thu, 21 Dec 2023 12:55:32 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6F5497CD1D; Thu, 21 Dec 2023 12:48:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="ZMitHe2c" X-Original-To: linux-kernel@vger.kernel.org Received: from madrid.collaboradmins.com (madrid.collaboradmins.com [46.235.227.194]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7EC257BEEE; Thu, 21 Dec 2023 12:48:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1703162929; bh=ssMjukwPYr5YFlWiAdM91Hji1S8UHvaa/NNDxIiec6o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZMitHe2cFQXc5iZcG2E859bVs3QezJ9Heebe5o2HM+KroJkJxidtsnLxxrNI8YAfO 7AtQ3f2OB0PNRp65286MIAcIWq7KDMab7oFCpimORGlzJ7CpLe6pWhL8HARYRrHsde qy8CfDcCdHx16BPNFvDRS5XrUhLbnwB9X3AQ2HAyyNTbMTskmpccCVsFnST/4VlfLq XIjXCF4LS0Bmi7MqkJtwnRDOkPR8XpMwEEOwFUIiiTO61Zpea36GvsxfbU/1WgGux3 5SLvjx9Mtq7WIB7fBrU9mwhClmIjCiN+8Wst/diu+bzoZnVFhAM9QnLKI89yTMKEmR iSlt5UdgZWzRw== Received: from IcarusMOD.eternityproject.eu (cola.collaboradmins.com [195.201.22.229]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: kholk11) by madrid.collaboradmins.com (Postfix) with ESMTPSA id B34403782013; Thu, 21 Dec 2023 12:48:48 +0000 (UTC) From: AngeloGioacchino Del Regno To: daniel.lezcano@linaro.org Cc: rafael@kernel.org, rui.zhang@intel.com, lukasz.luba@arm.com, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, AngeloGioacchino Del Regno , kernel@collabora.com Subject: [RFC PATCH 22/26] cxgb4: Migrate to thermal_zone_device_register() Date: Thu, 21 Dec 2023 13:48:21 +0100 Message-ID: <20231221124825.149141-23-angelogioacchino.delregno@collabora.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231221124825.149141-1-angelogioacchino.delregno@collabora.com> References: <20231221124825.149141-1-angelogioacchino.delregno@collabora.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1785896195469878469 X-GMAIL-MSGID: 1785896195469878469 The thermal API has a new thermal_zone_device_register() function which is deprecating the older thermal_zone_device_register_with_trips() and thermal_tripless_zone_device_register(). Migrate to the new thermal zone device registration function. Signed-off-by: AngeloGioacchino Del Regno --- .../net/ethernet/chelsio/cxgb4/cxgb4_thermal.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_thermal.c b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_thermal.c index dea9d2907666..0192dba14a84 100644 --- a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_thermal.c +++ b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_thermal.c @@ -37,12 +37,21 @@ static struct thermal_trip trip = { .type = THERMAL_TRIP_CRITICAL } ; int cxgb4_thermal_init(struct adapter *adap) { + struct thermal_zone_device_params tzdp = { + .ops = &cxgb4_thermal_ops, + .devdata = adap, + .trips = &trip, + .num_trips = num_trip, + }; struct ch_thermal *ch_thermal = &adap->ch_thermal; - char ch_tz_name[THERMAL_NAME_LENGTH]; int num_trip = CXGB4_NUM_TRIPS; u32 param, val; int ret; + tzdp.type = kasprintf("cxgb4_%s", adap->name); + if (!tzdp.type) + return -ENOMEM; + /* on older firmwares we may not get the trip temperature, * set the num of trips to 0. */ @@ -58,11 +67,8 @@ int cxgb4_thermal_init(struct adapter *adap) trip.temperature = val * 1000; } - snprintf(ch_tz_name, sizeof(ch_tz_name), "cxgb4_%s", adap->name); - ch_thermal->tzdev = thermal_zone_device_register_with_trips(ch_tz_name, &trip, num_trip, - 0, adap, - &cxgb4_thermal_ops, - NULL, 0, 0); + ch_thermal->tzdev = thermal_zone_device_register(&tzdp); + kfree(tzdp.type); if (IS_ERR(ch_thermal->tzdev)) { ret = PTR_ERR(ch_thermal->tzdev); dev_err(adap->pdev_dev, "Failed to register thermal zone\n"); From patchwork Thu Dec 21 12:48:22 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AngeloGioacchino Del Regno X-Patchwork-Id: 182205 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:2483:b0:fb:cd0c:d3e with SMTP id q3csp386795dyi; Thu, 21 Dec 2023 04:55:34 -0800 (PST) X-Google-Smtp-Source: AGHT+IGG8ZscI1O2Swrrc167v3KEAoWoPhmJ98ClfXdmLFSj7Z/GOY2a95ztRYEy7O3pd0JsCWQD X-Received: by 2002:a9d:68c1:0:b0:6d9:d8fe:fc06 with SMTP id i1-20020a9d68c1000000b006d9d8fefc06mr20296562oto.44.1703163334638; Thu, 21 Dec 2023 04:55:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703163334; cv=none; d=google.com; s=arc-20160816; b=BnU2mXKPSppFcfT49FQTpQ4hIozkbWv1c7E8iCaauWYsOMc4/OjuDxcCjzb0oEpvq+ BcxKlDh/bzmWFIzObby2aLFqrhmOdgJbAqDhNf70URX/TJWrFSTTn96qnrv7EB+1aX0H Oc5+8KeTXkkB3KzNT86S0c9UYH2ydOWHdzcXE+ehlxtGwFHY4DpfhkQMymGASP7j2++z DlTgI5R00R3kJgFGV2mVtjq7b4PwzZ7veNwpQwvwGBoSTeU3VCI86CIHmrvFEKrxDwdk o7JkTxh5yXzYg0hCASL8GehbTCAv8AhNmxhNipvZ0vfodFadDV3SS0QIILG8/9C3r5eE QGeQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=X2VtMFNVwe79moKpAjGx4M96C7xuRnHF7CK7R0wpSXY=; fh=tj3vwvS1joPqVAqhm025RI9FzN3aC+9rlGGIIVsXGr8=; b=sV+s3+zfOa0exhxVl4L8HPO7yNY73XMHpNlOMHm6k5Tjgee6QwlnqZyBPPOuZ0tkA7 Tl0apVbV8SVAx5r7RglIKHWhoKcOqx7XOgoZSqaxiA56mxI8qt6vTqKGxZteNndGjA6G zx3fg+edjkFYOJudbtn9p9c8GHH2CPLibmgID8Ko85HNIY9lgQHtps7bkAMhl3OqoNcK vSkDAC7G4i3TEngO23zTVDEjLiW8VCkGC1A9Uzrk5rY8CCpt/Hvu124EXMaFsjlO50Ju itVCnl3k1MKBv5Lz5b7SGRmbP/sOEQq7RPtSfo76q/9ZpC1ce/lokSYR9aXDf1TcmUae ebsw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=bA37CyAR; spf=pass (google.com: domain of linux-kernel+bounces-8392-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-8392-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id e14-20020ac8598e000000b00427781fd7e2si2149627qte.137.2023.12.21.04.55.34 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Dec 2023 04:55:34 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-8392-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=bA37CyAR; spf=pass (google.com: domain of linux-kernel+bounces-8392-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-8392-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 5CED81C2562F for ; Thu, 21 Dec 2023 12:55:34 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 848257D5E5; Thu, 21 Dec 2023 12:48:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="bA37CyAR" X-Original-To: linux-kernel@vger.kernel.org Received: from madrid.collaboradmins.com (madrid.collaboradmins.com [46.235.227.194]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7ECA17BEF0; Thu, 21 Dec 2023 12:48:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1703162930; bh=afwWvYc7TNNJ91qm8hZuwUj/Kn9qVwfNFnfkz4getTU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bA37CyAR/1RM6usgEvYIPl/RV//Z2SY7ur9LbLrlQYOWRuQPPU238ncLEJ7jhS1oa DpAQUk2K++HBTKC0jkdEvhXdIDUkY7jfHG3pCv8NzTcNFgpjvBJvCIHaAKYXVBT89J OQUGDsqZuSw7ZTWi0HoW4k3EYYVmKfiYnspBLwbGFTfq2V6pvUTQZBh5En6pOKU55O ofQyak//8/BevQjIZ61pwtJ+ekrUwsqC1SeALSLd2aevG3ZYcI1pt7GysNHaWFqm0W W2b9XZHtrm7/RXWkbHCu0ijM1F9b0QzSu1MAiWMeX/FA8fA9B+HomoRhMm+72ESRsa Xedk3bRKVZhKQ== Received: from IcarusMOD.eternityproject.eu (cola.collaboradmins.com [195.201.22.229]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: kholk11) by madrid.collaboradmins.com (Postfix) with ESMTPSA id 79A5A378201A; Thu, 21 Dec 2023 12:48:49 +0000 (UTC) From: AngeloGioacchino Del Regno To: daniel.lezcano@linaro.org Cc: rafael@kernel.org, rui.zhang@intel.com, lukasz.luba@arm.com, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, AngeloGioacchino Del Regno , kernel@collabora.com Subject: [RFC PATCH 23/26] mlxsw: core_thermal: Migrate to thermal_zone_device_register() Date: Thu, 21 Dec 2023 13:48:22 +0100 Message-ID: <20231221124825.149141-24-angelogioacchino.delregno@collabora.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231221124825.149141-1-angelogioacchino.delregno@collabora.com> References: <20231221124825.149141-1-angelogioacchino.delregno@collabora.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1785896196682988384 X-GMAIL-MSGID: 1785896196682988384 The thermal API has a new thermal_zone_device_register() function which is deprecating the older thermal_zone_device_register_with_trips() and thermal_tripless_zone_device_register(). Migrate to the new thermal zone device registration function. Signed-off-by: AngeloGioacchino Del Regno --- .../ethernet/mellanox/mlxsw/core_thermal.c | 93 ++++++++++--------- 1 file changed, 50 insertions(+), 43 deletions(-) diff --git a/drivers/net/ethernet/mellanox/mlxsw/core_thermal.c b/drivers/net/ethernet/mellanox/mlxsw/core_thermal.c index f1b48d6615f6..5ad9f90d096d 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/core_thermal.c +++ b/drivers/net/ethernet/mellanox/mlxsw/core_thermal.c @@ -226,10 +226,6 @@ static int mlxsw_thermal_get_temp(struct thermal_zone_device *tzdev, return 0; } -static struct thermal_zone_params mlxsw_thermal_params = { - .no_hwmon = true, -}; - static struct thermal_zone_device_ops mlxsw_thermal_ops = { .bind = mlxsw_thermal_bind, .unbind = mlxsw_thermal_unbind, @@ -408,28 +404,30 @@ static const struct thermal_cooling_device_ops mlxsw_cooling_ops = { static int mlxsw_thermal_module_tz_init(struct mlxsw_thermal_module *module_tz) { - char tz_name[THERMAL_NAME_LENGTH]; + struct thermal_zone_device_params tzdp = { + .tzp = { .no_hwmon = true }, + .ops = &mlxsw_thermal_module_ops, + .devdata = module_tz, + .trips = module_tz->trips, + .num_trips = MLXSW_THERMAL_NUM_TRIPS, + .mask = MLXSW_THERMAL_TRIP_MASK, + .polling_delay = module_tz->parent->polling_delay + }; int err; if (module_tz->slot_index) - snprintf(tz_name, sizeof(tz_name), "mlxsw-lc%d-module%d", - module_tz->slot_index, module_tz->module + 1); + tzdp.type = kasprintf("mlxsw-lc%d-module%d", + module_tz->slot_index, module_tz->module + 1); else - snprintf(tz_name, sizeof(tz_name), "mlxsw-module%d", - module_tz->module + 1); - module_tz->tzdev = thermal_zone_device_register_with_trips(tz_name, - module_tz->trips, - MLXSW_THERMAL_NUM_TRIPS, - MLXSW_THERMAL_TRIP_MASK, - module_tz, - &mlxsw_thermal_module_ops, - &mlxsw_thermal_params, - 0, - module_tz->parent->polling_delay); - if (IS_ERR(module_tz->tzdev)) { - err = PTR_ERR(module_tz->tzdev); - return err; - } + tzdp.type = kasprintf("mlxsw-module%d", module_tz->module + 1); + + if (!tzdp.type) + return -ENOMEM; + + module_tz->tzdev = thermal_zone_device_register(&tzdp); + kfree(tzdp.type); + if (IS_ERR(module_tz->tzdev)) + return PTR_ERR(module_tz->tzdev); err = thermal_zone_device_enable(module_tz->tzdev); if (err) @@ -536,23 +534,28 @@ mlxsw_thermal_modules_fini(struct mlxsw_thermal *thermal, static int mlxsw_thermal_gearbox_tz_init(struct mlxsw_thermal_module *gearbox_tz) { - char tz_name[40]; + struct thermal_zone_device_params tzdp = { + .tzp = { .no_hwmon = true }, + .ops = &mlxsw_thermal_gearbox_ops, + .devdata = gearbox_tz, + .trips = gearbox_tz->trips, + .num_trips = MLXSW_THERMAL_NUM_TRIPS, + .mask = MLXSW_THERMAL_TRIP_MASK, + .polling_delay = gearbox_tz->parent->polling_delay + }; int ret; if (gearbox_tz->slot_index) - snprintf(tz_name, sizeof(tz_name), "mlxsw-lc%d-gearbox%d", - gearbox_tz->slot_index, gearbox_tz->module + 1); + tzdp.type = kasprintf("mlxsw-lc%d-gearbox%d", + gearbox_tz->slot_index, gearbox_tz->module + 1); else - snprintf(tz_name, sizeof(tz_name), "mlxsw-gearbox%d", - gearbox_tz->module + 1); - gearbox_tz->tzdev = thermal_zone_device_register_with_trips(tz_name, - gearbox_tz->trips, - MLXSW_THERMAL_NUM_TRIPS, - MLXSW_THERMAL_TRIP_MASK, - gearbox_tz, - &mlxsw_thermal_gearbox_ops, - &mlxsw_thermal_params, 0, - gearbox_tz->parent->polling_delay); + tzdp.type = kasprintf("mlxsw-gearbox%d", gearbox_tz->module + 1); + + if (!tzdp.type) + return -ENOMEM; + + gearbox_tz->tzdev = thermal_zone_device_register(&tzdp); + kfree(tzdp.type); if (IS_ERR(gearbox_tz->tzdev)) return PTR_ERR(gearbox_tz->tzdev); @@ -695,6 +698,12 @@ int mlxsw_thermal_init(struct mlxsw_core *core, const struct mlxsw_bus_info *bus_info, struct mlxsw_thermal **p_thermal) { + struct thermal_zone_device_params tzdp = { + .type = "mlxsw", + .tzp = { .no_hwmon = true }, + .ops = &mlxsw_thermal_ops, + .mask = MLXSW_THERMAL_TRIP_MASK + }; char mfcr_pl[MLXSW_REG_MFCR_LEN] = { 0 }; enum mlxsw_reg_mfcr_pwm_frequency freq; struct device *dev = bus_info->dev; @@ -770,14 +779,12 @@ int mlxsw_thermal_init(struct mlxsw_core *core, MLXSW_THERMAL_SLOW_POLL_INT : MLXSW_THERMAL_POLL_INT; - thermal->tzdev = thermal_zone_device_register_with_trips("mlxsw", - thermal->trips, - MLXSW_THERMAL_NUM_TRIPS, - MLXSW_THERMAL_TRIP_MASK, - thermal, - &mlxsw_thermal_ops, - &mlxsw_thermal_params, 0, - thermal->polling_delay); + tzdp.devdata = thermal; + tzdp.trips = thermal->trips; + tzdp.num_trips = MLXSW_THERMAL_NUM_TRIPS; + tzdp.polling_delay = thermal->polling_delay; + + thermal->tzdev = thermal_zone_device_register(&tzdp); if (IS_ERR(thermal->tzdev)) { err = PTR_ERR(thermal->tzdev); dev_err(dev, "Failed to register thermal zone\n"); From patchwork Thu Dec 21 12:48:23 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AngeloGioacchino Del Regno X-Patchwork-Id: 182207 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:2483:b0:fb:cd0c:d3e with SMTP id q3csp386957dyi; Thu, 21 Dec 2023 04:55:59 -0800 (PST) X-Google-Smtp-Source: AGHT+IGEAOFW0WzUVGda+7n6iVMAm0fSS2X+7Yb55K2QKeIX0+P1uhKqZ0nGTb/rEDK2GDfE8iiM X-Received: by 2002:a17:907:91ce:b0:a23:8a32:466e with SMTP id h14-20020a17090791ce00b00a238a32466emr505801ejz.0.1703163359592; Thu, 21 Dec 2023 04:55:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703163359; cv=none; d=google.com; s=arc-20160816; b=jeB41EwbYpDJkeeQ5RE7Sazt/QP+OyvTLYPEnxLFuDgLDVETWMTYdM0vFPvsddGQAB JDvcfzzx9HP34sXiPuizuowWzYLTevTa99Jn/ll/tKV8T0UEkEnw0Do8SXkTSlAwgYXe S0xfepsSDeKpf/ZBX7/h4u4ChcpWUFebgVSyqeHDxc68XIZmspgHrEVn+as2Ei3xuhaG OCsVhK9NM6/X+7x6zt4gxdhJeu5xHSk4XonMyWwuzyT05ZQvMILg6RiOOT2Pr14Pia7Q 45ra6F2E4th11rTVWKdX93zdpJxgYJFdshmoh4pUj5Svp6hjXD0dELBU/9AHEVjVheuP XJdA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=clPqkadFLI0XC2fMHrAkGqMH321bCdiQ+LbPyQ8oIAo=; fh=tj3vwvS1joPqVAqhm025RI9FzN3aC+9rlGGIIVsXGr8=; b=JRSYjtaEFqJD+D4f7+ljajkXIwtsZ46ZWysHBnO6taNzPuINUNnUswxdYRRSaWL3fs 7YhXTnu8Ir+RXtyRdqELr15tjCYaSX7jyTmIFLjY9ApNskAkI208Q9AV3iOS6d9iTbRP 5/WMMwiyPlnN38xLfXVK3YWoGz6Nmo/n2K6cybWvYmMin8RBLcfwvUlIlclgb57Ii6Uj 8It3Twne9jAXu0nvOS1qrUWqd8k64EGGvA28GHRyETw5A68Cuzydh2VkcPnjLnV1bDsb HAC/7hwd1tLp2W5XCVYgYc0AT+6w1w3oN0gSJpzc4Wr61a4BIpPhP0u+ZsNRAuefZDu3 6d1A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=NByCFnyz; spf=pass (google.com: domain of linux-kernel+bounces-8394-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-8394-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id v16-20020a1709060b5000b00a234c5dfe2dsi791925ejg.716.2023.12.21.04.55.59 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Dec 2023 04:55:59 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-8394-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=NByCFnyz; spf=pass (google.com: domain of linux-kernel+bounces-8394-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-8394-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 0C5B51F2185E for ; Thu, 21 Dec 2023 12:55:54 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4408A745C7; Thu, 21 Dec 2023 12:48:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="NByCFnyz" X-Original-To: linux-kernel@vger.kernel.org Received: from madrid.collaboradmins.com (madrid.collaboradmins.com [46.235.227.194]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 589687BF0F; Thu, 21 Dec 2023 12:48:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1703162930; bh=6AYkxKl8UtbFduON+vHDTlSbEKDTiAXo+qEGqK3aoS0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NByCFnyzTo9m0wh9v1y13lUpMSf5CRF7uM6N7DGKk0U5Y/h4ryJ4gNAZw8J2ltJe8 w0Cr0vo6JEevDL+3XbhBlwbmJoRSa2kUBsoovq2Nt2dgBLaAjbiJKnewj9Xx418VjL EavcvSLQOmu9yGCYW1K7pyabhD1JJqFvkQSF7RQXEYONyjbQNBAppq38DTkwwZqIl9 NtWy0sGdQz1xBDxjzvdr721DQ52GnCeW/G97EQLIXb2nQ10Zoic1opx2wEPEf67ePC E9cBmOPLFrM9p4v4v2DHbPBWyvRGb7GWEFwjtxJ4MUORe2vtGfAjODakNezpCjuysC v3buCg4Ym2PNQ== Received: from IcarusMOD.eternityproject.eu (cola.collaboradmins.com [195.201.22.229]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: kholk11) by madrid.collaboradmins.com (Postfix) with ESMTPSA id 402A5378201D; Thu, 21 Dec 2023 12:48:50 +0000 (UTC) From: AngeloGioacchino Del Regno To: daniel.lezcano@linaro.org Cc: rafael@kernel.org, rui.zhang@intel.com, lukasz.luba@arm.com, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, AngeloGioacchino Del Regno , kernel@collabora.com Subject: [RFC PATCH 24/26] fixup! power: supply: core: Migrate to thermal_zone_device_register() Date: Thu, 21 Dec 2023 13:48:23 +0100 Message-ID: <20231221124825.149141-25-angelogioacchino.delregno@collabora.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231221124825.149141-1-angelogioacchino.delregno@collabora.com> References: <20231221124825.149141-1-angelogioacchino.delregno@collabora.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1785896222911136474 X-GMAIL-MSGID: 1785896222911136474 --- drivers/power/supply/power_supply_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/power/supply/power_supply_core.c b/drivers/power/supply/power_supply_core.c index d656a2e39157..b0211ab97f9c 100644 --- a/drivers/power/supply/power_supply_core.c +++ b/drivers/power/supply/power_supply_core.c @@ -1310,7 +1310,7 @@ static int psy_register_thermal(struct power_supply *psy) /* Register battery zone device psy reports temperature */ if (psy_has_property(psy->desc, POWER_SUPPLY_PROP_TEMP)) { - tzdp.name = psy->desc->name; + tzdp.type = psy->desc->name; psy->tzd = thermal_zone_device_register(&tzdp); if (IS_ERR(psy->tzd)) return PTR_ERR(psy->tzd); From patchwork Thu Dec 21 12:48:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AngeloGioacchino Del Regno X-Patchwork-Id: 182208 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:2483:b0:fb:cd0c:d3e with SMTP id q3csp387031dyi; Thu, 21 Dec 2023 04:56:07 -0800 (PST) X-Google-Smtp-Source: AGHT+IHaHfDeSmsKM/L9uNw90hurYtiVW6GAGxNo35CAuCoDUzh6hrSFQtN8zFU4pA++Qb1xqdO9 X-Received: by 2002:a17:906:3f4b:b0:a1e:ef3d:7b63 with SMTP id f11-20020a1709063f4b00b00a1eef3d7b63mr11323625ejj.0.1703163367125; Thu, 21 Dec 2023 04:56:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703163367; cv=none; d=google.com; s=arc-20160816; b=tHuZnxSngtItG+BTX9bDmDBz2QwNXvkKFKU01KOlSOxX0uhhwO874zvafJu3Hc4NnQ rwH98d+Xc4h73Yk782TlFQ/Nu+hlsgl953EaWmxXUMIc9r3Wm6tsoUEUtHaG3/SC8Gjy WWYNJXUvOn6xtPso3zTYNS5gxVoA/tWTVGZOtcFWAq0LrqDYZPDe3xoVU6FpY9+JezT1 BJL4DeqYYzQKXiMxW06epYmSxiyQL7/ELp94KiZ9To667r6TyTp/c5uVkC2d6otqLwGW mCf29yJvxQ7vPSFK2b7/KTxNAc96FH7jQVarS6RAPg+lozBwmG9wHD/CbPBnDFZyJox9 oNNA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=+bdfHZcQu0HFCTsKw0VW/zmXNfd6sD+NqS0EjQTRg84=; fh=tj3vwvS1joPqVAqhm025RI9FzN3aC+9rlGGIIVsXGr8=; b=kKHdQEC72GRD8x90j2/q16Dh5a3P18XjoiVgrUWSAWtjLNIFS0dW8D4/D1wHgD0bcd hN6ZpMrWCquplnjr3ttystgYquePZmtDuaeshDDAj/fcn8uhubs621t8Cpt6Sofv6fSD 1Vf3tUYEyrFuMtZxb+T5Dhg0ePX624/mWAnnqSSXttaF0oEcmshlNo1UDLnfGrESzXxq htu9uH/h+oHpuE3nXC7blCyK6/INZQpShq8LeepwPstUWBpQ3OWLcaWcRY2d1qPZjQMt 9GhwPkZjMCjv3+nsOU+8FJfd7L1aVfS8XnrDVXmzlvDekmPOHW/cWfVoT0UxMILcnQgK 1PMg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=qNepVTp1; spf=pass (google.com: domain of linux-kernel+bounces-8395-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-8395-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id b8-20020a170906038800b00a2688f2ea1esi809872eja.887.2023.12.21.04.56.06 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Dec 2023 04:56:07 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-8395-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=qNepVTp1; spf=pass (google.com: domain of linux-kernel+bounces-8395-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-8395-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 92F131F22138 for ; Thu, 21 Dec 2023 12:56:06 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1ABD97D889; Thu, 21 Dec 2023 12:48:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="qNepVTp1" X-Original-To: linux-kernel@vger.kernel.org Received: from madrid.collaboradmins.com (madrid.collaboradmins.com [46.235.227.194]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E44217BF1D; Thu, 21 Dec 2023 12:48:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1703162931; bh=GtlxthakiJ4lmKIfCmFvoUbrzDEnn38lk/26FiOqO1M=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qNepVTp1SEiiRRs6475WQeA/DyE5rYMZw73vGgLmQESQT6xi/guiWTQfiitPhN+c/ IcuMYhgDR3FgL6zKUJyI9R9I4G+R9bMfTTBuia7E6Q0djz/x7bnQxEwOfwxhjuufkM e1pPgNKbkh6I2zN7Lx+0BwxHC+W/ROPwS2R9nW6ZVHaClTa2OtBb5IdtKC8/zqCBDu t9sKXER3LdAMybXq2hxyIkFl53VP6gsLhg4e5bgZq+GLHgTCJDme3HQO/mnekUyo5K +sdwcZOZ4HIpzV5+on0lHT9Cdqr3JY+pi6zaA52cruxI8dm/eXrkXoJA2d3q0N8aFT BmPZfvuQpLGfg== Received: from IcarusMOD.eternityproject.eu (cola.collaboradmins.com [195.201.22.229]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: kholk11) by madrid.collaboradmins.com (Postfix) with ESMTPSA id 1168C3782006; Thu, 21 Dec 2023 12:48:51 +0000 (UTC) From: AngeloGioacchino Del Regno To: daniel.lezcano@linaro.org Cc: rafael@kernel.org, rui.zhang@intel.com, lukasz.luba@arm.com, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, AngeloGioacchino Del Regno , kernel@collabora.com Subject: [RFC PATCH 25/26] thermal: Remove tripless_zone_register and register_with_trips functions Date: Thu, 21 Dec 2023 13:48:24 +0100 Message-ID: <20231221124825.149141-26-angelogioacchino.delregno@collabora.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231221124825.149141-1-angelogioacchino.delregno@collabora.com> References: <20231221124825.149141-1-angelogioacchino.delregno@collabora.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1785896230831311482 X-GMAIL-MSGID: 1785896230831311482 There are no more users of thermal_tripless_zone_device_register() and thermal_zone_device_register_with_trips() functions, as they were all converted to the new thermal_zone_device_register(): remove the former two functions. Signed-off-by: AngeloGioacchino Del Regno --- drivers/thermal/thermal_core.c | 111 +++++++++------------------------ include/linux/thermal.h | 15 ----- 2 files changed, 29 insertions(+), 97 deletions(-) diff --git a/drivers/thermal/thermal_core.c b/drivers/thermal/thermal_core.c index 6be508eb2d72..9eb0200a85ff 100644 --- a/drivers/thermal/thermal_core.c +++ b/drivers/thermal/thermal_core.c @@ -1221,21 +1221,9 @@ int thermal_zone_get_crit_temp(struct thermal_zone_device *tz, int *temp) EXPORT_SYMBOL_GPL(thermal_zone_get_crit_temp); /** - * thermal_zone_device_register_with_trips() - register a new thermal zone device - * @type: the thermal zone device type - * @trips: a pointer to an array of thermal trips - * @num_trips: the number of trip points the thermal zone support - * @mask: a bit string indicating the writeablility of trip points - * @devdata: private device data - * @ops: standard thermal zone device callbacks - * @tzp: thermal zone platform parameters - * @passive_delay: number of milliseconds to wait between polls when - * performing passive cooling - * @polling_delay: number of milliseconds to wait between polls when checking - * whether trip points have been crossed (0 for interrupt - * driven systems) - * - * This function is deprecated. See thermal_zone_device_register(). + * thermal_zone_device_register() - register a new thermal zone device + * @tzdp: Parameters of the new thermal zone device + * See struct thermal_zone_device_register. * * This interface function adds a new thermal zone device (sensor) to * /sys/class/thermal folder as thermal_zone[0-*]. It tries to bind all the @@ -1247,25 +1235,21 @@ EXPORT_SYMBOL_GPL(thermal_zone_get_crit_temp); * in case of error, an ERR_PTR. Caller must check return value with * IS_ERR*() helpers. */ -struct thermal_zone_device * -thermal_zone_device_register_with_trips(const char *type, struct thermal_trip *trips, int num_trips, int mask, - void *devdata, struct thermal_zone_device_ops *ops, - const struct thermal_zone_params *tzp, int passive_delay, - int polling_delay) +struct thermal_zone_device *thermal_zone_device_register(struct thermal_zone_device_params *tzdp) { struct thermal_zone_device *tz; int id; int result; struct thermal_governor *governor; - if (!type || strlen(type) == 0) { + if (!tzdp->type || strlen(tzdp->type) == 0) { pr_err("No thermal zone type defined\n"); return ERR_PTR(-EINVAL); } - if (strlen(type) >= THERMAL_NAME_LENGTH) { + if (strlen(tzdp->type) >= THERMAL_NAME_LENGTH) { pr_err("Thermal zone name (%s) too long, should be under %d chars\n", - type, THERMAL_NAME_LENGTH); + tzdp->type, THERMAL_NAME_LENGTH); return ERR_PTR(-EINVAL); } @@ -1282,17 +1266,18 @@ thermal_zone_device_register_with_trips(const char *type, struct thermal_trip *t * Check will be true when the bit 31 of the mask is set. * 32 bit shift will cause overflow of 4 byte integer. */ - if (num_trips > (BITS_PER_TYPE(int) - 1) || num_trips < 0 || mask >> num_trips) { + if (tzdp->num_trips > (BITS_PER_TYPE(int) - 1) || tzdp->num_trips < 0 || + tzdp->mask >> tzdp->num_trips) { pr_err("Incorrect number of thermal trips\n"); return ERR_PTR(-EINVAL); } - if (!ops) { + if (!tzdp->ops) { pr_err("Thermal zone device ops not defined\n"); return ERR_PTR(-EINVAL); } - if (num_trips > 0 && !trips) + if (tzdp->num_trips > 0 && !tzdp->trips) return ERR_PTR(-EINVAL); if (!thermal_class) @@ -1302,12 +1287,10 @@ thermal_zone_device_register_with_trips(const char *type, struct thermal_trip *t if (!tz) return ERR_PTR(-ENOMEM); - if (tzp) { - tz->tzp = kmemdup(tzp, sizeof(*tzp), GFP_KERNEL); - if (!tz->tzp) { - result = -ENOMEM; - goto free_tz; - } + tz->tzp = kmemdup(&tzdp->tzp, sizeof(tzdp->tzp), GFP_KERNEL); + if (!tz->tzp) { + result = -ENOMEM; + goto free_tz; } INIT_LIST_HEAD(&tz->thermal_instances); @@ -1322,23 +1305,23 @@ thermal_zone_device_register_with_trips(const char *type, struct thermal_trip *t } tz->id = id; - strscpy(tz->type, type, sizeof(tz->type)); + strscpy(tz->type, tzdp->type, sizeof(tz->type)); - if (!ops->critical) - ops->critical = thermal_zone_device_critical; + if (!tzdp->ops->critical) + tzdp->ops->critical = thermal_zone_device_critical; - tz->ops = ops; + tz->ops = tzdp->ops; tz->device.class = thermal_class; - tz->devdata = devdata; - tz->trips = trips; - tz->num_trips = num_trips; + tz->devdata = tzdp->devdata; + tz->trips = tzdp->trips; + tz->num_trips = tzdp->num_trips; - thermal_set_delay_jiffies(&tz->passive_delay_jiffies, passive_delay); - thermal_set_delay_jiffies(&tz->polling_delay_jiffies, polling_delay); + thermal_set_delay_jiffies(&tz->passive_delay_jiffies, tzdp->passive_delay); + thermal_set_delay_jiffies(&tz->polling_delay_jiffies, tzdp->polling_delay); /* sys I/F */ /* Add nodes that are always present via .groups */ - result = thermal_zone_create_device_groups(tz, mask); + result = thermal_zone_create_device_groups(tz, tzdp->mask); if (result) goto remove_id; @@ -1357,10 +1340,10 @@ thermal_zone_device_register_with_trips(const char *type, struct thermal_trip *t /* Update 'this' zone's governor information */ mutex_lock(&thermal_governor_lock); - if (tz->tzp) - governor = __find_governor(tz->tzp->governor_name); - else + if (strlen(tz->tzp->governor_name) == 0) governor = def_governor; + else + governor = __find_governor(tz->tzp->governor_name); result = thermal_set_governor(tz, governor); if (result) { @@ -1370,7 +1353,7 @@ thermal_zone_device_register_with_trips(const char *type, struct thermal_trip *t mutex_unlock(&thermal_governor_lock); - if (!tz->tzp || !tz->tzp->no_hwmon) { + if (!tz->tzp->no_hwmon) { result = thermal_add_hwmon_sysfs(tz); if (result) goto unregister; @@ -1409,42 +1392,6 @@ thermal_zone_device_register_with_trips(const char *type, struct thermal_trip *t kfree(tz); return ERR_PTR(result); } -EXPORT_SYMBOL_GPL(thermal_zone_device_register_with_trips); - -/* This function is deprecated. See thermal_zone_device_register(). */ -struct thermal_zone_device *thermal_tripless_zone_device_register( - const char *type, - void *devdata, - struct thermal_zone_device_ops *ops, - const struct thermal_zone_params *tzp) -{ - return thermal_zone_device_register_with_trips(type, NULL, 0, 0, devdata, - ops, tzp, 0, 0); -} -EXPORT_SYMBOL_GPL(thermal_tripless_zone_device_register); - -/** - * thermal_zone_device_register() - register a new thermal zone device - * @tzdp: Parameters of the new thermal zone device - * See struct thermal_zone_device_register. - * - * This interface function adds a new thermal zone device (sensor) to - * /sys/class/thermal folder as thermal_zone[0-*]. It tries to bind all the - * thermal cooling devices registered at the same time. - * thermal_zone_device_unregister() must be called when the device is no - * longer needed. The passive cooling depends on the .get_trend() return value. - * - * Return: a pointer to the created struct thermal_zone_device or an - * in case of error, an ERR_PTR. Caller must check return value with - * IS_ERR*() helpers. - */ -struct thermal_zone_device *thermal_zone_device_register(struct thermal_zone_device_params *tzdp) -{ - return thermal_zone_device_register_with_trips(tzdp->type, tzdp->trips, tzdp->num_trips, - tzdp->mask, tzdp->devdata, tzdp->ops, - &tzdp->tzp, tzdp->passive_delay, - tzdp->polling_delay); -} EXPORT_SYMBOL_GPL(thermal_zone_device_register); void *thermal_zone_device_priv(struct thermal_zone_device *tzd) diff --git a/include/linux/thermal.h b/include/linux/thermal.h index c6ed33a7e468..84b62575d93a 100644 --- a/include/linux/thermal.h +++ b/include/linux/thermal.h @@ -322,21 +322,6 @@ int thermal_zone_get_num_trips(struct thermal_zone_device *tz); int thermal_zone_get_crit_temp(struct thermal_zone_device *tz, int *temp); #ifdef CONFIG_THERMAL -struct thermal_zone_device *thermal_zone_device_register_with_trips( - const char *type, - struct thermal_trip *trips, - int num_trips, int mask, - void *devdata, - struct thermal_zone_device_ops *ops, - const struct thermal_zone_params *tzp, - int passive_delay, int polling_delay); - -struct thermal_zone_device *thermal_tripless_zone_device_register( - const char *type, - void *devdata, - struct thermal_zone_device_ops *ops, - const struct thermal_zone_params *tzp); - struct thermal_zone_device *thermal_zone_device_register(struct thermal_zone_device_params *tzdp); void thermal_zone_device_unregister(struct thermal_zone_device *tz); From patchwork Thu Dec 21 12:48:25 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AngeloGioacchino Del Regno X-Patchwork-Id: 182209 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:2483:b0:fb:cd0c:d3e with SMTP id q3csp387094dyi; Thu, 21 Dec 2023 04:56:13 -0800 (PST) X-Google-Smtp-Source: AGHT+IE+KjJbApdUfeCuk5twIQZuDueqZrOwJAOHC+2WICWtASbJQhutoixgqXE24emDgQBgYoNN X-Received: by 2002:a50:c88c:0:b0:551:e53b:f0fd with SMTP id d12-20020a50c88c000000b00551e53bf0fdmr8618456edh.53.1703163373539; Thu, 21 Dec 2023 04:56:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703163373; cv=none; d=google.com; s=arc-20160816; b=UvQ8XHN0pVNJ2BUaI+sHtn4iPFcDGVQJg8DPBrdugdUXWQZDRRfJwdYiGya4Hw79ok hw8RImMz6bcPZm/L+N7YbZtmeToraE9rbVHH8bjJI0LNCIj/wsJmXILg2TLM7UKVv2Bv pU1A4MVjYNYIwWNB4R5Gtp39UNA4Soqn31zBY68x83mn+c1uBSceGGAin7d1UWBVYt/S mVGs/cbKyx1YdLcCZJU8ujBNY/IW1Nn0y/cObuW2LT5DiX6Vc8jgalHSiSIf326HTBOx 61vk6Ubce8g+hernvsFF/D3NN2ZizLi7UgId6XOc5IdQgSsecVJkmn1FRUJ3xp3iucvV i5yw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=skaxi1s4VECu5LEbv8IhENpwKGyywf4nu/V6ctdM++M=; fh=tj3vwvS1joPqVAqhm025RI9FzN3aC+9rlGGIIVsXGr8=; b=xKoTkjlcAxoaLBodlaObD2jQq2pGXicrTrpJnYVIMjwbx27tBcZKNiq1wOwy0npdWp iMrC4dlMo4qAs8ZV+ziQ2n71D5EKDbCfEIaPJyKVRvRfccLy/xbEp8KP93TUFCoG75nO JIH3QCo45BnayQ57b+JfRWgtDQx2SKPsFLqasSUgNE3SwynGLyFtHUdCVg97rkW71b3K Bjz0D2mjyxt4SBsRtZaEUu9U/adJnOGX2fAW+EFd8JPeJXJKjY7CLiHryTuH0UNRbAAK BS14pBba8dZrLEnkymaD2VTUuZrONSWocylKuoigXKVQ5qQkiVWposBv+Dy1B8Y3YF+v 4NxA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=1mF95Ueg; spf=pass (google.com: domain of linux-kernel+bounces-8396-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-8396-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id 29-20020a50875d000000b0055412af5c33si711069edv.117.2023.12.21.04.56.13 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Dec 2023 04:56:13 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-8396-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=1mF95Ueg; spf=pass (google.com: domain of linux-kernel+bounces-8396-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-8396-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 00D3E1F22DDF for ; Thu, 21 Dec 2023 12:56:13 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 00D597D892; Thu, 21 Dec 2023 12:48:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="1mF95Ueg" X-Original-To: linux-kernel@vger.kernel.org Received: from madrid.collaboradmins.com (madrid.collaboradmins.com [46.235.227.194]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DE52E7C670; Thu, 21 Dec 2023 12:48:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1703162932; bh=JvnNtNzLnxBHi+1B1yovKVASCm/Y8JsnlC3wCWBkVHc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=1mF95Ueg2YUSSDBl1QmdMUylbMga3HSXJmzyGclvWb10VCCfy5kTErmhb41XNRgsx 7IM9CnziwKY0iIWy07uhkWGdJdGEx5iWogKMj0nQG4AuDKTHXEPjs6Fs/wPjWl5Xj+ Lk/I+BPrj6OiMDbjjL6KizWNo89J1LweQEKABLUdz7VZB0Wp3OTGAsFJE5RQ4PAsiJ Id+VQqJlTkPmyVZzMMKCT2yqHhza0os4qdSRtXQLmFj+fqRM6p8YffIZGGyz6W2f// khaD/ajprR7yOt06Cgv6D8W1NTiicjHHqqVNIIcrsGA0N9LESZ5llYooSxt4MSv5Vp avJV8jmCu8+FA== Received: from IcarusMOD.eternityproject.eu (cola.collaboradmins.com [195.201.22.229]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: kholk11) by madrid.collaboradmins.com (Postfix) with ESMTPSA id BFCBB3782025; Thu, 21 Dec 2023 12:48:51 +0000 (UTC) From: AngeloGioacchino Del Regno To: daniel.lezcano@linaro.org Cc: rafael@kernel.org, rui.zhang@intel.com, lukasz.luba@arm.com, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, AngeloGioacchino Del Regno , kernel@collabora.com Subject: [RFC PATCH 26/26] thermal: Introduce thermal zones names Date: Thu, 21 Dec 2023 13:48:25 +0100 Message-ID: <20231221124825.149141-27-angelogioacchino.delregno@collabora.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231221124825.149141-1-angelogioacchino.delregno@collabora.com> References: <20231221124825.149141-1-angelogioacchino.delregno@collabora.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1785896237254683874 X-GMAIL-MSGID: 1785896237254683874 Currently thermal zones have a "type" but this is often used, and referenced, as a name instead in multiple kernel drivers that are either registering a zone or grabbing a thermal zone handle and unfortunately this is a kind of abuse/misuse of the thermal zone concept of "type". In order to disambiguate name<->type and to actually provide an accepted way of giving a specific name to a thermal zone for both platform drivers and devicetree-defined zones, add a new "name" member in the main thermal_zone_device structure, and also to the thermal_zone_device_params structure which is used to register a thermal zone device. This will enforce the following constraints: - Multiple thermal zones may be of the same "type" (no change); - A thermal zone may have a *unique* name: trying to register a new zone with the same name as an already present one will produce a failure; --- drivers/thermal/thermal_core.c | 34 ++++++++++++++++++++++++++++++--- drivers/thermal/thermal_of.c | 1 + drivers/thermal/thermal_sysfs.c | 9 +++++++++ drivers/thermal/thermal_trace.h | 17 +++++++++++------ include/linux/thermal.h | 4 ++++ 5 files changed, 56 insertions(+), 9 deletions(-) diff --git a/drivers/thermal/thermal_core.c b/drivers/thermal/thermal_core.c index 9eb0200a85ff..adf2ac8113e1 100644 --- a/drivers/thermal/thermal_core.c +++ b/drivers/thermal/thermal_core.c @@ -1238,8 +1238,8 @@ EXPORT_SYMBOL_GPL(thermal_zone_get_crit_temp); struct thermal_zone_device *thermal_zone_device_register(struct thermal_zone_device_params *tzdp) { struct thermal_zone_device *tz; - int id; - int result; + int id, tz_name_len; + int result = 0; struct thermal_governor *governor; if (!tzdp->type || strlen(tzdp->type) == 0) { @@ -1248,11 +1248,36 @@ struct thermal_zone_device *thermal_zone_device_register(struct thermal_zone_dev } if (strlen(tzdp->type) >= THERMAL_NAME_LENGTH) { - pr_err("Thermal zone name (%s) too long, should be under %d chars\n", + pr_err("Thermal zone type (%s) too long, should be under %d chars\n", tzdp->type, THERMAL_NAME_LENGTH); return ERR_PTR(-EINVAL); } + tz_name_len = tzdp->name ? strlen(tzdp->name) : 0; + if (tz_name_len) { + struct thermal_zone_device *pos; + + if (tz_name_len >= THERMAL_NAME_LENGTH) { + pr_err("Thermal zone name (%s) too long, should be under %d chars\n", + tzdp->name, THERMAL_NAME_LENGTH); + return ERR_PTR(-EINVAL); + } + + mutex_lock(&thermal_list_lock); + list_for_each_entry(pos, &thermal_tz_list, node) + if (!strncasecmp(tzdp->name, pos->name, THERMAL_NAME_LENGTH)) { + result = -EEXIST; + break; + } + mutex_unlock(&thermal_list_lock); + + if (result) { + pr_err("Thermal zone name (%s) already exists and must be unique\n", + tzdp->name); + return ERR_PTR(result); + } + } + /* * Max trip count can't exceed 31 as the "mask >> num_trips" condition. * For example, shifting by 32 will result in compiler warning: @@ -1307,6 +1332,9 @@ struct thermal_zone_device *thermal_zone_device_register(struct thermal_zone_dev tz->id = id; strscpy(tz->type, tzdp->type, sizeof(tz->type)); + if (tz_name_len) + strscpy(tz->name, tzdp->name, sizeof(tzdp->name)); + if (!tzdp->ops->critical) tzdp->ops->critical = thermal_zone_device_critical; diff --git a/drivers/thermal/thermal_of.c b/drivers/thermal/thermal_of.c index 62a903ad649f..eaacc140abeb 100644 --- a/drivers/thermal/thermal_of.c +++ b/drivers/thermal/thermal_of.c @@ -486,6 +486,7 @@ static struct thermal_zone_device *thermal_of_zone_register(struct device_node * ret = PTR_ERR(np); goto out_kfree_of_ops; } + tzdp.name = np->name; tzdp.type = np->name; tzdp.trips = thermal_of_trips_init(np, &tzdp.num_trips); diff --git a/drivers/thermal/thermal_sysfs.c b/drivers/thermal/thermal_sysfs.c index f52af8a3b4b5..f4002fa6caa2 100644 --- a/drivers/thermal/thermal_sysfs.c +++ b/drivers/thermal/thermal_sysfs.c @@ -23,6 +23,14 @@ /* sys I/F for thermal zone */ +static ssize_t +name_show(struct device *dev, struct device_attribute *attr, char *buf) +{ + struct thermal_zone_device *tz = to_thermal_zone(dev); + + return sprintf(buf, "%s\n", tz->name); +} + static ssize_t type_show(struct device *dev, struct device_attribute *attr, char *buf) { @@ -341,6 +349,7 @@ create_s32_tzp_attr(offset); * All the attributes created for tzp (create_s32_tzp_attr) also are always * present on the sysfs interface. */ +static DEVICE_ATTR_RO(name); static DEVICE_ATTR_RO(type); static DEVICE_ATTR_RO(temp); static DEVICE_ATTR_RW(policy); diff --git a/drivers/thermal/thermal_trace.h b/drivers/thermal/thermal_trace.h index 459c8ce6cf3b..c9dbae1e3b9e 100644 --- a/drivers/thermal/thermal_trace.h +++ b/drivers/thermal/thermal_trace.h @@ -28,6 +28,7 @@ TRACE_EVENT(thermal_temperature, TP_ARGS(tz), TP_STRUCT__entry( + __string(thermal_zone_name, tz->name) __string(thermal_zone, tz->type) __field(int, id) __field(int, temp_prev) @@ -35,15 +36,16 @@ TRACE_EVENT(thermal_temperature, ), TP_fast_assign( + __assign_str(thermal_zone_name, tz->name); __assign_str(thermal_zone, tz->type); __entry->id = tz->id; __entry->temp_prev = tz->last_temperature; __entry->temp = tz->temperature; ), - TP_printk("thermal_zone=%s id=%d temp_prev=%d temp=%d", - __get_str(thermal_zone), __entry->id, __entry->temp_prev, - __entry->temp) + TP_printk("thermal_zone=%s name=%s id=%d temp_prev=%d temp=%d", + __get_str(thermal_zone), __get_str(thermal_zone_name), + __entry->id, __entry->temp_prev, __entry->temp) ); TRACE_EVENT(cdev_update, @@ -73,6 +75,7 @@ TRACE_EVENT(thermal_zone_trip, TP_ARGS(tz, trip, trip_type), TP_STRUCT__entry( + __string(thermal_zone_name, tz->name) __string(thermal_zone, tz->type) __field(int, id) __field(int, trip) @@ -80,15 +83,17 @@ TRACE_EVENT(thermal_zone_trip, ), TP_fast_assign( + __assign_str(thermal_zone_name, tz->name); __assign_str(thermal_zone, tz->type); __entry->id = tz->id; __entry->trip = trip; __entry->trip_type = trip_type; ), - TP_printk("thermal_zone=%s id=%d trip=%d trip_type=%s", - __get_str(thermal_zone), __entry->id, __entry->trip, - show_tzt_type(__entry->trip_type)) + TP_printk("thermal_zone=%s name=%s id=%d trip=%d trip_type=%s", + __get_str(thermal_zone), __get_str(thermal_zone_name), + __entry->id, __entry->trip, + show_tzt_type(__entry->trip_type)) ); #ifdef CONFIG_CPU_THERMAL diff --git a/include/linux/thermal.h b/include/linux/thermal.h index 84b62575d93a..a06521eda162 100644 --- a/include/linux/thermal.h +++ b/include/linux/thermal.h @@ -115,6 +115,7 @@ struct thermal_cooling_device { /** * struct thermal_zone_device - structure for a thermal zone * @id: unique id number for each thermal zone + * @name: name of the thermal zone device * @type: the thermal zone device type * @device: &struct device for this thermal zone * @removal: removal completion @@ -155,6 +156,7 @@ struct thermal_cooling_device { */ struct thermal_zone_device { int id; + char name[THERMAL_NAME_LENGTH]; char type[THERMAL_NAME_LENGTH]; struct device device; struct completion removal; @@ -260,6 +262,7 @@ struct thermal_zone_params { /** * struct thermal_zone_device_params - parameters for a thermal zone device + * @name: name of the thermal zone device * @type: the thermal zone device type * @tzp: thermal zone platform parameters * @ops: standard thermal zone device callbacks @@ -274,6 +277,7 @@ struct thermal_zone_params { * driven systems) */ struct thermal_zone_device_params { + const char *name; const char *type; struct thermal_zone_params tzp; struct thermal_zone_device_ops *ops;