static int __init gp2a_opt_init(void) { int ret; printk(KERN_INFO "enter %s\n", __func__); #if !defined(CONFIG_LU6500) && !defined(CONFIG_KS1001) gp2a_power_control(ON); #endif return i2c_add_driver(&gp2a_opt_driver); }
static int touch_resume(struct i2c_client *client) { struct lge_touch_driver *touch = i2c_get_clientdata(client); #if 0//defined(CONFIG_LU6500) || defined(CONFIG_KS1001) if (!already_call_state) { gp2a_power_control(1); touch->h_powerCtrl->on(touch->h_touch); } #ifndef CONFIG_HAS_EARLYSUSPEND touch->h_interrupt->enable(touch->h_touch); init_touch_device_setting(touch->h_touch, false); #endif #else touch->h_powerCtrl->on(touch->h_touch); #ifndef CONFIG_HAS_EARLYSUSPEND touch->h_interrupt->enable(touch->h_touch); init_touch_device_setting(touch->h_touch, false); #endif #endif return 0; }
static int touch_suspend(struct i2c_client *client, pm_message_t state) { struct lge_touch_driver *touch = i2c_get_clientdata(client); #if 0//defined(CONFIG_LU6500) || defined(CONFIG_KS1001) #ifndef CONFIG_HAS_EARLYSUSPEND touch->h_interrupt->disable(touch->h_touch); #endif already_call_state = false; if (!in_call_state()) { touch->h_powerCtrl->off(touch->h_touch); gp2a_power_control(0); } else already_call_state = true; #else #ifndef CONFIG_HAS_EARLYSUSPEND touch->h_interrupt->disable(touch->h_touch); #endif touch->h_powerCtrl->off(touch->h_touch); #endif return 0; }
void gp2a_on(struct gp2a_data *gp2a) { int i; if(proximity_enable == OFF) { gprintk("gp2a power on\n"); #if defined(CONFIG_LU6500) || defined(CONFIG_KS1001) gp2a_power_control(ON); msleep(5); #endif proximity_enable = ON; //20111001 [email protected] : Set Operation mode B1 for X2 New HW Revision [S] //Shutdown Mode(0x02) -> Operation Mode(ox03) Procedure 1~5 opt_i2c_write(gp2a, (u8)(REGS_CON), 0x18);//1 opt_i2c_write(gp2a, (u8)(REGS_HYS), 0x40);//2 opt_i2c_write(gp2a, (u8)(REGS_OPMOD), 0x03);//3 enable_irq(gp2a->irq);//4 msleep(2); opt_i2c_write(gp2a, (u8)(REGS_CON), 0x00);//5 //20111001 [email protected] : Set Operation mode B1 for X2 New HW Revision [E] gp2a_read_forcely(gp2a); } }