Input: edt-ft5x06 - fix get_default register write access

Since commit b6eba86030 ("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: b6eba86030 ("Input: edt-ft5x06 - add offset support for ev-ft5726")
Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>
Link: https://lore.kernel.org/r/20200227112819.16754-2-m.felsch@pengutronix.de
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
This commit is contained in:
Marco Felsch 2020-05-09 14:34:35 -07:00 committed by Dmitry Torokhov
parent 9d17ad2369
commit 255cdaf734

View File

@ -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;
}
}