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

Commit 00b994b5 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "input: synaptics: add ability to distinguish touch part"

parents 94a03b04 08478ca9
Loading
Loading
Loading
Loading
+35 −11
Original line number Diff line number Diff line
@@ -2597,15 +2597,44 @@ static int synaptics_rmi4_parse_dt_children(struct device *dev,
			rmi4_pdata->package_id = 0x00;
		}

		if (rmi4_pdata->package_id && (rmi4_pdata->package_id !=
					rmi->package_id)) {
		if (rmi4_pdata->package_id) {
			if (rmi4_pdata->package_id != rmi->package_id) {
				dev_err(dev,
				"%s: Synaptics package id don't match %d %d\n",
				__func__,
				rmi4_pdata->package_id, rmi->package_id);

			/* Iterate over next child if package does not match */
				/*
				 * Iterate over next child if package
				 * does not match
				 */
				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_dsx_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;
				}
			}
		}

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

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

		prop = of_find_property(child, "synaptics,button-map", NULL);
		if (prop) {
			rc = synaptics_dsx_get_button_map(dev, prop,
+26 −5
Original line number Diff line number Diff line
@@ -1753,6 +1753,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;
				}
			}
		}

@@ -1763,11 +1789,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) {