Skip to content

Commit 255cdaf

Browse files
Marco Felschdtor
authored andcommitted
Input: edt-ft5x06 - fix get_default register write access
Since commit b6eba86 ("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: b6eba86 ("Input: edt-ft5x06 - add offset support for ev-ft5726") Signed-off-by: Marco Felsch <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Dmitry Torokhov <[email protected]>
1 parent 9d17ad2 commit 255cdaf

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

drivers/input/touchscreen/edt-ft5x06.c

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -938,19 +938,25 @@ static void edt_ft5x06_ts_get_defaults(struct device *dev,
938938

939939
error = device_property_read_u32(dev, "offset", &val);
940940
if (!error) {
941-
edt_ft5x06_register_write(tsdata, reg_addr->reg_offset, val);
941+
if (reg_addr->reg_offset != NO_REGISTER)
942+
edt_ft5x06_register_write(tsdata,
943+
reg_addr->reg_offset, val);
942944
tsdata->offset = val;
943945
}
944946

945947
error = device_property_read_u32(dev, "offset-x", &val);
946948
if (!error) {
947-
edt_ft5x06_register_write(tsdata, reg_addr->reg_offset_x, val);
949+
if (reg_addr->reg_offset_x != NO_REGISTER)
950+
edt_ft5x06_register_write(tsdata,
951+
reg_addr->reg_offset_x, val);
948952
tsdata->offset_x = val;
949953
}
950954

951955
error = device_property_read_u32(dev, "offset-y", &val);
952956
if (!error) {
953-
edt_ft5x06_register_write(tsdata, reg_addr->reg_offset_y, val);
957+
if (reg_addr->reg_offset_y != NO_REGISTER)
958+
edt_ft5x06_register_write(tsdata,
959+
reg_addr->reg_offset_y, val);
954960
tsdata->offset_y = val;
955961
}
956962
}

0 commit comments

Comments
 (0)