Skip to content

Commit

Permalink
mxt224_u1: fix tsp_threshold sysfs and store the value in platform st…
Browse files Browse the repository at this point in the history
…ructure
  • Loading branch information
Gokhan Moral committed Sep 5, 2012
1 parent 92d2645 commit cc3293a
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions drivers/input/touchscreen/mxt224_u1.c
Original file line number Diff line number Diff line change
Expand Up @@ -3270,9 +3270,9 @@ static ssize_t tsp_threshold_show(struct device *dev,
struct device_attribute *attr, char *buf)
{
if (copy_data->mxt_version_disp == 0x80)
return sprintf(buf, "%u\n", copy_data->threshold);
return sprintf(buf, "%u\n", copy_pdata->tchthr_batt);
else
return sprintf(buf, "%u\n", copy_data->threshold_e);
return sprintf(buf, "%u\n", copy_pdata->tchthr_batt_e);
}

static ssize_t tsp_threshold_store(struct device *dev,
Expand All @@ -3288,11 +3288,6 @@ static ssize_t tsp_threshold_store(struct device *dev,
u16 size_one;
int threshold;

if (copy_data->mxt_version_disp == 0x80)
threshold = copy_data->threshold;
else
threshold = copy_data->threshold_e;

if (sscanf(buf, "%d", &threshold) == 1) {
printk(KERN_ERR "[TSP] threshold value %d\n",
threshold);
Expand All @@ -3301,6 +3296,10 @@ static ssize_t tsp_threshold_store(struct device *dev,
&size_one, &address);
size_one = 1;
value = (u8) threshold;
if (copy_data->mxt_version_disp == 0x80)
copy_pdata->tchthr_batt = threshold;
else
copy_pdata->tchthr_batt_e = threshold;
write_mem(copy_data, address + (u16) object_register, size_one,
&value);
read_mem(copy_data, address + (u16) object_register,
Expand Down Expand Up @@ -4360,3 +4359,4 @@ module_exit(mxt224_exit);
MODULE_DESCRIPTION("Atmel MaXTouch 224 driver");
MODULE_AUTHOR("Rom Lemarchand <rlemarchand@sta.samsung.com>");
MODULE_LICENSE("GPL");

0 comments on commit cc3293a

Please sign in to comment.