mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-11 13:27:06 +09:00
board-rk29-ddr3sdk: modify for touch screen standby
This commit is contained in:
@@ -131,7 +131,7 @@ struct rk29_nand_platform_data rk29_nand_data = {
|
||||
*****************************************************************************************/
|
||||
#define FB_ID 0
|
||||
#define FB_DISPLAY_ON_PIN RK29_PIN6_PD0
|
||||
#define FB_LCD_STANDBY_PIN RK29_PIN6_PD1
|
||||
#define FB_LCD_STANDBY_PIN INVALID_GPIO
|
||||
#define FB_LCD_CABC_EN_PIN RK29_PIN6_PD2
|
||||
#define FB_MCU_FMK_PIN INVALID_GPIO
|
||||
|
||||
@@ -139,6 +139,13 @@ struct rk29_nand_platform_data rk29_nand_data = {
|
||||
#define FB_LCD_STANDBY_VALUE GPIO_HIGH
|
||||
|
||||
//#endif
|
||||
/*****************************************************************************************
|
||||
* touch screen devices
|
||||
* author: cf@rock-chips.com
|
||||
*****************************************************************************************/
|
||||
#define TOUCH_SCREEN_STANDBY_PIN RK29_PIN6_PD1
|
||||
#define TOUCH_SCREEN_STANDBY_VALUE GPIO_HIGH
|
||||
|
||||
static int rk29_lcd_io_init(void)
|
||||
{
|
||||
int ret = 0;
|
||||
@@ -183,14 +190,28 @@ static int rk29_fb_io_init(struct rk29_fb_setting_info *fb_setting)
|
||||
}
|
||||
}
|
||||
|
||||
if(fb_setting->disp_on_en && (FB_LCD_STANDBY_PIN != INVALID_GPIO))
|
||||
if(fb_setting->disp_on_en)
|
||||
{
|
||||
ret = gpio_request(FB_LCD_STANDBY_PIN, NULL);
|
||||
if(ret != 0)
|
||||
if(FB_LCD_STANDBY_PIN != INVALID_GPIO)
|
||||
{
|
||||
gpio_free(FB_LCD_STANDBY_PIN);
|
||||
printk(">>>>>> FB_LCD_STANDBY_PIN gpio_request err \n ");
|
||||
ret = gpio_request(FB_LCD_STANDBY_PIN, NULL);
|
||||
if(ret != 0)
|
||||
{
|
||||
gpio_free(FB_LCD_STANDBY_PIN);
|
||||
printk(">>>>>> FB_LCD_STANDBY_PIN gpio_request err \n ");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ret = gpio_request(TOUCH_SCREEN_STANDBY_PIN, NULL);
|
||||
if(ret != 0)
|
||||
{
|
||||
gpio_free(TOUCH_SCREEN_STANDBY_PIN);
|
||||
printk(">>>>>> TOUCH_SCREEN_STANDBY_PIN gpio_request err \n ");
|
||||
}
|
||||
gpio_direction_output(TOUCH_SCREEN_STANDBY_PIN, 0);
|
||||
gpio_set_value(TOUCH_SCREEN_STANDBY_PIN, TOUCH_SCREEN_STANDBY_VALUE);
|
||||
}
|
||||
}
|
||||
|
||||
if(FB_LCD_CABC_EN_PIN != INVALID_GPIO)
|
||||
@@ -387,7 +408,8 @@ static int EETI_EGALAX_init_platform_hw(void)
|
||||
static struct eeti_egalax_platform_data eeti_egalax_info = {
|
||||
.model= 1003,
|
||||
.init_platform_hw= EETI_EGALAX_init_platform_hw,
|
||||
|
||||
.standby_pin = TOUCH_SCREEN_STANDBY_PIN,
|
||||
.standby_value = TOUCH_SCREEN_STANDBY_VALUE,
|
||||
};
|
||||
#endif
|
||||
/*MMA8452 gsensor*/
|
||||
|
||||
@@ -152,6 +152,9 @@ struct eeti_egalax_platform_data{
|
||||
int (*eeti_egalax_platform_sleep)(void);
|
||||
int (*eeti_egalax_platform_wakeup)(void);
|
||||
void (*exit_platform_hw)(void);
|
||||
int standby_pin;
|
||||
int standby_value;
|
||||
|
||||
};
|
||||
|
||||
/*sintex touch*/
|
||||
|
||||
@@ -496,6 +496,21 @@ static irqreturn_t egalax_i2c_interrupt(int irq, void *dev_id)
|
||||
return IRQ_HANDLED;
|
||||
}
|
||||
|
||||
|
||||
void egalax_i2c_set_standby(struct i2c_client *client, int enable)
|
||||
{
|
||||
struct eeti_egalax_platform_data *pdata = pdata = client->dev.platform_data;
|
||||
unsigned lcd_standby = pdata->standby_pin;
|
||||
int lcd_standby_pol = pdata->standby_value;
|
||||
printk("%s : %s, enable = %d", __FILE__, __FUNCTION__,enable);
|
||||
// set display_on
|
||||
if(lcd_standby != INVALID_GPIO)
|
||||
{
|
||||
gpio_direction_output(lcd_standby, 0);
|
||||
gpio_set_value(lcd_standby, enable ? lcd_standby_pol : !lcd_standby_pol);
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef CONFIG_PM
|
||||
static int egalax_i2c_suspend(struct i2c_client *client, pm_message_t mesg)
|
||||
{
|
||||
@@ -518,14 +533,14 @@ static int egalax_i2c_suspend(struct i2c_client *client, pm_message_t mesg)
|
||||
{
|
||||
printk(KERN_DEBUG "[egalax_i2c]: device_may_wakeup false\n");
|
||||
}
|
||||
|
||||
egalax_i2c_set_standby(client, 1);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int egalax_i2c_resume(struct i2c_client *client)
|
||||
{
|
||||
struct _egalax_i2c *egalax_i2c = i2c_get_clientdata(client);
|
||||
|
||||
egalax_i2c_set_standby(client, 0);
|
||||
if(device_may_wakeup(&client->dev))
|
||||
{
|
||||
disable_irq_wake(p_egalax_i2c_dev->irq);
|
||||
|
||||
Reference in New Issue
Block a user