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

Commit 2c052825 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_i2c_rmi4: configure gpio using pinctrl"

parents 686239e5 fc66e37e
Loading
Loading
Loading
Loading
+42 −2
Original line number Diff line number Diff line
@@ -9,13 +9,22 @@ Required properties:
				of fingers on the panel.
 - synaptics,irq-gpio	: irq gpio
 - synaptics,reset-gpio	: reset gpio

 - pinctrl-names : This should be defined if a target uses pinctrl framework.
			See "pinctrl" in Documentation/devicetree/bindings/pinctrl/msm-pinctrl.txt.
			It should specify the names of the configs that pinctrl can install in driver.
			Following are the pinctrl configs that can be installed:
			"pmx_ts_active" : Active configuration of pins, this should specify active
			config defined in pin groups of interrupt and reset gpio.
			"pmx_ts_suspend" : Disabled configuration of pins, this should specify sleep
			config defined in pin groups of interrupt and reset gpio.
Optional property:
 - vdd-supply		: Analog power supply needed to power device
 - vcc_i2c-supply		: Power source required to pull up i2c bus
 - synaptics,i2c-pull-up	: specify to indicate pull up is needed
 - synaptics,disable-gpios	: specify to disable gpios in suspend (power saving)
 - synaptics,button-map		: virtual key code mappings to be used
 - synaptics,modify-reso	: specify to modify X-Y Maximum coordinates from driver.
				This is used only if the panel-coordinates are defined.
 - synaptics,x-flip		: modify orientation of the x axis
 - synaptics,y-flip		: modify orientation of the y axis
 - synaptics,panel-coords	: touch panel min x, min y, max x and
@@ -26,6 +35,24 @@ Optional property:
 - synaptics,fw-image-name	: name of firmware .img file in /etc/firmware
 - synaptics,power-down		: fully power down regulators in suspend
 - synaptics,do-lockdown	: perform one time lockdown procedure
 - synaptics,detect-device 	: Define this property when two Synaptics Touchscreen controllers
				need to be supported without changing the DT. In this case, all
				such devices are placed as child nodes of Synaptics touchscreen
				node. Following are the properties that can be defined inside
				these child nodes:
				- synaptics-package-id
				- synaptics,panel-coords
				- synaptics-display-coords
				- synaptics,button-map

Optional properties inside child node:
These properties are defined only when synaptics,detect-device property is defined in DT.
- synaptics,package-id		: Specifies the Package Id of touch controller.
- synaptics,panel-coords	: Specifies the Touch panel min x, min y, max x and max y
				resolution.
- synaptics,display-coords	: Specifies the display min x, min y, max x and max y
				resolution.
- synaptics,button-map		: virtual key code mappings to be used.

Example:
	i2c@f9927000 { /* BLSP1 QUP5 */
@@ -49,9 +76,22 @@ Example:
			interrupts = <17 0x2>;
			vdd-supply = <&pm8226_l19>;
			vcc_i2c-supply = <&pm8226_lvs1>;
			pinctrl-names = "pmx_ts_active","pmx_ts_suspend";
			pinctrl-0 = <&ts_int_active &ts_reset_active>;
			pinctrl-1 = <&ts_int_suspend &ts_reset_suspend>;
			synaptics,reset-gpio = <&msmgpio 16 0x00>;
			synaptics,irq-gpio = <&msmgpio 17 0x00>;
			synaptics,button-map = [8B 66 9E];
			synaptics,i2c-pull-up;
			synaptics,modify-reso;
			synaptics,detect-device;
			synaptics,device1 {
				synaptics,package-id = <3202>;
				synaptics,button-map = <139 172 158>;
			};
			synaptics,device2 {
				synaptics,package-id = <3408>;
				synaptics,display-coords = <0 0 1079 1919>;
				synaptics,panel-coords = <0 0 1079 2084>;
			};
		};
	};
+27 −20
Original line number Diff line number Diff line
@@ -354,8 +354,7 @@ static void parse_header(void)
		(data->options_firmware_id == (1 << OPTION_BUILD_INFO));

	if (img->is_contain_build_info) {
		img->firmware_id = extract_uint(data->firmware_id);
		img->package_id = (data->pkg_id_rev_msb << 8) |
		img->package_id = (data->pkg_id_msb << 8) |
				data->pkg_id_lsb;
		img->package_revision_id = (data->pkg_id_rev_msb << 8) |
				data->pkg_id_rev_lsb;
@@ -1564,7 +1563,7 @@ static int fwu_start_reflash(void)
		}

		dev_dbg(&fwu->rmi4_data->i2c_client->dev,
				"%s: Firmware image size = %zd\n",
				"%s: Firmware image size = %zu\n",
				__func__, fw_entry->size);

		fwu->data_buffer = fw_entry->data;
@@ -1675,7 +1674,7 @@ static ssize_t fwu_sysfs_show_image(struct file *data_file,

	if (count < fwu->config_size) {
		dev_err(&rmi4_data->i2c_client->dev,
				"%s: Not enough space (%zd bytes) in buffer\n",
				"%s: Not enough space (%zu bytes) in buffer\n",
				__func__, count);
		return -EINVAL;
	}
@@ -1908,12 +1907,20 @@ static ssize_t fwu_sysfs_config_area_store(struct device *dev,
		struct device_attribute *attr, const char *buf, size_t count)
{
	int retval;
	unsigned long config_area;
	unsigned short config_area;
	struct synaptics_rmi4_data *rmi4_data = fwu->rmi4_data;

	retval = kstrtoul(buf, 10, &config_area);
	retval = kstrtou16(buf, 10, &config_area);
	if (retval)
		return retval;

	if (config_area < 0x00 || config_area > 0x03) {
		dev_err(&rmi4_data->i2c_client->dev,
			"%s: Incorrect value of config_area\n",
			__func__);
		return -EINVAL;
	}

	fwu->config_area = config_area;

	return count;
@@ -2051,26 +2058,26 @@ static struct device_attribute attrs[] = {
	__ATTR(fw_name, S_IRUGO | S_IWUSR | S_IWGRP,
			fwu_sysfs_image_name_show,
			fwu_sysfs_image_name_store),
	__ATTR(force_update_fw, S_IRUGO | S_IWUSR | S_IWGRP,
			synaptics_rmi4_show_error,
	__ATTR(force_update_fw, S_IWUSR | S_IWGRP,
			NULL,
			fwu_sysfs_force_reflash_store),
	__ATTR(update_fw, S_IRUGO | S_IWUSR | S_IWGRP,
			synaptics_rmi4_show_error,
	__ATTR(update_fw, S_IWUSR | S_IWGRP,
			NULL,
			fwu_sysfs_do_reflash_store),
	__ATTR(writeconfig, S_IRUGO | S_IWUSR | S_IWGRP,
			synaptics_rmi4_show_error,
	__ATTR(writeconfig, S_IWUSR | S_IWGRP,
			NULL,
			fwu_sysfs_write_config_store),
	__ATTR(writelockdown, S_IRUGO | S_IWUSR | S_IWGRP,
			synaptics_rmi4_show_error,
	__ATTR(writelockdown, S_IWUSR | S_IWGRP,
			NULL,
			fwu_sysfs_write_lockdown_store),
	__ATTR(readconfig, S_IRUGO | S_IWUSR | S_IWGRP,
			synaptics_rmi4_show_error,
	__ATTR(readconfig, S_IWUSR | S_IWGRP,
			NULL,
			fwu_sysfs_read_config_store),
	__ATTR(configarea, S_IRUGO | S_IWUSR | S_IWGRP,
			synaptics_rmi4_show_error,
	__ATTR(configarea, S_IWUSR | S_IWGRP,
			NULL,
			fwu_sysfs_config_area_store),
	__ATTR(imagesize, S_IRUGO | S_IWUSR | S_IWGRP,
			synaptics_rmi4_show_error,
	__ATTR(imagesize, S_IWUSR | S_IWGRP,
			NULL,
			fwu_sysfs_image_size_store),
	__ATTR(blocksize, S_IRUGO,
			fwu_sysfs_block_size_show,
+620 −73

File changed.

Preview size limit exceeded, changes collapsed.

+7 −9
Original line number Diff line number Diff line
@@ -5,7 +5,7 @@
 *
 * Copyright (C) 2012 Alexandra Chin <alexandra.chin@tw.synaptics.com>
 * Copyright (C) 2012 Scott Lin <scott.lin@tw.synaptics.com>
 * Copyright (c) 2013, The Linux Foundation. All rights reserved.
 * Copyright (c) 2013-2014, 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
@@ -161,7 +161,10 @@ struct synaptics_rmi4_device_info {
	unsigned char product_id_string[SYNAPTICS_RMI4_PRODUCT_ID_SIZE + 1];
	unsigned char build_id[SYNAPTICS_RMI4_BUILD_ID_SIZE];
	unsigned char config_id[3];
	struct mutex support_fn_list_mutex;
	struct list_head support_fn_list;
	unsigned int package_id;
	unsigned int package_id_rev;
};

/*
@@ -262,6 +265,9 @@ struct synaptics_rmi4_data {
	struct early_suspend early_suspend;
#endif
#endif
	struct pinctrl *ts_pinctrl;
	struct pinctrl_state *gpio_state_active;
	struct pinctrl_state *gpio_state_suspend;
};

enum exp_fn {
@@ -286,14 +292,6 @@ void synaptics_rmi4_new_function(enum exp_fn fn_type, bool insert,
		void (*func_attn)(struct synaptics_rmi4_data *rmi4_data,
				unsigned char intr_mask));

static inline ssize_t synaptics_rmi4_show_error(struct device *dev,
		struct device_attribute *attr, char *buf)
{
	dev_warn(dev, "%s Attempted to read from write-only attribute %s\n",
			__func__, attr->attr.name);
	return -EPERM;
}

static inline ssize_t synaptics_rmi4_store_error(struct device *dev,
		struct device_attribute *attr, const char *buf, size_t count)
{
+9 −9
Original line number Diff line number Diff line
@@ -73,19 +73,19 @@ struct rmidev_data {
};

static struct device_attribute attrs[] = {
	__ATTR(open, S_IRUGO | S_IWUSR | S_IWGRP,
			synaptics_rmi4_show_error,
	__ATTR(open, S_IWUSR | S_IWGRP,
			NULL,
			rmidev_sysfs_open_store),
	__ATTR(release, S_IRUGO | S_IWUSR | S_IWGRP,
			synaptics_rmi4_show_error,
	__ATTR(release, S_IWUSR | S_IWGRP,
			NULL,
			rmidev_sysfs_release_store),
	__ATTR(address, S_IRUGO | S_IWUSR | S_IWGRP,
			synaptics_rmi4_show_error,
	__ATTR(address, S_IWUSR | S_IWGRP,
			NULL,
			rmidev_sysfs_address_store),
	__ATTR(length, S_IRUGO | S_IWUSR | S_IWGRP,
			synaptics_rmi4_show_error,
	__ATTR(length, S_IWUSR | S_IWGRP,
			NULL,
			rmidev_sysfs_length_store),
	__ATTR(data, (S_IRUGO | S_IWUSR | S_IWGRP),
	__ATTR(data, (S_IWUSR | S_IWGRP),
			rmidev_sysfs_data_show,
			rmidev_sysfs_data_store),
};
Loading