From 4b0d245e438ce21c92aa5bcb6a643ddb13ce9467 Mon Sep 17 00:00:00 2001 From: root Date: Fri, 1 Jul 2011 02:20:33 -0700 Subject: [PATCH] A22: lcd use spi0 instead of spi1, make lcd enter deep sleep in suspend --- arch/arm/configs/rk29_a22_defconfig | 2 ++ arch/arm/mach-rk29/board-rk29-a22.c | 25 ++++++++-------------- drivers/video/display/screen/lcd_nt35510.c | 22 ++++++++++++------- 3 files changed, 25 insertions(+), 24 deletions(-) mode change 100644 => 100755 arch/arm/configs/rk29_a22_defconfig diff --git a/arch/arm/configs/rk29_a22_defconfig b/arch/arm/configs/rk29_a22_defconfig old mode 100644 new mode 100755 index dcf596facfc3..e3441b5327ad --- a/arch/arm/configs/rk29_a22_defconfig +++ b/arch/arm/configs/rk29_a22_defconfig @@ -985,6 +985,8 @@ CONFIG_SPIM_RK29=y CONFIG_SPIM0_RK29=y CONFIG_SPIM1_RK29=y CONFIG_LCD_USE_SPIM_CONTROL=y +CONFIG_LCD_USE_SPI0=y +# CONFIG_LCD_USE_SPI1 is not set # # SPI Protocol Masters diff --git a/arch/arm/mach-rk29/board-rk29-a22.c b/arch/arm/mach-rk29/board-rk29-a22.c index 92f023d996ca..e41230fb2fbe 100755 --- a/arch/arm/mach-rk29/board-rk29-a22.c +++ b/arch/arm/mach-rk29/board-rk29-a22.c @@ -180,13 +180,12 @@ struct rk29_nand_platform_data rk29_nand_data = { * author: zyw@rock-chips.com *****************************************************************************************/ //#ifdef CONFIG_LCD_TD043MGEA1 +#define CONFIG_LCD_USE_SPI0 1 #ifdef CONFIG_LCD_USE_SPI0 #define LCD_TXD_PIN RK29_PIN2_PC2 #define LCD_CLK_PIN RK29_PIN2_PC0 #define LCD_CS_PIN RK29_PIN1_PA4 -#endif - -#ifdef CONFIG_LCD_USE_SPI1 +#else #define LCD_TXD_PIN RK29_PIN2_PC6 #define LCD_CLK_PIN RK29_PIN2_PC4 #define LCD_CS_PIN RK29_PIN2_PC5 @@ -209,25 +208,21 @@ static int rk29_lcd_io_init(void) { int ret = 0; //printk("rk29_lcd_io_init\n"); - //ret = gpio_request(LCD_RXD_PIN, NULL); - ret = gpio_request(LCD_TXD_PIN, NULL); - ret = gpio_request(LCD_CLK_PIN, NULL); - ret = gpio_request(LCD_CS_PIN, NULL); - #ifdef CONFIG_LCD_USE_SPI0 //rk29_mux_api_set(GPIO2C7_SPI1RXD_NAME,GPIO2H_GPIO2C7); rk29_mux_api_set(GPIO2C2_SPI0TXD_NAME,GPIO2H_GPIO2C2); rk29_mux_api_set(GPIO1A4_EMMCWRITEPRT_SPI0CS1_NAME,GPIO1L_GPIO1A4); rk29_mux_api_set(GPIO2C0_SPI0CLK_NAME,GPIO2H_GPIO2C0); -#endif - -#ifdef CONFIG_LCD_USE_SPI1 +#else //rk29_mux_api_set(GPIO2C7_SPI1RXD_NAME,GPIO2H_GPIO2C7); rk29_mux_api_set(GPIO2C6_SPI1TXD_NAME,GPIO2H_GPIO2C6); rk29_mux_api_set(GPIO2C5_SPI1CSN0_NAME,GPIO2H_GPIO2C5); rk29_mux_api_set(GPIO2C4_SPI1CLK_NAME,GPIO2H_GPIO2C4); #endif - + //ret = gpio_request(LCD_RXD_PIN, NULL); + ret = gpio_request(LCD_TXD_PIN, NULL); + ret = gpio_request(LCD_CLK_PIN, NULL); + ret = gpio_request(LCD_CS_PIN, NULL); return ret; } @@ -244,9 +239,7 @@ static int rk29_lcd_io_deinit(void) rk29_mux_api_set(GPIO2C2_SPI0TXD_NAME,GPIO2H_SPI0_TXD); rk29_mux_api_set(GPIO1A4_EMMCWRITEPRT_SPI0CS1_NAME,GPIO1L_SPI0_CSN1); rk29_mux_api_set(GPIO2C0_SPI0CLK_NAME,GPIO2H_SPI0_CLK); -#endif - -#ifdef CONFIG_LCD_USE_SPI1 +#else //rk29_mux_api_set(GPIO2C7_SPI1RXD_NAME,GPIO2H_SPI1_RXD); rk29_mux_api_set(GPIO2C6_SPI1TXD_NAME,GPIO2H_SPI1_TXD); rk29_mux_api_set(GPIO2C5_SPI1CSN0_NAME,GPIO2H_SPI1_CSN0); @@ -1561,7 +1554,7 @@ struct rk_headset_pdata rk_headset_info = { .Headset_gpio = RK29_PIN3_PA6, .headset_in_type= HEADSET_IN_HIGH, .Hook_gpio = RK29_PIN4_PD1,//Detection Headset--Must be set - .hook_key_code = KEY_MEDIA, +// .hook_key_code = KEY_MEDIA, }; struct platform_device rk_device_headset = { diff --git a/drivers/video/display/screen/lcd_nt35510.c b/drivers/video/display/screen/lcd_nt35510.c index ee8ec33a4103..564bddc9db06 100755 --- a/drivers/video/display/screen/lcd_nt35510.c +++ b/drivers/video/display/screen/lcd_nt35510.c @@ -1576,23 +1576,29 @@ extern void rk29_lcd_spim_spin_lock(void); extern void rk29_lcd_spim_spin_unlock(void); int standby(u8 enable) //***enable =1 means suspend, 0 means resume { - rk29_lcd_spim_spin_lock(); + //rk29_lcd_spim_spin_lock(); if(gLcd_info) gLcd_info->io_init(); if(enable) { WriteCommand(0X2800); //set_backlight(0); - mdelay(100); - WriteCommand(0X1000); + WriteCommand(0X1100); + mdelay(5); + WriteCommand(0X4f00); + WriteParameter(0x01); } else { - WriteCommand(0X1100); - mdelay(120); - WriteCommand(0X2900); - mdelay(100); + gpio_request(RK29_PIN6_PC6, NULL); + gpio_direction_output(RK29_PIN6_PC6, 1); + gpio_direction_output(RK29_PIN6_PC6, 0); + mdelay(5); + gpio_set_value(RK29_PIN6_PC6, 1); + mdelay(50); + gpio_free(RK29_PIN6_PC6); + init_nt35510(); //set_backlight(255); //resume_nt35510();//may be fail to wake up LCD some time,so change to init lcd again - printk("%s\n",__FUNCTION__); + printk("%s\n",__FUNCTION__);printk("%s\n",__FUNCTION__); } if(gLcd_info) -- 2.34.1