From patchwork Thu Jul 26 10:28:45 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 1241511 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork2.kernel.org (Postfix) with ESMTP id 33F3DDFFBF for ; Thu, 26 Jul 2012 10:51:47 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1SuLad-0002yM-EV; Thu, 26 Jul 2012 10:46:45 +0000 Received: from mail-we0-f177.google.com ([74.125.82.177]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1SuLKH-0008HC-B8 for linux-arm-kernel@lists.infradead.org; Thu, 26 Jul 2012 10:30:00 +0000 Received: by weyr3 with SMTP id r3so1339630wey.36 for ; Thu, 26 Jul 2012 03:29:35 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references :x-gm-message-state; bh=hSgI4B1xoCiD5zGbX+dlqd6stcLhjM1YAZZ2Mrr4uJ4=; b=fej40xyhHvor8JFx9bipN29GvDRChKpFtDIuW6hpHKqMStt5pC5Gqu0/CFiNqf0PNx LXthe9iiY+dNGOTTAoe9JzupSTWDMwV7zIYyuk/96u1SvvUIMX1bPbpbisC2zC+kHhRP ucOZTWAk7Uh+Myi4x8+MuWeVa/90XAckBfmGJndWtKJ6SHhWjwSJeFfwa/BTR1+Tfeqf GLDjXZRXyMin+JyyFHwV5DbQiOgupbcxYCwWbH6AxxnzjmvWzMyM4OwEgYb8j0tFYU5P uSoVJaNIu1X2jLw4a5yLiz2tFbR3/Phr0HuwuSzd+WhZfOlQtI23eKESbVl4VG37R6/N XZog== Received: by 10.216.3.85 with SMTP id 63mr9707458weg.134.1343298571446; Thu, 26 Jul 2012 03:29:31 -0700 (PDT) Received: from localhost.localdomain (cpc1-aztw13-0-0-cust473.18-1.cable.virginmedia.com. [77.102.241.218]) by mx.google.com with ESMTPS id fb20sm11559455wid.1.2012.07.26.03.29.30 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 26 Jul 2012 03:29:30 -0700 (PDT) From: Lee Jones To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 12/21] ARM: ux500: Fork MSP platform registration for step-by-step DT enablement Date: Thu, 26 Jul 2012 11:28:45 +0100 Message-Id: <1343298534-13611-13-git-send-email-lee.jones@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1343298534-13611-1-git-send-email-lee.jones@linaro.org> References: <1343298534-13611-1-git-send-email-lee.jones@linaro.org> X-Gm-Message-State: ALoCoQl7Y4G2nJoNezmcCaYsDr7ej+jLepht9tC7lqTlohNg8QhmiZYkuFUfj51HBn0c6GnLziRh 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 [74.125.82.177 listed in list.dnswl.org] -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: ola.o.lilja@stericsson.com, alsa-devel@alsa-project.org, linus.walleij@stericsson.com, arnd@arndb.de, broonie@opensource.wolfsonmicro.com, olalilja@yahoo.se, STEricsson_nomadik_linux@list.st.com, Lee Jones , lrg@ti.com, sameo@linux.intel.com X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org We've done this before and it worked well last time. Here we're duplicating a complex registration function to ease the process of enabling it for Device Tree. As there are quite a few steps taken during the registration process, it makes sense to break them up into more manageable chunks. This patch will aid us. Signed-off-by: Lee Jones --- arch/arm/mach-ux500/board-mop500-msp.c | 42 ++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/arch/arm/mach-ux500/board-mop500-msp.c b/arch/arm/mach-ux500/board-mop500-msp.c index 217df1d..d0bd030 100644 --- a/arch/arm/mach-ux500/board-mop500-msp.c +++ b/arch/arm/mach-ux500/board-mop500-msp.c @@ -223,6 +223,48 @@ static struct msp_i2s_platform_data msp3_platform_data = { .msp_i2s_exit = msp13_i2s_exit, }; +/* Due for removal once the MSP driver has been fully DT:ed. */ +void mop500_of_msp_init(struct device *parent) +{ + struct platform_device *msp1; + + pr_info("%s: Register platform-device 'snd-soc-u8500'.\n", __func__); + platform_device_register(&snd_soc_mop500); + + pr_info("Initialize MSP I2S-devices.\n"); + db8500_add_msp_i2s(parent, 0, U8500_MSP0_BASE, IRQ_DB8500_MSP0, + &msp0_platform_data); + msp1 = db8500_add_msp_i2s(parent, 1, U8500_MSP1_BASE, IRQ_DB8500_MSP1, + &msp1_platform_data); + db8500_add_msp_i2s(parent, 2, U8500_MSP2_BASE, IRQ_DB8500_MSP2, + &msp2_platform_data); + db8500_add_msp_i2s(parent, 3, U8500_MSP3_BASE, IRQ_DB8500_MSP1, + &msp3_platform_data); + + /* Get the pinctrl handle for MSP1 */ + if (msp1) { + msp1_p = pinctrl_get(&msp1->dev); + if (IS_ERR(msp1_p)) + dev_err(&msp1->dev, "could not get MSP1 pinctrl\n"); + else { + msp1_def = pinctrl_lookup_state(msp1_p, + PINCTRL_STATE_DEFAULT); + if (IS_ERR(msp1_def)) { + dev_err(&msp1->dev, + "could not get MSP1 defstate\n"); + } + msp1_sleep = pinctrl_lookup_state(msp1_p, + PINCTRL_STATE_SLEEP); + if (IS_ERR(msp1_sleep)) + dev_err(&msp1->dev, + "could not get MSP1 idlestate\n"); + } + } + + pr_info("%s: Register platform-device 'ux500-pcm'\n", __func__); + platform_device_register(&ux500_pcm); +} + void mop500_msp_init(struct device *parent) { struct platform_device *msp1;