From patchwork Tue May 1 12:23:45 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mohammed Afzal X-Patchwork-Id: 156130 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:4978:20e::2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 4BA4DB6EE7 for ; Tue, 1 May 2012 23:31:38 +1000 (EST) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1SPD6B-0003un-9D; Tue, 01 May 2012 13:26:36 +0000 Received: from bear.ext.ti.com ([192.94.94.41]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1SPCNr-0001QS-0g; Tue, 01 May 2012 12:40:48 +0000 Received: from dlelxv30.itg.ti.com ([172.17.2.17]) by bear.ext.ti.com (8.13.7/8.13.7) with ESMTP id q41CeZET020421; Tue, 1 May 2012 07:40:35 -0500 Received: from DFLE70.ent.ti.com (dfle70.ent.ti.com [128.247.5.40]) by dlelxv30.itg.ti.com (8.13.8/8.13.8) with ESMTP id q41CeZed028686; Tue, 1 May 2012 07:40:35 -0500 Received: from dlelxv23.itg.ti.com (172.17.1.198) by dfle70.ent.ti.com (128.247.5.40) with Microsoft SMTP Server id 14.1.323.3; Tue, 1 May 2012 07:40:35 -0500 Received: from ucmsshproxy.india.ext.ti.com (dbdp20.itg.ti.com [172.24.170.38]) by dlelxv23.itg.ti.com (8.13.8/8.13.8) with SMTP id q41CeTwc013017; Tue, 1 May 2012 07:40:30 -0500 Received: from symphony.india.ext.ti.com (unknown [192.168.247.13]) by ucmsshproxy.india.ext.ti.com (Postfix) with ESMTP id CBA48158003; Tue, 1 May 2012 18:10:28 +0530 (IST) Received: from linux-psp-server.india.ext.ti.com (linux-psp-server [192.168.247.76]) by symphony.india.ext.ti.com (8.11.7p1+Sun/8.11.7) with ESMTP id q41CeSI18741; Tue, 1 May 2012 18:10:28 +0530 (IST) From: Afzal Mohammed To: , , , , , , , , , , , , , , , , Subject: [PATCH v4 37/39] ARM: OMAP2+: board zoom-debugboard: gpmc driver adaptation Date: Tue, 1 May 2012 17:53:45 +0530 Message-ID: <7c68bdb43ff3d41568f993609239487792399d82.1335874494.git.afzal@ti.com> X-Mailer: git-send-email 1.7.10 In-Reply-To: References: MIME-Version: 1.0 X-Spam-Note: CRM114 invocation failed X-Spam-Score: -4.2 (----) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-4.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at http://www.dnswl.org/, medium trust [192.94.94.41 listed in list.dnswl.org] -0.0 T_RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: Afzal Mohammed X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-mtd-bounces@lists.infradead.org Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org gpmc code has been converted to driver. Modify the board code to provide gpmc driver with required information. Signed-off-by: Afzal Mohammed --- arch/arm/mach-omap2/board-zoom-debugboard.c | 47 +++++++++++++++------------ 1 file changed, 27 insertions(+), 20 deletions(-) diff --git a/arch/arm/mach-omap2/board-zoom-debugboard.c b/arch/arm/mach-omap2/board-zoom-debugboard.c index f64f441..dae7df2 100644 --- a/arch/arm/mach-omap2/board-zoom-debugboard.c +++ b/arch/arm/mach-omap2/board-zoom-debugboard.c @@ -31,6 +31,13 @@ #define DEBUG_BASE 0x08000000 #define ZOOM_ETHR_START DEBUG_BASE +static struct gpmc_device_pdata *gpmc_device_data[2]; +static struct gpmc_device_pdata **gpmc_cur = gpmc_device_data; + +static struct gpmc_pdata gpmc_data = { + .device_pdata = gpmc_device_data, +}; + static struct omap_smsc911x_platform_data zoom_smsc911x_cfg = { .cs = ZOOM_SMSC911X_CS, .gpio_irq = ZOOM_SMSC911X_GPIO, @@ -40,7 +47,11 @@ static struct omap_smsc911x_platform_data zoom_smsc911x_cfg = { static inline void __init zoom_init_smsc911x(void) { - gpmc_smsc911x_init(&zoom_smsc911x_cfg); + *gpmc_cur = gpmc_smsc911x_init(&zoom_smsc911x_cfg); + if (*gpmc_cur) + gpmc_data.num_device++, gpmc_cur++; + else + pr_err("error: %s: gpmc smsc911x setup\n", __func__); } static struct plat_serial8250_port serial_platform_data[] = { @@ -56,18 +67,22 @@ static struct plat_serial8250_port serial_platform_data[] = { } }; -static struct platform_device zoom_debugboard_serial_device = { +static struct gpmc_cs_data zoom_debugboard_gpmc_cs_serial_data = { + .cs = ZOOM_QUADUART_CS, + .mem_size = SZ_1M, +}; + +static struct gpmc_device_pdata zoom_debugboard_gpmc_serial_data = { .name = "serial8250", .id = PLAT8250_DEV_PLATFORM, - .dev = { - .platform_data = serial_platform_data, - }, + .pdata = serial_platform_data, + .pdata_size = sizeof(serial_platform_data), + .cs_data = &zoom_debugboard_gpmc_cs_serial_data, + .num_cs = 1, }; static inline void __init zoom_init_quaduart(void) { - int quart_cs; - unsigned long cs_mem_base; int quart_gpio = 0; if (gpio_request_one(ZOOM_QUADUART_RST_GPIO, @@ -78,14 +93,6 @@ static inline void __init zoom_init_quaduart(void) return; } - quart_cs = ZOOM_QUADUART_CS; - - if (gpmc_cs_request(quart_cs, SZ_1M, &cs_mem_base) < 0) { - printk(KERN_ERR "Failed to request GPMC mem" - "for Quad UART(TL16CP754C)\n"); - return; - } - quart_gpio = ZOOM_QUADUART_GPIO; if (gpio_request_one(quart_gpio, GPIOF_IN, "TL16CP754C GPIO") < 0) @@ -93,6 +100,9 @@ static inline void __init zoom_init_quaduart(void) quart_gpio); serial_platform_data[0].irq = gpio_to_irq(102); + + *gpmc_cur++ = &zoom_debugboard_gpmc_serial_data; + gpmc_data.num_device++; } static inline int omap_zoom_debugboard_detect(void) @@ -116,10 +126,6 @@ static inline int omap_zoom_debugboard_detect(void) return ret; } -static struct platform_device *zoom_devices[] __initdata = { - &zoom_debugboard_serial_device, -}; - static struct regulator_consumer_supply dummy_supplies[] = { REGULATOR_SUPPLY("vddvario", "smsc911x.0"), REGULATOR_SUPPLY("vdd33a", "smsc911x.0"), @@ -133,5 +139,6 @@ int __init zoom_debugboard_init(void) regulator_register_fixed(0, dummy_supplies, ARRAY_SIZE(dummy_supplies)); zoom_init_smsc911x(); zoom_init_quaduart(); - return platform_add_devices(zoom_devices, ARRAY_SIZE(zoom_devices)); + omap_init_gpmc(&gpmc_data); + return 0; }