Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752309AbdIUAfJ (ORCPT ); Wed, 20 Sep 2017 20:35:09 -0400 Received: from mailout3.samsung.com ([203.254.224.33]:49986 "EHLO mailout3.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751995AbdIUAd7 (ORCPT ); Wed, 20 Sep 2017 20:33:59 -0400 X-AuditID: b6c32a37-f79a16d000003afa-62-59c308f4a2a8 From: Chanwoo Choi To: myungjoo.ham@samsung.com, kyungmin.park@samsung.com, cw00.choi@samsung.com Cc: rafael.j.wysocki@intel.com, chanwoo@kernel.org, inki.dae@samsung.com, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Kukjin Kim , Krzysztof Kozlowski , linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH v2 8/8] PM / devfreq: exynos-bus: Register cooling device Date: Thu, 21 Sep 2017 09:33:52 +0900 Message-id: <1505954032-3327-9-git-send-email-cw00.choi@samsung.com> X-Mailer: git-send-email 1.8.0 In-reply-to: <1505954032-3327-1-git-send-email-cw00.choi@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrLKsWRmVeSWpSXmKPExsWy7bCmge5XjsORBhP6WSwm3rjCYnH9y3NW i0n3J7BY9D9+zWxx/vwGdouzTW/YLTY9vsZqcXnXHDaLz71HGC1mnN/HZHG7cQWbxeMVb9kd eDwW73nJ5LFpVSebx+Yl9R59W1YxenzeJBfAGpVqk5GamJJapJCal5yfkpmXbqvkHRzvHG9q ZmCoa2hpYa6kkJeYm2qr5OIToOuWmQN0npJCWWJOKVAoILG4WEnfzqYov7QkVSEjv7jEVina 0NBIz9DAXM/IyEjPxDjWysgUqCQhNaN31my2gi7+im1tXawNjOd5uhg5OSQETCS2tGxggbDF JC7cW8/WxcjFISSwg1Hi9J+VLBDOd0aJZZ2rmGE6lu8/DVW1m1FiS99eRgjnB6NE494jTCBV bAJaEvtf3GADsUUE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czcxAoNu22Gtvh2M95fEH2IU4GBU4uENsDoYKcSaWFZcmXuIUYKDWUmEN+bhoUgh3pTEyqrU ovz4otKc1OJDjNIcLErivJl9MyKFBNITS1KzU1MLUotgskwcnFINjNNso3r+tJ79b63Jan7W c37wITGuoPzLfzfs2fhn8dP/yXEnTGI28W653B1e3evreORQlY7w1exvh3y/f1sttX8ba/fz Zu+jL/X2Xvw7xfjq+8NuAhd4Eo7tFNg+S8bc6v2/ZXFcsd5rd2Wstb5SvFLz0rG5M+zCgze3 Xxe7Fmd1YEeeeW7bvOVKLMUZiYZazEXFiQBinPFrNgIAAA== X-CMS-MailID: 20170921003356epcas1p34bf88ccd1b9630577a83f14f0c291b1d X-Msg-Generator: CA X-Sender-IP: 182.195.42.142 X-Local-Sender: =?UTF-8?B?7LWc7LCs7JqwG1RpemVuIFBsYXRmb3JtIExhYihTL1fshLw=?= =?UTF-8?B?7YSwKRvsgrzshLHsoITsnpAbU2VuaW9yIEVuZ2luZWVy?= X-Global-Sender: =?UTF-8?B?Q2hhbndvbyBDaG9pG1RpemVuIFBsYXRmb3JtIExhYi4bU2Ft?= =?UTF-8?B?c3VuZyBFbGVjdHJvbmljcxtTZW5pb3IgRW5naW5lZXI=?= X-Sender-Code: =?UTF-8?B?QzEwG1RFTEUbQzEwVjgxMTE=?= CMS-TYPE: 101P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20170921003356epcas1p34bf88ccd1b9630577a83f14f0c291b1d X-RootMTR: 20170921003356epcas1p34bf88ccd1b9630577a83f14f0c291b1d References: <1505954032-3327-1-git-send-email-cw00.choi@samsung.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1864 Lines: 64 This patch registers the Exynos Bus-Frequency scaling device as a cooling device of thermal management. Signed-off-by: Chanwoo Choi Cc: Kukjin Kim Cc: Krzysztof Kozlowski Cc: linux-samsung-soc@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org --- drivers/devfreq/Kconfig | 1 + drivers/devfreq/exynos-bus.c | 11 +++++++++++ 2 files changed, 12 insertions(+) diff --git a/drivers/devfreq/Kconfig b/drivers/devfreq/Kconfig index 6a172d338f6d..eb8128e08b2c 100644 --- a/drivers/devfreq/Kconfig +++ b/drivers/devfreq/Kconfig @@ -81,6 +81,7 @@ config ARM_EXYNOS_BUS_DEVFREQ select DEVFREQ_GOV_SIMPLE_ONDEMAND select DEVFREQ_GOV_PASSIVE select DEVFREQ_EVENT_EXYNOS_PPMU + select DEVFREQ_THERMAL select PM_DEVFREQ_EVENT select PM_OPP help diff --git a/drivers/devfreq/exynos-bus.c b/drivers/devfreq/exynos-bus.c index c25658b26598..200ca0d11834 100644 --- a/drivers/devfreq/exynos-bus.c +++ b/drivers/devfreq/exynos-bus.c @@ -15,6 +15,7 @@ #include #include #include +#include #include #include #include @@ -41,6 +42,8 @@ struct exynos_bus { struct clk *clk; unsigned int voltage_tolerance; unsigned int ratio; + + struct thermal_cooling_device *cdev; }; /* @@ -468,6 +471,14 @@ static int exynos_bus_probe(struct platform_device *pdev) goto err; } + /* Register devfreq cooling device */ + bus->cdev = of_devfreq_cooling_register(np, bus->devfreq); + if (IS_ERR(bus->cdev) < 0) { + dev_err(dev, "failed to register cooling device\n"); + ret = PTR_ERR(bus->cdev); + goto err; + } + goto out; passive: /* Initialize the struct profile and governor data for passive device */ -- 1.9.1