From patchwork Fri Oct 9 15:25:43 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sekhar Nori X-Patchwork-Id: 52749 Received: from bear.ext.ti.com (bear.ext.ti.com [192.94.94.41]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n99FSxFJ025725 for ; Fri, 9 Oct 2009 15:29:00 GMT Received: from dlep35.itg.ti.com ([157.170.170.118]) by bear.ext.ti.com (8.13.7/8.13.7) with ESMTP id n99FPr6Q030686 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 9 Oct 2009 10:25:54 -0500 Received: from linux.omap.com (localhost [127.0.0.1]) by dlep35.itg.ti.com (8.13.7/8.13.7) with ESMTP id n99FPqON005469; Fri, 9 Oct 2009 10:25:53 -0500 (CDT) Received: from linux.omap.com (localhost [127.0.0.1]) by linux.omap.com (Postfix) with ESMTP id 3B09780626; Fri, 9 Oct 2009 10:25:51 -0500 (CDT) X-Original-To: davinci-linux-open-source@linux.davincidsp.com Delivered-To: davinci-linux-open-source@linux.davincidsp.com Received: from dbdp31.itg.ti.com (dbdp31.itg.ti.com [172.24.170.98]) by linux.omap.com (Postfix) with ESMTP id 49D5480627 for ; Fri, 9 Oct 2009 10:25:47 -0500 (CDT) Received: from psplinux051.india.ti.com (localhost [127.0.0.1]) by dbdp31.itg.ti.com (8.13.8/8.13.8) with ESMTP id n99FPixX009916; Fri, 9 Oct 2009 20:55:45 +0530 (IST) Received: from psplinux051.india.ti.com (localhost [127.0.0.1]) by psplinux051.india.ti.com (8.13.1/8.13.1) with ESMTP id n99FPi93012146; Fri, 9 Oct 2009 20:55:44 +0530 Received: (from a0875516@localhost) by psplinux051.india.ti.com (8.13.1/8.13.1/Submit) id n99FPiBA012142; Fri, 9 Oct 2009 20:55:44 +0530 From: Sekhar Nori To: davinci-linux-open-source@linux.davincidsp.com Date: Fri, 9 Oct 2009 20:55:43 +0530 Message-Id: <1255101943-12092-2-git-send-email-nsekhar@ti.com> X-Mailer: git-send-email 1.6.2.4 In-Reply-To: <1255101943-12092-1-git-send-email-nsekhar@ti.com> References: <1255101943-12092-1-git-send-email-nsekhar@ti.com> Cc: Subject: [PATCH 2/2] davinci: DA830/OMAP-L137 EVM: remove ifdefs inside da830_evm_init() X-BeenThere: davinci-linux-open-source@linux.davincidsp.com X-Mailman-Version: 2.1.4 Precedence: list List-Id: davinci-linux-open-source.linux.davincidsp.com List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: davinci-linux-open-source-bounces@linux.davincidsp.com Errors-To: davinci-linux-open-source-bounces@linux.davincidsp.com diff --git a/arch/arm/mach-davinci/board-da830-evm.c b/arch/arm/mach-davinci/board-da830-evm.c index 95928f2..9ecda5e 100644 --- a/arch/arm/mach-davinci/board-da830-evm.c +++ b/arch/arm/mach-davinci/board-da830-evm.c @@ -276,6 +276,20 @@ static struct davinci_mmc_config da830_evm_mmc_config = { .version = MMC_CTLR_VERSION_2, }; +/* + * UI board NAND/NOR flashes only use 8-bit data bus. + */ +static const short da830_evm_emif25_pins[] = { + DA830_EMA_D_0, DA830_EMA_D_1, DA830_EMA_D_2, DA830_EMA_D_3, + DA830_EMA_D_4, DA830_EMA_D_5, DA830_EMA_D_6, DA830_EMA_D_7, + DA830_EMA_A_0, DA830_EMA_A_1, DA830_EMA_A_2, DA830_EMA_A_3, + DA830_EMA_A_4, DA830_EMA_A_5, DA830_EMA_A_6, DA830_EMA_A_7, + DA830_EMA_A_8, DA830_EMA_A_9, DA830_EMA_A_10, DA830_EMA_A_11, + DA830_EMA_A_12, DA830_EMA_BA_0, DA830_EMA_BA_1, DA830_NEMA_WE, + DA830_NEMA_CS_2, DA830_NEMA_CS_3, DA830_NEMA_OE, DA830_EMA_WAIT_0, + -1 +}; + #ifdef CONFIG_DA830_UI_NAND static struct mtd_partition da830_evm_nand_partitions[] = { /* bootloader (U-Boot, etc) in first sector */ @@ -366,21 +380,41 @@ static struct platform_device da830_evm_nand_device = { .num_resources = ARRAY_SIZE(da830_evm_nand_resources), .resource = da830_evm_nand_resources, }; + +static inline void da830_evm_init_nand(void) +{ + int ret; + + ret = da8xx_pinmux_setup(da830_evm_emif25_pins); + if (ret) + pr_warning("da830_evm_init: emif25 mux setup failed: %d\n", + ret); + + ret = platform_device_register(&da830_evm_nand_device); + if (ret) + pr_warning("da830_evm_init: NAND device not registered.\n"); +} +#else +static inline void da830_evm_init_nand(void) { } #endif -/* - * UI board NAND/NOR flashes only use 8-bit data bus. - */ -static const short da830_evm_emif25_pins[] = { - DA830_EMA_D_0, DA830_EMA_D_1, DA830_EMA_D_2, DA830_EMA_D_3, - DA830_EMA_D_4, DA830_EMA_D_5, DA830_EMA_D_6, DA830_EMA_D_7, - DA830_EMA_A_0, DA830_EMA_A_1, DA830_EMA_A_2, DA830_EMA_A_3, - DA830_EMA_A_4, DA830_EMA_A_5, DA830_EMA_A_6, DA830_EMA_A_7, - DA830_EMA_A_8, DA830_EMA_A_9, DA830_EMA_A_10, DA830_EMA_A_11, - DA830_EMA_A_12, DA830_EMA_BA_0, DA830_EMA_BA_1, DA830_NEMA_WE, - DA830_NEMA_CS_2, DA830_NEMA_CS_3, DA830_NEMA_OE, DA830_EMA_WAIT_0, - -1 -}; +#ifdef CONFIG_DA830_UI_LCD +static inline void da830_evm_init_lcdc(void) +{ + int ret; + + ret = da8xx_pinmux_setup(da830_lcdcntl_pins); + if (ret) + pr_warning("da830_evm_init: lcdcntl mux setup failed: %d\n", + ret); + + ret = da8xx_register_lcdc(&sharp_lcd035q3dg01_pdata); + if (ret) + pr_warning("da830_evm_init: lcd setup failed: %d\n", ret); +} +#else +static inline void da830_evm_init_lcdc(void) { } +#endif static __init void da830_evm_init(void) { @@ -444,27 +478,9 @@ static __init void da830_evm_init(void) pr_warning("da830_evm_init: mmc/sd registration failed: %d\n", ret); -#ifdef CONFIG_DA830_UI -#ifdef CONFIG_DA830_UI_LCD - ret = da8xx_pinmux_setup(da830_lcdcntl_pins); - if (ret) - pr_warning("da830_evm_init: lcdcntl mux setup failed: %d\n", - ret); - - ret = da8xx_register_lcdc(&sharp_lcd035q3dg01_pdata); - if (ret) - pr_warning("da830_evm_init: lcd setup failed: %d\n", ret); -#else /* Must be NAND or NOR */ - ret = da8xx_pinmux_setup(da830_evm_emif25_pins); - if (ret) - pr_warning("da830_evm_init: emif25 mux setup failed: %d\n", - ret); + da830_evm_init_lcdc(); - ret = platform_device_register(&da830_evm_nand_device); - if (ret) - pr_warning("da830_evm_init: NAND device not registered.\n"); -#endif -#endif + da830_evm_init_nand(); ret = da8xx_register_rtc(); if (ret)