From patchwork Fri Jul 1 08:52:29 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jarkko Nikula X-Patchwork-Id: 934952 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.4) with ESMTP id p618r7Z2016025 for ; Fri, 1 Jul 2011 08:53:07 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755731Ab1GAIxF (ORCPT ); Fri, 1 Jul 2011 04:53:05 -0400 Received: from mail-bw0-f46.google.com ([209.85.214.46]:58452 "EHLO mail-bw0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755721Ab1GAIxD (ORCPT ); Fri, 1 Jul 2011 04:53:03 -0400 Received: by mail-bw0-f46.google.com with SMTP id 5so2453487bwd.19 for ; Fri, 01 Jul 2011 01:53:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; bh=oFiIaR4VuAdTbtF0STU8yjhpzxSdz2ERcqtLoNLSiz4=; b=IlamEjtHpjs9QkJaJssMRAmRb78tCYLtKawBBcYDA4OezmvMwv3G8l0NwvOapY2YE7 aTxCOzohvJYSjSVg0A35SOJDCfMeSgByrJbC3V40KQidz12gVNP1rMQM5G5Mjx4Z3cSc YOdSm6cqMqth3YAOK3yQqjLMKEKfoRfkGCgQ8= Received: by 10.204.9.197 with SMTP id m5mr3035655bkm.38.1309510383020; Fri, 01 Jul 2011 01:53:03 -0700 (PDT) Received: from localhost (host-94-101-4-66.igua.fi [94.101.4.66]) by mx.google.com with ESMTPS id af13sm2809198bkc.19.2011.07.01.01.53.02 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 01 Jul 2011 01:53:02 -0700 (PDT) From: Jarkko Nikula To: linux-omap@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org, Janusz Krzysztofik , Peter Ujfalusi , Jarkko Nikula Subject: [RFC 05/12] omap: mcbsp: Move out omap_mcbsp_register_board_cfg from plat-omap/devices.c Date: Fri, 1 Jul 2011 11:52:29 +0300 Message-Id: <1309510356-27147-6-git-send-email-jhnikula@gmail.com> X-Mailer: git-send-email 1.7.0.4 In-Reply-To: <1309510356-27147-1-git-send-email-jhnikula@gmail.com> References: <1309510356-27147-1-git-send-email-jhnikula@gmail.com> Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Fri, 01 Jul 2011 08:53:07 +0000 (UTC) Only OMAP1s are using omap_mcbsp_register_board_cfg after OMAP2+ hwmod conversion so it can be moved to mach-omap1/mcbsp.c. Signed-off-by: Jarkko Nikula --- arch/arm/mach-omap1/mcbsp.c | 32 +++++++++++++++++++++ arch/arm/plat-omap/devices.c | 46 ------------------------------- arch/arm/plat-omap/include/plat/mcbsp.h | 2 - 3 files changed, 32 insertions(+), 48 deletions(-) diff --git a/arch/arm/mach-omap1/mcbsp.c b/arch/arm/mach-omap1/mcbsp.c index ab7395d..3c985ac 100644 --- a/arch/arm/mach-omap1/mcbsp.c +++ b/arch/arm/mach-omap1/mcbsp.c @@ -31,6 +31,7 @@ static int dsp_use; static struct clk *api_clk; static struct clk *dsp_clk; +static struct platform_device **omap_mcbsp_devices; static void omap1_mcbsp_request(unsigned int id) { @@ -369,6 +370,37 @@ static struct omap_mcbsp_platform_data omap16xx_mcbsp_pdata[] = { #define OMAP16XX_MCBSP_COUNT 0 #endif +static void omap_mcbsp_register_board_cfg(struct resource *res, int res_count, + struct omap_mcbsp_platform_data *config, int size) +{ + int i; + + omap_mcbsp_devices = kzalloc(size * sizeof(struct platform_device *), + GFP_KERNEL); + if (!omap_mcbsp_devices) { + printk(KERN_ERR "Could not register McBSP devices\n"); + return; + } + + for (i = 0; i < size; i++) { + struct platform_device *new_mcbsp; + int ret; + + new_mcbsp = platform_device_alloc("omap-mcbsp", i + 1); + if (!new_mcbsp) + continue; + platform_device_add_resources(new_mcbsp, &res[i * res_count], + res_count); + new_mcbsp->dev.platform_data = &config[i]; + ret = platform_device_add(new_mcbsp); + if (ret) { + platform_device_put(new_mcbsp); + continue; + } + omap_mcbsp_devices[i] = new_mcbsp; + } +} + static int __init omap1_mcbsp_init(void) { if (!cpu_class_is_omap1()) diff --git a/arch/arm/plat-omap/devices.c b/arch/arm/plat-omap/devices.c index ea28f98..bd9a06b 100644 --- a/arch/arm/plat-omap/devices.c +++ b/arch/arm/plat-omap/devices.c @@ -26,54 +26,8 @@ #include #include #include -#include #include -/*-------------------------------------------------------------------------*/ - -#if defined(CONFIG_OMAP_MCBSP) || defined(CONFIG_OMAP_MCBSP_MODULE) - -static struct platform_device **omap_mcbsp_devices; - -void omap_mcbsp_register_board_cfg(struct resource *res, int res_count, - struct omap_mcbsp_platform_data *config, int size) -{ - int i; - - omap_mcbsp_devices = kzalloc(size * sizeof(struct platform_device *), - GFP_KERNEL); - if (!omap_mcbsp_devices) { - printk(KERN_ERR "Could not register McBSP devices\n"); - return; - } - - for (i = 0; i < size; i++) { - struct platform_device *new_mcbsp; - int ret; - - new_mcbsp = platform_device_alloc("omap-mcbsp", i + 1); - if (!new_mcbsp) - continue; - platform_device_add_resources(new_mcbsp, &res[i * res_count], - res_count); - new_mcbsp->dev.platform_data = &config[i]; - ret = platform_device_add(new_mcbsp); - if (ret) { - platform_device_put(new_mcbsp); - continue; - } - omap_mcbsp_devices[i] = new_mcbsp; - } -} - -#else -void omap_mcbsp_register_board_cfg(struct resource *res, int res_count, - struct omap_mcbsp_platform_data *config, int size) -{ } -#endif - -/*-------------------------------------------------------------------------*/ - #if defined(CONFIG_SND_OMAP_SOC_MCPDM) || \ defined(CONFIG_SND_OMAP_SOC_MCPDM_MODULE) diff --git a/arch/arm/plat-omap/include/plat/mcbsp.h b/arch/arm/plat-omap/include/plat/mcbsp.h index 6db02b3..2202457 100644 --- a/arch/arm/plat-omap/include/plat/mcbsp.h +++ b/arch/arm/plat-omap/include/plat/mcbsp.h @@ -376,8 +376,6 @@ extern int omap_mcbsp_count, omap_mcbsp_cache_size; #define id_to_mcbsp_ptr(id) mcbsp_ptr[id]; int omap_mcbsp_init(void); -void omap_mcbsp_register_board_cfg(struct resource *res, int res_count, - struct omap_mcbsp_platform_data *config, int size); void omap_mcbsp_config(unsigned int id, const struct omap_mcbsp_reg_cfg * config); #ifdef CONFIG_ARCH_OMAP3 void omap_mcbsp_set_tx_threshold(unsigned int id, u16 threshold);