From patchwork Wed Sep 11 12:11:24 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mateusz Majewski X-Patchwork-Id: 13800327 Received: from mailout1.w1.samsung.com (mailout1.w1.samsung.com [210.118.77.11]) (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 6B52C1885A3 for ; Wed, 11 Sep 2024 12:11:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=210.118.77.11 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726056718; cv=none; b=d+TxTMfao59vvjE7jgd2fhR/567HTsi+7+SksLg8i1ig72/RCLpjXy5ygGFcoFC2B683ZkxkxFNMbyNM2kmHZ4BaWIm+jk3RKnDa4ZHbNIozdpK0Jpepl1ZRkNg+DaAaoEuB8OZaVLXxYtnxNXBRcyLGQEXYBl8MNmJIf/c/rCc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726056718; c=relaxed/simple; bh=hwopkNPUqoevD6Cga6bxVg0ViqRZN33dDe39k+TX+PI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:MIME-Version: Content-Type:References; b=kl+Hms6xTGUWMCaOnNdgP1v8TKGAgYBXTdI0HtjjjuDfODc3r9i84Nx6HOeqASy2so0UDJWwMIe1k9NVbKOwTk2sKaBiDPshxfiFuQYUM0cNwK4kxswOERR1IbZP7eptxCUwIT+Tu/0VwnEv6iwV9ONxtE9k3Tzf45vXOHeqtes= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=samsung.com; spf=pass smtp.mailfrom=samsung.com; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b=d7HMvBtx; arc=none smtp.client-ip=210.118.77.11 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=samsung.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=samsung.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b="d7HMvBtx" Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20240911121153euoutp01b4e328b201508bd9aa5c5ffa9a0257f4~0L2_e29vh0903909039euoutp01Y for ; Wed, 11 Sep 2024 12:11:53 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20240911121153euoutp01b4e328b201508bd9aa5c5ffa9a0257f4~0L2_e29vh0903909039euoutp01Y DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1726056713; bh=0qS1OvBnHT+CBCcVEJwR8UDgglfjE/IHE9VpcHMT5q0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=d7HMvBtxIcZ3C+y3lLcfV/va2lV7cZdWaTnDlXu+CAwnJhvZ8uYhqcszX8rzG72KD XyquQ2EC5i8+BjqGL3vDnz92dDr1tWGq+oWKigfsTQ4nllYsXkT8vFSoDTNi5j1tIT mcnL0rTWHYXinyNeZdnqK1WqBuNOMP2V3xqTEsLQ= Received: from eusmges1new.samsung.com (unknown [203.254.199.242]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20240911121153eucas1p2761935111876fbc6971ecfcbedd26222~0L29635n41736617366eucas1p2x; Wed, 11 Sep 2024 12:11:53 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges1new.samsung.com (EUCPMTA) with SMTP id F3.D1.09624.80981E66; Wed, 11 Sep 2024 13:11:52 +0100 (BST) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20240911121152eucas1p113445ce1ce6b6bd9c8f96322604bf517~0L29bZq2r1386613866eucas1p1o; Wed, 11 Sep 2024 12:11:52 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20240911121152eusmtrp299c699f697c3da3f8e1f2ee01298cafd~0L29aaIrr2708727087eusmtrp2g; Wed, 11 Sep 2024 12:11:52 +0000 (GMT) X-AuditID: cbfec7f2-c11ff70000002598-91-66e18908d101 Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id 1A.4D.19096.80981E66; Wed, 11 Sep 2024 13:11:52 +0100 (BST) Received: from AMDC4515.eu.corp.samsungelectronics.net (unknown [106.120.51.28]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20240911121151eusmtip1b27d9ec62e0b7c209798e6802c626127~0L28gF1KN0847908479eusmtip1h; Wed, 11 Sep 2024 12:11:51 +0000 (GMT) From: Mateusz Majewski To: linux-pm@vger.kernel.org, linux-samsung-soc@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: Mateusz Majewski , Bartlomiej Zolnierkiewicz , Krzysztof Kozlowski , "Rafael J. Wysocki" , Daniel Lezcano , Zhang Rui , Lukasz Luba , Rob Herring , Conor Dooley , Alim Akhtar , Sam Protsenko , Anand Moon , Marek Szyprowski Subject: [PATCH v4 1/7] drivers/thermal/exynos: use DEFINE_SIMPLE_DEV_PM_OPS Date: Wed, 11 Sep 2024 14:11:24 +0200 Message-ID: <20240911121136.1120026-2-m.majewski2@samsung.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240911121136.1120026-1-m.majewski2@samsung.com> Precedence: bulk X-Mailing-List: linux-samsung-soc@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrMKsWRmVeSWpSXmKPExsWy7djPc7ocnQ/TDBbdsLR4MG8bm8X3LdeZ LNbsPcd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FHq/7vz6IQA aTEDO4k+Rv7eWeL5E4x3Pu10qlsf/XLdKXM77SpNnjlRM52+hLz5+n2P5TWnfbnfqv+EPSg0 Zn2ZosRSnJFoqMVcVJwIACaeMpxYAwAA X-CMS-MailID: 20240911121152eucas1p113445ce1ce6b6bd9c8f96322604bf517 X-Msg-Generator: CA X-RootMTR: 20240911121152eucas1p113445ce1ce6b6bd9c8f96322604bf517 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20240911121152eucas1p113445ce1ce6b6bd9c8f96322604bf517 References: <20240911121136.1120026-1-m.majewski2@samsung.com> SIMPLE_DEV_PM_OPS is deprecated, as noted next to its definition. Signed-off-by: Mateusz Majewski Reviewed-by: Sam Protsenko --- drivers/thermal/samsung/exynos_tmu.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/thermal/samsung/exynos_tmu.c b/drivers/thermal/samsung/exynos_tmu.c index 96cffb2c44ba..9b7ca93a72f1 100644 --- a/drivers/thermal/samsung/exynos_tmu.c +++ b/drivers/thermal/samsung/exynos_tmu.c @@ -1150,8 +1150,8 @@ static int exynos_tmu_resume(struct device *dev) return 0; } -static SIMPLE_DEV_PM_OPS(exynos_tmu_pm, - exynos_tmu_suspend, exynos_tmu_resume); +static DEFINE_SIMPLE_DEV_PM_OPS(exynos_tmu_pm, + exynos_tmu_suspend, exynos_tmu_resume); #define EXYNOS_TMU_PM (&exynos_tmu_pm) #else #define EXYNOS_TMU_PM NULL From patchwork Wed Sep 11 12:11:25 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mateusz Majewski X-Patchwork-Id: 13800328 Received: from mailout2.w1.samsung.com (mailout2.w1.samsung.com [210.118.77.12]) (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 6787E18C912 for ; Wed, 11 Sep 2024 12:11:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=210.118.77.12 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726056719; cv=none; b=MS8cXaRJnbD26lq8roembsd9I8+rd9iuvegv5UY6Uhc+B81ok6oxHEjx8Bh2fFYrdpVl/+WNdfakf1I2FDlcHXtoIq4u/bKcF6SRwiqqNCZaDnIvmjeEyO75JkFUtZUbeKD0ul7Mz7SeHpwmM/9slq1e0a6/78+DuAiYnzWcPy8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726056719; c=relaxed/simple; bh=FEDEmbpAYmPOuuRo+RlDglGdJcWvHkw84rfZyKXuWo0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:MIME-Version: Content-Type:References; b=HPA/7V/EJausNuwjO+306cUXMFWI3sByQ62StuFN9aVgUxt+hvAKTynrB2lVSFFwIwCjIOjkZe+bwki1+4NJHxSSFg/+prDwqaWEzJgAyjUaQFjqGQ55MkH3GyjWbHMqAYxjH+uclmKsZrVhToJFSGJUfdlH9NaQ25H1VDoaytI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=samsung.com; spf=pass smtp.mailfrom=samsung.com; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b=PeaPEPnd; arc=none smtp.client-ip=210.118.77.12 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=samsung.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=samsung.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b="PeaPEPnd" Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20240911121154euoutp027081469c3fce7314a99a5cb9643eec61~0L2-tbIst0111101111euoutp02B for ; Wed, 11 Sep 2024 12:11:54 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20240911121154euoutp027081469c3fce7314a99a5cb9643eec61~0L2-tbIst0111101111euoutp02B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1726056715; bh=nvjwVOd+W/1Fy0GOMSwgEOErF159CdYtI3kdur0Gf6I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PeaPEPndiNIlV2xAXlDfahN7GcyATXD+NEvPh2Zbdz/LMTaQFRQVZkhQuPaSvSDwe VUiXLN5cUM1EamPjagO/s3mxVBFjWcW1gCq1uPuvsaW3Iu3AmDgqThvB3ckpuV/f2F kC11hsfAG8kbsIEebVMPe8KTPCx3s0zHpQGQC0Gg= Received: from eusmges2new.samsung.com (unknown [203.254.199.244]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20240911121154eucas1p2552975738977fa101ffa3a3c06d5579a~0L2_8pLtA1732517325eucas1p2r; Wed, 11 Sep 2024 12:11:54 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges2new.samsung.com (EUCPMTA) with SMTP id B0.61.09875.90981E66; Wed, 11 Sep 2024 13:11:54 +0100 (BST) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20240911121153eucas1p20f864c51746e6a7de55ecd0e52efe5c4~0L2_Xdqg22858828588eucas1p2o; Wed, 11 Sep 2024 12:11:53 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20240911121153eusmtrp2b14e07e38aec133391ae4431a80287ec~0L2_WRz632688526885eusmtrp2b; Wed, 11 Sep 2024 12:11:53 +0000 (GMT) X-AuditID: cbfec7f4-131ff70000002693-8f-66e18909b265 Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id 8B.4D.19096.90981E66; Wed, 11 Sep 2024 13:11:53 +0100 (BST) Received: from AMDC4515.eu.corp.samsungelectronics.net (unknown [106.120.51.28]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20240911121152eusmtip124636a6e621dbf563a9446cfc7e7ca49~0L29Ypa2P3163131631eusmtip19; Wed, 11 Sep 2024 12:11:52 +0000 (GMT) From: Mateusz Majewski To: linux-pm@vger.kernel.org, linux-samsung-soc@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: Mateusz Majewski , Bartlomiej Zolnierkiewicz , Krzysztof Kozlowski , "Rafael J. Wysocki" , Daniel Lezcano , Zhang Rui , Lukasz Luba , Rob Herring , Conor Dooley , Alim Akhtar , Sam Protsenko , Anand Moon , Marek Szyprowski Subject: [PATCH v4 2/7] drivers/thermal/exynos: use pm_sleep_ptr instead of conditional compilation Date: Wed, 11 Sep 2024 14:11:25 +0200 Message-ID: <20240911121136.1120026-3-m.majewski2@samsung.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240911121136.1120026-1-m.majewski2@samsung.com> Precedence: bulk X-Mailing-List: linux-samsung-soc@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrCKsWRmVeSWpSXmKPExsWy7djP87pcnQ/TDHovM1k8mLeNzeL7lutM Fmv2nmOymPdZ1mL+kXOsFufPb2C32PT4GqvF5V1z2Cw+9x5htJhxfh+TxbqNt9gtFja1sFtM PDaZ2WLtkbvsFnO/TGW2+L9nB7vFk4d9bBbP+/YxOQh5rJm3htFj56y77B6L97xk8ti0qpPN 4861PWwem5fUe/RtWcXo8XmTXABHFJdNSmpOZllqkb5dAlfG2kdHmAseclUcXnyepYGxh7OL kZNDQsBEYlHnXLYuRi4OIYEVjBK/Dp+Ecr4wSvT1fWGGcD4zSiydd5sdpuVa6x+oxHJGieam SWwgCSGBViaJFQeYQGw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Ni+p9+jbsorR4/MmuQCOKD2bovzSklSFjPziElulaEMLIz1DSws9IxNLPUNj81gr I1MlfTublNSczLLUIn27BL2MtY+OMBc85Ko4vPg8SwNjD2cXIyeHhICJxLXWP8wgtpDAUkaJ rWsMIeLSEoe/TGGHsIUl/lzrYuti5AKqaWaS+LXwHStIgk3AQOLBm2VgRSICyxklNrd7gBQx C8xlkeh8vRosISyQLPG1cy+YzSKgKnH2Qi/YNl4BO4kvL3exQGyQl7i45jkbiM0pYC/x/fVy RoiL7CQ+bjzJClEvKHFy5hOwemag+uats5knMArMQpKahSS1gJFpFaNIamlxbnpusZFecWJu cWleul5yfu4mRmB0bjv2c8sOxpWvPuodYmTiYDzEKMHBrCTC2293L02INyWxsiq1KD++qDQn tfgQoynQ3ROZpUST84HpIa8k3tDMwNTQxMzSwNTSzFhJnJftyvk0IYH0xJLU7NTUgtQimD4m Dk6pBqZdDo0JWX6ObLNvLxf+t+KWzIupd1j7+yzezL7VOimjKemUvrrdy8+hM9MlE6UbxLsb W5/lPlujmzzxraTDtexNojynuPZ4zOyf2iGW93R99T6r9P9MQff2SVsrcV345c6lKhneUKNi Lf++efGblJJ/nrvsClT2vEg8v8T+hX7H3hITD5OjT7uu7WOeMDN/W9Aci0VeIu+PBzw4rnVc zPOj4c8TuvtOnGtZfzOkm+MLg96aKlmmiqsTDHq1LsQ5ctccYzm8wvJHy2SFe+GxS8pMU/5v m7pl5oNJp16aHJh9d4niAX6hXyeluffr7BM9p/WoUa0g5YWXh+g549LaXyoLQg0/3uIpPj71 Q9HGXzxKLMUZiYZazEXFiQCKAhD+VwMAAA== X-CMS-MailID: 20240911121153eucas1p20f864c51746e6a7de55ecd0e52efe5c4 X-Msg-Generator: CA X-RootMTR: 20240911121153eucas1p20f864c51746e6a7de55ecd0e52efe5c4 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20240911121153eucas1p20f864c51746e6a7de55ecd0e52efe5c4 References: <20240911121136.1120026-1-m.majewski2@samsung.com> Slightly simpler and nothing is lost if _suspend and _resume functions are built unconditionally. Suggested-by: Anand Moon Reviewed-by: Sam Protsenko Signed-off-by: Mateusz Majewski --- drivers/thermal/samsung/exynos_tmu.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/drivers/thermal/samsung/exynos_tmu.c b/drivers/thermal/samsung/exynos_tmu.c index 9b7ca93a72f1..b68e9755c933 100644 --- a/drivers/thermal/samsung/exynos_tmu.c +++ b/drivers/thermal/samsung/exynos_tmu.c @@ -1132,7 +1132,6 @@ static void exynos_tmu_remove(struct platform_device *pdev) clk_unprepare(data->clk_sec); } -#ifdef CONFIG_PM_SLEEP static int exynos_tmu_suspend(struct device *dev) { exynos_tmu_control(to_platform_device(dev), false); @@ -1152,15 +1151,11 @@ static int exynos_tmu_resume(struct device *dev) static DEFINE_SIMPLE_DEV_PM_OPS(exynos_tmu_pm, exynos_tmu_suspend, exynos_tmu_resume); -#define EXYNOS_TMU_PM (&exynos_tmu_pm) -#else -#define EXYNOS_TMU_PM NULL -#endif static struct platform_driver exynos_tmu_driver = { .driver = { .name = "exynos-tmu", - .pm = EXYNOS_TMU_PM, + .pm = pm_sleep_ptr(&exynos_tmu_pm), .of_match_table = exynos_tmu_match, }, .probe = exynos_tmu_probe, From patchwork Wed Sep 11 12:11:26 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mateusz Majewski X-Patchwork-Id: 13800329 Received: from mailout1.w1.samsung.com (mailout1.w1.samsung.com [210.118.77.11]) (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 69A4B18C930 for ; Wed, 11 Sep 2024 12:11:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=210.118.77.11 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726056719; cv=none; b=duOkL6NRvMgCQ72yLlZwVNBJQXZUb9LPmuK/coa1tYbuCFYLD7m+7pzuBGhyJnTj6y4wcFxBjE72HZN/yXDvTTMbz19+xz/7MpJ4vwIiT7Lf6tdeXM7aOhDPxUAac3d1HDz4VixGr2OUIdSV1CVLjcqCDk8TkXdmPnmjXcXKDNc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726056719; c=relaxed/simple; bh=gY3sYk1R8x/s7rHhF9wyEi7cHSsdKFKDg0teFGH3L/o=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:MIME-Version: Content-Type:References; b=LVjBYeI7eqgF+ssC5UEo9+rJN3ENvuYZV4AXOsFQUmsEyWNiLwOSHBtfmXT117ycN7DS1pj65WTkMbrVM8G8DHBgl7P0CE0qiZRjv/bGcJVHiO+ZwzPJeU3SAkK6MsRNpeEMd9BsfBE3/lhX7XeNdnpiQNHVST0CuExp908fbIE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=samsung.com; spf=pass smtp.mailfrom=samsung.com; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b=fm0836T9; arc=none smtp.client-ip=210.118.77.11 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=samsung.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=samsung.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b="fm0836T9" Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20240911121155euoutp014007da5ef8273f5614cd8cb00322179d~0L3AoTqOP0990809908euoutp01D for ; Wed, 11 Sep 2024 12:11:55 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20240911121155euoutp014007da5ef8273f5614cd8cb00322179d~0L3AoTqOP0990809908euoutp01D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1726056715; bh=NJdZThH/4rVsf6XBL7/98lsA2ZRMGdmDLTG8epuqeXs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fm0836T9VLbJbXzXgN7F87AI6oZJtGBQ022ZayU1cBU9iu8NeIN6L9Vkv2bs5TB3z u+mwoYpTwW4Le+EaZ2O6EdfNzC+R+FoB3tyqYQimj2PAty94ZxJBsWPJeYBOVxJ/p7 QmV4KRm39fLr2G5jAx9JQfn24b1vUKIGyzLKeFD0= Received: from eusmges2new.samsung.com (unknown [203.254.199.244]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20240911121155eucas1p1f1fda5e90a3c7cf15e520430d0564982~0L3ADN0pR1328313283eucas1p1s; Wed, 11 Sep 2024 12:11:55 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges2new.samsung.com (EUCPMTA) with SMTP id D2.61.09875.B0981E66; Wed, 11 Sep 2024 13:11:55 +0100 (BST) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20240911121154eucas1p1a429a565c446cdd968f565df1ffae42c~0L2-fJYMn2450124501eucas1p1N; Wed, 11 Sep 2024 12:11:54 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20240911121154eusmtrp28d359762649260d33f3c7f8a315fd71e~0L2-eCf6X2688526885eusmtrp2c; Wed, 11 Sep 2024 12:11:54 +0000 (GMT) X-AuditID: cbfec7f4-131ff70000002693-93-66e1890b802d Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id DC.4D.19096.A0981E66; Wed, 11 Sep 2024 13:11:54 +0100 (BST) Received: from AMDC4515.eu.corp.samsungelectronics.net (unknown [106.120.51.28]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20240911121153eusmtip1f4eff36b994b8846f7538e82aadde599~0L2_jbr-E0774607746eusmtip14; Wed, 11 Sep 2024 12:11:53 +0000 (GMT) From: Mateusz Majewski To: linux-pm@vger.kernel.org, linux-samsung-soc@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: Mateusz Majewski , Bartlomiej Zolnierkiewicz , Krzysztof Kozlowski , "Rafael J. Wysocki" , Daniel Lezcano , Zhang Rui , Lukasz Luba , Rob Herring , Conor Dooley , Alim Akhtar , Sam Protsenko , Anand Moon , Marek Szyprowski Subject: [PATCH v4 3/7] drivers/thermal/exynos: improve sanitize_temp_error Date: Wed, 11 Sep 2024 14:11:26 +0200 Message-ID: <20240911121136.1120026-4-m.majewski2@samsung.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240911121136.1120026-1-m.majewski2@samsung.com> Precedence: bulk X-Mailing-List: linux-samsung-soc@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrEKsWRmVeSWpSXmKPExsWy7djP87rcnQ/TDH7eZrd4MG8bm8X3LdeZ LNbsPcdkMe+zrMX8I+dYLc6f38BusenxNVaLy7vmsFl87j3CaDHj/D4mi3Ubb7FbLGxqYbeY eGwys8XaI3fZLeZ+mcps8X/PDnaLJw/72Cye9+1jchDyWDNvDaPHzll32T0W73nJ5LFpVSeb x51re9g8Ni+p9+jbsorR4/MmuQCOKC6blNSczLLUIn27BK6Mo4fWMBZc0quY+Og5UwPjCbUu Rk4OCQETidefnzJ2MXJxCAmsYJR41H6OHSQhJPCFUaLzjw9E4jOjxKnv7SwwHS9vvGCDSCxn lDjy/AGU08oksevMM0aQKjYBA4kHb5axgyREBBYzSjT+eMcK4jALTGSRWP+mG6xKWMBb4ujz SawgNouAqsT9y71gO3gF7CR+/vzEBLFPXuLimudsIDangL3E99fLGSFqBCVOznwCVs8MVNO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ZSYsusmK0RCWuLwlynsELawxJ9rXWwgtpBAM5PEs/PVIDabgIHEgzfLwGpEBJYzSmxu9wAZ xCwwl0Wi8/VqsISwgLfE0eeTwIayCKhK3L/cywJi8wrYSfz8+YkJYoG8xMU1z8EWcArYS3x/ vZwRYpmdxMeNJ1kh6gUlTs58AtbLDFTfvHU28wRGgVlIUrOQpBYwMq1iFEktLc5Nzy020itO zC0uzUvXS87P3cQIjM5tx35u2cG48tVHvUOMTByMhxglOJiVRHj77e6lCfGmJFZWpRblxxeV 5qQWH2I0Bbp7IrOUaHI+MD3klcQbmhmYGpqYWRqYWpoZK4nzsl05nyYkkJ5YkpqdmlqQWgTT x8TBKdXApD7zem0qA4OU9M/K7vj/su/iYi70xZzobTNN9b5p/1QpbUXoH6c/P+bJya3ODLZ2 tlUP0i/aaSEl/1KeZ4rJ/rzNz5Tq/xj+392+Ys1r60NVX09uu5WUMdF30+KvX153/LecwbzY ryXywpWevt8evSfmHTp+8l/WxnnJ1yrX26WxiZaeSgj85BciKBhwdPe0G5NDiyZUc0p0Totw uMLWwFT79aLaoj8ld7Rn7YgOXFTcVC7tEVpl9fnwthrpdX8enfKas33xe9kzF5ZEF7ew/0r9 p3FjbcF19ZaYR6/iPjH8Ddm96IFw4R3Ob2Ia1vICGx9q7uxKSotLbZrNdjT94O3zyg1SH+PM lir4WS3gUWIpzkg01GIuKk4EADuSQhZXAwAA X-CMS-MailID: 20240911121154eucas1p1a429a565c446cdd968f565df1ffae42c X-Msg-Generator: CA X-RootMTR: 20240911121154eucas1p1a429a565c446cdd968f565df1ffae42c X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20240911121154eucas1p1a429a565c446cdd968f565df1ffae42c References: <20240911121136.1120026-1-m.majewski2@samsung.com> There are two minor issues regarding this function. One is that it attempts to calculate the second calibration value even if 1-point trimming is being used; in this case, the calculated value is probably not useful and is never used anyway. Changing this also requires a minor reordering in Exynos5433 initialization function, so that we know which type of trimming is used before we call sanitize_temp_error. The second issue is that the function is not very consistent when it comes to the use of Exynos7-specific parameters. This seems to not be an issue in practice, in part because some of these issues are related to the mentioned calculation of the second calibration value. However, fixing this makes the code a bit less confusing, and will be required for Exynos850 which has 9-bit temperature values and uses 2-point trimming. Signed-off-by: Mateusz Majewski --- v3 -> v4: further reworked to avoid SoC-specific code, instead using SoC-specific parameters inside of exynos_tmu_data (probably different enough to drop R-b). v1 -> v2: reworked to change shift instead of only mask and to also fix the 2-point trimming issue. drivers/thermal/samsung/exynos_tmu.c | 40 ++++++++++++++++++---------- 1 file changed, 26 insertions(+), 14 deletions(-) diff --git a/drivers/thermal/samsung/exynos_tmu.c b/drivers/thermal/samsung/exynos_tmu.c index b68e9755c933..8b1014915c31 100644 --- a/drivers/thermal/samsung/exynos_tmu.c +++ b/drivers/thermal/samsung/exynos_tmu.c @@ -111,6 +111,7 @@ #define EXYNOS7_TMU_REG_EMUL_CON 0x160 #define EXYNOS7_TMU_TEMP_MASK 0x1ff +#define EXYNOS7_TMU_TEMP_SHIFT 9 #define EXYNOS7_PD_DET_EN_SHIFT 23 #define EXYNOS7_TMU_INTEN_RISE0_SHIFT 0 #define EXYNOS7_EMUL_DATA_SHIFT 7 @@ -152,6 +153,8 @@ enum soc_type { * @max_efuse_value: maximum valid trimming data * @temp_error1: fused value of the first point trim. * @temp_error2: fused value of the second point trim. + * @temp_mask: SoC specific temperature mask + * @temp_85_shift: SoC specific address shift * @gain: gain of amplifier in the positive-TC generator block * 0 < gain <= 15 * @reference_voltage: reference voltage of amplifier @@ -182,6 +185,8 @@ struct exynos_tmu_data { u32 min_efuse_value; u32 max_efuse_value; u16 temp_error1, temp_error2; + u16 temp_mask; + int temp_85_shift; u8 gain; u8 reference_voltage; struct thermal_zone_device *tzd; @@ -229,25 +234,26 @@ static int code_to_temp(struct exynos_tmu_data *data, u16 temp_code) EXYNOS_FIRST_POINT_TRIM; } +/* + * Sanitize sensor calibration values, according to minimum and maximum + * values defined for each SoC. + */ static void sanitize_temp_error(struct exynos_tmu_data *data, u32 trim_info) { - u16 tmu_temp_mask = - (data->soc == SOC_ARCH_EXYNOS7) ? EXYNOS7_TMU_TEMP_MASK - : EXYNOS_TMU_TEMP_MASK; - - data->temp_error1 = trim_info & tmu_temp_mask; - data->temp_error2 = ((trim_info >> EXYNOS_TRIMINFO_85_SHIFT) & - EXYNOS_TMU_TEMP_MASK); - + data->temp_error1 = trim_info & data->temp_mask; if (!data->temp_error1 || (data->min_efuse_value > data->temp_error1) || (data->temp_error1 > data->max_efuse_value)) - data->temp_error1 = data->efuse_value & EXYNOS_TMU_TEMP_MASK; + data->temp_error1 = data->efuse_value & data->temp_mask; - if (!data->temp_error2) - data->temp_error2 = - (data->efuse_value >> EXYNOS_TRIMINFO_85_SHIFT) & - EXYNOS_TMU_TEMP_MASK; + if (data->cal_type == TYPE_TWO_POINT_TRIMMING) { + data->temp_error2 = (trim_info >> data->temp_85_shift) & + data->temp_mask; + if (!data->temp_error2) + data->temp_error2 = + (data->efuse_value >> data->temp_85_shift) & + data->temp_mask; + } } static int exynos_tmu_initialize(struct platform_device *pdev) @@ -510,7 +516,6 @@ static void exynos5433_tmu_initialize(struct platform_device *pdev) int sensor_id, cal_type; trim_info = readl(data->base + EXYNOS_TMU_REG_TRIMINFO); - sanitize_temp_error(data, trim_info); /* Read the temperature sensor id */ sensor_id = (trim_info & EXYNOS5433_TRIMINFO_SENSOR_ID_MASK) @@ -532,6 +537,8 @@ static void exynos5433_tmu_initialize(struct platform_device *pdev) break; } + sanitize_temp_error(data, trim_info); + dev_info(&pdev->dev, "Calibration type is %d-point calibration\n", cal_type ? 2 : 1); } @@ -876,6 +883,7 @@ static int exynos_map_dt_data(struct platform_device *pdev) data->tmu_control = exynos4210_tmu_control; data->tmu_read = exynos4210_tmu_read; data->tmu_clear_irqs = exynos4210_tmu_clear_irqs; + data->temp_mask = EXYNOS_TMU_TEMP_MASK; data->gain = 15; data->reference_voltage = 7; data->efuse_value = 55; @@ -898,6 +906,7 @@ static int exynos_map_dt_data(struct platform_device *pdev) data->tmu_read = exynos4412_tmu_read; data->tmu_set_emulation = exynos4412_tmu_set_emulation; data->tmu_clear_irqs = exynos4210_tmu_clear_irqs; + data->temp_mask = EXYNOS_TMU_TEMP_MASK; data->gain = 8; data->reference_voltage = 16; data->efuse_value = 55; @@ -919,6 +928,8 @@ static int exynos_map_dt_data(struct platform_device *pdev) data->tmu_read = exynos4412_tmu_read; data->tmu_set_emulation = exynos4412_tmu_set_emulation; data->tmu_clear_irqs = exynos4210_tmu_clear_irqs; + data->temp_mask = EXYNOS_TMU_TEMP_MASK; + data->temp_85_shift = EXYNOS_TRIMINFO_85_SHIFT; data->gain = 8; if (res.start == EXYNOS5433_G3D_BASE) data->reference_voltage = 23; @@ -939,6 +950,7 @@ static int exynos_map_dt_data(struct platform_device *pdev) data->tmu_read = exynos7_tmu_read; data->tmu_set_emulation = exynos4412_tmu_set_emulation; data->tmu_clear_irqs = exynos4210_tmu_clear_irqs; + data->temp_mask = EXYNOS7_TMU_TEMP_MASK; data->gain = 9; data->reference_voltage = 17; data->efuse_value = 75; From patchwork Wed Sep 11 12:11:27 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mateusz Majewski X-Patchwork-Id: 13800330 Received: from mailout1.w1.samsung.com (mailout1.w1.samsung.com [210.118.77.11]) (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 8F929191F8C for ; Wed, 11 Sep 2024 12:11:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=210.118.77.11 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726056720; cv=none; b=ibn2VNGzmbXswV7K8OelePMIeGlSmTemqyFjEGevEb6ob+TDkLSJWnd+TapakK0Cu8/UuJ/gwx4jB95QHD9DqcxBi/X9kM5Yr3DKX7SR/pDLhKuf/68ppDis2pjwy47XVgFfAF28pV2JYDsScQRMCq3NvuNyoLAuZfMkcRqKtjM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726056720; c=relaxed/simple; bh=ozQqRLSq7IDjYDABSRGssFY6xGkaa/o/USWejNvQnV8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:MIME-Version: Content-Type:References; b=acJZyxF7iI4e09ODRgHKmJKYGmH9bEaVXo8rW99zavzoUStvgVHlrzLHD4yjF0lJR6qvLV3C0in9NhvM2X+ZNnavHcxoQ8VlOvxcrjrGv58NjoAODb3uEkE7TG2CCqB67ZQ+Tha6/simaSbmZj69qMosfvLj/0uM/4bCHS0/lqM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=samsung.com; spf=pass smtp.mailfrom=samsung.com; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b=bulYgyZV; arc=none smtp.client-ip=210.118.77.11 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=samsung.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=samsung.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b="bulYgyZV" Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20240911121157euoutp017a59acee6d12bab303e3fe2ce53d2bbf~0L3BwCyA20990809908euoutp01E for ; Wed, 11 Sep 2024 12:11:57 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20240911121157euoutp017a59acee6d12bab303e3fe2ce53d2bbf~0L3BwCyA20990809908euoutp01E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1726056717; bh=Y23/WQ9wTzL9cT2j+ezI3cB32JYq7m7BkHPWsCs5IOo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bulYgyZVce1V8YvoXr78iLNm5Hg1K+qcUUX3D7xewHyjXk8ABm5y8jvAjFltKzZuC zuFjj4EIACqmJRbmN7BAMdQ2/UD583WC9+9MQDofwnUR7pN6KJo7p0asMUACfz93AF Ip0yhRjbyhlXJsSfuLn+izbE/h6jXEWLxCYyYHso= Received: from eusmges1new.samsung.com (unknown [203.254.199.242]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20240911121156eucas1p20fb94f4f1119dd274889d7e029d9c14c~0L3BL0Iqr2873128731eucas1p2S; Wed, 11 Sep 2024 12:11:56 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges1new.samsung.com (EUCPMTA) with SMTP id D7.D1.09624.C0981E66; Wed, 11 Sep 2024 13:11:56 +0100 (BST) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20240911121155eucas1p160223d89bff83a89a03c5447252f44a9~0L3AmQ4Yr1357913579eucas1p1s; Wed, 11 Sep 2024 12:11:55 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20240911121155eusmtrp2d48ce6715ada201ca38692c9112d690d~0L3AlEb2u2688526885eusmtrp2e; Wed, 11 Sep 2024 12:11:55 +0000 (GMT) X-AuditID: cbfec7f2-bfbff70000002598-9e-66e1890c2e03 Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 7C.E9.14621.B0981E66; Wed, 11 Sep 2024 13:11:55 +0100 (BST) Received: from AMDC4515.eu.corp.samsungelectronics.net (unknown [106.120.51.28]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20240911121154eusmtip1fb836354b159274484cd7bc4a3684392~0L2-cRo5h0847908479eusmtip1j; Wed, 11 Sep 2024 12:11:54 +0000 (GMT) From: Mateusz Majewski To: linux-pm@vger.kernel.org, linux-samsung-soc@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: Mateusz Majewski , Bartlomiej Zolnierkiewicz , Krzysztof Kozlowski , "Rafael J. Wysocki" , Daniel Lezcano , Zhang Rui , Lukasz Luba , Rob Herring , Conor Dooley , Alim Akhtar , Sam Protsenko , Anand Moon , Marek Szyprowski Subject: [PATCH v4 4/7] drivers/thermal/exynos: reuse data->temp_mask in exynos_tmu_update_temp Date: Wed, 11 Sep 2024 14:11:27 +0200 Message-ID: <20240911121136.1120026-5-m.majewski2@samsung.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240911121136.1120026-1-m.majewski2@samsung.com> Precedence: bulk X-Mailing-List: linux-samsung-soc@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrCKsWRmVeSWpSXmKPExsWy7djP87o8nQ/TDK5uErN4MG8bm8X3LdeZ LNbsPcdkMe+zrMX8I+dYLc6f38BusenxNVaLy7vmsFl87j3CaDHj/D4mi3Ubb7FbLGxqYbeY eGwys8XaI3fZLeZ+mcps8X/PDnaLJw/72Cye9+1jchDyWDNvDaPHzll32T0W73nJ5LFpVSeb x51re9g8Ni+p9+jbsorR4/MmuQCOKC6blNSczLLUIn27BK6Ma2+2MxUs5Kj4P3MpcwPjB7Yu Rk4OCQETidmvdzN3MXJxCAmsYJT4f/sJK4TzhVFi68ZGRpAqIYHPjBKf1urDdMy7s48Fomg5 o8T27mdQHa1MEvN/PAPrYBMwkHjwZhk7SEJEYDGjROOPd2BVzAITWSTWv+kGqxIWSJTYfOgQ O4jNIqAq0d10CszmFbCTaHq9ihVin7zExTXPwa7lFLCX+P56OSNEjaDEyZlPWEBsZqCa5q2z wb6QEJjNKTHz5Bao91wklly9wgxhC0u8Or6FHcKWkfi/cz4ThJ0vMWPze6BBHEB2hcTdg14Q prXExzPMICazgK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vV4MlhAXiJTbMewK2jUVAVaK76RRYnFfATqLp9SpWiA3yEhfXPAer4RSwl/j+ejkjxEV2 Eh83nmSFqBeUODnzCdilzED1zVtnM09gFJiFJDULSWoBI9MqRpHU0uLc9NxiQ73ixNzi0rx0 veT83E2MwOjcduzn5h2M81591DvEyMTBeIhRgoNZSYS33+5emhBvSmJlVWpRfnxRaU5q8SFG U6C7JzJLiSbnA9NDXkm8oZmBqaGJmaWBqaWZsZI4r9vl82lCAumJJanZqakFqUUwfUwcnFIN THPMJm3JOPHbcqdl/joF6zP7X3/1jr+c7/ouTUS8O6TpaPFzl9dlVsUzw0yZFlmdXSQlIK9w /7WpXLLinfX+Lob2QhM2KoT8Kbpyr8S2SN425mX1C71T5/Qs/bTmftw7NfJuH6vgU+e66+nH 5gerTP1w/FbJtW+Xc7gzn8y4pHhxyd0WO/9VbPGW00o5FdbON/t5pcEu+Uv2natiV7fWLdfq ZK2f9v3tvsLVhkb2m1j0NJwvskbrzl5WuvS6/a+clEV6x99PXzJLX/PqIv3pk87ccU5pP/2j Ii1Lt/e8yPI5kmz6Mvfctb/96HqqHfXptabntNXzE0QjJs2rtowI3tH77Mxiu3aXpXdmFd2L X6nEUpyRaKjFXFScCADG0pz+VwMAAA== X-CMS-MailID: 20240911121155eucas1p160223d89bff83a89a03c5447252f44a9 X-Msg-Generator: CA X-RootMTR: 20240911121155eucas1p160223d89bff83a89a03c5447252f44a9 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20240911121155eucas1p160223d89bff83a89a03c5447252f44a9 References: <20240911121136.1120026-1-m.majewski2@samsung.com> Both the intention and the actual logic is identical, little point in duplicating it. Signed-off-by: Mateusz Majewski --- drivers/thermal/samsung/exynos_tmu.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/drivers/thermal/samsung/exynos_tmu.c b/drivers/thermal/samsung/exynos_tmu.c index 8b1014915c31..9bddf9fd5049 100644 --- a/drivers/thermal/samsung/exynos_tmu.c +++ b/drivers/thermal/samsung/exynos_tmu.c @@ -357,15 +357,10 @@ static void exynos_tmu_update_bit(struct exynos_tmu_data *data, int reg_off, static void exynos_tmu_update_temp(struct exynos_tmu_data *data, int reg_off, int bit_off, u8 temp) { - u16 tmu_temp_mask; u32 th; - tmu_temp_mask = - (data->soc == SOC_ARCH_EXYNOS7) ? EXYNOS7_TMU_TEMP_MASK - : EXYNOS_TMU_TEMP_MASK; - th = readl(data->base + reg_off); - th &= ~(tmu_temp_mask << bit_off); + th &= ~(data->temp_mask << bit_off); th |= temp_to_code(data, temp) << bit_off; writel(th, data->base + reg_off); } From patchwork Wed Sep 11 12:11:28 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mateusz Majewski X-Patchwork-Id: 13800331 Received: from mailout1.w1.samsung.com (mailout1.w1.samsung.com [210.118.77.11]) (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 366AC187342 for ; Wed, 11 Sep 2024 12:11:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=210.118.77.11 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726056722; cv=none; b=T+sh9zxADB1yNGcrhjhFNVr51Jo6EBLbKfjdYcpUvZG2cTBLR99Ave23+x6GlpFYIVuwkOESOkgGOocvDPdb2YdqxRDWBYkkhTi1Hkgf6IZesE02hAeyq8/Bl+FBCn8s7Mj2dEJcpzzZ8ayPDl+TOPHBCNLeQyZ+qKDaWCr4D0U= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726056722; c=relaxed/simple; bh=QYuOvbi3yolBODIX0i/1mxP3qBTmhqEHCAIEx2DAgN8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:MIME-Version: Content-Type:References; b=MZgrFXCZt2ZVMLp0X5wf8VLegNwVOblZ3OMq1NFmteqTFd6cb3o2TOoI8rzTZgcHOvRniLFs6ugae4Df4z5XPL2anQvMhxfgSOw3Xl6UDx0qIBjphxqsNqiPsC4DXQn+RZbXGhYmT4PeLMCcURyZkRv+vqR1Zt7GMaR2aqRVTjA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=samsung.com; spf=pass smtp.mailfrom=samsung.com; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b=UVma+JWN; arc=none smtp.client-ip=210.118.77.11 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=samsung.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=samsung.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b="UVma+JWN" Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20240911121158euoutp01503654229fea5c78f5de1690f835f23f~0L3C7f24y0990609906euoutp01- for ; Wed, 11 Sep 2024 12:11:58 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20240911121158euoutp01503654229fea5c78f5de1690f835f23f~0L3C7f24y0990609906euoutp01- DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1726056718; bh=a5aoA1DUV1XIYRXDrlemZ2Dc7B1rAnuJ/1tYUrMlhp4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=UVma+JWNnQAA8QGUksAY4FyXIm2HMYH/n5+hcXP1eQS+tDe1Jhj0NZOzm+hmr0AzI mkNZL97GQ6yOSktlD+bZA1vYMAAIJjIcGVp5FjIUQ/BLlaUvqywOJwRZpSKU9Y4FfH 7zOOmEt1YXD1dY9cPXdgW9mK9JRJFRvF2z4CRWB0= Received: from eusmges3new.samsung.com (unknown [203.254.199.245]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20240911121158eucas1p282816a798880d1990c3dc3eca36930df~0L3ClV4I62862528625eucas1p25; Wed, 11 Sep 2024 12:11:58 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges3new.samsung.com (EUCPMTA) with SMTP id F4.48.09620.D0981E66; Wed, 11 Sep 2024 13:11:57 +0100 (BST) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20240911121157eucas1p2a8ff398f0f30f141de974763680bb041~0L3BweUzC1735017350eucas1p2p; Wed, 11 Sep 2024 12:11:57 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20240911121157eusmtrp2e855c8a04f0574368ccac78e19b0e260~0L3Bvnbmo2708727087eusmtrp2p; Wed, 11 Sep 2024 12:11:57 +0000 (GMT) X-AuditID: cbfec7f5-d1bff70000002594-84-66e1890d6518 Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 0E.E9.14621.D0981E66; Wed, 11 Sep 2024 13:11:57 +0100 (BST) Received: from AMDC4515.eu.corp.samsungelectronics.net (unknown [106.120.51.28]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20240911121155eusmtip1732f687d82842f00a1e798253f9d46f6~0L3AkkBZy0956609566eusmtip1G; Wed, 11 Sep 2024 12:11:55 +0000 (GMT) From: Mateusz Majewski To: linux-pm@vger.kernel.org, linux-samsung-soc@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: Mateusz Majewski , Bartlomiej Zolnierkiewicz , Krzysztof Kozlowski , "Rafael J. Wysocki" , Daniel Lezcano , Zhang Rui , Lukasz Luba , Rob Herring , Conor Dooley , Alim Akhtar , Sam Protsenko , Anand Moon , Marek Szyprowski , Krzysztof Kozlowski Subject: [PATCH v4 5/7] dt-bindings: thermal: samsung,exynos: add exynos850-tmu string Date: Wed, 11 Sep 2024 14:11:28 +0200 Message-ID: <20240911121136.1120026-6-m.majewski2@samsung.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240911121136.1120026-1-m.majewski2@samsung.com> Precedence: bulk X-Mailing-List: linux-samsung-soc@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA02SfUwTZxjA9961d9eOuqOY+AxEsLa6LRvoJMsb3JgbcznIEpeYTLNk024c lY0P04ogiQHHRyzB6opIKayKqBDscJRStAOyQldkKEhYbIN2sxsb3zOkMBybY5TTzP9+z/v8 nq/kZUi5TxzJZGQf5rXZ6kwFJRU5PH8NviLTB9K3Li8m4PsWB4UX7V4CW7sGCWwJRuNz7kEx Hhr6hsZd0+00tv16R4xHnHUUDp50I2wa6iZwS+sojeu/KKHxl55KEn/t9tP4q/kqEi93XqPx WMBA4XFDN7EzgrNarIi7bvbTXEPnJMHZmvUUd+9OJ8W1XSzkDPZmxAVtG95nPpS+nsZnZhzh tfFJB6QHl3ovoEMeSX79pI8uQjfpciRhgE0Aj71ihaWMnG1C0GQyiIRgHsHfrUZSCIIIyqrO oyclZ783P040IlgYv0QJQSkBN3o7yJBFsVvh/szl1cZr2QYExx/+IQ4lSLZfBJVXUkMcwe6D +R9/W20rYlXgrRpfLZaxSeCfuiEWxsXAsHWcCrGEfRMWpxuR4IRDf82YSOgZA8XttasrAdso gYUBHyUUvwPHv5sQCRwBU332x2evh+Xr5wiBc8DU9mDFYVY4H/yuVAF3wNxNMoQk+yJcdcYL 8lvw4MxpWjDWgG82XFhgDRgd1aTwLIMTZXLBVkFfp5EUOArGSu4SgsJB/a31p9FG81OXmJ+6 xPz/2POIbEbr+FxdlobXbc/m8+J06ixdbrYm7tOcLBta+XwD//YtXENNU3NxPYhgUA8ChlSs lZ1K+ildLktTHy3gtTn7tbmZvK4HRTEixTqZKi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p0N0TmaVEk/OBqSKvJN7QzMDU0MTM0sDU0sxYSZzX7fL5NCGB9MSS1OzU 1ILUIpg+Jg5OqQamhVE6qnYH1zgsPCK123WX1DyvadtWrvpwZHdrzDeGU2cKnpdX+aoukNjv rr2mqU34+bGTXReE9QT+ie46O1s2YlE+B5vOJe7oQJlVvh3G4fy6nI2KHowd9uXqk/wvmnme +lKW3qKsrD1liuNf1e9BjV4msSe2fvrxpZJBS2x1qkzpo/tfDbTrSu10bzP7rjk/t0s7Xlow ZcECESG/tD6jj2LJIrXbojb/iM59WsxXXVFsvXarXfSL2B9H5+hdWXotdpv3E+bAUAat+bsf xr1bbbvilZXOnLW7fGKW2jUYqc7Z/HYBT1GUw3q9vTmmyTMYJR9rOa9qrjgZ9JJl73u9b69E Nt1rVjixvq1orbsSS3FGoqEWc1FxIgC2kcgKXQMAAA== X-CMS-MailID: 20240911121157eucas1p2a8ff398f0f30f141de974763680bb041 X-Msg-Generator: CA X-RootMTR: 20240911121157eucas1p2a8ff398f0f30f141de974763680bb041 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20240911121157eucas1p2a8ff398f0f30f141de974763680bb041 References: <20240911121136.1120026-1-m.majewski2@samsung.com> Like most of the SoCs, it requires 1 clock and 1 register. Reviewed-by: Sam Protsenko Reviewed-by: Krzysztof Kozlowski Signed-off-by: Mateusz Majewski --- v1 -> v2: make the clock required in Exynos850. .../devicetree/bindings/thermal/samsung,exynos-thermal.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Documentation/devicetree/bindings/thermal/samsung,exynos-thermal.yaml b/Documentation/devicetree/bindings/thermal/samsung,exynos-thermal.yaml index 29a08b0729ee..b8c0bb7f4263 100644 --- a/Documentation/devicetree/bindings/thermal/samsung,exynos-thermal.yaml +++ b/Documentation/devicetree/bindings/thermal/samsung,exynos-thermal.yaml @@ -27,6 +27,7 @@ properties: - samsung,exynos5420-tmu-ext-triminfo - samsung,exynos5433-tmu - samsung,exynos7-tmu + - samsung,exynos850-tmu clocks: minItems: 1 @@ -131,6 +132,7 @@ allOf: - samsung,exynos5250-tmu - samsung,exynos5260-tmu - samsung,exynos5420-tmu + - samsung,exynos850-tmu then: properties: clocks: From patchwork Wed Sep 11 12:11:29 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mateusz Majewski X-Patchwork-Id: 13800332 Received: from mailout2.w1.samsung.com (mailout2.w1.samsung.com [210.118.77.12]) (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 D233419ABC2 for ; Wed, 11 Sep 2024 12:12:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=210.118.77.12 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726056723; cv=none; b=cFEoPxrUYs/Y/ZerS4hdRKptbvZ4Y/ELxi7KNBnGUmrA3f04/7TNnZPF8YU0VzxHP9RoGvPu9SnXCm2reXPL1x5xTWgbaXBFBAluUBtwTeVkLYng5+CKPjfOce/3QNvyX2Vu2rGrO86/dYCOjMI1jU7p8WTtsWL86kGvt80ZEVE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726056723; c=relaxed/simple; bh=gNQ2tE7EWB1AI0nO5W0Zynui8PoA6aK9BqaMLy90mPk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:MIME-Version: Content-Type:References; b=qh3/wKQBP1ceyCOiLHSVObg3PoqZhDme+LlPvMClmKqgxFBtf29dhOTpwJuFO/P9Z/3cW/yno/yjsd2zaIbudjiJgzhqn8/OjA1ukJkRG4B9lzseRnoAb075oq/H+mvcmhqTdmdjh+qEPupneymxx4YtTHSc49swzXsUDciswDM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=samsung.com; spf=pass smtp.mailfrom=samsung.com; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b=TSS7trxo; arc=none smtp.client-ip=210.118.77.12 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=samsung.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=samsung.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b="TSS7trxo" Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20240911121159euoutp022df91400ef67a4522dd47464ace2ce09~0L3D7XHb20044900449euoutp02O for ; Wed, 11 Sep 2024 12:11:59 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20240911121159euoutp022df91400ef67a4522dd47464ace2ce09~0L3D7XHb20044900449euoutp02O DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1726056719; bh=S3zwFMdOfOUMhX015nExx0+RoZXJIo6huLDw+tGPrXw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=TSS7trxogvcSRL/K5DfeR+xx5ih7zM4vWELgtHBDDMgGQ6n9F++7oPy/AjKCcmchp X8o33ezcW9wY920Ndzwh9rs/4lx5zTzOXkQxq+nMLYMQb/0J5b+mXjXm7vY+S1N0te tey+CGBrnvPCuCHZ/Ku2bxeLGxETCNvwtsvz6wEo= Received: from eusmges1new.samsung.com (unknown [203.254.199.242]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20240911121159eucas1p2e097336e5a263c87eeb3e393e6f09985~0L3Dhem3A2873128731eucas1p2W; Wed, 11 Sep 2024 12:11:59 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges1new.samsung.com (EUCPMTA) with SMTP id 5B.D1.09624.E0981E66; Wed, 11 Sep 2024 13:11:58 +0100 (BST) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20240911121158eucas1p2ab3ec5b5b59351af22c5740e02236b16~0L3Cv561f3175631756eucas1p2L; Wed, 11 Sep 2024 12:11:58 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20240911121158eusmtrp28ab9473e10a4db5afac116835ff782fa~0L3CvL4dj2708727087eusmtrp2q; Wed, 11 Sep 2024 12:11:58 +0000 (GMT) X-AuditID: cbfec7f2-bfbff70000002598-a8-66e1890e1a9e Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id BF.4D.19096.D0981E66; Wed, 11 Sep 2024 13:11:58 +0100 (BST) Received: from AMDC4515.eu.corp.samsungelectronics.net (unknown [106.120.51.28]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20240911121157eusmtip1882ba911a83418a9736a09c51fae7dc2~0L3BtpZL70674806748eusmtip1I; Wed, 11 Sep 2024 12:11:57 +0000 (GMT) From: Mateusz Majewski To: linux-pm@vger.kernel.org, linux-samsung-soc@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: Mateusz Majewski , Bartlomiej Zolnierkiewicz , Krzysztof Kozlowski , "Rafael J. Wysocki" , Daniel Lezcano , Zhang Rui , Lukasz Luba , Rob Herring , Conor Dooley , Alim Akhtar , Sam Protsenko , Anand Moon , Marek Szyprowski Subject: [PATCH v4 6/7] drivers/thermal/exynos: add initial Exynos850 support Date: Wed, 11 Sep 2024 14:11:29 +0200 Message-ID: <20240911121136.1120026-7-m.majewski2@samsung.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240911121136.1120026-1-m.majewski2@samsung.com> Precedence: bulk X-Mailing-List: linux-samsung-soc@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Brightmail-Tracker: H4sI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 k0LEWdbfXp+X+Dmw6JWpBIdC/hm2kwVtsgu/tjfXev68/kN70rev5747JZ0MWWwRsvRvS0aH +bkX+55XFdXkv/NP4LZtn9fku2xat8qUeWHztA8ttmHV+bbGV5sz61BkC/OKpaXfCvfMb0vY t/33Y1YlluKMREMt5qLiRACJPi8EVgMAAA== X-CMS-MailID: 20240911121158eucas1p2ab3ec5b5b59351af22c5740e02236b16 X-Msg-Generator: CA X-RootMTR: 20240911121158eucas1p2ab3ec5b5b59351af22c5740e02236b16 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20240911121158eucas1p2ab3ec5b5b59351af22c5740e02236b16 References: <20240911121136.1120026-1-m.majewski2@samsung.com> This is loosely adapted from an implementation available at https://gitlab.com/Linaro/96boards/e850-96/kernel/-/blob/android-exynos-4.14-linaro/drivers/thermal/samsung/exynos_tmu.c Some differences from that implementation: - unlike that implementation, we do not use the ACPM mechanism, instead we just access the registers, like we do for other SoCs, - the SoC is supposed to support multiple sensors inside one unit. The vendor implementation uses one kernel device per sensor, we would probably prefer to have one device for all sensors, have #thermal-sensor-cells = <1> and so on. We implemented this, but we could not get the extra sensors to work on our hardware so far. This might be due to a misconfiguration and we will probably come back to this, however our implementation only supports a single sensor for now, - the vendor implementation supports disabling CPU cores as a cooling device. We did not attempt to port this, and this would not really fit this driver anyway. Additionally, some differences from the other SoCs supported by this driver: - we do not really constrain the e-fuse information like the other SoCs do (data->{min,max}_efuse_value). In our tests, those values (as well as the raw sensor values) were much higher than in the other SoCs, to the degree that reusing the data->{min,max}_efuse_value from the other SoCs would cause instant critical temperature reset on boot, - this SoC provides more information in the e-fuse data than other SoCs, so we read some values inside exynos850_tmu_initialize instead of hardcoding them in exynos_map_dt_data. Reviewed-by: Sam Protsenko Signed-off-by: Mateusz Majewski --- v3 -> v4: adapted to sanitize_temp_error change. v1 -> v2: rename and reorder some registers, use the correct register offset for EXYNOS850_TMU_REG_AVG_CON, make the clock required, additionally do some minor style changes. drivers/thermal/samsung/exynos_tmu.c | 179 ++++++++++++++++++++++++++- 1 file changed, 176 insertions(+), 3 deletions(-) diff --git a/drivers/thermal/samsung/exynos_tmu.c b/drivers/thermal/samsung/exynos_tmu.c index 9bddf9fd5049..c5769f9b6471 100644 --- a/drivers/thermal/samsung/exynos_tmu.c +++ b/drivers/thermal/samsung/exynos_tmu.c @@ -117,6 +117,41 @@ #define EXYNOS7_EMUL_DATA_SHIFT 7 #define EXYNOS7_EMUL_DATA_MASK 0x1ff +/* Exynos850 specific registers */ +#define EXYNOS850_TMU_REG_CURRENT_TEMP0_1 0x40 +#define EXYNOS850_TMU_REG_THD_TEMP0_RISE 0x50 +#define EXYNOS850_TMU_REG_THD_TEMP0_FALL 0x60 + +#define EXYNOS850_TMU_TRIMINFO_SHIFT 4 +#define EXYNOS850_TMU_TRIMINFO_OFFSET(n) \ + (EXYNOS_TMU_REG_TRIMINFO + (n) * EXYNOS850_TMU_TRIMINFO_SHIFT) +#define EXYNOS850_TMU_T_TRIM0_SHIFT 18 + +#define EXYNOS850_TMU_REG_CONTROL1 0x24 +#define EXYNOS850_TMU_LPI_MODE_MASK 1 +#define EXYNOS850_TMU_LPI_MODE_SHIFT 10 + +#define EXYNOS850_TMU_REG_COUNTER_VALUE0 0x30 +#define EXYNOS850_TMU_EN_TEMP_SEN_OFF_MASK 0xffff +#define EXYNOS850_TMU_EN_TEMP_SEN_OFF_SHIFT 0 + +#define EXYNOS850_TMU_REG_COUNTER_VALUE1 0x34 +#define EXYNOS850_TMU_CLK_SENSE_ON_MASK 0xffff +#define EXYNOS850_TMU_CLK_SENSE_ON_SHIFT 16 + +#define EXYNOS850_TMU_REG_AVG_CON 0x38 +#define EXYNOS850_TMU_AVG_MODE_MASK 0x7 +#define EXYNOS850_TMU_DEM_ENABLE BIT(4) + +#define EXYNOS850_TMU_REG_TRIM0 0x3c +#define EXYNOS850_TMU_TRIM0_MASK 0xf +#define EXYNOS850_TMU_VBEI_TRIM_SHIFT 8 +#define EXYNOS850_TMU_VREF_TRIM_SHIFT 12 +#define EXYNOS850_TMU_BGRI_TRIM_SHIFT 20 + +#define EXYNOS850_TMU_TEM1051X_SENSE_VALUE 0x028a +#define EXYNOS850_TMU_TEM1456X_SENSE_VALUE 0x0a28 + #define EXYNOS_FIRST_POINT_TRIM 25 #define EXYNOS_SECOND_POINT_TRIM 85 @@ -134,6 +169,7 @@ enum soc_type { SOC_ARCH_EXYNOS5420_TRIMINFO, SOC_ARCH_EXYNOS5433, SOC_ARCH_EXYNOS7, + SOC_ARCH_EXYNOS850, }; /** @@ -584,6 +620,114 @@ static void exynos7_tmu_initialize(struct platform_device *pdev) sanitize_temp_error(data, trim_info); } +static void exynos850_tmu_set_low_temp(struct exynos_tmu_data *data, u8 temp) +{ + exynos_tmu_update_temp(data, EXYNOS850_TMU_REG_THD_TEMP0_FALL + 12, 0, + temp); + exynos_tmu_update_bit(data, EXYNOS7_TMU_REG_INTEN, + EXYNOS_TMU_INTEN_FALL0_SHIFT + 0, true); +} + +static void exynos850_tmu_set_high_temp(struct exynos_tmu_data *data, u8 temp) +{ + exynos_tmu_update_temp(data, EXYNOS850_TMU_REG_THD_TEMP0_RISE + 12, 16, + temp); + exynos_tmu_update_bit(data, EXYNOS7_TMU_REG_INTEN, + EXYNOS7_TMU_INTEN_RISE0_SHIFT + 1, true); +} + +static void exynos850_tmu_disable_low(struct exynos_tmu_data *data) +{ + exynos_tmu_update_bit(data, EXYNOS7_TMU_REG_INTEN, + EXYNOS_TMU_INTEN_FALL0_SHIFT + 0, false); +} + +static void exynos850_tmu_disable_high(struct exynos_tmu_data *data) +{ + exynos_tmu_update_bit(data, EXYNOS7_TMU_REG_INTEN, + EXYNOS7_TMU_INTEN_RISE0_SHIFT + 1, false); +} + +static void exynos850_tmu_set_crit_temp(struct exynos_tmu_data *data, u8 temp) +{ + exynos_tmu_update_temp(data, EXYNOS850_TMU_REG_THD_TEMP0_RISE + 0, 16, + temp); + exynos_tmu_update_bit(data, EXYNOS_TMU_REG_CONTROL, + EXYNOS_TMU_THERM_TRIP_EN_SHIFT, true); + exynos_tmu_update_bit(data, EXYNOS7_TMU_REG_INTEN, + EXYNOS7_TMU_INTEN_RISE0_SHIFT + 7, true); +} + +static void exynos850_tmu_initialize(struct platform_device *pdev) +{ + struct exynos_tmu_data *data = platform_get_drvdata(pdev); + u32 cal_type, avg_mode, reg, bgri, vref, vbei; + + reg = readl(data->base + EXYNOS850_TMU_TRIMINFO_OFFSET(0)); + cal_type = (reg & EXYNOS5433_TRIMINFO_CALIB_SEL_MASK) >> + EXYNOS5433_TRIMINFO_CALIB_SEL_SHIFT; + data->reference_voltage = (reg >> EXYNOS850_TMU_T_TRIM0_SHIFT) & + EXYNOS_TMU_REF_VOLTAGE_MASK; + reg = readl(data->base + EXYNOS850_TMU_TRIMINFO_OFFSET(1)); + data->gain = (reg >> EXYNOS850_TMU_T_TRIM0_SHIFT) & + EXYNOS_TMU_BUF_SLOPE_SEL_MASK; + reg = readl(data->base + EXYNOS850_TMU_TRIMINFO_OFFSET(2)); + avg_mode = (reg >> EXYNOS850_TMU_T_TRIM0_SHIFT) & + EXYNOS850_TMU_AVG_MODE_MASK; + reg = readl(data->base + EXYNOS850_TMU_TRIMINFO_OFFSET(3)); + bgri = (reg >> EXYNOS850_TMU_T_TRIM0_SHIFT) & EXYNOS850_TMU_TRIM0_MASK; + reg = readl(data->base + EXYNOS850_TMU_TRIMINFO_OFFSET(4)); + vref = (reg >> EXYNOS850_TMU_T_TRIM0_SHIFT) & EXYNOS850_TMU_TRIM0_MASK; + reg = readl(data->base + EXYNOS850_TMU_TRIMINFO_OFFSET(5)); + vbei = (reg >> EXYNOS850_TMU_T_TRIM0_SHIFT) & EXYNOS850_TMU_TRIM0_MASK; + + data->cal_type = cal_type == EXYNOS5433_TRIMINFO_TWO_POINT_TRIMMING ? + TYPE_TWO_POINT_TRIMMING : + TYPE_ONE_POINT_TRIMMING; + + reg = readl(data->base + EXYNOS850_TMU_TRIMINFO_OFFSET(0)); + sanitize_temp_error(data, reg); + + dev_info(&pdev->dev, "Calibration type is %d-point calibration\n", + cal_type ? 2 : 1); + + reg = readl(data->base + EXYNOS850_TMU_REG_AVG_CON); + reg &= ~EXYNOS850_TMU_AVG_MODE_MASK; + reg &= ~EXYNOS850_TMU_DEM_ENABLE; + if (avg_mode) { + reg |= avg_mode; + reg |= EXYNOS850_TMU_DEM_ENABLE; + } + writel(reg, data->base + EXYNOS850_TMU_REG_AVG_CON); + + reg = readl(data->base + EXYNOS850_TMU_REG_COUNTER_VALUE0); + reg &= ~(EXYNOS850_TMU_EN_TEMP_SEN_OFF_MASK + << EXYNOS850_TMU_EN_TEMP_SEN_OFF_SHIFT); + reg |= EXYNOS850_TMU_TEM1051X_SENSE_VALUE + << EXYNOS850_TMU_EN_TEMP_SEN_OFF_SHIFT; + writel(reg, data->base + EXYNOS850_TMU_REG_COUNTER_VALUE0); + + reg = readl(data->base + EXYNOS850_TMU_REG_COUNTER_VALUE1); + reg &= ~(EXYNOS850_TMU_CLK_SENSE_ON_MASK + << EXYNOS850_TMU_CLK_SENSE_ON_SHIFT); + reg |= EXYNOS850_TMU_TEM1051X_SENSE_VALUE + << EXYNOS850_TMU_CLK_SENSE_ON_SHIFT; + writel(reg, data->base + EXYNOS850_TMU_REG_COUNTER_VALUE1); + + reg = readl(data->base + EXYNOS850_TMU_REG_TRIM0); + reg &= ~(EXYNOS850_TMU_TRIM0_MASK << EXYNOS850_TMU_BGRI_TRIM_SHIFT); + reg &= ~(EXYNOS850_TMU_TRIM0_MASK << EXYNOS850_TMU_VREF_TRIM_SHIFT); + reg &= ~(EXYNOS850_TMU_TRIM0_MASK << EXYNOS850_TMU_VBEI_TRIM_SHIFT); + reg |= bgri << EXYNOS850_TMU_BGRI_TRIM_SHIFT; + reg |= vref << EXYNOS850_TMU_VREF_TRIM_SHIFT; + reg |= vbei << EXYNOS850_TMU_VBEI_TRIM_SHIFT; + writel(reg, data->base + EXYNOS850_TMU_REG_TRIM0); + + reg = readl(data->base + EXYNOS850_TMU_REG_CONTROL1); + reg &= ~(EXYNOS850_TMU_LPI_MODE_MASK << EXYNOS850_TMU_LPI_MODE_SHIFT); + writel(reg, data->base + EXYNOS850_TMU_REG_CONTROL1); +} + static void exynos4210_tmu_control(struct platform_device *pdev, bool on) { struct exynos_tmu_data *data = platform_get_drvdata(pdev); @@ -673,7 +817,8 @@ static u32 get_emul_con_reg(struct exynos_tmu_data *data, unsigned int val, val &= ~(EXYNOS_EMUL_TIME_MASK << EXYNOS_EMUL_TIME_SHIFT); val |= (EXYNOS_EMUL_TIME << EXYNOS_EMUL_TIME_SHIFT); - if (data->soc == SOC_ARCH_EXYNOS7) { + if (data->soc == SOC_ARCH_EXYNOS7 || + data->soc == SOC_ARCH_EXYNOS850) { val &= ~(EXYNOS7_EMUL_DATA_MASK << EXYNOS7_EMUL_DATA_SHIFT); val |= (temp_to_code(data, temp) << @@ -703,7 +848,8 @@ static void exynos4412_tmu_set_emulation(struct exynos_tmu_data *data, emul_con = EXYNOS5260_EMUL_CON; else if (data->soc == SOC_ARCH_EXYNOS5433) emul_con = EXYNOS5433_TMU_EMUL_CON; - else if (data->soc == SOC_ARCH_EXYNOS7) + else if (data->soc == SOC_ARCH_EXYNOS7 || + data->soc == SOC_ARCH_EXYNOS850) emul_con = EXYNOS7_TMU_REG_EMUL_CON; else emul_con = EXYNOS_EMUL_CON; @@ -758,6 +904,12 @@ static int exynos7_tmu_read(struct exynos_tmu_data *data) EXYNOS7_TMU_TEMP_MASK; } +static int exynos850_tmu_read(struct exynos_tmu_data *data) +{ + return readw(data->base + EXYNOS850_TMU_REG_CURRENT_TEMP0_1) & + EXYNOS7_TMU_TEMP_MASK; +} + static irqreturn_t exynos_tmu_threaded_irq(int irq, void *id) { struct exynos_tmu_data *data = id; @@ -784,7 +936,8 @@ static void exynos4210_tmu_clear_irqs(struct exynos_tmu_data *data) if (data->soc == SOC_ARCH_EXYNOS5260) { tmu_intstat = EXYNOS5260_TMU_REG_INTSTAT; tmu_intclear = EXYNOS5260_TMU_REG_INTCLEAR; - } else if (data->soc == SOC_ARCH_EXYNOS7) { + } else if (data->soc == SOC_ARCH_EXYNOS7 || + data->soc == SOC_ARCH_EXYNOS850) { tmu_intstat = EXYNOS7_TMU_REG_INTPEND; tmu_intclear = EXYNOS7_TMU_REG_INTPEND; } else if (data->soc == SOC_ARCH_EXYNOS5433) { @@ -835,6 +988,9 @@ static const struct of_device_id exynos_tmu_match[] = { }, { .compatible = "samsung,exynos7-tmu", .data = (const void *)SOC_ARCH_EXYNOS7, + }, { + .compatible = "samsung,exynos850-tmu", + .data = (const void *)SOC_ARCH_EXYNOS850, }, { }, }; @@ -952,6 +1108,23 @@ static int exynos_map_dt_data(struct platform_device *pdev) data->min_efuse_value = 15; data->max_efuse_value = 100; break; + case SOC_ARCH_EXYNOS850: + data->tmu_set_low_temp = exynos850_tmu_set_low_temp; + data->tmu_set_high_temp = exynos850_tmu_set_high_temp; + data->tmu_disable_low = exynos850_tmu_disable_low; + data->tmu_disable_high = exynos850_tmu_disable_high; + data->tmu_set_crit_temp = exynos850_tmu_set_crit_temp; + data->tmu_initialize = exynos850_tmu_initialize; + data->tmu_control = exynos4210_tmu_control; + data->tmu_read = exynos850_tmu_read; + data->tmu_set_emulation = exynos4412_tmu_set_emulation; + data->tmu_clear_irqs = exynos4210_tmu_clear_irqs; + data->temp_mask = EXYNOS7_TMU_TEMP_MASK; + data->temp_85_shift = EXYNOS7_TMU_TEMP_SHIFT; + data->efuse_value = 55; + data->min_efuse_value = 0; + data->max_efuse_value = 511; + break; default: dev_err(&pdev->dev, "Platform not supported\n"); return -EINVAL; From patchwork Wed Sep 11 12:11:30 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mateusz Majewski X-Patchwork-Id: 13800333 Received: from mailout1.w1.samsung.com (mailout1.w1.samsung.com [210.118.77.11]) (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 DDFE018785F for ; Wed, 11 Sep 2024 12:12:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=210.118.77.11 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726056724; cv=none; b=C6Xtn+8u3/xg5GCy0ZSctTyo9+Lk7fY0AV6R34C6Y1fyywI77vXAWm1yQLDMYNmBaKsgwrGpOfOFOdedg/6//+mORV7qBnaen9EyTcHqGFxrEMvNjcnBgV49j0DrfqWrpmMuL9nhhhxz8ID3DqFGYwzm7+quGNRgshECn77jJ4g= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726056724; c=relaxed/simple; bh=kuHpYla48FL3IoPXA3I3u/L0oNHA2kLHhX+p73plfos=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:MIME-Version: Content-Type:References; b=aYoL0UdCKYeFsVU7ZDPv+CAhY80McpJG+1N6vN2isBbaTIAGxCXgqMZfecD9AbePp61Z79hxtRpGWFMVQmOlhHk+2ve9yi9KkF2/H3+wpNXl6jrQVCRVDdvOgaV12JG6Vz+5TJ/AAuvFZqEQzEnMF7kulXqn6mh4jAzzk0FsLQY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=samsung.com; spf=pass smtp.mailfrom=samsung.com; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b=g5+kyYFK; arc=none smtp.client-ip=210.118.77.11 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=samsung.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=samsung.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b="g5+kyYFK" Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20240911121200euoutp017172bd199b8fe05fabf972c99ed55299~0L3EoFVc00990209902euoutp01M for ; Wed, 11 Sep 2024 12:12:00 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20240911121200euoutp017172bd199b8fe05fabf972c99ed55299~0L3EoFVc00990209902euoutp01M DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1726056720; bh=Y0Eg0QBpQbCUuL7P46NlXOmSQkcvzkcL2BjioU95Oh0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=g5+kyYFKZjkkO7S+uLiYh25SmDmbbO5hncMsJxX1/vja5aRYTJXtTAr7JFOjLBAZZ TgSWDRaD9KhGhZGWfEljMLHVPMGvDXJrLCWIy3d4+KPg+z6mNSPR2gKLsDMrWsCpTR ewebVMmShKW3jyFdkY5HEJFqPW6SsauvRQSGvtoY= Received: from eusmges3new.samsung.com (unknown [203.254.199.245]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20240911121159eucas1p218ace4e87ae9e4ecf30cdf23b6f5e2a0~0L3EIX72E2873128731eucas1p2Y; Wed, 11 Sep 2024 12:11:59 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges3new.samsung.com (EUCPMTA) with SMTP id F7.48.09620.F0981E66; Wed, 11 Sep 2024 13:11:59 +0100 (BST) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20240911121159eucas1p1ecfa41871f21953b49d90c287d121409~0L3DmH--S2500425004eucas1p1E; Wed, 11 Sep 2024 12:11:59 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20240911121159eusmtrp21828e598ebcdf09e9c799a63cc01525c~0L3DlDyHi2708727087eusmtrp2r; Wed, 11 Sep 2024 12:11:59 +0000 (GMT) X-AuditID: cbfec7f5-d31ff70000002594-8b-66e1890f8fd3 Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id 31.5D.19096.E0981E66; Wed, 11 Sep 2024 13:11:58 +0100 (BST) Received: from AMDC4515.eu.corp.samsungelectronics.net (unknown [106.120.51.28]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20240911121158eusmtip1eb216979373ba6be7882e3e7022bd6ac~0L3CmHKMU0718707187eusmtip1h; Wed, 11 Sep 2024 12:11:58 +0000 (GMT) From: Mateusz Majewski To: linux-pm@vger.kernel.org, linux-samsung-soc@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: Mateusz Majewski , Bartlomiej Zolnierkiewicz , Krzysztof Kozlowski , "Rafael J. Wysocki" , Daniel Lezcano , Zhang Rui , Lukasz Luba , Rob Herring , Conor Dooley , Alim Akhtar , Sam Protsenko , Anand Moon , Marek Szyprowski , Krzysztof Kozlowski Subject: [PATCH v4 7/7] dt-bindings: thermal: samsung,exynos: remove driver-specific information Date: Wed, 11 Sep 2024 14:11:30 +0200 Message-ID: <20240911121136.1120026-8-m.majewski2@samsung.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240911121136.1120026-1-m.majewski2@samsung.com> Precedence: bulk X-Mailing-List: linux-samsung-soc@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrOKsWRmVeSWpSXmKPExsWy7djP87r8nQ/TDPZsVrF4MG8bm8X3LdeZ LNbsPcdkMe+zrMX8I+dYLc6f38Busff1VnaLTY+vsVpc3jWHzeJz7xFGixnn9zFZrNt4i91i YVMLu8XEY5OZLdYeuctuMffLVGaL/3t2sFs8edjHZvG8bx+Tg7DHmnlrGD12zrrL7rF4z0sm j02rOtk87lzbw+axeUm9R9+WVYwenzfJBXBEcdmkpOZklqUW6dslcGX0fXzDWNDMV/Fv6Q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P7mCzWbbzFbrGw qYXdYuKxycwWa4/cZbeY+2Uqs8X/PTvYLZ487GOzeN63j8lB2GPNvDWMHjtn3WX3WLznJZPH plWdbB53ru1h89i8pN6jb8sqRo/Pm+QCOKL0bIryS0tSFTLyi0tslaINLYz0DC0t9IxMLPUM jc1jrYxMlfTtbFJSczLLUov07RL0Mvo+vmEsaOar+Ld0BWMD40XuLkZODgkBE4kTt64zdTFy cQgJLGWU2NlxiwUiIS1x+MsUdghbWOLPtS42iKJmJomeA72MIAk2AQOJB2+WgRWJCCxnlNjc 7gFSxCxwlUXi0Os5rCAJYYEEiS2XHoDZLAKqEnembGUCsXkF7CS+bPvDCrFBXuLimudsIDan gL3E99fLwRYIAdV83HiSFaJeUOLkzCdg1zED1Tdvnc08gVFgFpLULCSpBYxMqxhFUkuLc9Nz i430ihNzi0vz0vWS83M3MQLjdNuxn1t2MK589VHvECMTB+MhRgkOZiUR3n67e2lCvCmJlVWp RfnxRaU5qcWHGE2B7p7ILCWanA9MFHkl8YZmBqaGJmaWBqaWZsZK4rxsV86nCQmkJ5akZqem FqQWwfQxcXBKNTBNW7LCJeg3i9nfaQX5p/L2x93Zvtok+uaXKq6VZ6QmW7yqEY3uXba9+orR bBfGKTU3RCVmsYW2ztt6YOnSWSX3jiltOLQqxSkj1T6EVXHDC/MjfJO71jte4Vq841Tl52tV Hn6GKz41NnSFf8nTqL1vstEtfNfBk2tF/nDqPGc7K2WeMHtD1Ce2nbkPhcT/SPfcSOKUO/a0 4uaJaW72iZ59524xXmf0qrsrrC9VG6J/PflojvmLRKGQ9UGveqz03yw49+TqvCW3vv38vXeB 2kTZr+Ye+8UXHAlgn9Wi9oRjgZNUia36566ppwT/TdsrFin4Qn2hk7u58PM1asv5jv9e/Kg9 ub/83IRQ2ZsLm76sUWIpzkg01GIuKk4EAA3DAb9cAwAA X-CMS-MailID: 20240911121159eucas1p1ecfa41871f21953b49d90c287d121409 X-Msg-Generator: CA X-RootMTR: 20240911121159eucas1p1ecfa41871f21953b49d90c287d121409 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20240911121159eucas1p1ecfa41871f21953b49d90c287d121409 References: <20240911121136.1120026-1-m.majewski2@samsung.com> The number of supported trip points was only limited by the driver implementation at the time, which mapped each trip point defined in the devicetree source file to a hardware trip point. An implementation that does not have this limitation is possible; indeed, that is how the driver works currently. Therefore, this information should be removed from the bindings description, which are meant to be independent of the details of the driver implementation. Reviewed-by: Sam Protsenko Reviewed-by: Krzysztof Kozlowski Reviewed-by: Rob Herring (Arm) Signed-off-by: Mateusz Majewski --- v2 -> v3: reword the commit message to be easier to understand in context of dt-bindings. v1 -> v2: remove an unnecessary sentence. .../devicetree/bindings/thermal/samsung,exynos-thermal.yaml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/Documentation/devicetree/bindings/thermal/samsung,exynos-thermal.yaml b/Documentation/devicetree/bindings/thermal/samsung,exynos-thermal.yaml index b8c0bb7f4263..b85b4c420cd3 100644 --- a/Documentation/devicetree/bindings/thermal/samsung,exynos-thermal.yaml +++ b/Documentation/devicetree/bindings/thermal/samsung,exynos-thermal.yaml @@ -40,11 +40,7 @@ properties: interrupts: description: | The Exynos TMU supports generating interrupts when reaching given - temperature thresholds. Number of supported thermal trip points depends - on the SoC (only first trip points defined in DT will be configured):: - - most of SoC: 4 - - samsung,exynos5433-tmu: 8 - - samsung,exynos7-tmu: 8 + temperature thresholds. maxItems: 1 reg: