From patchwork Wed Feb 6 05:21:02 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: ??? X-Patchwork-Id: 2101701 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 1D555DFE82 for ; Wed, 6 Feb 2013 05:21:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751319Ab3BFFVF (ORCPT ); Wed, 6 Feb 2013 00:21:05 -0500 Received: from mailout2.samsung.com ([203.254.224.25]:61816 "EHLO mailout2.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751317Ab3BFFVE (ORCPT ); Wed, 6 Feb 2013 00:21:04 -0500 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 <0MHS00MYJ9J03EI0@mailout2.samsung.com> for linux-samsung-soc@vger.kernel.org; Wed, 06 Feb 2013 14:21:02 +0900 (KST) Received: from epcpsbgm1.samsung.com ( [203.254.230.47]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id 1E.22.03918.E38E1115; Wed, 06 Feb 2013 14:21:02 +0900 (KST) X-AuditID: cbfee61a-b7f7d6d000000f4e-97-5111e83ee634 Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id 9D.22.03918.E38E1115; Wed, 06 Feb 2013 14:21:02 +0900 (KST) Received: from DOSANGSU4UP02 ([12.23.118.226]) by mmp2.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0MHS00GWI9J2VZ80@mmp2.samsung.com> for linux-samsung-soc@vger.kernel.org; Wed, 06 Feb 2013 14:21:02 +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 Subject: [RESEND][PATCH] ARM: EXYNOS: Add clocks for EXYNOS I2S and PCM I/F Date: Wed, 06 Feb 2013 14:21:02 +0900 Message-id: <003201ce0429$c15e8350$441b89f0$@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: Ac4EKZ19LI4ykezqT267HBZCA5KQ2Q== Content-language: ko X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrKIsWRmVeSWpSXmKPExsVy+t8zfV27F4KBButbjS1mnN/H5MDo8XmT XABjFJdNSmpOZllqkb5dAldGf9NUxoLN4hV7e10aGG8KdzFyckgImEi8ndnAAmGLSVy4t56t i5GLQ0hgGaPEzhVdzDBFbcvXMkIkpjNKHF/Uww7hLGGS+PDnMStIFZuArsSBdXOARnFwiAh4 Syy/pggSZhaokeiY08UIYgsDhafO3MMEYrMIqEqcvPUNbAGvgKXE3b1NLBC2oMSPyfdYIHq1 JNbvPM4EYctLbF7zFuogBYkdZ1+DzRQR0JPoPn6eGaJGRGLfi3dgh0oINLNLXN38ng1imYDE t8mHwG6TEJCV2HQAao6kxMEVN1gmMIrNQrJ6FpLVs5CsnoVkxQJGllWMoqkFyQXFSem5hnrF ibnFpXnpesn5uZsYIZEitYNxZYPFIUYBDkYlHt4beoKBQqyJZcWVuYcYJTiYlUR4FbYBhXhT EiurUovy44tKc1KLDzEmAx07kVlKNDkfGMV5JfGGxsYmZiamJuaWpuampAkrifMynnoSICSQ nliSmp2aWpBaBLOFiYNTqoHRblJB2bfHS3w88y86dLk/mvt3z/Wq+Wdyl1VODr0puEtw/n9x oT1Kza7iJneb3dh8nwQx/Io9ckzE61qDerZHcMHupA3vDnOLbCoJqrvG8LG7ZsWpVFa/qcFh LziPHVxqorBPxf+6YFb3s+yKgIi7ejcTb6oYdrqqymuv2rbo341nbZaV62WVWIozEg21mIuK EwHvM3vh2AIAAA== X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrCIsWRmVeSWpSXmKPExsVy+t9jQV27F4KBBo8+6FrMOL+PyYHR4/Mm uQDGqAZGm4zUxJTUIoXUvOT8lMy8dFsl7+B453hTMwNDXUNLC3MlhbzE3FRbJRefAF23zByg qUoKZYk5pUChgMTiYiV9O0wTQkPcdC1gGiN0fUOC4HqMDNBAwjrGjP6mqYwFm8Ur9va6NDDe FO5i5OSQEDCRaFu+lhHCFpO4cG89WxcjF4eQwHRGieOLetghnCVMEh/+PGYFqWIT0JU4sG4O SxcjB4eIgLfE8muKIGFmgRqJjjldYIOEgcJTZ+5hArFZBFQlTt76xgxi8wpYStzd28QCYQtK /Jh8jwWiV0ti/c7jTBC2vMTmNW+ZIQ5SkNhx9jXYTBEBPYnu4+eZIWpEJPa9eMc4gVFgFpJR s5CMmoVk1CwkLQsYWVYxiqYWJBcUJ6XnGuoVJ+YWl+al6yXn525iBMfhM6kdjCsbLA4xCnAw KvHw3tATDBRiTSwrrsw9xCjBwawkwquwDSjEm5JYWZValB9fVJqTWnyIMRno04nMUqLJ+cAU kVcSb2hsYmZkaWRmYWRibk6asJI4L+OpJwFCAumJJanZqakFqUUwW5g4OKUaGNmr79/dPN0h 6kCSz/MzsQrzDeZfvaD7w5xdReJC1y8edeUrwktZblXbnq3zSr/soxu6IWZL1QTdtXsfLZxY 8bMmfMO+jsgpYtEBOWtapy7s2F4bd8j+gh2LvyqP37w5WlcPX6v6meSsdax6sdXjGGPR2bvC XC+tlVMxtXV3KDna63tFYAbfASWW4oxEQy3mouJEAK+Ee6MHAwAA DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected 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 | 64 ++++++++++++++++++++++++++++++++++++ 2 files changed, 65 insertions(+), 0 deletions(-) create mode 100644 arch/arm/mach-exynos/clock-audss.c ARRAY_SIZE(exynos_init_audss_clocks)); + s3c_disable_clocks(exynos_init_audss_clocks, ARRAY_SIZE(exynos_init_audss_clocks)); +} 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..8260185 --- /dev/null +++ b/arch/arm/mach-exynos/clock-audss.c @@ -0,0 +1,64 @@ +/* + * 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 = 0; + +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 gpio_base1\n"); + return; + } + + s3c_register_clocks(exynos_init_audss_clocks,