From patchwork Wed Jun 11 01:17:56 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonghwa Lee X-Patchwork-Id: 4333061 Return-Path: X-Original-To: patchwork-linux-pm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id EC9199F314 for ; Wed, 11 Jun 2014 01:18:18 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 12D0C20218 for ; Wed, 11 Jun 2014 01:18:18 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 1AF1520295 for ; Wed, 11 Jun 2014 01:18:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753058AbaFKBSQ (ORCPT ); Tue, 10 Jun 2014 21:18:16 -0400 Received: from mailout4.samsung.com ([203.254.224.34]:61587 "EHLO mailout4.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753119AbaFKBSP (ORCPT ); Tue, 10 Jun 2014 21:18:15 -0400 Received: from epcpsbgr2.samsung.com (u142.gpu120.samsung.co.kr [203.254.230.142]) by mailout4.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0N6Z00HRNCY0V4C0@mailout4.samsung.com> for linux-pm@vger.kernel.org; Wed, 11 Jun 2014 10:18:00 +0900 (KST) Received: from epcpsbgm2.samsung.com ( [172.20.52.116]) by epcpsbgr2.samsung.com (EPCPMTA) with SMTP id 41.BD.19452.84EA7935; Wed, 11 Jun 2014 10:18:00 +0900 (KST) X-AuditID: cbfee68e-b7fb96d000004bfc-cd-5397ae484500 Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id AB.6C.07139.84EA7935; Wed, 11 Jun 2014 10:18:00 +0900 (KST) Received: from localhost.localdomain ([10.252.82.199]) by mmp1.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0N6Z00LDBCXX4280@mmp1.samsung.com>; Wed, 11 Jun 2014 10:18:00 +0900 (KST) From: Jonghwa Lee To: linux-pm@vger.kernel.org Cc: myungjoo.ham@samsung.com, kyungmin.park@samsung.com, cw00.choi@samsung.com, Jonghwa Lee Subject: [PATCH 3/3] devfreq: exynos4_bus: Support DT in exynos4 busfreq driver. Date: Wed, 11 Jun 2014 10:17:56 +0900 Message-id: <1402449476-6782-4-git-send-email-jonghwa3.lee@samsung.com> X-Mailer: git-send-email 1.7.9.5 In-reply-to: <1402449476-6782-1-git-send-email-jonghwa3.lee@samsung.com> References: <1402449476-6782-1-git-send-email-jonghwa3.lee@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrLLMWRmVeSWpSXmKPExsWyRsSkRNdj3fRgg203ZS2uf3nOatF59gmz xdmmN+wWn3uPMFrcblzB5sDq0bdlFaPH501yAUxRXDYpqTmZZalF+nYJXBnLJz1gLngsVXFg xiaWBsZNYl2MnBwSAiYSy18eYIewxSQu3FvP1sXIxSEksJRR4vz2TlaYokVHt7JCJBYxSvxu WgpV1cYkcfHXUmaQKjYBHYn/+26CjRIRkJGYemU/WDezQIVE86XfLCC2sECAxN2bh9hAbBYB VYmPGy+D1fMKuEs03p0JVM8BtE1BYs4kG5Awp4CHxNOvf8DKhYBKtp1bxASyV0LgO5vElrnz WSHmCEh8m3yIBaJXVmLTAWaIoyUlDq64wTKBUXgBI8MqRtHUguSC4qT0IiO94sTc4tK8dL3k /NxNjMCgPf3vWd8OxpsHrA8xJgONm8gsJZqcDwz6vJJ4Q2MzIwtTE1NjI3NLM9KElcR5Fz1M ChISSE8sSc1OTS1ILYovKs1JLT7EyMTBKdXAqKgVNeWwtp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GS X-CFilter-Loop: Reflected Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, 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 makes exynos4 busfreq driver to use DeviceTree. This patch includes creation of DT binding documentation directory for devfreq and exynos4_bus driver's description. Signed-off-by: Jonghwa Lee Signed-off-by: Chanwoo Choi Signed-off-by: Myungjoo Ham --- .../devicetree/bindings/devfreq/exynos4_bus.txt | 19 +++++++++++++ drivers/devfreq/exynos/exynos4_bus.c | 30 ++++++++++++++++---- 2 files changed, 44 insertions(+), 5 deletions(-) create mode 100644 Documentation/devicetree/bindings/devfreq/exynos4_bus.txt diff --git a/Documentation/devicetree/bindings/devfreq/exynos4_bus.txt b/Documentation/devicetree/bindings/devfreq/exynos4_bus.txt new file mode 100644 index 0000000..5a65001 --- /dev/null +++ b/Documentation/devicetree/bindings/devfreq/exynos4_bus.txt @@ -0,0 +1,19 @@ +Exynos4 busfreq bindings +~~~~~~~~~~~~~~~~~~~~~~~~ + +Require properties: +- compatible : "samsung,exynos4210-busfreq"; + "samsung,exynos4x12-busfreq"; +- reg : Memory range for PPMU IP block's SFR region. +- clocks : Source clocks for PPMU blocks; + Currently, driver needs two ppmu clks for dmc0, dmc1. +- clock-names : PPMU clock's lookup name; + +Examples: + busfreq@0 { + compatible = "samsung,exynos4x12-busfreq"; + reg = <0x106A0000 0x2000>, <0x106B0000 0x2000>; + clocks = <&clock 412>, <&clock 413>; + clock-names = "ppmudmc0", "ppmudmc1"; + }; + }; diff --git a/drivers/devfreq/exynos/exynos4_bus.c b/drivers/devfreq/exynos/exynos4_bus.c index 7c5e940..e2514b7 100644 --- a/drivers/devfreq/exynos/exynos4_bus.c +++ b/drivers/devfreq/exynos/exynos4_bus.c @@ -16,16 +16,13 @@ */ #include -#include #include #include -#include #include #include #include #include -#include -#include +#include #include "exynos_ppmu.h" #include "exynos4_bus.h" @@ -895,6 +892,22 @@ unlock: return NOTIFY_DONE; } +#ifdef CONFIG_OF +static const struct of_device_id exynos4_busfreq_match[] = { + { + .compatible = "samsung,exynos4210-busfreq", + .data = (void *)TYPE_BUSF_EXYNOS4210, + }, + { + .compatible = "samsung,exynos4x12-busfreq", + .data = (void *)TYPE_BUSF_EXYNOS4x12, + }, +}; +MODULE_DEVICE_TABLE(of, exynos4_busfreq_match[]); +#else +#define exynos4_busfreq_match NULL +#endif + static int exynos4_busfreq_probe(struct platform_device *pdev) { struct busfreq_data *data; @@ -919,7 +932,13 @@ static int exynos4_busfreq_probe(struct platform_device *pdev) return -ENOMEM; } - data->type = pdev->id_entry->driver_data; + if (dev->of_node) { + const struct of_device_id *match; + match = of_match_node(exynos4_busfreq_match, dev->of_node); + data->type = (int) match->data; + } else { + data->type = pdev->id_entry->driver_data; + } /* Allocate MMIO region for PPMU SFRs */ for (i = 0; i < PPMU_END; i++) { @@ -1075,6 +1094,7 @@ static struct platform_driver exynos4_busfreq_driver = { .name = "exynos4-busfreq", .owner = THIS_MODULE, .pm = &exynos4_busfreq_pm_ops, + .of_match_table = of_match_ptr(exynos4_busfreq_match), }, };