From patchwork Fri Feb 8 09:05:58 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: ??? X-Patchwork-Id: 2115151 Return-Path: X-Original-To: patchwork-linux-samsung-soc@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 9297CDF264 for ; Fri, 8 Feb 2013 09:06:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1946132Ab3BHJGH (ORCPT ); Fri, 8 Feb 2013 04:06:07 -0500 Received: from mailout4.samsung.com ([203.254.224.34]:62053 "EHLO mailout4.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1946045Ab3BHJGB (ORCPT ); Fri, 8 Feb 2013 04:06:01 -0500 Received: from epcpsbgm1.samsung.com (epcpsbgm1 [203.254.230.26]) by mailout4.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0MHW00G1097RCK10@mailout4.samsung.com> for linux-samsung-soc@vger.kernel.org; Fri, 08 Feb 2013 18:06:00 +0900 (KST) Received: from epcpsbgm1.samsung.com ( [203.254.230.49]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id E1.B8.03918.8FFB4115; Fri, 08 Feb 2013 18:06:00 +0900 (KST) X-AuditID: cbfee61a-b7f7d6d000000f4e-8a-5114bff8e551 Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id 31.B8.03918.8FFB4115; Fri, 08 Feb 2013 18:06:00 +0900 (KST) Received: from DOSANGSU4UP02 ([12.23.118.226]) by mmp1.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0MHW004ZC99ZPM30@mmp1.samsung.com> for linux-samsung-soc@vger.kernel.org; Fri, 08 Feb 2013 18:06:00 +0900 (KST) From: Sangsu Park To: linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org Cc: ben-linux@fluff.org, Kukjin Kim , sbkim73@samsung.com, Tushar Behera , Sachin Kamat , Padma Venkat Subject: [PATCH V3] ARM: EXYNOS: Add clocks for EXYNOS I2S and PCM I/F Date: Fri, 08 Feb 2013 18:05:58 +0900 Message-id: <011201ce05db$82ae97e0$880bc7a0$@samsung.com> MIME-version: 1.0 Content-type: text/plain; charset=us-ascii Content-transfer-encoding: 7bit X-Mailer: Microsoft Outlook 14.0 Thread-index: Ac4F23zHhJrzTMZhRLSTGnw13S7UOg== Content-language: ko X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrGIsWRmVeSWpSXmKPExsVy+t8zQ90f+0UCDbZ/F7SYcX4fkwOjx+dN cgGMUVw2Kak5mWWpRfp2CVwZf15NZC04KV7xrXc9YwPjbeEuRk4OCQETiRM/rrFD2GISF+6t Z+ti5OIQEljGKDFjzW4mmKKera8YIRKLGCVurW5khXCWMElMmv8crIpNQFfiwLo5LF2MHBwi At4Sy68pgtQwC5xilDi2cCYrSI2wgJvEl8VzmEFqWARUJU6d5wYJ8wpYSsz4d5wJwhaU+DH5 HguIzSygJbF+J0ScWUBeYvOat8wQBylI7Dj7mhHEFhHQk1gydQcbRI2IxL4X78AOlRDoZ5d4 d/wuWIJFQEDi2+RDYLdJCMhKbDoANUdS4uCKGywTGMVmIVk9C8nqWUhWz0KyYgEjyypG0dSC 5ILipPRcQ73ixNzi0rx0veT83E2MkFiR2sG4ssHiEKMAB6MSD6/GWeFAIdbEsuLK3EOMEhzM SiK8zLtEAoV4UxIrq1KL8uOLSnNSiw8xJgMdO5FZSjQ5HxjHeSXxhsbGJmYmpibmlqbmpqQJ K4nzMp56EiAkkJ5YkpqdmlqQWgSzhYmDU6qBcW/Bn2+Fzr5BZ1brbH3gv1PFyeevdD2j7g99 y/nzLm2PvLJszoFaI9V2i9TZz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ected Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org Audio Subsystem has own clocks for I2S0 and PCM0 in all EXYNOS series. This patch add clocks for I2S0 and PCM0 I/F. Signed-off-by: Sangsu Park --- arch/arm/mach-exynos/Makefile | 1 + arch/arm/mach-exynos/clock-audss.c | 68 ++++++++++++++++++++++++++++++++++++ 2 files changed, 69 insertions(+), 0 deletions(-) create mode 100644 arch/arm/mach-exynos/clock-audss.c diff --git a/arch/arm/mach-exynos/Makefile b/arch/arm/mach-exynos/Makefile index 7e53a3a..5b6c7c0 100644 --- a/arch/arm/mach-exynos/Makefile +++ b/arch/arm/mach-exynos/Makefile @@ -13,6 +13,7 @@ obj- := # Core obj-$(CONFIG_ARCH_EXYNOS) += common.o +obj-$(CONFIG_ARCH_EXYNOS) += clock-audss.o obj-$(CONFIG_ARCH_EXYNOS4) += clock-exynos4.o obj-$(CONFIG_CPU_EXYNOS4210) += clock-exynos4210.o obj-$(CONFIG_SOC_EXYNOS4212) += clock-exynos4212.o diff --git a/arch/arm/mach-exynos/clock-audss.c b/arch/arm/mach-exynos/clock-audss.c new file mode 100644 index 0000000..31d01c3 --- /dev/null +++ b/arch/arm/mach-exynos/clock-audss.c @@ -0,0 +1,68 @@ +/* + * Copyright (c) 2013 Samsung Electronics Co., Ltd. + * http://www.samsung.com + * + * Clock support for EXYNOS Audio Subsystem + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + */ + +#include +#include +#include + +#include +#include + +#define EXYNOS_PA_AUDSS (0x03810000) + +/* IP Clock Gate 0 Registers */ +#define EXYNOS_AUDSS_CLKGATE_I2SBUS (1<<2) +#define EXYNOS_AUDSS_CLKGATE_I2SSPECIAL (1<<3) +#define EXYNOS_AUDSS_CLKGATE_PCMBUS (1<<4) +#define EXYNOS_AUDSS_CLKGATE_PCMSPECIAL (1<<5) +#define EXYNOS_AUDSS_CLKGATE_GPIO (1<<6) + +static void __iomem *clk_audss_base; + +static int exynos_clk_audss_ctrl(struct clk *clk, int enable) +{ + if (!clk_audss_base) + return -ENOMEM; + + return s5p_gatectrl(clk_audss_base, clk, enable); +} + +static struct clk exynos_init_audss_clocks[] = { + { + .name = "iis", + .devname = "samsung-i2s.0", + .enable = exynos_clk_audss_ctrl, + .ctrlbit = EXYNOS_AUDSS_CLKGATE_I2SSPECIAL + | EXYNOS_AUDSS_CLKGATE_I2SBUS + | EXYNOS_AUDSS_CLKGATE_GPIO, + }, { + .name = "pcm", + .devname = "samsung-pcm.0", + .enable = exynos_clk_audss_ctrl, + .ctrlbit = EXYNOS_AUDSS_CLKGATE_PCMSPECIAL + | EXYNOS_AUDSS_CLKGATE_PCMBUS + | EXYNOS_AUDSS_CLKGATE_GPIO, + }, +}; + +void __init exynos_register_audss_clocks(void) +{ + clk_audss_base = ioremap(EXYNOS_PA_AUDSS, SZ_4K); + if (clk_audss_base == NULL) { + pr_err("unable to ioremap for audss base\n"); + return; + } + + s3c_register_clocks(exynos_init_audss_clocks, + ARRAY_SIZE(exynos_init_audss_clocks)); + s3c_disable_clocks(exynos_init_audss_clocks, + ARRAY_SIZE(exynos_init_audss_clocks)); +}