From patchwork Wed Sep 16 01:05:10 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Mark A. Greer" X-Patchwork-Id: 47792 Received: from comal.ext.ti.com (comal.ext.ti.com [198.47.26.152]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n8G17F3w026411 for ; Wed, 16 Sep 2009 01:07:15 GMT Received: from dlep33.itg.ti.com ([157.170.170.112]) by comal.ext.ti.com (8.13.7/8.13.7) with ESMTP id n8G15IOu016217; Tue, 15 Sep 2009 20:05:18 -0500 Received: from linux.omap.com (localhost [127.0.0.1]) by dlep33.itg.ti.com (8.13.7/8.13.7) with ESMTP id n8G15IZj004603; Tue, 15 Sep 2009 20:05:18 -0500 (CDT) Received: from linux.omap.com (localhost [127.0.0.1]) by linux.omap.com (Postfix) with ESMTP id 8AE1180627; Tue, 15 Sep 2009 20:05:18 -0500 (CDT) X-Original-To: Davinci-linux-open-source@linux.davincidsp.com Delivered-To: Davinci-linux-open-source@linux.davincidsp.com Received: from dflp52.itg.ti.com (dflp52.itg.ti.com [128.247.22.96]) by linux.omap.com (Postfix) with ESMTP id 5F01780627 for ; Tue, 15 Sep 2009 20:05:16 -0500 (CDT) Received: from medina.ext.ti.com (localhost [127.0.0.1]) by dflp52.itg.ti.com (8.13.7/8.13.7) with ESMTP id n8G15Gr9001042 for ; Tue, 15 Sep 2009 20:05:16 -0500 (CDT) Received: from mail92-va3-R.bigfish.com (mail-va3.bigfish.com [216.32.180.112]) by medina.ext.ti.com (8.13.7/8.13.7) with ESMTP id n8G15FbV013211 for ; Tue, 15 Sep 2009 20:05:16 -0500 Received: from mail92-va3 (localhost.localdomain [127.0.0.1]) by mail92-va3-R.bigfish.com (Postfix) with ESMTP id D4557518533 for ; Wed, 16 Sep 2009 01:05:15 +0000 (UTC) X-SpamScore: 7 X-BigFish: vps7(zza4b1ozz1202hzzz2dh6bh62h) X-Spam-TCS-SCL: 1:0 X-FB-SS: 5, X-MS-Exchange-Organization-Antispam-Report: OrigIP: 63.81.120.158; Service: EHS Received: by mail92-va3 (MessageSwitch) id 1253063113280399_17273; Wed, 16 Sep 2009 01:05:13 +0000 (UCT) Received: from gateway-1237.mvista.com (gateway-1237.mvista.com [63.81.120.158]) by mail92-va3.bigfish.com (Postfix) with ESMTP id 19A055C805A for ; Wed, 16 Sep 2009 01:05:13 +0000 (UTC) Received: from mag.az.mvista.com (mag.az.mvista.com [10.50.1.99]) by hermes.mvista.com (Postfix) with ESMTP id C124C1B753 for ; Tue, 15 Sep 2009 18:05:11 -0700 (PDT) Received: from mgreer by mag.az.mvista.com with local (Exim 4.69) (envelope-from ) id 1MnixK-0008Lp-QA for Davinci-linux-open-source@linux.davincidsp.com; Tue, 15 Sep 2009 18:05:10 -0700 Date: Tue, 15 Sep 2009 18:05:10 -0700 From: "Mark A. Greer" To: Davinci List Message-ID: <20090916010510.GB32052@mag.az.mvista.com> References: <20090916010034.GA31954@mag.az.mvista.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20090916010034.GA31954@mag.az.mvista.com> User-Agent: Mutt/1.5.17+20080114 (2008-01-14) Cc: Subject: [PATCH 3/4] davinci: Add LCD Graphics support for DA830/OMAP-L137 EVM 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 From: Mark A. Greer Add graphics support for the Sharp LCD035Q3DG01 graphical LCD that's on the User Interface (UI) daughter card of the DA830/OMAP-L137 EVM. The LCD shares EMIFA lines with the NAND and NOR devices that are also on the UI card so those lines are shared via a couple of muxes. The muxes are controlled by the 'MUX_MODE' line on the UI card. The 'MUX_MODE' line is controlled by pin P6 of a pcf8574 i2c expander that's at i2c address 0x3f on UI card. The i2c expander is controlled using the gpio infrastructure from the board code using the 'setup()' and 'teardown()' routines. Signed-off-by: Mark A. Greer --- arch/arm/mach-davinci/Kconfig | 21 ++++++++++++++ arch/arm/mach-davinci/board-da830-evm.c | 44 ++++++++++++++++++++++++++++++- arch/arm/mach-davinci/da830.c | 2 +- 3 files changed, 65 insertions(+), 2 deletions(-) diff --git a/arch/arm/mach-davinci/Kconfig b/arch/arm/mach-davinci/Kconfig index 40866c6..7b6dddf 100644 --- a/arch/arm/mach-davinci/Kconfig +++ b/arch/arm/mach-davinci/Kconfig @@ -101,6 +101,27 @@ config MACH_DAVINCI_DA830_EVM help Say Y here to select the TI DA830/OMAP-L137 Evaluation Module. +config DA830_UI + bool "DA830/OMAP-L137 UI (User Interface) board support" + depends on MACH_DAVINCI_DA830_EVM + help + Say Y here if you have the DA830/OMAP-L137 UI + (User Interface) board installed and you want to + enable the peripherals located on User Interface + board. + +choice + prompt "Select DA830/OMAP-L137 UI board peripheral" + depends on DA830_UI + +config DA830_UI_LCD + bool "LCD" + help + Say Y here to use the LCD as a framebuffer or simple character + display. + +endchoice + config MACH_DAVINCI_DA850_EVM bool "TI DA850/OMAP-L138 Reference Platform" default ARCH_DAVINCI_DA850 diff --git a/arch/arm/mach-davinci/board-da830-evm.c b/arch/arm/mach-davinci/board-da830-evm.c index 69a791a..dfc4897 100644 --- a/arch/arm/mach-davinci/board-da830-evm.c +++ b/arch/arm/mach-davinci/board-da830-evm.c @@ -13,7 +13,9 @@ #include #include #include +#include #include +#include #include #include @@ -38,6 +40,31 @@ static struct at24_platform_data da830_evm_i2c_eeprom_info = { .context = (void *)0x7f00, }; +static int da830_evm_ui_expander_setup(struct i2c_client *client, int gpio, + unsigned ngpio, void *context) +{ + gpio_request(gpio + 6, "MUX_MODE"); +#ifdef CONFIG_DA830_UI_LCD + gpio_direction_output(gpio + 6, 0); +#else /* Must be NAND or NOR */ + gpio_direction_output(gpio + 6, 1); +#endif + return 0; +} + +static int da830_evm_ui_expander_teardown(struct i2c_client *client, int gpio, + unsigned ngpio, void *context) +{ + gpio_free(gpio + 6); + return 0; +} + +static struct pcf857x_platform_data da830_evm_ui_expander_info = { + .gpio_base = DAVINCI_N_GPIO, + .setup = da830_evm_ui_expander_setup, + .teardown = da830_evm_ui_expander_teardown, +}; + static struct i2c_board_info __initdata da830_evm_i2c_devices[] = { { I2C_BOARD_INFO("24c256", 0x50), @@ -45,7 +72,11 @@ static struct i2c_board_info __initdata da830_evm_i2c_devices[] = { }, { I2C_BOARD_INFO("tlv320aic3x", 0x18), - } + }, + { + I2C_BOARD_INFO("pcf8574", 0x3f), + .platform_data = &da830_evm_ui_expander_info, + }, }; static struct davinci_i2c_platform_data da830_evm_i2c_0_pdata = { @@ -175,6 +206,17 @@ static __init void da830_evm_init(void) if (ret) pr_warning("da830_evm_init: mmc/sd registration failed: %d\n", ret); + +#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); +#endif } #ifdef CONFIG_SERIAL_8250_CONSOLE diff --git a/arch/arm/mach-davinci/da830.c b/arch/arm/mach-davinci/da830.c index f52174a..f0b2f96 100644 --- a/arch/arm/mach-davinci/da830.c +++ b/arch/arm/mach-davinci/da830.c @@ -411,7 +411,7 @@ static struct davinci_clk da830_clks[] = { CLK(NULL, "pwm2", &pwm2_clk), CLK("eqep.0", NULL, &eqep0_clk), CLK("eqep.1", NULL, &eqep1_clk), - CLK("da830_lcdc", NULL, &lcdc_clk), + CLK("da8xx_lcdc.0", NULL, &lcdc_clk), CLK("davinci-mcasp.0", NULL, &mcasp0_clk), CLK("davinci-mcasp.1", NULL, &mcasp1_clk), CLK("davinci-mcasp.2", NULL, &mcasp2_clk),