Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f8141f66 authored by Himanshu Aggarwal's avatar Himanshu Aggarwal
Browse files

input: synaptics: add support for unprogrammed panels



Some unprogrammed touch panels from touch vendor and
wrongly programmed touch panels from factory may
return incorrect touch sensor coordinate range when
their query registers are read via I2C transaction,
but these panels work fine in the field otherwise
and their data registers give correct coordinates.
These panels give incorrect coordinates range because
either they are not programmed with a firmware file
or there was an error in programming the firmware.
In such a scenario, touch driver should not compare
the coordinate ranges retreived from touch sensor
and DT node and allow the driver operation to continue
normally.

Change-Id: Id2a5d8e7c3298adc4a583a87d577adbe951003c5
Signed-off-by: default avatarHimanshu Aggarwal <haggarwa@codeaurora.org>
parent 57301a09
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -61,6 +61,9 @@ These properties are defined only when synaptics,detect-device property is defin
 - synaptics,key-codes		: Virtual key code mappings to be used when device
				supports 2D buttons and sends coordinates instead of
				key codes.
 - synaptics,bypass-sensor-coords-check : Bypass the comparison of sensor coordinates
				range read from DT and touch controller. Used when some
				touch panels in the field are unprogrammed and misprogrammed.

Example:
	i2c@f9927000 {
+25 −1
Original line number Diff line number Diff line
@@ -2604,9 +2604,33 @@ static int synaptics_rmi4_parse_dt_children(struct device *dev,
				rmi4_pdata->package_id, rmi->package_id);
				/*
				 * Iterate over next child if package
				 * does not match
				 * id does not match
				 */
				continue;
			} else if (of_property_read_bool(child,
				"synaptics,bypass-sensor-coords-check")) {
				/*
				 * Some unprogrammed panels from touch vendor
				 * and wrongly programmed panels from factory
				 * may return incorrect sensor coordinate range
				 * when their query registers are read, but
				 * they normally work fine in field. In such
				 * a scenario, driver can bypass the comparison
				 * of coordinate range read from sensor and read
				 * from DT and continue normal operation.
				 */
				dev_info(dev,
					"%s Synaptics package id matches %d %d,"
					"but bypassing the comparison of sensor"
					"coordinates.\n", __func__,
					rmi4_pdata->package_id,
					rmi->package_id);
				dev_info(dev, "Pmax_x Pmax_y = %d:%d\n",
					rmi4_pdata->panel_maxx,
					rmi4_pdata->panel_maxy);
				dev_info(dev, "Smax_x Smax_y = %d:%d\n",
					rmi4_data->sensor_max_x,
					rmi4_data->sensor_max_y);
			} else {
				/*
				 * If package id read from DT matches the