Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S967409AbdIZCb4 (ORCPT ); Mon, 25 Sep 2017 22:31:56 -0400 Received: from mailout1.samsung.com ([203.254.224.24]:35419 "EHLO mailout1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S966283AbdIZCby (ORCPT ); Mon, 25 Sep 2017 22:31:54 -0400 X-AuditID: b6c32a38-d71ff70000001124-94-59c9bc177f1c 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-kernel@vger.kernel.org, linux-pm@vger.kernel.org, Kukjin Kim , Krzysztof Kozlowski , linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH v2.1] PM / devfreq: exynos-bus: Register cooling device Date: Tue, 26 Sep 2017 11:31:48 +0900 Message-id: <1506393108-17456-1-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+NgFjrEKsWRmVeSWpSXmKPExsWy7bCmnq74npORBh/vqFtMvHGFxeL6l+es FpPuT2Cx6H/8mtni/PkN7BZnm96wW2x6fI3V4vKuOWwWn3uPMFrMOL+PyeJ24wo2i8cr3rI7 8Hgs3vOSyWPTqk42j81L6j36tqxi9Pi8SS6ANSrVJiM1MSW1SCE1Lzk/JTMv3VbJOzjeOd7U zMBQ19DSwlxJIS8xN9VWycUnQNctMwfoPCWFssScUqBQQGJxsZK+nU1RfmlJqkJGfnGJrVK0 oaGRnqGBuZ6RkZGeiXGslZEpUElCakb/p03MBYcFKj6eO8LcwHibt4uRk0NCwERi7YaDzF2M XBxCAjsYJZZc3gTlfGeU+PX6ERtM1cLPW9ghEhsYJZ52PGGEcH4wSiy9uocRpIpNQEti/4sb YB0iAgESnWtXMYEU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5r9e1gvL8k/hCjAAejEg9vA9PJSCHWxLLiytxDjBIczEoivNe3A4V4UxIrq1KL 8uOLSnNSiw8xSnOwKInz3s47FikkkJ5YkpqdmlqQWgSTZeLglGpgnMZoeKNfIsxNlP/E8yc2 9yQlXltHK4Q2+jBIGLJKHb3es7j4vl7JfY+JJt75hmvWKNxUvzPR+IrjjBXRR4115l3S9nxp 41XwYdc0Ab2tQslCbGsvT/kd9LDgHq/onahgb7lZgk+LMvyOhW9/fv853+2PmyaFHUtPuhti t3PpI/OPdoflbl/Zr8RSnJFoqMVcVJwIAEHLYjQ3AgAA X-CMS-MailID: 20170926023151epcas1p41f999f2804facb4548b2d42ac3a00601 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: 20170926023151epcas1p41f999f2804facb4548b2d42ac3a00601 X-RootMTR: 20170926023151epcas1p41f999f2804facb4548b2d42ac3a00601 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: 2039 Lines: 74 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/exynos-bus.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/drivers/devfreq/exynos-bus.c b/drivers/devfreq/exynos-bus.c index c25658b26598..fe9ef6a3238b 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,13 @@ 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)) { + dev_err(dev, "running exynos-bus without cooling device\n"); + bus->cdev = NULL; + } + goto out; passive: /* Initialize the struct profile and governor data for passive device */ @@ -514,6 +524,15 @@ static int exynos_bus_probe(struct platform_device *pdev) return ret; } +static int exynos_bus_remove(struct platform_device *pdev) +{ + struct exynos_bus *bus = platform_get_drvdata(pdev); + + devfreq_cooling_unregister(bus->cdev); + + return 0; +} + #ifdef CONFIG_PM_SLEEP static int exynos_bus_resume(struct device *dev) { @@ -556,6 +575,7 @@ static int exynos_bus_suspend(struct device *dev) static struct platform_driver exynos_bus_platdrv = { .probe = exynos_bus_probe, + .remove = exynos_bus_remove, .driver = { .name = "exynos-bus", .pm = &exynos_bus_pm, -- 1.9.1