aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsbrissen <sbrissen@hotmail.com>2014-03-26 15:49:16 -0400
committersbrissen <sbrissen@hotmail.com>2014-03-26 16:20:39 -0400
commitecefed8471ad2a78e80ac0817e69defde022f5c5 (patch)
tree829a76665a2de0a4dcbf4654b5ea181f29766dcb
parentb1c5069196635586f0cc98cf3eca277c08b282f6 (diff)
downloadkernel_samsung_smdk4412-ecefed8471ad2a78e80ac0817e69defde022f5c5.tar.gz
kernel_samsung_smdk4412-ecefed8471ad2a78e80ac0817e69defde022f5c5.tar.bz2
kernel_samsung_smdk4412-ecefed8471ad2a78e80ac0817e69defde022f5c5.zip
synaptics_s7301: add disabling keypad
Change-Id: I5af258d2245024918f08a1a7c93c6efcc4d177b3
-rw-r--r--drivers/input/touchscreen/synaptics_s7301.c30
-rw-r--r--drivers/input/touchscreen/synaptics_sysfs.c34
-rw-r--r--include/linux/synaptics_s7301.h1
3 files changed, 52 insertions, 13 deletions
diff --git a/drivers/input/touchscreen/synaptics_s7301.c b/drivers/input/touchscreen/synaptics_s7301.c
index fb152e17033..34d42e725ec 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 be829540bbf..840a3621ea9 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,
};
diff --git a/include/linux/synaptics_s7301.h b/include/linux/synaptics_s7301.h
index 5c0b4712911..13b4c5c40d5 100644
--- a/include/linux/synaptics_s7301.h
+++ b/include/linux/synaptics_s7301.h
@@ -281,6 +281,7 @@ struct synaptics_drv_data {
u16 refer_min;
u16 rx_to_rx[42][42];
unsigned long func_bit[BITS_TO_LONGS(MAX_FUNC+1)];
+ atomic_t keypad_enable;
};
extern struct class *sec_class;