Commit 2ebc1919 authored by Marco Felsch's avatar Marco Felsch Committed by Dmitry Torokhov

Input: edt-ft5x06 - add support to update ev-ft5726 registers

Currently only the threshold and gain parameters can be read.
Signed-off-by: default avatarMarco Felsch <m.felsch@pengutronix.de>
Signed-off-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
parent a2f39dac
...@@ -353,9 +353,10 @@ struct edt_ft5x06_attribute { ...@@ -353,9 +353,10 @@ struct edt_ft5x06_attribute {
u8 limit_high; u8 limit_high;
u8 addr_m06; u8 addr_m06;
u8 addr_m09; u8 addr_m09;
u8 addr_ev;
}; };
#define EDT_ATTR(_field, _mode, _addr_m06, _addr_m09, \ #define EDT_ATTR(_field, _mode, _addr_m06, _addr_m09, _addr_ev, \
_limit_low, _limit_high) \ _limit_low, _limit_high) \
struct edt_ft5x06_attribute edt_ft5x06_attr_##_field = { \ struct edt_ft5x06_attribute edt_ft5x06_attr_##_field = { \
.dattr = __ATTR(_field, _mode, \ .dattr = __ATTR(_field, _mode, \
...@@ -364,6 +365,7 @@ struct edt_ft5x06_attribute { ...@@ -364,6 +365,7 @@ struct edt_ft5x06_attribute {
.field_offset = offsetof(struct edt_ft5x06_ts_data, _field), \ .field_offset = offsetof(struct edt_ft5x06_ts_data, _field), \
.addr_m06 = _addr_m06, \ .addr_m06 = _addr_m06, \
.addr_m09 = _addr_m09, \ .addr_m09 = _addr_m09, \
.addr_ev = _addr_ev, \
.limit_low = _limit_low, \ .limit_low = _limit_low, \
.limit_high = _limit_high, \ .limit_high = _limit_high, \
} }
...@@ -400,6 +402,10 @@ static ssize_t edt_ft5x06_setting_show(struct device *dev, ...@@ -400,6 +402,10 @@ static ssize_t edt_ft5x06_setting_show(struct device *dev,
addr = attr->addr_m09; addr = attr->addr_m09;
break; break;
case EV_FT:
addr = attr->addr_ev;
break;
default: default:
error = -ENODEV; error = -ENODEV;
goto out; goto out;
...@@ -471,6 +477,10 @@ static ssize_t edt_ft5x06_setting_store(struct device *dev, ...@@ -471,6 +477,10 @@ static ssize_t edt_ft5x06_setting_store(struct device *dev,
addr = attr->addr_m09; addr = attr->addr_m09;
break; break;
case EV_FT:
addr = attr->addr_ev;
break;
default: default:
error = -ENODEV; error = -ENODEV;
goto out; goto out;
...@@ -494,16 +504,16 @@ static ssize_t edt_ft5x06_setting_store(struct device *dev, ...@@ -494,16 +504,16 @@ static ssize_t edt_ft5x06_setting_store(struct device *dev,
/* m06, m09: range 0-31, m12: range 0-5 */ /* m06, m09: range 0-31, m12: range 0-5 */
static EDT_ATTR(gain, S_IWUSR | S_IRUGO, WORK_REGISTER_GAIN, static EDT_ATTR(gain, S_IWUSR | S_IRUGO, WORK_REGISTER_GAIN,
M09_REGISTER_GAIN, 0, 31); M09_REGISTER_GAIN, EV_REGISTER_GAIN, 0, 31);
/* m06, m09: range 0-31, m12: range 0-16 */ /* m06, m09: range 0-31, m12: range 0-16 */
static EDT_ATTR(offset, S_IWUSR | S_IRUGO, WORK_REGISTER_OFFSET, static EDT_ATTR(offset, S_IWUSR | S_IRUGO, WORK_REGISTER_OFFSET,
M09_REGISTER_OFFSET, 0, 31); M09_REGISTER_OFFSET, NO_REGISTER, 0, 31);
/* m06: range 20 to 80, m09: range 0 to 30, m12: range 1 to 255... */ /* m06: range 20 to 80, m09: range 0 to 30, m12: range 1 to 255... */
static EDT_ATTR(threshold, S_IWUSR | S_IRUGO, WORK_REGISTER_THRESHOLD, static EDT_ATTR(threshold, S_IWUSR | S_IRUGO, WORK_REGISTER_THRESHOLD,
M09_REGISTER_THRESHOLD, 0, 255); M09_REGISTER_THRESHOLD, EV_REGISTER_THRESHOLD, 0, 255);
/* m06: range 3 to 14, m12: (0x64: 100Hz) */ /* m06: range 3 to 14, m12: (0x64: 100Hz) */
static EDT_ATTR(report_rate, S_IWUSR | S_IRUGO, WORK_REGISTER_REPORT_RATE, static EDT_ATTR(report_rate, S_IWUSR | S_IRUGO, WORK_REGISTER_REPORT_RATE,
NO_REGISTER, 0, 255); NO_REGISTER, NO_REGISTER, 0, 255);
static struct attribute *edt_ft5x06_attrs[] = { static struct attribute *edt_ft5x06_attrs[] = {
&edt_ft5x06_attr_gain.dattr.attr, &edt_ft5x06_attr_gain.dattr.attr,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment