From patchwork Fri Jan 3 16:38:00 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Claudiu Beznea X-Patchwork-Id: 13925705 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 67244E7718F for ; Fri, 3 Jan 2025 16:41:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=uRfd2J8GP5C8knwZHf/66JpMVkPptrjLbcLPhoT3Dxw=; b=JqQuYP1nJsSrKG7wfBie2Ybu8c bG+Cv3hRGIHGph/z+zQP1lLG0q/nyHyJpn8VlSH08EYHi2GV3nBG2K2rt69M3QAFDznhn35mt65wr qJTHZ+3jJO1eng2Xflhbx3dggJMlPNsYk7+TWpqFHAvy0N7hA7Xk/zWYRLOR8lLh8TNk1SYeMTQZF DyT9Y3O24YSk7xjbHYz5XEEwDj8DyjViDJBoRaZ4r3cIzNZd7JqMWiIF2DTJxaHKcCSmyWLl55mXW njBH/hXQ0D/wnUlcEeWGtoq3T0X0qlU8pPUxvQI/rZFL+70orJgWtFdmTNU3aO2WfI/eiCEvPFR3H 3C8H2pJA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tTkjK-0000000DSPm-16w6; Fri, 03 Jan 2025 16:40:58 +0000 Received: from mail-ej1-x62f.google.com ([2a00:1450:4864:20::62f]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tTkgy-0000000DRrd-0gJ0 for linux-arm-kernel@lists.infradead.org; Fri, 03 Jan 2025 16:38:33 +0000 Received: by mail-ej1-x62f.google.com with SMTP id a640c23a62f3a-aa6a92f863cso2137821266b.1 for ; Fri, 03 Jan 2025 08:38:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tuxon.dev; s=google; t=1735922310; x=1736527110; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=uRfd2J8GP5C8knwZHf/66JpMVkPptrjLbcLPhoT3Dxw=; b=ClPdiGAZXIjA238oGOB3omPwKNOM/oGw90kKOiUpDQb+KQmFdPHqVxEhLjbQu45EgQ 3wqcqZ0EypnGzGWk4IQSc+bDvYrePueHQRRbicEMe/KlTyZwxmZMYR6Ejwo/Shum3ICJ 7K6b5/BHBBWoL65DaiCcjnmWDCwmMRvhyAdxtWmqMWfJPKwM620Pd9COvR1FlQs+JELP y1vhGxuR7JuHqf2PgUyXG1IheXv2Vq/q2BBO0J2ogpa2oah6L3HaAy+Ebh5AHQ+LpdaY ULn2dnqXokrXPiSxSetfwrtnHPEAXACafZ0eLLEgFV260xZIJO6Ixh4ob9Xg29iUAGXq 0eQw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735922310; x=1736527110; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=uRfd2J8GP5C8knwZHf/66JpMVkPptrjLbcLPhoT3Dxw=; b=TYxFXjqHe64CU7LxmO2VXBUbsETyUQvx0TL5PVQCtQDSOd+IukecZu3eFhw50ZC+18 XFpK2JXbEr1Y+EKEy5Db2pObPPsh6lJkzwPiEdpJWK5P85CQ3mizPYMiHnkObNfeJ4Se 5yo8pf/6JrUOdrc8BiLE0RAO5ryAnGcsazyDw1jIgDvyi4CGFWZvLHFwQZ7RsVGBHJsC AKku6eWgUq6igZveXtgJZ/nIbTM+IF9cGdzIGaXEHQaDiU0zRplThfPHNlbh2G9s7KfN 9v9/gcZ0r5VS+5ODlPURB2RyvxmCXDJ9HQ+gVT/YlrF2OmWdt/xJl5xZGNSMOSOaMdkl hJfQ== X-Forwarded-Encrypted: i=1; AJvYcCXnp4u6jZhrey8p8SPHw0DLbGo3CzO6D6XM2wgF49gNbK6TVA4xN6NMaYPKKI/wmOLjuSSGWgYiiFdXCwL3WQ+h@lists.infradead.org X-Gm-Message-State: AOJu0YyzJsV5krk0YYrlCWrLqUCJ8blxnM900uFytaHZoOr0jLu8ELxX rFZcOI2UY/tJkykEpXml4co4K/WNBp9LWWyfvzv5jipV74VB4gQvORzg9GW/Uyo= X-Gm-Gg: ASbGnctyxsauKYH1vjc+OBuHRLM/Q2P7XXxu9787ha2BQ8G8FgP6qx1qLLe9eqMxe4c nb/vGtPBYjTKSzQOOsA4hz0VX7i1WexlziHFSxOVLRbmH12tt2jAsCnvc7aH8RfhmPdXjmHeXe5 wE8LhWbEMErq/KU1VnmWZIbM2E8Ehts9lSmS1EySRYsA1BSPjRAbcpZvca/n/h35E9iufFdEIt9 YLswn9zXH6LR9UKmCkgvQ58vD9jWhkcacuaLbjdTkk1L1LBSCMfQLpZjHGlpZJcAITG1oiiaqI/ PuENi5vCNhU= X-Google-Smtp-Source: AGHT+IEDncREyuqiaeFdEZrch8doNfoioGsr8GniNw17HEMgfl8Mb5jP1IALi9TIgf4Be+b+F0vcRQ== X-Received: by 2002:a17:907:944f:b0:aac:439:10ce with SMTP id a640c23a62f3a-aac2ba3c11amr5503329166b.27.1735922310189; Fri, 03 Jan 2025 08:38:30 -0800 (PST) Received: from claudiu-X670E-Pro-RS.. ([82.78.167.102]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-aac0e8953b6sm1932984066b.65.2025.01.03.08.38.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Jan 2025 08:38:29 -0800 (PST) From: Claudiu X-Google-Original-From: Claudiu To: rafael@kernel.org, daniel.lezcano@linaro.org, rui.zhang@intel.com, lukasz.luba@arm.com, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, geert+renesas@glider.be, magnus.damm@gmail.com, mturquette@baylibre.com, sboyd@kernel.org, p.zabel@pengutronix.de, ulf.hansson@linaro.org Cc: claudiu.beznea@tuxon.dev, linux-pm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-clk@vger.kernel.org, Claudiu Beznea Subject: [PATCH 1/6] clk: renesas: r9a08g045: Add clocks, resets and power domain support for the TSU IP Date: Fri, 3 Jan 2025 18:38:00 +0200 Message-ID: <20250103163805.1775705-2-claudiu.beznea.uj@bp.renesas.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250103163805.1775705-1-claudiu.beznea.uj@bp.renesas.com> References: <20250103163805.1775705-1-claudiu.beznea.uj@bp.renesas.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250103_083832_200684_5089527D X-CRM114-Status: UNSURE ( 9.68 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Claudiu Beznea Add clocks, resets and power domains for the TSU IP available on the Renesas RZ/G3S SoC. Signed-off-by: Claudiu Beznea --- drivers/clk/renesas/r9a08g045-cpg.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/clk/renesas/r9a08g045-cpg.c b/drivers/clk/renesas/r9a08g045-cpg.c index 0e7e3bf05b52..bc44e08e7eb9 100644 --- a/drivers/clk/renesas/r9a08g045-cpg.c +++ b/drivers/clk/renesas/r9a08g045-cpg.c @@ -241,6 +241,7 @@ static const struct rzg2l_mod_clk r9a08g045_mod_clks[] = { DEF_MOD("gpio_hclk", R9A08G045_GPIO_HCLK, R9A08G045_OSCCLK, 0x598, 0), DEF_MOD("adc_adclk", R9A08G045_ADC_ADCLK, R9A08G045_CLK_TSU, 0x5a8, 0), DEF_MOD("adc_pclk", R9A08G045_ADC_PCLK, R9A08G045_CLK_TSU, 0x5a8, 1), + DEF_MOD("tsu_pclk", R9A08G045_TSU_PCLK, R9A08G045_CLK_TSU, 0x5ac, 0), DEF_MOD("vbat_bclk", R9A08G045_VBAT_BCLK, R9A08G045_OSCCLK, 0x614, 0), }; @@ -279,6 +280,7 @@ static const struct rzg2l_reset r9a08g045_resets[] = { DEF_RST(R9A08G045_GPIO_SPARE_RESETN, 0x898, 2), DEF_RST(R9A08G045_ADC_PRESETN, 0x8a8, 0), DEF_RST(R9A08G045_ADC_ADRST_N, 0x8a8, 1), + DEF_RST(R9A08G045_TSU_PRESETN, 0x8ac, 0), DEF_RST(R9A08G045_VBAT_BRESETN, 0x914, 0), }; @@ -353,6 +355,8 @@ static const struct rzg2l_cpg_pm_domain_init_data r9a08g045_pm_domains[] = { DEF_REG_CONF(CPG_BUS_MCPU3_MSTOP, BIT(4)), 0), DEF_PD("adc", R9A08G045_PD_ADC, DEF_REG_CONF(CPG_BUS_MCPU2_MSTOP, BIT(14)), 0), + DEF_PD("tsu", R9A08G045_PD_TSU, + DEF_REG_CONF(CPG_BUS_MCPU2_MSTOP, BIT(15)), 0), DEF_PD("vbat", R9A08G045_PD_VBAT, DEF_REG_CONF(CPG_BUS_MCPU3_MSTOP, BIT(8)), GENPD_FLAG_ALWAYS_ON), From patchwork Fri Jan 3 16:38:01 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Claudiu Beznea X-Patchwork-Id: 13925706 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D9A9BE77188 for ; Fri, 3 Jan 2025 16:42:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=MKO092aqGvuaWEK1ec47bOLS5kCK+a7HRvUCASG+XdU=; b=N5h/q0X6RgIZFnsOrQjyDLap5r m8oDXFy5LKDdL4c4jcxkQSR0cJcbcOEyqZ5suOWUAY0KgekxEE8yg+tHRxDhDnMpxh3VZWHWRK0I0 JyDQDriBfp8D35GfajZnfyV6/x0aTGKKZEstRviauTEteCMmDhBz8Xk9P7W06KgigPtRvAC4fc66x cFx8yrcYZqR3zK2gj6ZA2DCjoKJFrSpIjMT87mfsOTR2CjVE/0UILgWpCDvHIgpw6peo8zCKFjBJz iZaoNtgjxDBimVDlMDzZa4423KxRKdR9aiHBtRq/r2z7Vz+ONk4RsbqnSKn0woEuahwhsHmy88usL TCD28QCg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tTkkU-0000000DSW9-46Kd; Fri, 03 Jan 2025 16:42:10 +0000 Received: from mail-ej1-x631.google.com ([2a00:1450:4864:20::631]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tTkh0-0000000DRsl-0dkH for linux-arm-kernel@lists.infradead.org; Fri, 03 Jan 2025 16:38:35 +0000 Received: by mail-ej1-x631.google.com with SMTP id a640c23a62f3a-aa692211331so2356361766b.1 for ; Fri, 03 Jan 2025 08:38:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tuxon.dev; s=google; t=1735922312; x=1736527112; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=MKO092aqGvuaWEK1ec47bOLS5kCK+a7HRvUCASG+XdU=; b=RPyatjGlduynQuaEtfcWtGSNDOF5f9hHbo6BZ6DVj+rjJsYZtGamlL84zzNKzCEuog tP0ZPGBkrcVb+2+5IHShGEoYpU2zNLQWDBkRBWFwn5OlCSA/gNT3LAm7HA64+wA/cO48 TNd5V/RqD2hLkwW4655x/1s8yTOkCkp7j1VeqgVulFs9rb+Jb+XztQivmG4yHTacUEMT gtUhF+yLoCygaJ7VqITtkF4YLFcoV9MLjsq8G+KHEsmV5ggH1rzyEn/K0Ddi4MSxvidS Q7+6W9QLnJ2jCYI2+f6K0LzobV3EIm9RLzET9++ksqGUbXqTrL7dnu2aM29es0rpEtPr /8TQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735922312; x=1736527112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=MKO092aqGvuaWEK1ec47bOLS5kCK+a7HRvUCASG+XdU=; b=qAeW1fJZEYbftDIF1jIk2HW5x/ewphAped6Xp77EFqG4en44ZlhAf65ltt+SBNMtao z2P0K+6l3+K5v4iKz+1tzA1ffo58CRs9m2AgQRqVUJuARFseDQepmkiVEFq0q7g2Od6R 1WXPCf7u0kfGSRL/zSd+tjtjz7brvJZ6auWVB35ODJMaaqVjB1O0NQzvE34XwnDWmd1C 0XETvRpSHuD0d4SR6SaHmJ54jSrkczf4XCaielUSFfkcTxFIALQC+UkgKABYCH8+7bKA iSvGuXy7MwlSLGq9jRdf6edvPyQGvNI3W1GQuCqCsfev8gzVC0uvWM+wbI5LS7VlFnpI 0slQ== X-Forwarded-Encrypted: i=1; AJvYcCW6c/02LM9z4FIQyGu6eRWP8ijDHZ4zCj0Mb9BSj186t9YHeUSHaRvj6loHt1R7Lm4Nz9vvPMz6o1ldRRad3ULU@lists.infradead.org X-Gm-Message-State: AOJu0Yye4DrMLHXb/4zOTYqOL83FzOhqg3v8rzMVKEE4IpZ8+GOn+D1l OU9A1QYJLtymT3vH7iaBDJxIAn4d5N0z6PXUvl0tT/400PHvwNJGwy/CiMQPIfQ= X-Gm-Gg: ASbGnct955M2qlsexZ/Zns9XzB+HjtWSi/Rhy+225Rn9GErOcfg36TsxErTZqwN1+7g xDbl2UoxLUgRdmgyHLuVGImIS2OPuRsPqM4ZZnpBy+N7hF5daInkco8GX0zpoha6u4GUIUeNJfb KU6w3gQpFfGxE4MytAvElEub4VxRV0HtQrsybe4TW+/o6lfx465YG4yR3mx3MwrTzoIpHg2oBbm Pum4QPznhH1BLiRYeFNku1qE/kDALbcpMJ5KmrpmS/kgh74Ua9H96mesiCUw92/9ZjhaLuLjjYm dsZLYTfnr/k= X-Google-Smtp-Source: AGHT+IHotX0t/tDNEmrDmtZY7hNyawr8SL8uDODoko36MDXxVpeudAHOQDSv7TvNphEb+Zb8F3tSTg== X-Received: by 2002:a17:906:4fcb:b0:aa6:7ff9:d248 with SMTP id a640c23a62f3a-aac0812631emr4709225166b.8.1735922312040; Fri, 03 Jan 2025 08:38:32 -0800 (PST) Received: from claudiu-X670E-Pro-RS.. ([82.78.167.102]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-aac0e8953b6sm1932984066b.65.2025.01.03.08.38.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Jan 2025 08:38:31 -0800 (PST) From: Claudiu X-Google-Original-From: Claudiu To: rafael@kernel.org, daniel.lezcano@linaro.org, rui.zhang@intel.com, lukasz.luba@arm.com, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, geert+renesas@glider.be, magnus.damm@gmail.com, mturquette@baylibre.com, sboyd@kernel.org, p.zabel@pengutronix.de, ulf.hansson@linaro.org Cc: claudiu.beznea@tuxon.dev, linux-pm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-clk@vger.kernel.org, Claudiu Beznea Subject: [PATCH 2/6] thermal: of: Export non-devres helper to register/unregister thermal zone Date: Fri, 3 Jan 2025 18:38:01 +0200 Message-ID: <20250103163805.1775705-3-claudiu.beznea.uj@bp.renesas.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250103163805.1775705-1-claudiu.beznea.uj@bp.renesas.com> References: <20250103163805.1775705-1-claudiu.beznea.uj@bp.renesas.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250103_083834_196521_D598C01C X-CRM114-Status: GOOD ( 18.75 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Claudiu Beznea On the Renesas RZ/G3S (and other Renesas SoCs, e.g., RZ/G2{L, LC, UL}), clocks are managed through PM domains. These PM domains, registered on behalf of the clock controller driver, are configured with GENPD_FLAG_PM_CLK. In most of the Renesas drivers used by RZ SoCs, the clocks are enabled/disabled using runtime PM APIs. During probe, devices are attached to the PM domain controlling their clocks. Similarly, during removal, devices are detached from the PM domain. The detachment call stack is as follows: device_driver_detach() -> device_release_driver_internal() -> __device_release_driver() -> device_remove() -> platform_remove() -> dev_pm_domain_detach() In the upcoming Renesas RZ/G3S thermal driver, the struct thermal_zone_device_ops::change_mode API is implemented to start/stop the thermal sensor unit. Register settings are updated within the change_mode API. In case devres helpers are used for thermal zone register/unregister the struct thermal_zone_device_ops::change_mode API is invoked when the driver is unbound. The identified call stack is as follows: device_driver_detach() -> device_release_driver_internal() -> device_unbind_cleanup() -> devres_release_all() -> devm_thermal_of_zone_release() -> thermal_zone_device_disable() -> thermal_zone_device_set_mode() -> rzg3s_thermal_change_mode() The device_unbind_cleanup() function is called after the thermal device is detached from the PM domain (via dev_pm_domain_detach()). The rzg3s_thermal_change_mode() implementation calls pm_runtime_resume_and_get()/pm_runtime_put_autosuspend() before/after accessing the registers. However, during the unbind scenario, the devm_thermal_of_zone_release() is invoked after dev_pm_domain_detach(). Consequently, the clocks are not enabled, as the device is removed from the PM domain at this time, leading to an Asynchronous SError Interrupt. The system cannot be used after this. Add thermal_of_zone_register()/thermal_of_zone_unregister(). These will be used in the upcomming RZ/G3S thermal driver. Signed-off-by: Claudiu Beznea --- drivers/thermal/thermal_of.c | 8 +++++--- include/linux/thermal.h | 14 ++++++++++++++ 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/drivers/thermal/thermal_of.c b/drivers/thermal/thermal_of.c index fab11b98ca49..8fc35d20db60 100644 --- a/drivers/thermal/thermal_of.c +++ b/drivers/thermal/thermal_of.c @@ -329,11 +329,12 @@ static bool thermal_of_should_bind(struct thermal_zone_device *tz, * * @tz: a pointer to the thermal zone structure */ -static void thermal_of_zone_unregister(struct thermal_zone_device *tz) +void thermal_of_zone_unregister(struct thermal_zone_device *tz) { thermal_zone_device_disable(tz); thermal_zone_device_unregister(tz); } +EXPORT_SYMBOL_GPL(thermal_of_zone_unregister); /** * thermal_of_zone_register - Register a thermal zone with device node @@ -355,8 +356,8 @@ static void thermal_of_zone_unregister(struct thermal_zone_device *tz) * - ENOMEM: if one structure can not be allocated * - Other negative errors are returned by the underlying called functions */ -static struct thermal_zone_device *thermal_of_zone_register(struct device_node *sensor, int id, void *data, - const struct thermal_zone_device_ops *ops) +struct thermal_zone_device *thermal_of_zone_register(struct device_node *sensor, int id, void *data, + const struct thermal_zone_device_ops *ops) { struct thermal_zone_device_ops of_ops = *ops; struct thermal_zone_device *tz; @@ -429,6 +430,7 @@ static struct thermal_zone_device *thermal_of_zone_register(struct device_node * return ERR_PTR(ret); } +EXPORT_SYMBOL_GPL(thermal_of_zone_register); static void devm_thermal_of_zone_release(struct device *dev, void *res) { diff --git a/include/linux/thermal.h b/include/linux/thermal.h index 69f9bedd0ee8..adbb4092a064 100644 --- a/include/linux/thermal.h +++ b/include/linux/thermal.h @@ -195,13 +195,23 @@ struct thermal_zone_params { /* Function declarations */ #ifdef CONFIG_THERMAL_OF +struct thermal_zone_device *thermal_of_zone_register(struct device_node *sensor, int id, void *data, + const struct thermal_zone_device_ops *ops); struct thermal_zone_device *devm_thermal_of_zone_register(struct device *dev, int id, void *data, const struct thermal_zone_device_ops *ops); +void thermal_of_zone_unregister(struct thermal_zone_device *tz); void devm_thermal_of_zone_unregister(struct device *dev, struct thermal_zone_device *tz); #else +static inline +struct thermal_zone_device *thermal_of_zone_register(struct device_node *sensor, int id, void *data, + const struct thermal_zone_device_ops *ops) +{ + return ERR_PTR(-ENOTSUPP); +} + static inline struct thermal_zone_device *devm_thermal_of_zone_register(struct device *dev, int id, void *data, const struct thermal_zone_device_ops *ops) @@ -209,6 +219,10 @@ struct thermal_zone_device *devm_thermal_of_zone_register(struct device *dev, in return ERR_PTR(-ENOTSUPP); } +static inline void thermal_of_zone_unregister(struct thermal_zone_device *tz) +{ +} + static inline void devm_thermal_of_zone_unregister(struct device *dev, struct thermal_zone_device *tz) { From patchwork Fri Jan 3 16:38:02 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Claudiu Beznea X-Patchwork-Id: 13925707 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 3918BE77188 for ; Fri, 3 Jan 2025 16:43:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=evyYwVG9jAAn2LfhNe4V0lOQ6hGXTx/eRi/lhEE4KRI=; b=JNWEHnuOyZiwVXk7bo6CEwx9p9 PhuYo2hNd2V9Tcmi97aZ1wDy1C6rron45JzAse/8nXi1+b3+s2NAIilPD/CJ6WR91DVVCfaPP9hhZ yW7nxCMHjRa68tvJR9NFqQ3RUj6IP3nUf3WDv9TLAqrosooxvDqIZhSmtw/d2An/9wwR8fyygP7Rw C+odJPQU9ToY3qx8VZDinsayzIIzdxkx6ntZ2w2lWqGCoobeMDaiAUOWjUV6ZXKsZRriGCMV35pIE Q0usnosVCVrBJ8g8gvkeRcJBzd7C81VltbLfwZi4djpJqVOZtZu35El+fsqxjgLrjK4yPytjYZRuW 8xdqbulw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tTklf-0000000DScv-2dTk; Fri, 03 Jan 2025 16:43:23 +0000 Received: from mail-ej1-x636.google.com ([2a00:1450:4864:20::636]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tTkh2-0000000DRtH-042V for linux-arm-kernel@lists.infradead.org; Fri, 03 Jan 2025 16:38:37 +0000 Received: by mail-ej1-x636.google.com with SMTP id a640c23a62f3a-aaeef97ff02so1407336866b.1 for ; Fri, 03 Jan 2025 08:38:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tuxon.dev; s=google; t=1735922314; x=1736527114; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=evyYwVG9jAAn2LfhNe4V0lOQ6hGXTx/eRi/lhEE4KRI=; b=llyJAj1FBKzjmqvrInAOal6o9xfGsgeXP+/+3ggAfXIN1OGUJvekVzjFAB7pZ0yxlG pqyyzjd9YNR0SdRM/nQblSNBTzkeLFUbVljcsry4eiqXnRdWJmohsfrXeBp80UAURcJU +TZawBchRctbTNWeI6GdXerGXV951maxIjM7sPMC41xrHDI0RY8AUVEH9Ll6Z6cUy1kk uRts9Qjij1XyILQLYPSL6f8i6cSFmQnDFw6fJ91wf9qkckEStUNKB7F5+maU6pO/X+aw +RVGSSYUWGEBWvlkrtTvLbtgJINK97jZdeUH9puFNhr0HPtFUmvPPLSAu+BFi+6B0OTp m8/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735922314; x=1736527114; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=evyYwVG9jAAn2LfhNe4V0lOQ6hGXTx/eRi/lhEE4KRI=; b=CcIBRTKlDCHnqqD5PAiKqGyNi4dwQXkw4fcX5Om2KkeXuXiTCaV6Tup2FcgMUGA7zo KHhdMBucxaIt7dS4xxiTSqAZkQJcDtj+sJRgX1hsD2GRVfTw85gEuU5z8tefOK2pKodV SiEj2991STIpy4eu4/pKxEgezBlfzJo/VyKzLsanxrqaGWQ3Fori/I9FToolEk2gTEcU Y50C6AFMgzzkuRUPosXp+onTT5h+uI4kKeY71wB8I8506RhYyS7ImddybXeTME4aGMbn /R5dmm6uE602RGxciFoLyA5MAo84FtRCA16MqAbYlM0APfTl2ocWmjWt4omJLR7uYJ5/ I3oA== X-Forwarded-Encrypted: i=1; AJvYcCUpVlHoQuzMMTa90bc3QM/NfGyoHziWRB0QXFczlq0mBm+NA3R0herHlKtUCGyHeEiwDpAZ28ki4ssQbRQQgjyd@lists.infradead.org X-Gm-Message-State: AOJu0Yzdh/YmYB8WtsghWNtkwR1gMGmq93qPQ+zPPzE+urwcbknlrAE0 JhrnAF9qaRHrxkHU6q73PRD7EJCOlW8D4Bp0StED6Gz0RfC2zWJFFCNt6Rb9eYU= X-Gm-Gg: ASbGncvrh11mP97J/UlfE5O6WWhCGQpxNAFV2SIXwPxhCm8hj8KCo9Ir8DTSPRKGN8Y hIgtnYq0mHKhJZq8WYrtS+lYxOKAtVY+ji8/kTOYPGzkUDNBl7nJlDl9ZG6yXsXiAzfJSaBoP8Y ALTY/qlXFEgIdjdS7SO0xOK3+aIUBaVngoufBou3crU//L+0eGPT9xtWn1LYbEEI46nuOZRS5MX FqhZo6Qf0zvOl5QMNtlGfcOxyvEkLEVa3KIHCV/h893E4nscKJrODWfiwqbjbK3Lb/yfl8pVeyc u8HJkhQKQYY= X-Google-Smtp-Source: AGHT+IGZziQN526Qz2cC4SM+sDiCIJGAjK04HVz8g4TFUK5HQL4oXUkqdbEpUHeE3KBwEfQsCEVxQA== X-Received: by 2002:a17:907:1c85:b0:aa6:29dc:11b with SMTP id a640c23a62f3a-aac3342c7f4mr4934010766b.16.1735922313975; Fri, 03 Jan 2025 08:38:33 -0800 (PST) Received: from claudiu-X670E-Pro-RS.. ([82.78.167.102]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-aac0e8953b6sm1932984066b.65.2025.01.03.08.38.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Jan 2025 08:38:33 -0800 (PST) From: Claudiu X-Google-Original-From: Claudiu To: rafael@kernel.org, daniel.lezcano@linaro.org, rui.zhang@intel.com, lukasz.luba@arm.com, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, geert+renesas@glider.be, magnus.damm@gmail.com, mturquette@baylibre.com, sboyd@kernel.org, p.zabel@pengutronix.de, ulf.hansson@linaro.org Cc: claudiu.beznea@tuxon.dev, linux-pm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-clk@vger.kernel.org, Claudiu Beznea Subject: [PATCH 3/6] dt-bindings: thermal: r9a08g045-tsu: Document the TSU unit Date: Fri, 3 Jan 2025 18:38:02 +0200 Message-ID: <20250103163805.1775705-4-claudiu.beznea.uj@bp.renesas.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250103163805.1775705-1-claudiu.beznea.uj@bp.renesas.com> References: <20250103163805.1775705-1-claudiu.beznea.uj@bp.renesas.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250103_083836_062258_58028131 X-CRM114-Status: GOOD ( 14.14 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Claudiu Beznea The Renesas RZ/G3S SoC includes a Thermal Sensor Unit (TSU) block designed to measure the junction temperature. The temperature is measured using the RZ/G3S ADC, with a dedicated ADC channel directly connected to the TSU. Add documentation for it. Signed-off-by: Claudiu Beznea --- .../thermal/renesas,r9a08g045-tsu.yaml | 93 +++++++++++++++++++ 1 file changed, 93 insertions(+) create mode 100644 Documentation/devicetree/bindings/thermal/renesas,r9a08g045-tsu.yaml diff --git a/Documentation/devicetree/bindings/thermal/renesas,r9a08g045-tsu.yaml b/Documentation/devicetree/bindings/thermal/renesas,r9a08g045-tsu.yaml new file mode 100644 index 000000000000..573e2b9d3752 --- /dev/null +++ b/Documentation/devicetree/bindings/thermal/renesas,r9a08g045-tsu.yaml @@ -0,0 +1,93 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/thermal/renesas,r9a08g045-tsu.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Renesas RZ/G3S Thermal Sensor Unit + +description: + The thermal sensor unit (TSU) measures the temperature(Tj) inside + the LSI. + +maintainers: + - Claudiu Beznea + +$ref: thermal-sensor.yaml# + +properties: + compatible: + const: renesas,r9a08g045-tsu + + reg: + maxItems: 1 + + clocks: + items: + - description: TSU module clock + + power-domains: + maxItems: 1 + + resets: + items: + - description: TSU module reset + + io-channels: + items: + - description: ADC channel which reports the TSU temperature + + io-channel-names: + items: + - const: tsu + + "#thermal-sensor-cells": + const: 0 + +required: + - compatible + - reg + - clocks + - power-domains + - resets + - io-channels + - io-channel-names + - '#thermal-sensor-cells' + +additionalProperties: false + +examples: + - | + #include + + tsu: thermal@10059000 { + compatible = "renesas,r9a08g045-tsu"; + reg = <0x10059000 0x1000>; + clocks = <&cpg CPG_MOD R9A08G045_TSU_PCLK>; + resets = <&cpg R9A08G045_TSU_PRESETN>; + power-domains = <&cpg>; + #thermal-sensor-cells = <0>; + io-channels = <&adc 8>; + io-channel-names = "tsu"; + }; + + thermal-zones { + cpu-thermal { + polling-delay-passive = <250>; + polling-delay = <1000>; + thermal-sensors = <&tsu>; + + trips { + sensor_crit: sensor-crit { + temperature = <125000>; + hysteresis = <1000>; + type = "critical"; + }; + target: trip-point { + temperature = <100000>; + hysteresis = <1000>; + type = "passive"; + }; + }; + }; + }; From patchwork Fri Jan 3 16:38:03 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Claudiu Beznea X-Patchwork-Id: 13925712 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 36B69E77188 for ; Fri, 3 Jan 2025 16:44:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=8GMhatKxsQop+YQYK/7e1h+i8uxI54IklqBBVCwti8U=; b=RnHc3dLdw9ZCNehZYINvqDxkNC I9gwpa+Fih+rEzHV2U6Ho8N8tgTVNFHUY64HkoGbs6KNFJFKsZ6G2DYcCa2FUGYtL2RCEcJVEulwi rlChYVVm5v6gGk5E8Y0dPb0wMhi/BoVq33Liw3XPxV8FSAfGR7Wqo9k0PvGeUeEGNBAvR7L+HI6zb uVV2IBteijPTAQH7SCRZdw6eduO/Uapn37JWOBv38WRXJebhFXDRu5D8CRbpCOXisQdkYTXRPolM7 Kel61J+x+M6f4M5nBDrYn6TjD6uvHReRMd0xei4CrMF2m7mhWu837cdAhZFLNNIbUkoXAvV9ZuvRe Hu6ZATFQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tTkmp-0000000DSm1-1BuE; Fri, 03 Jan 2025 16:44:35 +0000 Received: from mail-ej1-x633.google.com ([2a00:1450:4864:20::633]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tTkh3-0000000DRud-3R6t for linux-arm-kernel@lists.infradead.org; Fri, 03 Jan 2025 16:38:39 +0000 Received: by mail-ej1-x633.google.com with SMTP id a640c23a62f3a-aaee0b309adso1392087766b.3 for ; Fri, 03 Jan 2025 08:38:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tuxon.dev; s=google; t=1735922316; x=1736527116; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=8GMhatKxsQop+YQYK/7e1h+i8uxI54IklqBBVCwti8U=; b=H3iGvASw7zn3wfbADOOKlfUca02QAsozxbnNxijAhUA6jHoSePguH0WMo9Lig5ay2g wNII0jlbHKRtprAYO+EV6+4uzKT3X8xyWulE5c631bfzd4YhOd4tueJdcEVfpICMOxbo XYZgcNiWosFfAQ736FDr8U5HsVoml0op2eiciDKtuZLdzQQgpQuHrGvdItLEY2GjPdrv tRw8Z05Z60j0BnT1tXOVUFWlGGW1oy+EmIkJIaSBJZYVpEZLNNJFyc1raPcHCUmWurP/ TGi1j2qZDYNYKdn78MQsvsVOBlyqAcjCXc6uxnBl6XsbVaxUvMzQQyLrwbJ+f1o3Rx6m y4vA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735922316; x=1736527116; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=8GMhatKxsQop+YQYK/7e1h+i8uxI54IklqBBVCwti8U=; b=ecc8r2MbpCTzYGm/B6Yomhsa8lrK/TDLcsmn4g0vPpJ3wUwKz1MJXj1Nwvskh56yqc F+0xX4sdNPZI5BhwiOeBAOCKYHOFZCKLjz1vl1SJ/wkvlUx1pSgXKpDIu8j9ESzkKbFw +DKwruLfBVHqESY/oL1Q989a9S5a0lEj6kj00d9nnGJsQwuU+1Z93k97wVBoKYXi/ZW5 jRMHCguaxqO7PNaETtI2WmlFgB/8hSLz/XSv4YawjHvIcih8B3dW4PnmpbJFW5Um6VL1 H+bidBJ7GE/mk2hJ6EmqWllzOG5/mS7/cJeesgTcYwC+2n8B9scr7jOdqG/OUsBbHiTa ud/w== X-Forwarded-Encrypted: i=1; AJvYcCXawPbqnLRChf5MyYkAPShbpbcZQQ1aYOPArGNiXkJl7M3tLK7AHrD5stc7l2AcnfozwuFTobRvV7GmM4PmVMOw@lists.infradead.org X-Gm-Message-State: AOJu0Yxq1bFnxMqHBNkv/X+ARIPMkDyPnuJ1Ip6ccIV2NlQ08mwsMJsb a5ug2kMGADjpCPKWP6SGyrXTuiQE/7f1AxJ1pg6yHyVDMHodGkKgRjQhUO8df38= X-Gm-Gg: ASbGncs4wxC1NKiLRu7fluyaLWlH79UWl5AcsEzLgQPg8WU4OfjlUyVF3MxyUJAsH24 k0c0CVOHV7pSFQN6lt8f5h622CH3+bQYrEIrkJg4ATJjoXMjFogxhZNOyfcqCoMmjFdzdMpS8hu EKLIwMrZplSW0As/FxuJrNP9BGpmXjOHfO1dhrcVjYslV5fkHv/fnB1JzlPtn+zccRXeiOXiS4x VD7i8tp+wanOz3PSNQeMT2T2jbW6tsVZ5bB91VLg2+HMG53+kv8dClgKTRm8EaATTMUOW3xcIz1 RmQF2keMUeI= X-Google-Smtp-Source: AGHT+IHvkBYCDNtkuQoboipJHaoUL6w4sk5iBfZsbglTc7vIk6YcMpGGuJWGPm5LzFye+zIDIa3xRA== X-Received: by 2002:a17:907:2cc5:b0:aa6:8676:3b33 with SMTP id a640c23a62f3a-aac3464f929mr4112731566b.47.1735922316348; Fri, 03 Jan 2025 08:38:36 -0800 (PST) Received: from claudiu-X670E-Pro-RS.. ([82.78.167.102]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-aac0e8953b6sm1932984066b.65.2025.01.03.08.38.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Jan 2025 08:38:35 -0800 (PST) From: Claudiu X-Google-Original-From: Claudiu To: rafael@kernel.org, daniel.lezcano@linaro.org, rui.zhang@intel.com, lukasz.luba@arm.com, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, geert+renesas@glider.be, magnus.damm@gmail.com, mturquette@baylibre.com, sboyd@kernel.org, p.zabel@pengutronix.de, ulf.hansson@linaro.org Cc: claudiu.beznea@tuxon.dev, linux-pm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-clk@vger.kernel.org, Claudiu Beznea Subject: [PATCH 4/6] thermal: renesas: rzg3s: Add thermal driver for the Renesas RZ/G3S SoC Date: Fri, 3 Jan 2025 18:38:03 +0200 Message-ID: <20250103163805.1775705-5-claudiu.beznea.uj@bp.renesas.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250103163805.1775705-1-claudiu.beznea.uj@bp.renesas.com> References: <20250103163805.1775705-1-claudiu.beznea.uj@bp.renesas.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250103_083837_989004_C48C4FEB X-CRM114-Status: GOOD ( 27.52 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Claudiu Beznea The Renesas RZ/G3S SoC features a Thermal Sensor Unit (TSU) that reports the junction temperature. The temperature is reported through a dedicated ADC channel. Add a driver for the Renesas RZ/G3S TSU. Signed-off-by: Claudiu Beznea --- MAINTAINERS | 7 + drivers/thermal/renesas/Kconfig | 8 + drivers/thermal/renesas/Makefile | 1 + drivers/thermal/renesas/rzg3s_thermal.c | 301 ++++++++++++++++++++++++ 4 files changed, 317 insertions(+) create mode 100644 drivers/thermal/renesas/rzg3s_thermal.c diff --git a/MAINTAINERS b/MAINTAINERS index d2ab799a0659..0b5854dc2d5d 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -20131,6 +20131,13 @@ S: Maintained F: Documentation/devicetree/bindings/iio/potentiometer/renesas,x9250.yaml F: drivers/iio/potentiometer/x9250.c +RENESAS RZ/G3S THERMAL SENSOR UNIT DRIVER +M: Claudiu Beznea +L: linux-pm@vger.kernel.org +S: Maintained +F: Documentation/devicetree/bindings/thermal/renesas,r9a08g045-tsu.yaml +F: drivers/thermal/renesas/rzg3s_thermal.c + RESET CONTROLLER FRAMEWORK M: Philipp Zabel S: Maintained diff --git a/drivers/thermal/renesas/Kconfig b/drivers/thermal/renesas/Kconfig index dcf5fc5ae08e..566478797095 100644 --- a/drivers/thermal/renesas/Kconfig +++ b/drivers/thermal/renesas/Kconfig @@ -26,3 +26,11 @@ config RZG2L_THERMAL help Enable this to plug the RZ/G2L thermal sensor driver into the Linux thermal framework. + +config RZG3S_THERMAL + tristate "Renesas RZ/G3S thermal driver" + depends on ARCH_R9A08G045 || COMPILE_TEST + depends on OF && IIO && RZG2L_ADC + help + Enable this to plug the RZ/G3S thermal sensor driver into the Linux + thermal framework. diff --git a/drivers/thermal/renesas/Makefile b/drivers/thermal/renesas/Makefile index bf9cb3cb94d6..1feb5ab78827 100644 --- a/drivers/thermal/renesas/Makefile +++ b/drivers/thermal/renesas/Makefile @@ -3,3 +3,4 @@ obj-$(CONFIG_RCAR_GEN3_THERMAL) += rcar_gen3_thermal.o obj-$(CONFIG_RCAR_THERMAL) += rcar_thermal.o obj-$(CONFIG_RZG2L_THERMAL) += rzg2l_thermal.o +obj-$(CONFIG_RZG3S_THERMAL) += rzg3s_thermal.o diff --git a/drivers/thermal/renesas/rzg3s_thermal.c b/drivers/thermal/renesas/rzg3s_thermal.c new file mode 100644 index 000000000000..6719f9ca05eb --- /dev/null +++ b/drivers/thermal/renesas/rzg3s_thermal.c @@ -0,0 +1,301 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Renesas RZ/G3S TSU Thermal Sensor Driver + * + * Copyright (C) 2024 Renesas Electronics Corporation + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "../thermal_hwmon.h" + +#define TSU_SM 0x0 +#define TSU_SM_EN BIT(0) +#define TSU_SM_OE BIT(1) +#define OTPTSUTRIM_REG(n) (0x18 + (n) * 0x4) +#define OTPTSUTRIM_EN_MASK BIT(31) +#define OTPTSUTRIM_MASK GENMASK(11, 0) + +#define TSU_READ_STEPS 8 + +/* Default calibration values, if FUSE values are missing. */ +#define SW_CALIB0_VAL 1297 +#define SW_CALIB1_VAL 751 + +#define MCELSIUS(temp) ((temp) * MILLIDEGREE_PER_DEGREE) + +/** + * struct rzg3s_thermal_priv - RZ/G3S thermal private data structure + * @base: TSU base address + * @dev: device pointer + * @tz: thermal zone pointer + * @rstc: reset control + * @channel: IIO channel to read the TSU + * @mode: current device mode + * @calib0: calibration value + * @calib1: calibration value + */ +struct rzg3s_thermal_priv { + void __iomem *base; + struct device *dev; + struct thermal_zone_device *tz; + struct reset_control *rstc; + struct iio_channel *channel; + enum thermal_device_mode mode; + u16 calib0; + u16 calib1; +}; + +static int rzg3s_thermal_get_temp(struct thermal_zone_device *tz, int *temp) +{ + struct rzg3s_thermal_priv *priv = thermal_zone_device_priv(tz); + struct device *dev = priv->dev; + u32 ts_code_ave = 0; + int ret, val; + + if (priv->mode != THERMAL_DEVICE_ENABLED) + return -EAGAIN; + + ret = pm_runtime_resume_and_get(dev); + if (ret) + return ret; + + for (u8 i = 0; i < TSU_READ_STEPS; i++) { + ret = iio_read_channel_raw(priv->channel, &val); + if (ret < 0) + goto rpm_put; + + ts_code_ave += val; + /* + * According to the HW manual (section 40.4.4 Procedure for Measuring the + * Temperature) we need to wait here at leat 3us. + */ + usleep_range(5, 10); + } + + ret = 0; + ts_code_ave = DIV_ROUND_CLOSEST(ts_code_ave, TSU_READ_STEPS); + + /* + * According to the HW manual (section 40.4.4 Procedure for Measuring the Temperature) + * the computation formula is as follows: + * + * Tj = (ts_code_ave - priv->calib1) * 165 / (priv->calib0 - priv->calib1) - 40 + */ + *temp = DIV_ROUND_CLOSEST((ts_code_ave - priv->calib1) * 165, + (priv->calib0 - priv->calib1)) - 40; + + /* Report it in mili degrees Celsius and round it up to 0.5 degrees Celsius. */ + *temp = roundup(MCELSIUS(*temp), 500); + +rpm_put: + pm_runtime_mark_last_busy(dev); + pm_runtime_put_autosuspend(dev); + + return ret; +} + +static void rzg3s_thermal_set_mode(struct rzg3s_thermal_priv *priv, + enum thermal_device_mode mode) +{ + struct device *dev = priv->dev; + int ret; + + ret = pm_runtime_resume_and_get(dev); + if (ret) + return; + + if (mode == THERMAL_DEVICE_DISABLED) { + writel(0, priv->base + TSU_SM); + } else { + writel(TSU_SM_EN, priv->base + TSU_SM); + /* + * According to the HW manual (section 40.4.1 Procedure for + * Starting the TSU) we need to wait here 30us or more. + */ + usleep_range(30, 40); + + writel(TSU_SM_OE | TSU_SM_EN, priv->base + TSU_SM); + /* + * According to the HW manual (section 40.4.1 Procedure for + * Starting the TSU) we need to wait here 50us or more. + */ + usleep_range(50, 60); + } + + pm_runtime_mark_last_busy(dev); + pm_runtime_put_autosuspend(dev); +} + +static int rzg3s_thermal_change_mode(struct thermal_zone_device *tz, + enum thermal_device_mode mode) +{ + struct rzg3s_thermal_priv *priv = thermal_zone_device_priv(tz); + + if (priv->mode == mode) + return 0; + + rzg3s_thermal_set_mode(priv, mode); + priv->mode = mode; + + return 0; +} + +static const struct thermal_zone_device_ops rzg3s_tz_of_ops = { + .get_temp = rzg3s_thermal_get_temp, + .change_mode = rzg3s_thermal_change_mode, +}; + +static int rzg3s_thermal_read_calib(struct rzg3s_thermal_priv *priv) +{ + struct device *dev = priv->dev; + u32 val; + int ret; + + ret = pm_runtime_resume_and_get(dev); + if (ret) + return ret; + + val = readl(priv->base + OTPTSUTRIM_REG(0)); + if (val & OTPTSUTRIM_EN_MASK) + priv->calib0 = FIELD_GET(OTPTSUTRIM_MASK, val); + else + priv->calib0 = SW_CALIB0_VAL; + + val = readl(priv->base + OTPTSUTRIM_REG(1)); + if (val & OTPTSUTRIM_EN_MASK) + priv->calib1 = FIELD_GET(OTPTSUTRIM_MASK, val); + else + priv->calib1 = SW_CALIB1_VAL; + + pm_runtime_mark_last_busy(dev); + pm_runtime_put_autosuspend(dev); + + return 0; +} + +static int rzg3s_thermal_probe(struct platform_device *pdev) +{ + struct rzg3s_thermal_priv *priv; + struct device *dev = &pdev->dev; + int ret; + + priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL); + if (!priv) + return -ENOMEM; + + priv->base = devm_platform_ioremap_resource(pdev, 0); + if (IS_ERR(priv->base)) + return PTR_ERR(priv->base); + + priv->channel = devm_iio_channel_get(dev, "tsu"); + if (IS_ERR(priv->channel)) + return dev_err_probe(dev, PTR_ERR(priv->channel), "Failed to get IIO channel!\n"); + + priv->rstc = devm_reset_control_get_exclusive_deasserted(dev, NULL); + if (IS_ERR(priv->rstc)) + return dev_err_probe(dev, PTR_ERR(priv->rstc), "Failed to get reset!\n"); + + priv->dev = dev; + priv->mode = THERMAL_DEVICE_DISABLED; + platform_set_drvdata(pdev, priv); + + pm_runtime_set_autosuspend_delay(dev, 300); + pm_runtime_use_autosuspend(dev); + pm_runtime_enable(dev); + + ret = rzg3s_thermal_read_calib(priv); + if (ret) { + dev_err_probe(dev, ret, "Failed to read calibration data!\n"); + goto rpm_disable; + } + + priv->tz = thermal_of_zone_register(dev->of_node, 0, priv, &rzg3s_tz_of_ops); + if (IS_ERR(priv->tz)) { + dev_err_probe(dev, PTR_ERR(priv->tz), "Failed to register thermal zone!\n"); + goto rpm_disable; + } + + ret = thermal_add_hwmon_sysfs(priv->tz); + if (ret) { + dev_err_probe(dev, ret, "Failed to add hwmon sysfs!\n"); + goto tz_unregister; + } + + return 0; + +tz_unregister: + thermal_of_zone_unregister(priv->tz); +rpm_disable: + pm_runtime_disable(dev); + pm_runtime_dont_use_autosuspend(dev); + return ret; +} + +static void rzg3s_thermal_remove(struct platform_device *pdev) +{ + struct rzg3s_thermal_priv *priv = dev_get_drvdata(&pdev->dev); + + thermal_remove_hwmon_sysfs(priv->tz); + thermal_of_zone_unregister(priv->tz); + pm_runtime_disable(priv->dev); + pm_runtime_dont_use_autosuspend(priv->dev); +} + +static int rzg3s_thermal_suspend(struct device *dev) +{ + struct rzg3s_thermal_priv *priv = dev_get_drvdata(dev); + + rzg3s_thermal_set_mode(priv, THERMAL_DEVICE_DISABLED); + + return reset_control_assert(priv->rstc); +} + +static int rzg3s_thermal_resume(struct device *dev) +{ + struct rzg3s_thermal_priv *priv = dev_get_drvdata(dev); + int ret; + + ret = reset_control_deassert(priv->rstc); + if (ret) + return ret; + + if (priv->mode != THERMAL_DEVICE_DISABLED) + rzg3s_thermal_set_mode(priv, priv->mode); + + return 0; +} + +static const struct dev_pm_ops rzg3s_thermal_pm_ops = { + SYSTEM_SLEEP_PM_OPS(rzg3s_thermal_suspend, rzg3s_thermal_resume) +}; + +static const struct of_device_id rzg3s_thermal_dt_ids[] = { + { .compatible = "renesas,r9a08g045-tsu" }, + { /* sentinel */ } +}; +MODULE_DEVICE_TABLE(of, rzg3s_thermal_dt_ids); + +static struct platform_driver rzg3s_thermal_driver = { + .driver = { + .name = "rzg3s_thermal", + .of_match_table = rzg3s_thermal_dt_ids, + .pm = pm_ptr(&rzg3s_thermal_pm_ops), + }, + .probe = rzg3s_thermal_probe, + .remove = rzg3s_thermal_remove, +}; +module_platform_driver(rzg3s_thermal_driver); + +MODULE_DESCRIPTION("Renesas RZ/G3S Thermal Sensor Unit Driver"); +MODULE_AUTHOR("Claudiu Beznea "); +MODULE_LICENSE("GPL"); From patchwork Fri Jan 3 16:38:04 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Claudiu Beznea X-Patchwork-Id: 13925713 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 7E006E7718F for ; Fri, 3 Jan 2025 16:45:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=WzIPlmgQYvqaNwex1YHnIy7YRZOsyuGpSTntBCm6GNw=; b=i98RuMa2gBgF3fCKdyg7hCJ439 s0XxJuc20bXNIxmKUxE/lLr5kgLEzUuZp2kFAlcR67IK2asjWv9eGz8v52k4vFs/9qrarszDnHlwC OyN9uFOOgLtoR0s8Tjl8u9c9DL+hlkyTolXDgCyq43Zf6zvEPnWBvoRNUpeC0iY+dr+GDiuJDt1Tt 8BIR7+p18jM/TC0em04yWMNKl5nNmYXOvqwHgo3YVuNgPSlq+w4PWU5Kbju8Ic0cuE5EeMOSRLXZ+ n3+MX5UrRSmgO4eQT9CNggK0ZHkpihJlALQIKFvdpdQCa5/nZ+PD8b+ZT5zwiN7Ake4hJGpzVn+3J SMijUJpg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tTknz-0000000DSzy-3kcA; Fri, 03 Jan 2025 16:45:47 +0000 Received: from mail-ej1-x633.google.com ([2a00:1450:4864:20::633]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tTkh7-0000000DRvm-1EYm for linux-arm-kernel@lists.infradead.org; Fri, 03 Jan 2025 16:38:42 +0000 Received: by mail-ej1-x633.google.com with SMTP id a640c23a62f3a-aa6a618981eso2044003066b.3 for ; Fri, 03 Jan 2025 08:38:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tuxon.dev; s=google; t=1735922320; x=1736527120; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=WzIPlmgQYvqaNwex1YHnIy7YRZOsyuGpSTntBCm6GNw=; b=JfAjYg1UPuX1TZ/QTb6HshKZLeP9Ly5YuqaGx6SXzVafcZxbbmTr5/WE0VWJAQGblR 0ddpVA1yYGkgkO85zfPIFIH8F/TXmoJnTJyS3bTnsDohr7wHmLxGgua7OeGk4GnoaYOo rId2MlXlMqDKio08hDxe0tqYqDRug8PjwqKFbpsl/IyV1HGFsRNqH4Quu1YPvgH0aLaN 0uu0SSBqYVD0LYF0Hr6V3O0fcMdXhZ2BLOf+Hi9wEmI1WKA0ljhBlsUkTERCSgLPt+Ek vEStcjyHUwYxuT7/U58+u0SZ/VKiWP5kAeNMM2W88Lr9jiQfqGlp+CHqP5sWT0cbvbav hmHw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735922320; x=1736527120; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=WzIPlmgQYvqaNwex1YHnIy7YRZOsyuGpSTntBCm6GNw=; b=d7rJuO9FRWTZDP+lhntzs9lu/qDKQFtFk3sI+bHOFYgtLdouMwUZtBV09oBYub2Bk6 yVAXUxUPZOP9kHQX8uyAXfW7pkPwLIdDzMFsCGfVhamVXRJJNu5b7aYgQ7KgMtdSZJoK BROQ6PCo7YP32ueLiwMYmkuQoYWKMJvDD/thOpVppB1KiQ6hk9P09v4Ev6cLCiyhbl3O 5EJZ4BpaT4b9+YcgZ3muqgrtHvUqhndTs09I7Li8Ds21MghdQmi8Aen3pHZvqjJ4Vo/Q dCnNwyvCQyWwcN/COwGc86WSM9a9l0DTnZo4sZ9QdX2RNDdWGiSvy7u8COSME01EU9LR zSzA== X-Forwarded-Encrypted: i=1; AJvYcCVa8f7qo4JycKN+4ch0a6oFyL3YAWJY68LlKYSvP64EZE3NgJQhtj02xYU1Z2Hj6fcduNE4JXtLjcNgMKSQMnac@lists.infradead.org X-Gm-Message-State: AOJu0Yx7aD7mKeLBI28DZBGtU8W8DLPrrR5BH2Peh/7f3saSie1CokwQ Fhp/FjnKwy90sE/ygEQnjgZX3TavutW2r+QtTHDHRtWfL9ePK58jRztDKyAPRDc= X-Gm-Gg: ASbGncsLTNQmnzG1FDkemK0AZWOc1e2WowWwESa4PDh/D1ePWztGsM4D/XgNWw5shPA GzNygRYmd+3h+60gljAobKFXDY5HPvj57g7qAHUbplq9fqziE/tjN805hbxyIJDsABrNDxNtjYN 9iOn9tkIUUi3KjpU/QYNJPLDgBY7EKt7JJt6/OQgHaY5ZGRFrCYe9LUYr1MWEVtNhmebWkt01OL TM275IKCSN85D7+r4HdO5TOx/nXo7oiW2h1Vtgh6RlAZtrEEuh2pgOjI9ZQRXbzm+rPwLSbcd9g V3tg5dTgmUo= X-Google-Smtp-Source: AGHT+IE84xLk/WtOOKb4Wwm+4qdlu+SqcMhw+gwQquj/QrYYaTzEDXr5cpwvEJHSOv4z3jx+xnmhFA== X-Received: by 2002:a17:907:724b:b0:aa6:7737:1991 with SMTP id a640c23a62f3a-aac2702ae51mr5003000966b.2.1735922318403; Fri, 03 Jan 2025 08:38:38 -0800 (PST) Received: from claudiu-X670E-Pro-RS.. ([82.78.167.102]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-aac0e8953b6sm1932984066b.65.2025.01.03.08.38.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Jan 2025 08:38:37 -0800 (PST) From: Claudiu X-Google-Original-From: Claudiu To: rafael@kernel.org, daniel.lezcano@linaro.org, rui.zhang@intel.com, lukasz.luba@arm.com, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, geert+renesas@glider.be, magnus.damm@gmail.com, mturquette@baylibre.com, sboyd@kernel.org, p.zabel@pengutronix.de, ulf.hansson@linaro.org Cc: claudiu.beznea@tuxon.dev, linux-pm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-clk@vger.kernel.org, Claudiu Beznea Subject: [PATCH 5/6] arm64: dts: renesas: r9a08g045: Add TSU node Date: Fri, 3 Jan 2025 18:38:04 +0200 Message-ID: <20250103163805.1775705-6-claudiu.beznea.uj@bp.renesas.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250103163805.1775705-1-claudiu.beznea.uj@bp.renesas.com> References: <20250103163805.1775705-1-claudiu.beznea.uj@bp.renesas.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250103_083841_332205_2503AD0A X-CRM114-Status: GOOD ( 12.79 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Claudiu Beznea Add TSU node along with thermal zones and keep it enabled in the SoC DTSI. The temperature reported by the TSU can only be read through channel 8 of the ADC. Therefore, enable the ADC by default. Signed-off-by: Claudiu Beznea --- arch/arm64/boot/dts/renesas/r9a08g045.dtsi | 43 ++++++++++++++++++- .../boot/dts/renesas/rzg3s-smarc-som.dtsi | 4 -- 2 files changed, 42 insertions(+), 5 deletions(-) diff --git a/arch/arm64/boot/dts/renesas/r9a08g045.dtsi b/arch/arm64/boot/dts/renesas/r9a08g045.dtsi index a9b98db9ef95..fd74138198a8 100644 --- a/arch/arm64/boot/dts/renesas/r9a08g045.dtsi +++ b/arch/arm64/boot/dts/renesas/r9a08g045.dtsi @@ -205,7 +205,6 @@ adc: adc@10058000 { #address-cells = <1>; #size-cells = <0>; #io-channel-cells = <1>; - status = "disabled"; channel@0 { reg = <0>; @@ -244,6 +243,17 @@ channel@8 { }; }; + tsu: thermal@10059000 { + compatible = "renesas,r9a08g045-tsu"; + reg = <0 0x10059000 0 0x1000>; + clocks = <&cpg CPG_MOD R9A08G045_TSU_PCLK>; + resets = <&cpg R9A08G045_TSU_PRESETN>; + power-domains = <&cpg>; + #thermal-sensor-cells = <0>; + io-channels = <&adc 8>; + io-channel-names = "tsu"; + }; + vbattb: clock-controller@1005c000 { compatible = "renesas,r9a08g045-vbattb"; reg = <0 0x1005c000 0 0x1000>; @@ -690,6 +700,37 @@ timer { "hyp-virt"; }; + thermal-zones { + cpu_thermal: cpu-thermal { + polling-delay-passive = <250>; + polling-delay = <1000>; + thermal-sensors = <&tsu>; + sustainable-power = <423>; + + cooling-maps { + map0 { + trip = <&target>; + cooling-device = <&cpu0 0 2>; + contribution = <1024>; + }; + }; + + trips { + sensor_crit: sensor-crit { + temperature = <125000>; + hysteresis = <1000>; + type = "critical"; + }; + + target: trip-point { + temperature = <100000>; + hysteresis = <1000>; + type = "passive"; + }; + }; + }; + }; + vbattb_xtal: vbattb-xtal { compatible = "fixed-clock"; #clock-cells = <0>; diff --git a/arch/arm64/boot/dts/renesas/rzg3s-smarc-som.dtsi b/arch/arm64/boot/dts/renesas/rzg3s-smarc-som.dtsi index ef12c1c462a7..041d256d7b79 100644 --- a/arch/arm64/boot/dts/renesas/rzg3s-smarc-som.dtsi +++ b/arch/arm64/boot/dts/renesas/rzg3s-smarc-som.dtsi @@ -102,10 +102,6 @@ x3_clk: x3-clock { }; }; -&adc { - status = "okay"; -}; - #if SW_CONFIG3 == SW_ON ð0 { pinctrl-0 = <ð0_pins>; From patchwork Fri Jan 3 16:38:05 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Claudiu Beznea X-Patchwork-Id: 13925714 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E2F41E77188 for ; Fri, 3 Jan 2025 16:47:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=8obrWVZsJoXmrid0pqmVf5t2hFsLjtOlv8BcTL5IH0U=; b=THw064LKwujxfksVywh592rlcH W2OStCvDUbw7H8fQJd8hMe64Y9/FUwPfG7yXBW4IdbwYEhWG7AT2Vj7nLangKyE64UOdVxtI8K5/3 LVzTlS62iFViyYtIQ7IELJpoo+q57nx1e61L8AFEVVR9rO4qgiRI5z/TKDSjwdsSdKuo9MXOb452Q phiB8AKW7nJN0N4VxXSmHZiYa8LBbsteX8upZcJLDC0iB8YVTCVyncjlhGiaDOUvwfxYZGSUtfxRu Auq1IWNZzIIeHdW3RUCS1kqvKFaacq//gw4DL+GOgyPaSAXBhClsKwfefd7m3hd+MNgdoAsIO9db/ z1r+//6w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tTkpB-0000000DTQX-2Rr2; Fri, 03 Jan 2025 16:47:01 +0000 Received: from mail-ej1-x62f.google.com ([2a00:1450:4864:20::62f]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tTkh7-0000000DRvo-3EJQ for linux-arm-kernel@lists.infradead.org; Fri, 03 Jan 2025 16:38:43 +0000 Received: by mail-ej1-x62f.google.com with SMTP id a640c23a62f3a-aaeec07b705so1262409466b.2 for ; Fri, 03 Jan 2025 08:38:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tuxon.dev; s=google; t=1735922320; x=1736527120; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=8obrWVZsJoXmrid0pqmVf5t2hFsLjtOlv8BcTL5IH0U=; b=TZUi57quApHK+FLWFDNFz2Q+6bm9cKRPDQ2oIu4VbP0IxpVdgH+SQ9RFWg061WZWz2 rDBlG82VNdGoSkp8DDz7shhqCACHB7r57DAd9qqNyh67ffaUJOuBUq5x31SjeAGspk6m KwzeGIFn7w4mGj1TE6NoT8gYWknozhnqQWbqFWp/1B0iPrVMknUBUy0ejL5Ea6+/u78k l3xLmRfOuDZH3X4SAfzg2wr8cQ8jlM13BvXvdRE9PxNBm/H+GOut3pmGYwVSIypIj+fC 1VhMCdi+pKBD4yJGVQ2bCcGSEwEIdQFNbcA/KMukGrgPeYm9osMTSj//pD5aNzVlFRRP l9HA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735922320; x=1736527120; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=8obrWVZsJoXmrid0pqmVf5t2hFsLjtOlv8BcTL5IH0U=; b=hb6B4lElcuCrkoa1f3nfIPwd2lJOf8K0fz8NEPg+lP0HVHKfOh/k+4/GNTdCYCDENk eJv8elGIKDlwEGD/wf3dMlVwSuPXz4XVXOHr0IE0JPwN4VaZc5FoSeWEF2011DLj5BeY gNFK54yEEcfmw8ZkhU07be1xGRIpJJUQR/iGgXpZcF2Rjcx4U4QZNlTjsbogg22d6St8 LejLlohTj0pmmH2Zrhwg8769OLXj2g2YpSYi3mszHxZiU+9nagmH5weaVa/9uyTdvtWC byzzFtnI4D7+NVSE+xYqCDAUOl+oQkG9//znNHTeV7zQ3zfoIrtVd76hueO7neBMEHbi uARQ== X-Forwarded-Encrypted: i=1; AJvYcCWkeupnyvL407oIkvrY7h576dN+abgn0hcAEg6HS9KN6D/rwm1ZQCOMiUsLi/vekZQw9AObt/t/mENcvJH5zEyQ@lists.infradead.org X-Gm-Message-State: AOJu0YwMf/o2inn4Dsg2KuP4r/z1lbzS5rfvML+AunWqnNHR/HdH3ctt q/Pn0qOyl12vDIlILE9G4BVkW5q+91EK0dfkod012xpFFm6kYcJ7q8pDYidG6yw= X-Gm-Gg: ASbGncscxiABh7/NSDnO4jN15uNpWOoK+EPqd1XNYa2fo9mkKYcq0E8kI90zbCIDGBq M78dJVShDay9eXA00LbIVV47fuId9pI062J242E3v6kczEokM38V06Norh6PRW+A05RV6cpeaaX m58Md2RMZoTiZAtgJWEBXm88th27ZE4U9S3FWxsrsgEKF/L1dQKLJLImQNQw1vJxGfNKPW8OFpA EPVEHM9M8ikeGvEP7sku6o6ew8yIXNUqMyqPu/hqucNpKxzOaDiJQkbCCWm1w2L+4TzzKTmuLM3 tisQTnOt0hA= X-Google-Smtp-Source: AGHT+IH+DUY6nprcntI+5aClJEE8pz4wAhTYG8dCJD+t8yU/xxOBpHwSJqf9myK1PfsCCnfBeBYRqg== X-Received: by 2002:a17:907:1b96:b0:aae:83c6:c67e with SMTP id a640c23a62f3a-aae83c6c8f5mr3028524366b.55.1735922320359; Fri, 03 Jan 2025 08:38:40 -0800 (PST) Received: from claudiu-X670E-Pro-RS.. ([82.78.167.102]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-aac0e8953b6sm1932984066b.65.2025.01.03.08.38.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Jan 2025 08:38:39 -0800 (PST) From: Claudiu X-Google-Original-From: Claudiu To: rafael@kernel.org, daniel.lezcano@linaro.org, rui.zhang@intel.com, lukasz.luba@arm.com, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, geert+renesas@glider.be, magnus.damm@gmail.com, mturquette@baylibre.com, sboyd@kernel.org, p.zabel@pengutronix.de, ulf.hansson@linaro.org Cc: claudiu.beznea@tuxon.dev, linux-pm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-clk@vger.kernel.org, Claudiu Beznea Subject: [PATCH 6/6] arm64: defconfig: Enable RZ/G3S thermal Date: Fri, 3 Jan 2025 18:38:05 +0200 Message-ID: <20250103163805.1775705-7-claudiu.beznea.uj@bp.renesas.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250103163805.1775705-1-claudiu.beznea.uj@bp.renesas.com> References: <20250103163805.1775705-1-claudiu.beznea.uj@bp.renesas.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250103_083841_806267_B4956887 X-CRM114-Status: UNSURE ( 8.25 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Claudiu Beznea Enable the CONFIG_RZG3S_THERMAL flag for the RZ/G3S SoC. Signed-off-by: Claudiu Beznea --- arch/arm64/configs/defconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm64/configs/defconfig b/arch/arm64/configs/defconfig index dfa5c8d5b658..576a544b8c79 100644 --- a/arch/arm64/configs/defconfig +++ b/arch/arm64/configs/defconfig @@ -706,6 +706,7 @@ CONFIG_ROCKCHIP_THERMAL=m CONFIG_RCAR_THERMAL=y CONFIG_RCAR_GEN3_THERMAL=y CONFIG_RZG2L_THERMAL=y +CONFIG_RZG3S_THERMAL=m CONFIG_ARMADA_THERMAL=y CONFIG_MTK_THERMAL=m CONFIG_MTK_LVTS_THERMAL=m