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;