From patchwork Wed Jul 4 03:43:19 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Barry Song X-Patchwork-Id: 1153901 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 DFBA5DFF0F for ; Wed, 4 Jul 2012 03:49:48 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1SmGWN-0006eg-GL; Wed, 04 Jul 2012 03:44:55 +0000 Received: from cluster-g.mailcontrol.com ([208.87.233.190]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1SmGVw-0006eR-U8 for linux-arm-kernel@lists.infradead.org; Wed, 04 Jul 2012 03:44:52 +0000 Received: from rly18g.srv.mailcontrol.com (localhost.localdomain [127.0.0.1]) by rly18g.srv.mailcontrol.com (MailControl) with ESMTP id q643iJCI018766 for ; Wed, 4 Jul 2012 04:44:21 +0100 Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by rly18g.srv.mailcontrol.com (MailControl) id q643hhol015975 for ; Wed, 4 Jul 2012 04:43:43 +0100 Received: from banasiexc01.ASIA.ROOT.PRI ([202.80.51.114]) by rly18g-eth0.srv.mailcontrol.com (envelope-sender ) (MIMEDefang) with ESMTP id q643hdcO015710 (TLS bits=128 verify=FAIL); Wed, 04 Jul 2012 04:43:43 +0100 (BST) Received: from SHAASIEXC01.ASIA.ROOT.PRI (10.125.12.84) by banasiexc01.ASIA.ROOT.PRI (10.190.12.21) with Microsoft SMTP Server (TLS) id 14.1.289.1; Wed, 4 Jul 2012 09:13:38 +0530 Received: from localhost.localdomain (10.125.36.195) by asimail.csr.com (10.125.12.88) with Microsoft SMTP Server (TLS) id 14.1.289.1; Wed, 4 Jul 2012 12:43:36 +0900 From: Barry Song To: , Subject: [PATCH 1/2] ARM: PRIMA2: add of_dev_auxdata table for I2C, SPI, UART and PINCTRL Date: Wed, 4 Jul 2012 11:43:19 +0800 Message-ID: <1341373400-15763-1-git-send-email-Barry.Song@csr.com> X-Mailer: git-send-email 1.7.1 MIME-Version: 1.0 X-Originating-IP: [10.125.36.195] X-Scanned-By: MailControl 7.7.2 (www.mailcontrol.com) on 10.71.1.128 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 [208.87.233.190 listed in list.dnswl.org] -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: workgroup.linux@csr.com, linux-arm-kernel@lists.infradead.org, Barry Song 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: , Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org From: Barry Song This patch adds lookup table for attaching a specific name and platform_data pointer to devices like i2c, spi, uart and pinctrl as they get created by of_platform_populate(). Ideally this table would not exist. Signed-off-by: Barry Song --- arch/arm/mach-prima2/prima2.c | 20 +++++++++++++++++++- 1 files changed, 19 insertions(+), 1 deletions(-) diff --git a/arch/arm/mach-prima2/prima2.c b/arch/arm/mach-prima2/prima2.c index 8f0429d..82f5c0d 100644 --- a/arch/arm/mach-prima2/prima2.c +++ b/arch/arm/mach-prima2/prima2.c @@ -13,8 +13,26 @@ #include #include #include +#include #include "common.h" +/* + * Lookup table for attaching a specific name and platform_data pointer to + * devices as they get created by of_platform_populate(). Ideally this table + * would not exist. + */ +struct of_dev_auxdata prima2_auxdata_lookup[] __initdata = { + OF_DEV_AUXDATA("sirf,prima2-uart", 0xb0050000, "uart0", NULL), + OF_DEV_AUXDATA("sirf,prima2-uart", 0xb0060000, "uart1", NULL), + OF_DEV_AUXDATA("sirf,prima2-uart", 0xb0070000, "uart2", NULL), + OF_DEV_AUXDATA("sirf,prima2-spi", 0xb00d0000, "spi0", NULL), + OF_DEV_AUXDATA("sirf,prima2-spi", 0xb0170000, "spi1", NULL), + OF_DEV_AUXDATA("sirf,prima2-i2c", 0xb00e0000, "i2c0", NULL), + OF_DEV_AUXDATA("sirf,prima2-i2c", 0xb00f0000, "i2c1", NULL), + OF_DEV_AUXDATA("sirf,prima2-gpio-pinmux", 0xb0120000, "pinctrl0", NULL), + {}, +}; + static struct of_device_id sirfsoc_of_bus_ids[] __initdata = { { .compatible = "simple-bus", }, {}, @@ -22,7 +40,7 @@ static struct of_device_id sirfsoc_of_bus_ids[] __initdata = { void __init sirfsoc_mach_init(void) { - of_platform_bus_probe(NULL, sirfsoc_of_bus_ids, NULL); + of_platform_populate(NULL, sirfsoc_of_bus_ids, prima2_auxdata_lookup, NULL); } void __init sirfsoc_init_late(void)