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

Commit 9008831e 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_dsx: Read touchscreen config-id during probe"

parents 9e0cf5fa 7fd049e2
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -48,6 +48,7 @@ Optional property:
				is required only if secure touch is enabled and used with this driver.
 - clock-names:			: Clock names used for secure touch. The names are:
				"iface_clk", "core_clk".
 - synaptics,config-id		: Specifies the Config Id of touch controller.

Optional properties inside child node:
These properties are defined only when synaptics,detect-device property is defined in DT.
+35 −1
Original line number Diff line number Diff line
@@ -2235,6 +2235,32 @@ static int synaptics_rmi4_alloc_fh(struct synaptics_rmi4_fn **fhandler,
	return 0;
}

static int synaptics_rmi4_read_configid(struct synaptics_rmi4_data *rmi4_data,
		unsigned char ctrl_base_addr)
{
	unsigned int device_config_id;

	/*
	 * We may get an error while trying to read config id if it is
	 *  not provisioned by vendor
	 */
	if (synaptics_rmi4_reg_read(rmi4_data, ctrl_base_addr,
			(unsigned char *)(&device_config_id),
			 sizeof(device_config_id)) < 0)
		dev_err(rmi4_data->pdev->dev.parent, "Failed to read device config ID from CTP\n");

	if (rmi4_data->hw_if->board_data->config_id)
		dev_info(rmi4_data->pdev->dev.parent,
			"CTP Config ID=%pI4\tDT Config ID=%pI4\n",
			&device_config_id,
			&rmi4_data->hw_if->board_data->config_id);
	else
		dev_info(rmi4_data->pdev->dev.parent,
			"CTP Config ID=%pI4\n", &device_config_id);

	return 0;
}

 /**
 * synaptics_rmi4_query_device()
 *
@@ -2263,7 +2289,6 @@ static int synaptics_rmi4_query_device(struct synaptics_rmi4_data *rmi4_data)
	struct synaptics_rmi4_fn *fhandler;
	struct synaptics_rmi4_device_info *rmi;
	unsigned char pkg_id[PACKAGE_ID_SIZE];

	rmi = &(rmi4_data->rmi4_mod_info);

rescan_pdt:
@@ -2302,6 +2327,15 @@ rescan_pdt:
					page_number);

			switch (rmi_fd.fn_number) {
			case SYNAPTICS_RMI4_F34:
				/*
				 * Though function F34 is an interrupt source,
				 * but it is not a data source, hence do not
				 * add its handler to support_fn_list
				 */
				synaptics_rmi4_read_configid(rmi4_data,
						 rmi_fd.ctrl_base_addr);
				break;
			case SYNAPTICS_RMI4_F01:
				if (rmi_fd.intr_src_count == 0)
					break;
+6 −1
Original line number Diff line number Diff line
/*
 * Synaptics DSX touchscreen driver
 *
 * Copyright (c) 2014, The Linux Foundation.  All rights reserved.
 * Copyright (c) 2014-2015, The Linux Foundation.  All rights reserved.
 *
 * Linux foundation chooses to take subject only to the GPLv2 license terms,
 * and distributes only under these terms.
@@ -326,6 +326,11 @@ static int synaptics_dsx_parse_dt(struct device *dev,
		return rc;
	}

	rc = of_property_read_u32(np, "synaptics,config-id",
					&rmi4_pdata->config_id);
	if (rc && (rc != -EINVAL))
		dev_err(dev, "Unable to read config id from DT\n");

	rmi4_pdata->fw_name = "PRXXX_fw.img";
	rc = of_property_read_string(np, "synaptics,fw-name",
					&rmi4_pdata->fw_name);
+2 −0
Original line number Diff line number Diff line
@@ -5,6 +5,7 @@
 *
 * Copyright (C) 2012 Alexandra Chin <alexandra.chin@tw.synaptics.com>
 * Copyright (C) 2012 Scott Lin <scott.lin@tw.synaptics.com>
 * Copyright (c) 2015, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
@@ -96,6 +97,7 @@ struct synaptics_dsx_board_data {
	u32 disp_miny;
	u32 disp_maxx;
	u32 disp_maxy;
	u32 config_id;
	bool disable_gpios;
	bool detect_device;
	const char *fw_name;