Commit 255cdaf7 authored by Marco Felsch's avatar Marco Felsch Committed by Dmitry Torokhov

Input: edt-ft5x06 - fix get_default register write access

Since commit b6eba860 ("Input: edt-ft5x06 - add offset support for
ev-ft5726") offset-x and offset-y is supported. Devices using those
offset parameters don't support the offset parameter so we need to add
the NO_REGISTER check for edt_ft5x06_ts_get_defaults().

Fixes: b6eba860 ("Input: edt-ft5x06 - add offset support for ev-ft5726")
Signed-off-by: default avatarMarco Felsch <m.felsch@pengutronix.de>
Link: https://lore.kernel.org/r/20200227112819.16754-2-m.felsch@pengutronix.deSigned-off-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
parent 9d17ad23
......@@ -938,19 +938,25 @@ static void edt_ft5x06_ts_get_defaults(struct device *dev,
error = device_property_read_u32(dev, "offset", &val);
if (!error) {
edt_ft5x06_register_write(tsdata, reg_addr->reg_offset, val);
if (reg_addr->reg_offset != NO_REGISTER)
edt_ft5x06_register_write(tsdata,
reg_addr->reg_offset, val);
tsdata->offset = val;
}
error = device_property_read_u32(dev, "offset-x", &val);
if (!error) {
edt_ft5x06_register_write(tsdata, reg_addr->reg_offset_x, val);
if (reg_addr->reg_offset_x != NO_REGISTER)
edt_ft5x06_register_write(tsdata,
reg_addr->reg_offset_x, val);
tsdata->offset_x = val;
}
error = device_property_read_u32(dev, "offset-y", &val);
if (!error) {
edt_ft5x06_register_write(tsdata, reg_addr->reg_offset_y, val);
if (reg_addr->reg_offset_y != NO_REGISTER)
edt_ft5x06_register_write(tsdata,
reg_addr->reg_offset_y, val);
tsdata->offset_y = val;
}
}
......
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