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: 10261 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 5870E23E56 for ; Thu, 26 Jul 2012 10:29:38 +0000 (UTC) Received: from mail-gg0-f180.google.com (mail-gg0-f180.google.com [209.85.161.180]) by fiordland.canonical.com (Postfix) with ESMTP id 217E5A18866 for ; Thu, 26 Jul 2012 10:29:38 +0000 (UTC) Received: by mail-gg0-f180.google.com with SMTP id f1so1772698ggn.11 for ; Thu, 26 Jul 2012 03:29:38 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf:from:to:cc :subject:date:message-id:x-mailer:in-reply-to:references :x-gm-message-state; bh=hSgI4B1xoCiD5zGbX+dlqd6stcLhjM1YAZZ2Mrr4uJ4=; b=mxm2cNqnRqSkKVqMcw1c6h39gShPKuxHAyTuwxeeg2RTCee91JqimFawA15pb3k/1c XFpHmRE2wIzolK7gdzjcqUSJWS1RxaO9vdTVDeswzVtSerLZNS4uOHbcyuLBNKEpVaxE 0Asp0s/6D5mtDp19pFw9V8PU3EKbREOsGTga3qpkzQafMbTrsVG2z/vYFdsf3exeNxtJ bpNV0sB8gt4jCdf+laeqlQGIc6UdqfOyb3m3zH3oiz5Rwl0BoGF1SemRverzM3LGO/SB rzbBuZz8Z4qWZXhbSuWoYN/IY5s683APc/D3ieOw73RnDx77vASejE6LuYjYOKIUPJqr ZvgQ== Received: by 10.50.159.135 with SMTP id xc7mr1181462igb.1.1343298577577; Thu, 26 Jul 2012 03:29:37 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.43.93.3 with SMTP id bs3csp133391icc; Thu, 26 Jul 2012 03:29:36 -0700 (PDT) Received: by 10.180.78.99 with SMTP id a3mr12272455wix.15.1343298575953; Thu, 26 Jul 2012 03:29:35 -0700 (PDT) Received: from mail-we0-f178.google.com (mail-we0-f178.google.com [74.125.82.178]) by mx.google.com with ESMTPS id ay5si9812996wib.22.2012.07.26.03.29.35 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 26 Jul 2012 03:29:35 -0700 (PDT) Received-SPF: neutral (google.com: 74.125.82.178 is neither permitted nor denied by best guess record for domain of lee.jones@linaro.org) client-ip=74.125.82.178; Authentication-Results: mx.google.com; spf=neutral (google.com: 74.125.82.178 is neither permitted nor denied by best guess record for domain of lee.jones@linaro.org) smtp.mail=lee.jones@linaro.org Received: by mail-we0-f178.google.com with SMTP id u7so1432929wey.37 for ; Thu, 26 Jul 2012 03:29:35 -0700 (PDT) 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 Cc: STEricsson_nomadik_linux@list.st.com, linus.walleij@stericsson.com, arnd@arndb.de, broonie@opensource.wolfsonmicro.com, sameo@linux.intel.com, olalilja@yahoo.se, ola.o.lilja@stericsson.com, alsa-devel@alsa-project.org, lrg@ti.com, Lee Jones 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: ALoCoQnMKakd2j6NK1OF2jm5tZRc5LiqE8z1/c2/oeAD6tLXUDy9V4scvNlK9I9u2Ydmd6Gg9y7D 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;