// 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_status_show(struct device *dev, struct device_attribute *attr, char *buf) { struct hub_proxi_data* data = dev_get_drvdata(dev); int status; status = hub_read_vo_bit(data->client); // sprintf(buf, "%d\n", atomic_read(&proxi_status)); sprintf(buf, "%d\n", status); return (ssize_t)(strlen(buf) + 1); }
static void hub_proxi_det_work(struct work_struct *work) { struct hub_proxi_data *data = container_of(work, struct hub_proxi_data, work); atomic_set(&proxi_status, hub_read_vo_bit(data->client)); // int vo = hub_read_vo_bit(data->client); input_report_abs(data->input_dev, ABS_DISTANCE, atomic_read(&proxi_status)); printk("%s distance=%d\n", __FUNCTION__, atomic_read(&proxi_status)); input_sync(data->input_dev); }
static void hub_proxi_det_work(struct work_struct *work) { struct hub_proxi_data *data = container_of(work, struct hub_proxi_data, work); atomic_set(&proxi_status, hub_read_vo_bit(data->client)); // int vo = hub_read_vo_bit(data->client); input_report_abs(data->input_dev, ABS_DISTANCE, atomic_read(&proxi_status)); /* LGE_CHANGE_S, [email protected], 2011-04-06, Disable Proximity Log */ //printk("%s distance=%d\n", __FUNCTION__, atomic_read(&proxi_status)); /* LGE_CHANGE_E, [email protected], 2011-04-06, Disable Proximity Log */ input_sync(data->input_dev); }
// 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; }