// 20100827 [email protected] [START_LGE] int hub_proximity_check(void) { int proximity_status; alarm_flip = ALARM_FLIP_ACTIVE; //--[[ LGE_UBIQUIX_MODIFIED_START : [email protected] [2011.07.16] - flip_mode is added. int flip_mode = 0; if(!enabled) { flip_mode = 1; hub_proxi_enable(hub_proximity_client); disable_irq(hub_proximity_client->irq); } //--]] LGE_UBIQUIX_MODIFIED_END : [email protected] [2011.07.16]- flip_mode is added. proximity_status = hub_read_vo_bit(hub_proximity_client); /* LGE_CHANGE_S, [email protected], 2011-04-06, Disable Proximity Log */ //printk(KERN_DEBUG"[!]%s() - proximity status : %d\n", __func__, proximity_status); /* LGE_CHANGE_E, [email protected], 2011-04-06, Disable Proximity Log */ //--[[ LGE_UBIQUIX_MODIFIED_START : [email protected] [2011.07.16] - proximity mode is added. if(flip_mode && proxi_mode == MODE_DEACTIVE) //--]] LGE_UBIQUIX_MODIFIED_END : [email protected] [2011.07.16]- proximity mode is added. hub_proxi_disable(hub_proximity_client); //--[[ LGE_UBIQUIX_MODIFIED_START : [email protected] [2011.07.16] - proximity mode is added. flip_mode = 0; //--]] LGE_UBIQUIX_MODIFIED_END : [email protected] [2011.07.16]- proximity mode is added. alarm_flip = ALARM_FLIP_DEACTIVE; return proximity_status; }
static ssize_t hub_proxi_onoff_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { int val; int ret; struct hub_proxi_data* data = dev_get_drvdata(dev); val = simple_strtoul(buf, NULL, 10); sscanf(buf, "%d", &ret); //sprintf(buf, "%d\n", atomic_read(&proxi_status)); if(ret) { hub_proxi_enable(data->client); // enable_irq(data->client->irq); enable_irq_wake(gpio_to_irq(PROXI_OUT)); } else { // disable_irq(data->client->irq); disable_irq_wake(gpio_to_irq(PROXI_OUT)); hub_proxi_disable(data->client); } data->wakeup_while_sleep = (bool)ret; return 0; }
static ssize_t hub_proxi_onoff_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { int val; int ret; struct hub_proxi_data* data = dev_get_drvdata(dev); val = simple_strtoul(buf, NULL, 10); sscanf(buf, "%d", &ret); //sprintf(buf, "%d\n", atomic_read(&proxi_status)); if(ret) { hub_proxi_enable(data->client); enable_irq(data->client->irq); //--[[ LGE_UBIQUIX_MODIFIED_START : [email protected] [2011.07.16] - proximity_mode is added. proxi_mode = MODE_ACTIVE; //--]] LGE_UBIQUIX_MODIFIED_END : [email protected] [2011.07.16]- proximity_mode is added. } else { disable_irq(data->client->irq); hub_proxi_disable(data->client); //--[[ LGE_UBIQUIX_MODIFIED_START : [email protected] [2011.07.16] - proximity_mode is added. proxi_mode = MODE_DEACTIVE; //--]] LGE_UBIQUIX_MODIFIED_END : [email protected] [2011.07.16]- proximity_mode is added. } data->wakeup_while_sleep = (bool)ret; return count; }
// 20100827 [email protected] [START_LGE] int hub_proximity_check(void) { int proximity_status; alarm_flip = ALARM_FLIP_ACTIVE; hub_proxi_enable(hub_proximity_client); disable_irq(hub_proximity_client->irq); proximity_status = hub_read_vo_bit(hub_proximity_client); printk(KERN_DEBUG"[!]%s() - proximity status : %d\n", __func__, proximity_status); hub_proxi_disable(hub_proximity_client); alarm_flip = ALARM_FLIP_DEACTIVE; return proximity_status; }
static int hub_proxi_resume(struct i2c_client *client) { struct hub_proxi_data *data = i2c_get_clientdata(client); printk("%s\n", __FUNCTION__); if (!enabled) return 0; #if 0 if (data->wakeup_while_sleep) disable_irq(client->irq); if (hrtimer_try_to_cancel(&data->timer) == 0) //timer is not active hrtimer_start(&data->timer, ktime_set(0, data->delay), HRTIMER_MODE_REL); #endif // 20101115 [email protected] work queue after wake up [START_LGE] if(enabled) schedule_work(&data->work); // 20101115 [email protected] work queue after wake up [END_LGE] if (!data->wakeup_while_sleep) hub_proxi_enable(client); return 0; }