From patchwork Sun Mar 27 23:37:54 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chanwoo Choi X-Patchwork-Id: 8677341 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id B09ACC0554 for ; Sun, 27 Mar 2016 23:44:39 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id CEFFA20218 for ; Sun, 27 Mar 2016 23:44:38 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id DA066201EC for ; Sun, 27 Mar 2016 23:44:37 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1akKKk-0003fX-D0; Sun, 27 Mar 2016 23:43:02 +0000 Received: from mailout3.samsung.com ([203.254.224.33]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1akKGX-0007gD-EE for linux-arm-kernel@lists.infradead.org; Sun, 27 Mar 2016 23:38:42 +0000 Received: from epcpsbgr2.samsung.com (u142.gpu120.samsung.co.kr [203.254.230.142]) by mailout3.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0O4Q0308K1NQOW00@mailout3.samsung.com> for linux-arm-kernel@lists.infradead.org; Mon, 28 Mar 2016 08:38:14 +0900 (KST) Received: from epcpsbgm2new.samsung.com ( [172.20.52.112]) by epcpsbgr2.samsung.com (EPCPMTA) with SMTP id 0C.44.04785.6EE68F65; Mon, 28 Mar 2016 08:38:14 +0900 (KST) X-AuditID: cbfee68e-f79d96d0000012b1-d3-56f86ee625fa Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm2new.samsung.com (EPCPMTA) with SMTP id 6F.A2.06699.6EE68F65; Mon, 28 Mar 2016 08:38:14 +0900 (KST) Received: from chan.10.32.193.11 ([10.113.62.212]) by mmp1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0O4Q0044Y1NPUV30@mmp1.samsung.com>; Mon, 28 Mar 2016 08:38:13 +0900 (KST) From: Chanwoo Choi To: myungjoo.ham@samsung.com, kyungmin.park@samsung.com, k.kozlowski@samsung.com, kgene@kernel.org Subject: [PATCH v6 05/21] PM / devfreq: Add governer type with unique number Date: Mon, 28 Mar 2016 08:37:54 +0900 Message-id: <1459121890-4601-6-git-send-email-cw00.choi@samsung.com> X-Mailer: git-send-email 1.8.0 In-reply-to: <1459121890-4601-1-git-send-email-cw00.choi@samsung.com> References: <1459121890-4601-1-git-send-email-cw00.choi@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrPIsWRmVeSWpSXmKPExsWyRsSkQPdZ3o8wg8mLTCyuf3nOajH/yDlW i/43C1ktzr1ayWgx6f4EFovXLwwt+h+/ZrY42/SG3WLT42usFpd3zWGz+Nx7hNFixvl9TBbr Nt5it7h9mdfi5ZEfjBZLr19ksrjduILNYsL0tSwWZ05fYrVo3XuE3aJt9QdWB1GPNfPWMHq0 NPeweVzu62XyuHWn3mPnrLvsHiuXf2Hz2LSqk81j85J6j3/H2D22XG1n8ejbsorR4/MmuQCe KC6blNSczLLUIn27BK6Mvcv2MhaclK/4eHsvUwPjK6kuRk4OCQETibUvJrBC2GISF+6tZ+ti 5OIQEljBKLGo4xkjTNGmrd+YIRJLGSW23ulhhXC+MEqcbephA6liE9CS2P/iBpgtIpAi8fjh SbBRzAJHmCWmbrzBBJIQFvCRWP97H1gRi4CqxJUJB1m6GDk4eAVcJNbthTpJTuLDnkfsIDan gKtE89e5YFcI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O81HK94sTc4tK8dL3k /NxNjOCk8Ex6B+PhXe6HGAU4GJV4eDMsf4QJsSaWFVfmHmKU4GBWEuGtSgMK8aYkVlalFuXH F5XmpBYfYjQFumsis5Rocj4wYeWVxBsam5gZWRqZG1oYGZsrifM+/r8uTEggPbEkNTs1tSC1 CKaPiYNTqoFRmetQxI3jeydV/m9J8D6md6Rh47f+YFt/1hrVuoZEvSccE3MXlc5d3bAy2zLD cLrPZ+6NaltCot8snPNRY13Eje+KF5LVDxXd2PXlIUdzt0b6iibx1sOzt15IXPffrFrKMz/I SMZk87lZjfIdu9zqIptuBL8/9CDOT1fohlPdkdmql/3XLPmuxFKckWioxVxUnAgA70CA9iAD AAA= DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160327_163841_745908_5505BDE2 X-CRM114-Status: GOOD ( 13.63 ) X-Spam-Score: -7.9 (-------) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: mark.rutland@arm.com, inki.dae@samsung.com, linux-samsung-soc@vger.kernel.org, linux@arm.linux.org.uk, cw00.choi@samsung.com, pawel.moll@arm.com, ijc+devicetree@hellion.org.uk, linux.amoon@gmail.com, linux-pm@vger.kernel.org, rjw@rjwysocki.net, linux-kernel@vger.kernel.org, m.reichl@fivetechno.de, tjakobi@math.uni-bielefeld.de, devicetree@vger.kernel.org, robh+dt@kernel.org, galak@codeaurora.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-5.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This patch just adds the governor type to identify them by using the defined constant. Signed-off-by: Chanwoo Choi --- drivers/devfreq/governor.h | 6 ++++++ drivers/devfreq/governor_performance.c | 1 + drivers/devfreq/governor_powersave.c | 1 + drivers/devfreq/governor_simpleondemand.c | 1 + drivers/devfreq/governor_userspace.c | 1 + include/linux/devfreq.h | 2 ++ 6 files changed, 12 insertions(+) diff --git a/drivers/devfreq/governor.h b/drivers/devfreq/governor.h index fad7d6321978..cf19b923c362 100644 --- a/drivers/devfreq/governor.h +++ b/drivers/devfreq/governor.h @@ -18,6 +18,12 @@ #define to_devfreq(DEV) container_of((DEV), struct devfreq, dev) +/* Devfreq governor type */ +#define DEVFREQ_GOV_ONDEMAND 0x1 +#define DEVFREQ_GOV_PERFORMANCE 0x2 +#define DEVFREQ_GOV_POWERSAVE 0x3 +#define DEVFREQ_GOV_USERSPACE 0x4 + /* Devfreq events */ #define DEVFREQ_GOV_START 0x1 #define DEVFREQ_GOV_STOP 0x2 diff --git a/drivers/devfreq/governor_performance.c b/drivers/devfreq/governor_performance.c index c72f942f30a8..594d8ecb13fb 100644 --- a/drivers/devfreq/governor_performance.c +++ b/drivers/devfreq/governor_performance.c @@ -43,6 +43,7 @@ static int devfreq_performance_handler(struct devfreq *devfreq, static struct devfreq_governor devfreq_performance = { .name = "performance", + .type = DEVFREQ_GOV_PERFORMANCE, .get_target_freq = devfreq_performance_func, .event_handler = devfreq_performance_handler, }; diff --git a/drivers/devfreq/governor_powersave.c b/drivers/devfreq/governor_powersave.c index 0c6bed567e6d..e2817e1f2a31 100644 --- a/drivers/devfreq/governor_powersave.c +++ b/drivers/devfreq/governor_powersave.c @@ -40,6 +40,7 @@ static int devfreq_powersave_handler(struct devfreq *devfreq, static struct devfreq_governor devfreq_powersave = { .name = "powersave", + .type = DEVFREQ_GOV_POWERSAVE, .get_target_freq = devfreq_powersave_func, .event_handler = devfreq_powersave_handler, }; diff --git a/drivers/devfreq/governor_simpleondemand.c b/drivers/devfreq/governor_simpleondemand.c index ae72ba5e78df..b905a535d486 100644 --- a/drivers/devfreq/governor_simpleondemand.c +++ b/drivers/devfreq/governor_simpleondemand.c @@ -126,6 +126,7 @@ static int devfreq_simple_ondemand_handler(struct devfreq *devfreq, static struct devfreq_governor devfreq_simple_ondemand = { .name = "simple_ondemand", + .type = DEVFREQ_GOV_ONDEMAND, .get_target_freq = devfreq_simple_ondemand_func, .event_handler = devfreq_simple_ondemand_handler, }; diff --git a/drivers/devfreq/governor_userspace.c b/drivers/devfreq/governor_userspace.c index 35de6e83c1fe..c78ab78a5220 100644 --- a/drivers/devfreq/governor_userspace.c +++ b/drivers/devfreq/governor_userspace.c @@ -138,6 +138,7 @@ static int devfreq_userspace_handler(struct devfreq *devfreq, static struct devfreq_governor devfreq_userspace = { .name = "userspace", + .type = DEVFREQ_GOV_USERSPACE, .get_target_freq = devfreq_userspace_func, .event_handler = devfreq_userspace_handler, }; diff --git a/include/linux/devfreq.h b/include/linux/devfreq.h index 152ea342529c..9baf45f661ad 100644 --- a/include/linux/devfreq.h +++ b/include/linux/devfreq.h @@ -104,6 +104,7 @@ struct devfreq_dev_profile { * struct devfreq_governor - Devfreq policy governor * @node: list node - contains registered devfreq governors * @name: Governor's name + * @type: Governor's type * @get_target_freq: Returns desired operating frequency for the device. * Basically, get_target_freq will run * devfreq_dev_profile.get_dev_status() to get the @@ -121,6 +122,7 @@ struct devfreq_governor { struct list_head node; const char name[DEVFREQ_NAME_LEN]; + const int type; int (*get_target_freq)(struct devfreq *this, unsigned long *freq); int (*event_handler)(struct devfreq *devfreq, unsigned int event, void *data);