From patchwork Fri Oct 16 19:09:22 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin Hilman X-Patchwork-Id: 54367 Received: from devils.ext.ti.com (devils.ext.ti.com [198.47.26.153]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n9GJFAF3012285 for ; Fri, 16 Oct 2009 19:15:10 GMT Received: from dlep33.itg.ti.com ([157.170.170.112]) by devils.ext.ti.com (8.13.7/8.13.7) with ESMTP id n9GJFAYX016662 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Fri, 16 Oct 2009 14:15:10 -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 n9GJF9oZ020136 for ; Fri, 16 Oct 2009 14:15:10 -0500 (CDT) Received: from linux.omap.com (localhost [127.0.0.1]) by linux.omap.com (Postfix) with ESMTP id 146D680743 for ; Fri, 16 Oct 2009 14:14:54 -0500 (CDT) X-Original-To: davinci-linux-open-source@linux.davincidsp.com Delivered-To: davinci-linux-open-source@linux.davincidsp.com Received: from dflp51.itg.ti.com (dflp51.itg.ti.com [128.247.22.94]) by linux.omap.com (Postfix) with ESMTP id 7442D80664 for ; Fri, 16 Oct 2009 14:11:52 -0500 (CDT) Received: from white.ext.ti.com (localhost [127.0.0.1]) by dflp51.itg.ti.com (8.13.7/8.13.7) with ESMTP id n9GJBp21013600 for ; Fri, 16 Oct 2009 14:11:51 -0500 (CDT) Received: from mail56-tx2-R.bigfish.com (mail-tx2.bigfish.com [65.55.88.112]) by white.ext.ti.com (8.13.7/8.13.7) with ESMTP id n9GJBonU030462 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL) for ; Fri, 16 Oct 2009 14:11:51 -0500 Received: from mail56-tx2 (localhost.localdomain [127.0.0.1]) by mail56-tx2-R.bigfish.com (Postfix) with ESMTP id 4843BAF857F for ; Fri, 16 Oct 2009 19:11:50 +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: 74.125.78.147; Service: EHS Received: by mail56-tx2 (MessageSwitch) id 1255720301841558_16749; Fri, 16 Oct 2009 19:11:41 +0000 (UCT) Received: from TX2EHSMHS007.bigfish.com (unknown [10.9.14.235]) by mail56-tx2.bigfish.com (Postfix) with ESMTP id 1411213A0061 for ; Fri, 16 Oct 2009 19:11:41 +0000 (UTC) Received: from ey-out-1920.google.com (74.125.78.147) by TX2EHSMHS007.bigfish.com (10.9.99.107) with Microsoft SMTP Server id 14.0.482.32; Fri, 16 Oct 2009 19:11:39 +0000 Received: by ey-out-1920.google.com with SMTP id 3so488924eyh.30 for ; Fri, 16 Oct 2009 12:11:37 -0700 (PDT) Received: by 10.216.89.11 with SMTP id b11mr678032wef.171.1255720297537; Fri, 16 Oct 2009 12:11:37 -0700 (PDT) Received: from localhost ([216.254.16.51]) by mx.google.com with ESMTPS id p10sm3118523gvf.29.2009.10.16.12.11.35 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 16 Oct 2009 12:11:36 -0700 (PDT) From: Kevin Hilman To: linux-arm-kernel@lists.infradead.org Date: Fri, 16 Oct 2009 12:09:22 -0700 Message-ID: <1255720190-7452-20-git-send-email-khilman@deeprootsystems.com> X-Mailer: git-send-email 1.6.4.3 In-Reply-To: <1255720190-7452-19-git-send-email-khilman@deeprootsystems.com> References: <1255720190-7452-1-git-send-email-khilman@deeprootsystems.com> <1255720190-7452-2-git-send-email-khilman@deeprootsystems.com> <1255720190-7452-3-git-send-email-khilman@deeprootsystems.com> <1255720190-7452-4-git-send-email-khilman@deeprootsystems.com> <1255720190-7452-5-git-send-email-khilman@deeprootsystems.com> <1255720190-7452-6-git-send-email-khilman@deeprootsystems.com> <1255720190-7452-7-git-send-email-khilman@deeprootsystems.com> <1255720190-7452-8-git-send-email-khilman@deeprootsystems.com> <1255720190-7452-9-git-send-email-khilman@deeprootsystems.com> <1255720190-7452-10-git-send-email-khilman@deeprootsystems.com> <1255720190-7452-11-git-send-email-khilman@deeprootsystems.com> <1255720190-7452-12-git-send-email-khilman@deeprootsystems.com> <1255720190-7452-13-git-send-email-khilman@deeprootsystems.com> <1255720190-7452-14-git-send-email-khilman@deeprootsystems.com> <1255720190-7452-15-git-send-email-khilman@deeprootsystems.com> <1255720190-7452-16-git-send-email-khilman@deeprootsystems.com> <1255720190-7452-17-git-send-email-khilman@deeprootsystems.com> <1255720190-7452-18-git-send-email-khilman@deeprootsystems.com> <1255720190-7452-19-git-send-email-khilman@deeprootsystems.com> MIME-Version: 1.0 X-Reverse-DNS: ey-out-1920.google.com Cc: davinci-linux-open-source@linux.davincidsp.com Subject: [PATCH 18/46] 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+patchwork-davinci=patchwork.kernel.org@linux.davincidsp.com Errors-To: davinci-linux-open-source-bounces+patchwork-davinci=patchwork.kernel.org@linux.davincidsp.com 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),