diff options
Diffstat (limited to 'drivers/input')
-rw-r--r-- | drivers/input/touchscreen/synaptics_s7301.c | 30 | ||||
-rw-r--r-- | drivers/input/touchscreen/synaptics_sysfs.c | 34 |
2 files changed, 51 insertions, 13 deletions
diff --git a/drivers/input/touchscreen/synaptics_s7301.c b/drivers/input/touchscreen/synaptics_s7301.c index fb152e1..34d42e7 100644 --- a/drivers/input/touchscreen/synaptics_s7301.c +++ b/drivers/input/touchscreen/synaptics_s7301.c @@ -591,7 +591,7 @@ static void synaptics_ts_read_points(struct synaptics_drv_data *data, #endif u16 addr = data->f11.data_base_addr + 3; u16 x = 0, y = 0; - + #if defined(CONFIG_SEC_TOUCHSCREEN_SURFACE_TOUCH) ret = synaptics_ts_read_block(data, palm_addr, &palm, 1); @@ -1076,9 +1076,11 @@ static int __init synaptics_ts_probe(struct i2c_client *client, __set_bit(EV_KEY, input->evbit); __set_bit(MT_TOOL_FINGER, input->keybit); __set_bit(INPUT_PROP_DIRECT, input->propbit); + + atomic_set(&ddata->keypad_enable, 1); #if defined(CONFIG_TOUCHSCREEN_SYNAPTICS_S7301_KEYLED) - if (pdata->led_event) { + if (pdata->led_event && atomic_read(&ddata->keypad_enable)) { __set_bit(EV_LED, input->evbit); __set_bit(LED_MISC, input->ledbit); } @@ -1106,17 +1108,19 @@ static int __init synaptics_ts_probe(struct i2c_client *client, 0, 1, 0, 0); #endif #if defined (CONFIG_TOUCHSCREEN_SYNAPTICS_S7301_KEYS) - if (pdata->support_extend_button) { - for (ret = 0; ret < pdata->extend_button_map->nbuttons; ret++) { - if (pdata->extend_button_map->map[ret] != KEY_RESERVED) - input_set_capability(input, EV_KEY, - pdata->extend_button_map->map[ret]); - } - } else { - for (ret = 0; ret < pdata->button_map->nbuttons; ret++) - input_set_capability(input, EV_KEY, - pdata->button_map->map[ret]); - } + if(atomic_read(&ddata->keypad_enable)){ + if (pdata->support_extend_button) { + for (ret = 0; ret < pdata->extend_button_map->nbuttons; ret++) { + if (pdata->extend_button_map->map[ret] != KEY_RESERVED) + input_set_capability(input, EV_KEY, + pdata->extend_button_map->map[ret]); + } + } else { + for (ret = 0; ret < pdata->button_map->nbuttons; ret++) + input_set_capability(input, EV_KEY, + pdata->button_map->map[ret]); + } + } #endif ret = input_register_device(input); diff --git a/drivers/input/touchscreen/synaptics_sysfs.c b/drivers/input/touchscreen/synaptics_sysfs.c index be82954..840a362 100644 --- a/drivers/input/touchscreen/synaptics_sysfs.c +++ b/drivers/input/touchscreen/synaptics_sysfs.c @@ -1204,6 +1204,37 @@ static ssize_t sec_extra_button_store(struct device *dev, return size; } +static ssize_t sec_keypad_enable_show(struct device *dev, + struct device_attribute *attr, char *buf) +{ + struct synaptics_drv_data *data = dev_get_drvdata(dev); + + return sprintf(buf, "%d\n", atomic_read(&data->keypad_enable)); +} + +static ssize_t sec_keypad_enable_store(struct device *dev, + struct device_attribute *attr, const char *buf, size_t count) +{ + struct synaptics_drv_data *data = dev_get_drvdata(dev); + + unsigned int val = 0; + sscanf(buf, "%d", &val); + val = (val == 0 ? 0 : 1); + atomic_set(&data->keypad_enable, val); + if (val) { + set_bit(KEY_BACK, data->input->keybit); + set_bit(KEY_MENU, data->input->keybit); + set_bit(KEY_HOME, data->input->keybit); + } else { + clear_bit(KEY_BACK, data->input->keybit); + clear_bit(KEY_MENU, data->input->keybit); + clear_bit(KEY_HOME, data->input->keybit); + } + input_sync(data->input); + + return count; +} + static DEVICE_ATTR(touch_sensitivity, S_IRUGO | S_IWUSR, NULL, sec_touchkey_sensitivity_store); static DEVICE_ATTR(touchkey_back, S_IRUGO | S_IWUSR, @@ -1226,6 +1257,8 @@ static DEVICE_ATTR(extra_button_event, S_IRUGO | S_IWUSR, NULL, sec_extra_button_store); static DEVICE_ATTR(touchkey_button_status, S_IRUGO | S_IWUSR, sec_touchkey_button_status_show, NULL); +static DEVICE_ATTR(keypad_enable, S_IRUGO|S_IWUSR, + sec_keypad_enable_show, sec_keypad_enable_store); static struct attribute *sec_touchkey_sysfs_attributes[] = { &dev_attr_touch_sensitivity.attr, @@ -1239,6 +1272,7 @@ static struct attribute *sec_touchkey_sysfs_attributes[] = { &dev_attr_brightness.attr, &dev_attr_extra_button_event.attr, &dev_attr_touchkey_button_status.attr, + &dev_attr_keypad_enable.attr, NULL, }; |