From patchwork Thu Mar 24 04:25:14 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chanwoo Choi X-Patchwork-Id: 8657351 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id C92C39FEEA for ; Thu, 24 Mar 2016 04:29:02 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E579420340 for ; Thu, 24 Mar 2016 04:29:01 +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 6179720376 for ; Thu, 24 Mar 2016 04:29:00 +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 1aiwrm-0005ls-UB; Thu, 24 Mar 2016 04:27:26 +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 1aiwqM-00051a-Dc for linux-arm-kernel@lists.infradead.org; Thu, 24 Mar 2016 04:25:59 +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 <0O4J02QCR0ALHMD0@mailout3.samsung.com> for linux-arm-kernel@lists.infradead.org; Thu, 24 Mar 2016 13:25:33 +0900 (KST) Received: from epcpsbgm2new.samsung.com ( [172.20.52.115]) by epcpsbgr2.samsung.com (EPCPMTA) with SMTP id DD.C7.04972.D3C63F65; Thu, 24 Mar 2016 13:25:33 +0900 (KST) X-AuditID: cbfee68e-f793c6d00000136c-55-56f36c3d7f17 Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm2new.samsung.com (EPCPMTA) with SMTP id 95.17.09068.D3C63F65; Thu, 24 Mar 2016 13:25:33 +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 <0O4J007XC0AJOI80@mmp1.samsung.com>; Thu, 24 Mar 2016 13:25:32 +0900 (KST) From: Chanwoo Choi To: myungjoo.ham@samsung.com, kyungmin.park@samsung.com, k.kozlowski@samsung.com, kgene@kernel.org Subject: [PATCH v5 05/21] PM / devfreq: Add governer type with unique number Date: Thu, 24 Mar 2016 13:25:14 +0900 Message-id: <1458793530-31897-6-git-send-email-cw00.choi@samsung.com> X-Mailer: git-send-email 1.8.0 In-reply-to: <1458793530-31897-1-git-send-email-cw00.choi@samsung.com> References: <1458793530-31897-1-git-send-email-cw00.choi@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrEIsWRmVeSWpSXmKPExsWyRsSkWNc253OYwarlUhbXvzxntZh/5Byr Rf+bhawW516tZLR4/cLQov/xa2aLs01v2C02Pb7GanF51xw2i8+9RxgtZpzfx2SxbuMtdovb l3ktll6/yGRxu3EFm8WE6WtZLM6cvsRq0br3CLtF2+oPrA7CHmvmrWH0aGnuYfO43NfL5LFz 1l12j5XLv7B5bFrVyeaxeUm9x79j7B5brrazePRtWcXo8XmTXAB3FJdNSmpOZllqkb5dAlfG 3mV7GQtOyld8vL2XqYHxlVQXIyeHhICJxLeNmxghbDGJC/fWs3UxcnEICaxglDjc/oAJpuhp 829miMRSRomm7lmsIAkhgS+MEqsf14PYbAJaEvtf3GADsUUEUiQePzwJNolZYAqzxPLpzSwg CWEBH4m/5y6yg9gsAqoSU47PBrN5BVwl1l1rgtomJ/FhzyOwOKeAm8TUhiYWiGWuEk8fb2IF GSohMJdD4v/+ZSwQgwQkvk0+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DBqMTDe4Prc5gQa2JZcWXuIUYJDmYlEd714UAh3pTEyqrUovz4otKc1OJDjKZAh01klhJN zgcmpbySeENjEzMjSyNzQwsjY3Mlcd7H/9eFCQmkJ5akZqemFqQWwfQxcXBKNTAezFEtnfX8 uEIsm87fgB/meYqlXlyWLV4W7TeC/9jtOqfM1PXu4K3fc2afLbKc3BNwo6n5a7zhXKdd0Q6C Uu0flqQXJ1pe2xl65Xrx6WYxM7HWdba1zbseTvB3Zb0dniAaPvGB2YPTx+3aLzcu9+asUWV7 H9tjciX6I88ZJ4Mrsb1rtT3s1imxFGckGmoxFxUnAgCVD6siEgMAAA== 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-20160323_212558_647602_12893721 X-CRM114-Status: GOOD ( 13.52 ) X-Spam-Score: -6.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, devicetree@vger.kernel.org, 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, tjakobi@math.uni-bielefeld.de, 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=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_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);