From patchwork Mon Mar 5 14:30:50 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shawn Guo X-Patchwork-Id: 144687 Return-Path: X-Original-To: incoming-imx@patchwork.ozlabs.org Delivered-To: patchwork-incoming-imx@bilbo.ozlabs.org Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:4978:20e::2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 15843B6F9F for ; Tue, 6 Mar 2012 01:20:48 +1100 (EST) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1S4YjH-0008Ek-F6; Mon, 05 Mar 2012 14:17:35 +0000 Received: from mail-iy0-f177.google.com ([209.85.210.177]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1S4YjE-0008BQ-5I for linux-arm-kernel@lists.infradead.org; Mon, 05 Mar 2012 14:17:32 +0000 Received: by mail-iy0-f177.google.com with SMTP id y10so6679600iak.36 for ; Mon, 05 Mar 2012 06:17:32 -0800 (PST) Received-SPF: pass (google.com: domain of shawn.guo@linaro.org designates 10.50.89.137 as permitted sender) client-ip=10.50.89.137; Authentication-Results: mr.google.com; spf=pass (google.com: domain of shawn.guo@linaro.org designates 10.50.89.137 as permitted sender) smtp.mail=shawn.guo@linaro.org Received: from mr.google.com ([10.50.89.137]) by 10.50.89.137 with SMTP id bo9mr6987547igb.7.1330957052074 (num_hops = 1); Mon, 05 Mar 2012 06:17:32 -0800 (PST) MIME-Version: 1.0 Received: by 10.50.89.137 with SMTP id bo9mr5780164igb.7.1330957051987; Mon, 05 Mar 2012 06:17:31 -0800 (PST) Received: from localhost.localdomain ([114.219.82.3]) by mx.google.com with ESMTPS id df2sm18203398igb.0.2012.03.05.06.17.19 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 05 Mar 2012 06:17:31 -0800 (PST) From: Shawn Guo To: alsa-devel@alsa-project.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH v2 02/17] ASoC: imx: move phycore audmux call into ASoC machine driver Date: Mon, 5 Mar 2012 22:30:50 +0800 Message-Id: <1330957865-19085-3-git-send-email-shawn.guo@linaro.org> X-Mailer: git-send-email 1.7.5.4 In-Reply-To: <1330957865-19085-1-git-send-email-shawn.guo@linaro.org> References: <1330957865-19085-1-git-send-email-shawn.guo@linaro.org> X-Gm-Message-State: ALoCoQmRGRmqs0DHORe0efBHngtHBeVokqrglaNY4pTlQDNa51bdniWj3cJp3Z3CyZrNFur7JRkJ X-Spam-Note: CRM114 invocation failed X-Spam-Score: -2.6 (--) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-2.6 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [209.85.210.177 listed in list.dnswl.org] -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: Sascha Hauer , Mark Brown , Timur Tabi , Shawn Guo X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org List-Id: linux-imx-kernel.lists.patchwork.ozlabs.org It moves phycore audmux configuration call from board file into ASoC machine driver phycore-ac97 to ease converting audmux into a platform driver later. It moves phycore audmux configuration call from board file into ASoC machine driver phycore-ac97, so that it gets aligned with wm1133-ev1 and mx27vis-aic32x4, and more importantly it will ease the moving of audmux into sound/soc/imx as a platform driver later. Signed-off-by: Shawn Guo --- arch/arm/mach-imx/mach-pca100.c | 13 ------------- arch/arm/mach-imx/mach-pcm043.c | 13 ------------- sound/soc/imx/phycore-ac97.c | 26 +++++++++++++++++++++++++- 3 files changed, 25 insertions(+), 27 deletions(-) diff --git a/arch/arm/mach-imx/mach-pca100.c b/arch/arm/mach-imx/mach-pca100.c index d3b9c6b..541152e 100644 --- a/arch/arm/mach-imx/mach-pca100.c +++ b/arch/arm/mach-imx/mach-pca100.c @@ -36,7 +36,6 @@ #include #include #include -#include #include #include @@ -359,18 +358,6 @@ static void __init pca100_init(void) imx27_soc_init(); - /* SSI unit */ - mxc_audmux_v1_configure_port(MX27_AUDMUX_HPCR1_SSI0, - MXC_AUDMUX_V1_PCR_SYN | /* 4wire mode */ - MXC_AUDMUX_V1_PCR_TFCSEL(3) | - MXC_AUDMUX_V1_PCR_TCLKDIR | /* clock is output */ - MXC_AUDMUX_V1_PCR_RXDSEL(3)); - mxc_audmux_v1_configure_port(3, - MXC_AUDMUX_V1_PCR_SYN | /* 4wire mode */ - MXC_AUDMUX_V1_PCR_TFCSEL(0) | - MXC_AUDMUX_V1_PCR_TFSDIR | - MXC_AUDMUX_V1_PCR_RXDSEL(0)); - ret = mxc_gpio_setup_multiple_pins(pca100_pins, ARRAY_SIZE(pca100_pins), "PCA100"); if (ret) diff --git a/arch/arm/mach-imx/mach-pcm043.c b/arch/arm/mach-imx/mach-pcm043.c index 06dc106..237474f 100644 --- a/arch/arm/mach-imx/mach-pcm043.c +++ b/arch/arm/mach-imx/mach-pcm043.c @@ -37,7 +37,6 @@ #include #include #include -#include #include "devices-imx35.h" @@ -362,18 +361,6 @@ static void __init pcm043_init(void) mxc_iomux_v3_setup_multiple_pads(pcm043_pads, ARRAY_SIZE(pcm043_pads)); - mxc_audmux_v2_configure_port(3, - MXC_AUDMUX_V2_PTCR_SYN | /* 4wire mode */ - MXC_AUDMUX_V2_PTCR_TFSEL(0) | - MXC_AUDMUX_V2_PTCR_TFSDIR, - MXC_AUDMUX_V2_PDCR_RXDSEL(0)); - - mxc_audmux_v2_configure_port(0, - MXC_AUDMUX_V2_PTCR_SYN | /* 4wire mode */ - MXC_AUDMUX_V2_PTCR_TCSEL(3) | - MXC_AUDMUX_V2_PTCR_TCLKDIR, /* clock is output */ - MXC_AUDMUX_V2_PDCR_RXDSEL(3)); - imx35_add_fec(NULL); platform_add_devices(devices, ARRAY_SIZE(devices)); imx35_add_imx2_wdt(NULL); diff --git a/sound/soc/imx/phycore-ac97.c b/sound/soc/imx/phycore-ac97.c index 6ac1211..a59692e 100644 --- a/sound/soc/imx/phycore-ac97.c +++ b/sound/soc/imx/phycore-ac97.c @@ -18,6 +18,7 @@ #include #include #include +#include static struct snd_soc_card imx_phycore; @@ -50,9 +51,32 @@ static int __init imx_phycore_init(void) { int ret; - if (!machine_is_pcm043() && !machine_is_pca100()) + if (machine_is_pca100()) { + mxc_audmux_v1_configure_port(MX27_AUDMUX_HPCR1_SSI0, + MXC_AUDMUX_V1_PCR_SYN | /* 4wire mode */ + MXC_AUDMUX_V1_PCR_TFCSEL(3) | + MXC_AUDMUX_V1_PCR_TCLKDIR | /* clock is output */ + MXC_AUDMUX_V1_PCR_RXDSEL(3)); + mxc_audmux_v1_configure_port(3, + MXC_AUDMUX_V1_PCR_SYN | /* 4wire mode */ + MXC_AUDMUX_V1_PCR_TFCSEL(0) | + MXC_AUDMUX_V1_PCR_TFSDIR | + MXC_AUDMUX_V1_PCR_RXDSEL(0)); + } else if (machine_is_pcm043()) { + mxc_audmux_v2_configure_port(3, + MXC_AUDMUX_V2_PTCR_SYN | /* 4wire mode */ + MXC_AUDMUX_V2_PTCR_TFSEL(0) | + MXC_AUDMUX_V2_PTCR_TFSDIR, + MXC_AUDMUX_V2_PDCR_RXDSEL(0)); + mxc_audmux_v2_configure_port(0, + MXC_AUDMUX_V2_PTCR_SYN | /* 4wire mode */ + MXC_AUDMUX_V2_PTCR_TCSEL(3) | + MXC_AUDMUX_V2_PTCR_TCLKDIR, /* clock is output */ + MXC_AUDMUX_V2_PDCR_RXDSEL(3)); + } else { /* return happy. We might run on a totally different machine */ return 0; + } imx_phycore_snd_ac97_device = platform_device_alloc("soc-audio", -1); if (!imx_phycore_snd_ac97_device)