aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input
diff options
context:
space:
mode:
authorPhilipp Zabel <p.zabel@pengutronix.de>2016-02-09 12:32:42 -0500
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2016-02-09 18:36:20 -0500
commitdc262dfaaeda7617ae0b15b5ce1252a6cd102b19 (patch)
treeef65d6b25357273ef5938b10e2b3325dab636135 /drivers/input
parentd4f1b06d685d11ebdaccf11c0db1cb3c78736862 (diff)
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: 2e23b7a96372 ("Input: edt-ft5x06 - use generic properties API") Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Diffstat (limited to 'drivers/input')
-rw-r--r--drivers/input/touchscreen/edt-ft5x06.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/drivers/input/touchscreen/edt-ft5x06.c b/drivers/input/touchscreen/edt-ft5x06.c
index 0b0f8c17f3f7..23fbe382da8b 100644
--- a/drivers/input/touchscreen/edt-ft5x06.c
+++ b/drivers/input/touchscreen/edt-ft5x06.c
@@ -822,16 +822,22 @@ static void edt_ft5x06_ts_get_defaults(struct device *dev,
822 int error; 822 int error;
823 823
824 error = device_property_read_u32(dev, "threshold", &val); 824 error = device_property_read_u32(dev, "threshold", &val);
825 if (!error) 825 if (!error) {
826 reg_addr->reg_threshold = val; 826 edt_ft5x06_register_write(tsdata, reg_addr->reg_threshold, val);
827 tsdata->threshold = val;
828 }
827 829
828 error = device_property_read_u32(dev, "gain", &val); 830 error = device_property_read_u32(dev, "gain", &val);
829 if (!error) 831 if (!error) {
830 reg_addr->reg_gain = val; 832 edt_ft5x06_register_write(tsdata, reg_addr->reg_gain, val);
833 tsdata->gain = val;
834 }
831 835
832 error = device_property_read_u32(dev, "offset", &val); 836 error = device_property_read_u32(dev, "offset", &val);
833 if (!error) 837 if (!error) {
834 reg_addr->reg_offset = val; 838 edt_ft5x06_register_write(tsdata, reg_addr->reg_offset, val);
839 tsdata->offset = val;
840 }
835} 841}
836 842
837static void 843static void