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

Commit 8921628d authored by Sudhakar Manapati's avatar Sudhakar Manapati
Browse files

input: synaptics: add ability to distinguish touch part



The touchscreen controllers are field-swappable on both
customer devices and internal reference devices. For
Synaptics touch controller, package ID is a unique
identifier that is used to uniquely distinguish the touch
controller part. However, it is still possible to flash
these touch controllers with different firmware images. In
such a case, same touch controller's sensor will have
different dimensions depending on the firmware image
flashed in it. The patch adds the ability to identify
the correct sensor dimension for above use case. If
package ID read from device tree matches the package ID
read from touch controller, the driver also checks if
the sensor dimensions read from device tree match those
which are read from the touch controller.

This patch is propagated from msm-3.10 kernel
(commit: 08478ca90baf7a48cdd549d4df1fdc4284b568ed
input: synaptics: add ability to distinguish touch part)

Change-Id: I8423df30c61aaa7696c494aa5f105f169ad9c954
Signed-off-by: default avatarHimanshu Aggarwal <haggarwa@codeaurora.org>
Signed-off-by: default avatarSarada Prasanna Garnayak <c_sgarna@codeaurora.org>
Signed-off-by: default avatarSudhakar Manapati <smanap@codeaurora.org>
parent f7a993a9
Loading
Loading
Loading
Loading
+26 −5
Original line number Diff line number Diff line
@@ -1754,6 +1754,32 @@ static int synaptics_rmi4_parse_dt_children(struct device *dev,
					rmi->package_id);

				continue;
			} else {
				/*
				 * If package id read from DT matches the
				 * package id value read from touch controller,
				 * also check if sensor dimensions read from DT
				 * match those read from controller, before
				 * moving further. For this first check if touch
				 * panel coordinates are defined in DT or not.
				 */
				if (of_find_property(child,
					"synaptics,panel-coords", NULL)) {
					synaptics_rmi4_get_dt_coords(dev,
						"synaptics,panel-coords",
						rmi4_pdata, child);
					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);
					if ((rmi4_pdata->panel_maxx !=
						rmi4_data->sensor_max_x) ||
						(rmi4_pdata->panel_maxy !=
						rmi4_data->sensor_max_y))
						continue;
				}
			}
		}

@@ -1764,11 +1790,6 @@ static int synaptics_rmi4_parse_dt_children(struct device *dev,
		if (rc && (rc != -EINVAL))
			return rc;

		rc = synaptics_rmi4_get_dt_coords(dev, "synaptics,panel-coords",
				rmi4_pdata, child);
		if (rc && (rc != -EINVAL))
			return rc;

		rc = synaptics_rmi4_get_button_map(dev, "synaptics,button-map",
				rmi4_pdata, child);
		if (rc < 0) {