From patchwork Mon Jul 13 21:45:57 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin Hilman X-Patchwork-Id: 35483 Received: from bear.ext.ti.com (bear.ext.ti.com [192.94.94.41]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n6DLmCZL007497 for ; Mon, 13 Jul 2009 21:48:12 GMT Received: from dlep33.itg.ti.com ([157.170.170.112]) by bear.ext.ti.com (8.13.7/8.13.7) with ESMTP id n6DLkCe1008622; Mon, 13 Jul 2009 16:46:17 -0500 Received: from linux.omap.com (localhost [127.0.0.1]) by dlep33.itg.ti.com (8.13.7/8.13.7) with ESMTP id n6DLkBbs018358; Mon, 13 Jul 2009 16:46:11 -0500 (CDT) Received: from linux.omap.com (localhost [127.0.0.1]) by linux.omap.com (Postfix) with ESMTP id 9F5E880627; Mon, 13 Jul 2009 16:46:10 -0500 (CDT) X-Original-To: davinci-linux-open-source@linux.davincidsp.com Delivered-To: davinci-linux-open-source@linux.davincidsp.com Received: from dflp52.itg.ti.com (dflp52.itg.ti.com [128.247.22.96]) by linux.omap.com (Postfix) with ESMTP id F157380626 for ; Mon, 13 Jul 2009 16:46:08 -0500 (CDT) Received: from medina.ext.ti.com (localhost [127.0.0.1]) by dflp52.itg.ti.com (8.13.7/8.13.7) with ESMTP id n6DLk8PZ020121 for ; Mon, 13 Jul 2009 16:46:08 -0500 (CDT) Received: from mail120-tx2-R.bigfish.com (mail-tx2.bigfish.com [65.55.88.113]) by medina.ext.ti.com (8.13.7/8.13.7) with ESMTP id n6DLk3jW001141 for ; Mon, 13 Jul 2009 16:46:08 -0500 Received: from mail120-tx2 (localhost.localdomain [127.0.0.1]) by mail120-tx2-R.bigfish.com (Postfix) with ESMTP id 95F36DF8312 for ; Mon, 13 Jul 2009 21:46:03 +0000 (UTC) X-SpamScore: 0 X-BigFish: vps0(zzzz1202hzzz2dh62h) X-Spam-TCS-SCL: 1:0 X-MS-Exchange-Organization-Antispam-Report: OrigIP: 209.85.200.173; Service: EHS Received: by mail120-tx2 (MessageSwitch) id 1247521560569731_1742; Mon, 13 Jul 2009 21:46:00 +0000 (UCT) Received: from wf-out-1314.google.com (wf-out-1314.google.com [209.85.200.173]) by mail120-tx2.bigfish.com (Postfix) with ESMTP id 45C80620051 for ; Mon, 13 Jul 2009 21:46:00 +0000 (UTC) Received: by wf-out-1314.google.com with SMTP id 28so905831wff.31 for ; Mon, 13 Jul 2009 14:45:59 -0700 (PDT) Received: by 10.142.173.6 with SMTP id v6mr1405083wfe.233.1247521559705; Mon, 13 Jul 2009 14:45:59 -0700 (PDT) Received: from localhost (deeprooted.net [216.254.16.51]) by mx.google.com with ESMTPS id 29sm2107555wfg.19.2009.07.13.14.45.58 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 13 Jul 2009 14:45:59 -0700 (PDT) From: Kevin Hilman To: davinci-linux-open-source@linux.davincidsp.com Date: Mon, 13 Jul 2009 14:45:57 -0700 Message-Id: <1247521557-21010-1-git-send-email-khilman@deeprootsystems.com> X-Mailer: git-send-email 1.6.3.3 Cc: Mark Brown Subject: [PATCH] davinci: ASoC: pass clock instead of clock name X-BeenThere: davinci-linux-open-source@linux.davincidsp.com X-Mailman-Version: 2.1.4 Precedence: list List-Id: davinci-linux-open-source.linux.davincidsp.com List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: davinci-linux-open-source-bounces@linux.davincidsp.com Errors-To: davinci-linux-open-source-bounces@linux.davincidsp.com Clock name strings should not be passed along to drivers. Rather, let platform code get the correct clock for the platform, and pass it along to ASoC via platform data. Signed-off-by: Kevin Hilman --- Applies to current DaVinci git. arch/arm/mach-davinci/board-dm355-evm.c | 9 +++++---- arch/arm/mach-davinci/board-dm644x-evm.c | 9 +++++---- arch/arm/mach-davinci/board-dm646x-evm.c | 12 ++++++++---- arch/arm/mach-davinci/include/mach/asp.h | 2 +- 4 files changed, 19 insertions(+), 13 deletions(-) diff --git a/arch/arm/mach-davinci/board-dm355-evm.c b/arch/arm/mach-davinci/board-dm355-evm.c index 78a9604..cd87f89 100644 --- a/arch/arm/mach-davinci/board-dm355-evm.c +++ b/arch/arm/mach-davinci/board-dm355-evm.c @@ -118,9 +118,7 @@ static struct davinci_i2c_platform_data i2c_pdata = { .bus_delay = 0 /* usec */, }; -static struct snd_platform_data dm355_evm_snd_data = { - .clk_name = "asp1", -}; +static struct snd_platform_data dm355_evm_snd_data; static int dm355evm_mmc_gpios = -EINVAL; @@ -286,7 +284,10 @@ static __init void dm355_evm_init(void) ARRAY_SIZE(dm355_evm_spi_info)); /* DM335 EVM uses ASP1; line-out is a stereo mini-jack */ - dm355_init_asp1(ASP1_TX_EVT_EN | ASP1_RX_EVT_EN, &dm355_evm_snd_data); + dm355_evm_snd_data.clk = clk_get(NULL, "asp1"); + if (!WARN_ON(!dm355_evm_snd_data.clk)) + dm355_init_asp1(ASP1_TX_EVT_EN | ASP1_RX_EVT_EN, + &dm355_evm_snd_data); } static __init void dm355_evm_irq_init(void) diff --git a/arch/arm/mach-davinci/board-dm644x-evm.c b/arch/arm/mach-davinci/board-dm644x-evm.c index 30b2fd4..611583b 100644 --- a/arch/arm/mach-davinci/board-dm644x-evm.c +++ b/arch/arm/mach-davinci/board-dm644x-evm.c @@ -226,9 +226,7 @@ static struct platform_device ide_dev = { }, }; -static struct snd_platform_data dm644x_evm_snd_data = { - .clk_name = "asp0", -}; +static struct snd_platform_data dm644x_evm_snd_data; /*----------------------------------------------------------------------*/ @@ -671,7 +669,10 @@ static __init void davinci_evm_init(void) davinci_setup_mmc(0, &dm6446evm_mmc_config); davinci_serial_init(&uart_config); - dm644x_init_asp(&dm644x_evm_snd_data); + + dm644x_evm_snd_data.clk = clk_get(NULL, "asp0"); + if (!WARN_ON(!dm644x_evm_snd_data.clk)) + dm644x_init_asp(&dm644x_evm_snd_data); soc_info->emac_pdata->phy_mask = DM644X_EVM_PHY_MASK; soc_info->emac_pdata->mdio_max_freq = DM644X_EVM_MDIO_FREQUENCY; diff --git a/arch/arm/mach-davinci/board-dm646x-evm.c b/arch/arm/mach-davinci/board-dm646x-evm.c index 575c6ca..4e4091e 100644 --- a/arch/arm/mach-davinci/board-dm646x-evm.c +++ b/arch/arm/mach-davinci/board-dm646x-evm.c @@ -33,6 +33,7 @@ #include #include #include +#include #include #include @@ -217,7 +218,6 @@ static u8 dm646x_dit_serializer_direction[] = { static struct snd_platform_data dm646x_evm_snd_data[] = { { - .clk_name = "mcasp0", .tx_dma_offset = 0x400, .rx_dma_offset = 0x400, .op_mode = DAVINCI_MCASP_IIS_MODE, @@ -227,7 +227,6 @@ static struct snd_platform_data dm646x_evm_snd_data[] = { .eventq_no = EVENTQ_0, }, { - .clk_name = "mcasp1", .tx_dma_offset = 0x400, .rx_dma_offset = 0, .op_mode = DAVINCI_MCASP_DIT_MODE, @@ -271,8 +270,13 @@ static __init void evm_init(void) evm_init_i2c(); davinci_serial_init(&uart_config); - dm646x_init_mcasp0(&dm646x_evm_snd_data[0]); - dm646x_init_mcasp1(&dm646x_evm_snd_data[1]); + + dm646x_evm_snd_data[0].clk = clk_get(NULL, "mcasp0"); + if (!WARN_ON(!dm646x_evm_snd_data[0].clk)) + dm646x_init_mcasp0(&dm646x_evm_snd_data[0]); + dm646x_evm_snd_data[1].clk = clk_get(NULL, "mcasp1"); + if (!WARN_ON(!dm646x_evm_snd_data[1].clk)) + dm646x_init_mcasp1(&dm646x_evm_snd_data[1]); soc_info->emac_pdata->phy_mask = DM646X_EVM_PHY_MASK; soc_info->emac_pdata->mdio_max_freq = DM646X_EVM_MDIO_FREQUENCY; diff --git a/arch/arm/mach-davinci/include/mach/asp.h b/arch/arm/mach-davinci/include/mach/asp.h index 038ecb7..2df4ecb 100644 --- a/arch/arm/mach-davinci/include/mach/asp.h +++ b/arch/arm/mach-davinci/include/mach/asp.h @@ -33,7 +33,7 @@ #define DAVINCI_ASP1_TX_INT IRQ_MBXINT struct snd_platform_data { - char *clk_name; + struct clk *clk; u32 tx_dma_offset; u32 rx_dma_offset; enum dma_event_q eventq_no; /* event queue number */