From patchwork Thu Sep 27 10:28:23 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Padmavathi Venna X-Patchwork-Id: 1512801 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork1.kernel.org (Postfix) with ESMTP id 088603FC71 for ; Thu, 27 Sep 2012 10:27:19 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1THBGj-0002t6-NC; Thu, 27 Sep 2012 10:24:34 +0000 Received: from mailout2.samsung.com ([203.254.224.25]) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1THBG1-0002ZA-I8 for linux-arm-kernel@lists.infradead.org; Thu, 27 Sep 2012 10:23:51 +0000 Received: from epcpsbgm1.samsung.com (epcpsbgm1 [203.254.230.26]) by mailout2.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0MB00011I7JL9KD0@mailout2.samsung.com> for linux-arm-kernel@lists.infradead.org; Thu, 27 Sep 2012 19:23:48 +0900 (KST) Received: from epcpsbgm1.samsung.com ( [172.20.52.123]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id 24.03.03783.43924605; Thu, 27 Sep 2012 19:23:48 +0900 (KST) X-AuditID: cbfee61a-b7f726d000000ec7-86-506429349814 Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id A3.03.03783.43924605; Thu, 27 Sep 2012 19:23:48 +0900 (KST) Received: from padma-linuxpc.sisodomain.com ([107.108.83.35]) by mmp2.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0MB000LQ47J9RS40@mmp2.samsung.com> for linux-arm-kernel@lists.infradead.org; Thu, 27 Sep 2012 19:23:48 +0900 (KST) From: Padmavathi Venna To: linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org Subject: [PATCH 2/5] ARM: S5PC100: Add I2S clkdev support Date: Thu, 27 Sep 2012 15:58:23 +0530 Message-id: <1348741706-29497-3-git-send-email-padma.v@samsung.com> X-Mailer: git-send-email 1.7.4.4 In-reply-to: <1348741706-29497-1-git-send-email-padma.v@samsung.com> References: <1348741706-29497-1-git-send-email-padma.v@samsung.com> DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrFLMWRmVeSWpSXmKPExsWyRsSkWtdEMyXAoHuPksWmx9dYHRg9Ni+p D2CM4rJJSc3JLEst0rdL4MrYsusIW8Ff2YpdjzYyNTB+Fu9i5OSQEDCRWNK7gAXCFpO4cG89 WxcjF4eQwFJGid5t+5lgis7N/Q9WJCQwnVGiuzsLomgrk8SXlfdYuxg5ONgEdCRazrqAmCIC 3hLLrymClDALtDNKrH98nxGkV1jAUuLm62XsIDaLgKrE3wtfWUFsXgFniZOfHrFC7FKQODYV Is4p4CIx6+NdVoi9zhK7H55ghegVkPg2+RALyC4JAVmJTQeYQXZJCFxmk+hoWcQMMUdS4uCK GywTGIUXMDKsYhRNLUguKE5KzzXUK07MLS7NS9dLzs/dxAgMwNP/nkntYFzZYHGIUYCDUYmH N8A9OUCINbGsuDL3EKMEB7OSCG+UakqAEG9KYmVValF+fFFpTmrxIUYfoEsmMkuJJucDoyOv JN7Q2MTc1NjU0sjIzNQUh7CSOK/wp8AAIYH0xJLU7NTUgtQimHFMHJxSDYy8Eirum/TX8+ye u49psvisMNfECap3Fio8bnI/GdZa9uC39dqSM8Xl2o2fFsTdrhHWZTpx/4Fb9gqT23Xl665N uX8vK8VrS8yvo2JHX7OefxxpOmHLA3/xOXt2H3GsPLng3G/WvFfLPGcqRrhOXqV69yTDNd62 JeKbz9jsFgwxSOKx6H2qyZGnxFKckWioxVxUnAgAAWOXnG0CAAA= X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFupkkeLIzCtJLcpLzFFi42I5/e+xoK6JZkqAwe1vYhabHl9jdWD02Lyk PoAxqoHRJiM1MSW1SCE1Lzk/JTMv3VbJOzjeOd7UzMBQ19DSwlxJIS8xN9VWycUnQNctMwdo qpJCWWJOKVAoILG4WEnfDtOE0BA3XQuYxghd35AguB4jAzSQsIYxY8uuI2wFf2Urdj3ayNTA +Fm8i5GTQ0LAROLc3P8sELaYxIV769lAbCGB6YwS3d1ZXYxcQPZWJokvK++xdjFycLAJ6Ei0 nHUBMUUEvCWWX1MEKWEWaGeUWP/4PiNIr7CApcTN18vYQWwWAVWJvxe+soLYvALOEic/PWKF 2KUgcWwqRJxTwEVi1se7rBB7nSV2PzzBOoGRdwEjwypG0dSC5ILipPRcQ73ixNzi0rx0veT8 3E2M4PB+JrWDcWWDxSFGAQ5GJR7eAPfkACHWxLLiytxDjBIczEoivFGqKQFCvCmJlVWpRfnx RaU5qcWHGH2ArprILCWanA+MvbySeENjE3NTY1NLEwsTM0scwkrivMKfAgOEBNITS1KzU1ML UotgxjFxcEo1MFbMvq5h0SaxRoSzvlxhq6Bof6GDeJX9rtpTbTFnr79z+ZIYnBqZO8umWjRM dkld6uRPd/o1bNc9v5npZ51l5Prnh33n4dkbMgs2/N2Y9bnVwtBq4y/Rya9YUwPb0jb3qd5q +ySppMdbYuX0uMjnjGb5D51ZNc+qb1esdl8iNG9u7dmtsxoblFiKMxINtZiLihMBD8CpApwC AAA= X-CFilter-Loop: Reflected X-Spam-Note: CRM114 invocation failed X-Spam-Score: -7.7 (-------) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-7.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -5.0 RCVD_IN_DNSWL_HI RBL: Sender listed at http://www.dnswl.org/, high trust [203.254.224.25 listed in list.dnswl.org] -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.8 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: kgene.kim@samsung.com, padma.v@samsung.com, sbkim73@samsung.com, sangsu4u.park@samsung.com, ben-linux@fluff.org, olofj@google.com X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org I2S controller has an internal mux for RCLK source clk. The list of source clk names were passed through platform data in non-dt case. Register the existing RCLK source clocks with clkdev using generic connection id. This is required as part of adding DT support for I2S controller driver. Signed-off-by: Padmavathi Venna --- arch/arm/mach-s5pc100/clock.c | 48 +++++++++++++++++++++++-------------- arch/arm/mach-s5pc100/dev-audio.c | 16 ------------ 2 files changed, 30 insertions(+), 34 deletions(-) diff --git a/arch/arm/mach-s5pc100/clock.c b/arch/arm/mach-s5pc100/clock.c index 9262197..a206dc3 100644 --- a/arch/arm/mach-s5pc100/clock.c +++ b/arch/arm/mach-s5pc100/clock.c @@ -606,24 +606,6 @@ static struct clk init_clocks_off[] = { .enable = s5pc100_d1_4_ctrl, .ctrlbit = (1 << 13), }, { - .name = "iis", - .devname = "samsung-i2s.0", - .parent = &clk_div_pclkd1.clk, - .enable = s5pc100_d1_5_ctrl, - .ctrlbit = (1 << 0), - }, { - .name = "iis", - .devname = "samsung-i2s.1", - .parent = &clk_div_pclkd1.clk, - .enable = s5pc100_d1_5_ctrl, - .ctrlbit = (1 << 1), - }, { - .name = "iis", - .devname = "samsung-i2s.2", - .parent = &clk_div_pclkd1.clk, - .enable = s5pc100_d1_5_ctrl, - .ctrlbit = (1 << 2), - }, { .name = "ac97", .parent = &clk_div_pclkd1.clk, .enable = s5pc100_d1_5_ctrl, @@ -724,6 +706,30 @@ static struct clk clk_48m_spi2 = { .ctrlbit = (1 << 9), }; +static struct clk clk_i2s0 = { + .name = "iis", + .devname = "samsung-i2s.0", + .parent = &clk_div_pclkd1.clk, + .enable = s5pc100_d1_5_ctrl, + .ctrlbit = (1 << 0), +}; + +static struct clk clk_i2s1 = { + .name = "iis", + .devname = "samsung-i2s.1", + .parent = &clk_div_pclkd1.clk, + .enable = s5pc100_d1_5_ctrl, + .ctrlbit = (1 << 1), +}; + +static struct clk clk_i2s2 = { + .name = "iis", + .devname = "samsung-i2s.2", + .parent = &clk_div_pclkd1.clk, + .enable = s5pc100_d1_5_ctrl, + .ctrlbit = (1 << 2), +}; + static struct clk clk_vclk54m = { .name = "vclk_54m", .rate = 54000000, @@ -1154,6 +1160,9 @@ static struct clk *clk_cdev[] = { &clk_48m_spi0, &clk_48m_spi1, &clk_48m_spi2, + &clk_i2s0, + &clk_i2s1, + &clk_i2s2, }; static struct clksrc_clk *clksrc_cdev[] = { @@ -1321,6 +1330,9 @@ static struct clk_lookup s5pc100_clk_lookup[] = { CLKDEV_INIT("s5pc100-spi.1", "spi_busclk2", &clk_sclk_spi1.clk), CLKDEV_INIT("s5pc100-spi.2", "spi_busclk1", &clk_48m_spi2), CLKDEV_INIT("s5pc100-spi.2", "spi_busclk2", &clk_sclk_spi2.clk), + CLKDEV_INIT("samsung-i2s.0", "i2s_opclk0", &clk_i2s0), + CLKDEV_INIT("samsung-i2s.1", "i2s_opclk0", &clk_i2s1), + CLKDEV_INIT("samsung-i2s.2", "i2s_opclk0", &clk_i2s2), }; void __init s5pc100_register_clocks(void) diff --git a/arch/arm/mach-s5pc100/dev-audio.c b/arch/arm/mach-s5pc100/dev-audio.c index 9d4bde3..9e90bb4 100644 --- a/arch/arm/mach-s5pc100/dev-audio.c +++ b/arch/arm/mach-s5pc100/dev-audio.c @@ -39,18 +39,12 @@ static int s5pc100_cfg_i2s(struct platform_device *pdev) return 0; } -static const char *rclksrc_v5[] = { - [0] = "iis", - [1] = "i2sclkd2", -}; - static struct s3c_audio_pdata i2sv5_pdata = { .cfg_gpio = s5pc100_cfg_i2s, .type = { .i2s = { .quirks = QUIRK_PRI_6CHAN | QUIRK_SEC_DAI | QUIRK_NEED_RSTCLR, - .src_clk = rclksrc_v5, }, }, }; @@ -72,18 +66,8 @@ struct platform_device s5pc100_device_iis0 = { }, }; -static const char *rclksrc_v3[] = { - [0] = "iis", - [1] = "sclk_audio", -}; - static struct s3c_audio_pdata i2sv3_pdata = { .cfg_gpio = s5pc100_cfg_i2s, - .type = { - .i2s = { - .src_clk = rclksrc_v3, - }, - }, }; static struct resource s5pc100_iis1_resource[] = {