From dbcf5611cc9f55759700b5e77642a545dca86da7 Mon Sep 17 00:00:00 2001 From: Steve Chen Date: Tue, 15 Sep 2009 18:15:06 -0700 Subject: [PATCH] --- yaml --- r: 173315 b: refs/heads/master c: 13e1f0440e7892fa7041fc855d8eeffc5d6aa21a h: refs/heads/master i: 173313: 422e9214b3e27cd9f1b97bca3c32034b65709ec0 173311: faa1a28aea6690682f69ce1409532941753df07a v: v3 --- [refs] | 2 +- trunk/arch/arm/mach-davinci/Kconfig | 21 +++++++++ trunk/arch/arm/mach-davinci/board-da830-evm.c | 44 ++++++++++++++++++- trunk/arch/arm/mach-davinci/da830.c | 2 +- 4 files changed, 66 insertions(+), 3 deletions(-) diff --git a/[refs] b/[refs] index 2583d5c87069..fd36a973e50e 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: b9e6342b2b796c2f7fdc98cefd17df16892b035e +refs/heads/master: 13e1f0440e7892fa7041fc855d8eeffc5d6aa21a diff --git a/trunk/arch/arm/mach-davinci/Kconfig b/trunk/arch/arm/mach-davinci/Kconfig index 40866c643f13..7b6dddf08e94 100644 --- a/trunk/arch/arm/mach-davinci/Kconfig +++ b/trunk/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/trunk/arch/arm/mach-davinci/board-da830-evm.c b/trunk/arch/arm/mach-davinci/board-da830-evm.c index fe86afa7ea2e..fb941eb1f4da 100644 --- a/trunk/arch/arm/mach-davinci/board-da830-evm.c +++ b/trunk/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 = { @@ -186,6 +217,17 @@ static __init void da830_evm_init(void) da8xx_register_mcasp(1, &da830_evm_snd_data); da830_evm_init_mmc(); + +#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/trunk/arch/arm/mach-davinci/da830.c b/trunk/arch/arm/mach-davinci/da830.c index f52174af06c2..f0b2f9690d9c 100644 --- a/trunk/arch/arm/mach-davinci/da830.c +++ b/trunk/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),