Commit dc262dfa authored by Philipp Zabel's avatar Philipp Zabel Committed by Dmitry Torokhov

Input: edt-ft5x06 - fix setting gain, offset, and threshold via device tree

A recent patch broke parsing the gain, offset, and threshold parameters
from device tree. Instead of setting the cached values and writing them
to the correct registers during probe, it would write the values from DT
into the register address variables and never write them to the chip
during normal operation.

Fixes: 2e23b7a9 ("Input: edt-ft5x06 - use generic properties API")
Signed-off-by: default avatarPhilipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
parent d4f1b06d
...@@ -822,16 +822,22 @@ static void edt_ft5x06_ts_get_defaults(struct device *dev, ...@@ -822,16 +822,22 @@ static void edt_ft5x06_ts_get_defaults(struct device *dev,
int error; int error;
error = device_property_read_u32(dev, "threshold", &val); error = device_property_read_u32(dev, "threshold", &val);
if (!error) if (!error) {
reg_addr->reg_threshold = val; edt_ft5x06_register_write(tsdata, reg_addr->reg_threshold, val);
tsdata->threshold = val;
}
error = device_property_read_u32(dev, "gain", &val); error = device_property_read_u32(dev, "gain", &val);
if (!error) if (!error) {
reg_addr->reg_gain = val; edt_ft5x06_register_write(tsdata, reg_addr->reg_gain, val);
tsdata->gain = val;
}
error = device_property_read_u32(dev, "offset", &val); error = device_property_read_u32(dev, "offset", &val);
if (!error) if (!error) {
reg_addr->reg_offset = val; edt_ft5x06_register_write(tsdata, reg_addr->reg_offset, val);
tsdata->offset = val;
}
} }
static void static void
......
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