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

Commit 475bd53e 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: Move touch driver and fix issues"

parents 5e602b64 93422299
Loading
Loading
Loading
Loading
+42 −0
Original line number Diff line number Diff line
@@ -1033,4 +1033,46 @@ config TOUCHSCREEN_FT5X06
         To compile this driver as a module, choose M here: the
         module will be called ft5x06_ts.

config TOUCHSCREEN_SYNAPTICS_I2C_RMI4
	tristate "Synaptics DSX I2C touchscreen"
	depends on I2C
	help
	  Say Y here if you have a Synaptics DSX I2C touchscreen
	  connected to your system.

	  If unsure, say N.

	  To compile this driver as a module, choose M here: the
	  module will be called synaptics_i2c_rmi4.

config TOUCHSCREEN_SYNAPTICS_DSX_RMI4_DEV
	tristate "Synaptics I2C touchscreen rmi device"
	depends on TOUCHSCREEN_SYNAPTICS_I2C_RMI4
	help
	  This enables support for character device channel for Synaptics
	  RMI4 touchscreens.

	  Say Y here if you have a Synaptics DSX I2C touchscreen
	  connected to your system.

	  If unsure, say N.

	  To compile this driver as a module, choose M here: the
	  module will be called synaptics_dsx_rmi4_dev.

config TOUCHSCREEN_SYNAPTICS_DSX_FW_UPDATE
	tristate "Synaptics I2C touchscreen firmware update"
	depends on TOUCHSCREEN_SYNAPTICS_I2C_RMI4
	help
	  This enables support for firmware update for Synaptics RMI4
	  touchscreens.

	  Say Y here if you have a Synaptics DSX I2C touchscreen
	  connected to your system.

	  If unsure, say N.

	  To compile this driver as a module, choose M here: the
	  module will be called synaptics_dsx_fw_update.

endif
+3 −0
Original line number Diff line number Diff line
@@ -84,3 +84,6 @@ obj-$(CONFIG_TOUCHSCREEN_W90X900) += w90p910_ts.o
obj-$(CONFIG_TOUCHSCREEN_TPS6507X)	+= tps6507x-ts.o
obj-$(CONFIG_TOUCHSCREEN_ZFORCE)	+= zforce_ts.o
obj-$(CONFIG_TOUCHSCREEN_MSTAR21XX)	+= msg21xx_ts.o
obj-$(CONFIG_TOUCHSCREEN_SYNAPTICS_I2C_RMI4)		+= synaptics_i2c_rmi4.o
obj-$(CONFIG_TOUCHSCREEN_SYNAPTICS_DSX_RMI4_DEV)	+= synaptics_rmi_dev.o
obj-$(CONFIG_TOUCHSCREEN_SYNAPTICS_DSX_FW_UPDATE) 	+= synaptics_fw_update.o
+30 −44
Original line number Diff line number Diff line
@@ -256,19 +256,19 @@ static struct bin_attribute dev_attr_data = {
};

static struct device_attribute attrs[] = {
	__ATTR(doreflash, S_IWUGO,
	__ATTR(doreflash, (S_IWUSR | S_IWGRP),
			synaptics_rmi4_show_error,
			fwu_sysfs_do_reflash_store),
	__ATTR(writeconfig, S_IWUGO,
	__ATTR(writeconfig, (S_IWUSR | S_IWGRP),
			synaptics_rmi4_show_error,
			fwu_sysfs_write_config_store),
	__ATTR(readconfig, S_IWUGO,
	__ATTR(readconfig, (S_IWUSR | S_IWGRP),
			synaptics_rmi4_show_error,
			fwu_sysfs_read_config_store),
	__ATTR(configarea, S_IWUGO,
	__ATTR(configarea, (S_IWUSR | S_IWGRP),
			synaptics_rmi4_show_error,
			fwu_sysfs_config_area_store),
	__ATTR(imagesize, S_IWUGO,
	__ATTR(imagesize, (S_IWUSR | S_IWGRP),
			synaptics_rmi4_show_error,
			fwu_sysfs_image_size_store),
	__ATTR(blocksize, S_IRUGO,
@@ -322,7 +322,6 @@ static void parse_header(struct image_header *header,
		header->image_size,
		header->config_size);
#endif
	return;
}

static int fwu_read_f01_device_status(struct f01_device_status *status)
@@ -439,6 +438,7 @@ static int fwu_read_interrupt_status(void)
{
	int retval;
	unsigned char interrupt_status;

	retval = fwu->fn_ptr->read(fwu->rmi4_data,
			fwu->addr_f01_interrupt_register,
			&interrupt_status,
@@ -455,6 +455,7 @@ static int fwu_read_interrupt_status(void)
static int fwu_read_f34_flash_status(void)
{
	int retval;

	retval = fwu->fn_ptr->read(fwu->rmi4_data,
			fwu->addr_f34_flash_control,
			fwu->flash_control.data,
@@ -510,6 +511,7 @@ static int fwu_wait_for_idle(int timeout_ms)
{
	int count = 0;
	int timeout_count = ((timeout_ms * 1000) / SLEEP_TIME_US) + 1;

	do {
		if (fwu->flash_control.command == 0x00)
			return 0;
@@ -556,6 +558,10 @@ static enum flash_area fwu_go_nogo(void)
	}

	imagePR = kzalloc(sizeof(MAX_FIRMWARE_ID_LEN), GFP_KERNEL);
	if (!imagePR) {
		flash_area = NONE;
		return flash_area;
	}

	/* Force update firmware when device is in bootloader mode */
	if (f01_device_status.flash_prog) {
@@ -581,11 +587,10 @@ static enum flash_area fwu_go_nogo(void)
	deviceFirmwareID = extract_uint(firmware_id);

	/* .img firmware id */
	strptr = strstr(FW_IMAGE_NAME, "PR");
	strptr = strnstr(FW_IMAGE_NAME, "PR", sizeof(FW_IMAGE_NAME));
	if (!strptr) {
		dev_err(&i2c_client->dev,
			"No valid PR number (PRxxxxxxx)" \
			"found in image file name...\n");
			"No valid PR number (PRxxxxxxx) found in image file name...\n");
		goto exit;
	}

@@ -596,7 +601,7 @@ static enum flash_area fwu_go_nogo(void)
	}
	imagePR[index] = 0;

	retval = sstrtoul(imagePR, 10, &imageFirmwareID);
	retval = kstrtoul(imagePR, 10, &imageFirmwareID);
	if (retval ==  -EINVAL) {
		dev_err(&i2c_client->dev,
			"invalid image firmware id...\n");
@@ -791,7 +796,7 @@ static int fwu_write_blocks(unsigned char *block_ptr, unsigned short block_cnt,
			dev_err(&i2c_client->dev,
					"%s: Flash block %d failed, status 0x%02X\n",
					__func__, block_num, retval);
			return -1;
			return retval;
		}

		block_ptr += fwu->block_size;
@@ -958,7 +963,7 @@ static int fwu_do_reflash(void)
		dev_err(&fwu->rmi4_data->i2c_client->dev,
				"%s: Erase all command failed, status 0x%02X\n",
				__func__, retval);
		return -1;
		return -EINVAL;
	}

	if (fwu->firmware_data) {
@@ -1228,7 +1233,7 @@ static int fwu_start_reflash(void)
		}

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

		fw_image = fw_entry->data;
@@ -1330,7 +1335,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 (%d bytes) in buffer\n",
				"%s: Not enough space (%zd bytes) in buffer\n",
				__func__, count);
		return -EINVAL;
	}
@@ -1360,10 +1365,9 @@ static ssize_t fwu_sysfs_do_reflash_store(struct device *dev,
	unsigned int input;
	struct synaptics_rmi4_data *rmi4_data = fwu->rmi4_data;

	if (sscanf(buf, "%u", &input) != 1) {
		retval = -EINVAL;
	retval = kstrtouint(buf, 10, &input);
	if (retval)
		goto exit;
	}

	if (input != 1) {
		retval = -EINVAL;
@@ -1393,10 +1397,9 @@ static ssize_t fwu_sysfs_write_config_store(struct device *dev,
	unsigned int input;
	struct synaptics_rmi4_data *rmi4_data = fwu->rmi4_data;

	if (sscanf(buf, "%u", &input) != 1) {
		retval = -EINVAL;
	retval = kstrtouint(buf, 10, &input);
	if (retval)
		goto exit;
	}

	if (input != 1) {
		retval = -EINVAL;
@@ -1426,8 +1429,9 @@ static ssize_t fwu_sysfs_read_config_store(struct device *dev,
	unsigned int input;
	struct synaptics_rmi4_data *rmi4_data = fwu->rmi4_data;

	if (sscanf(buf, "%u", &input) != 1)
		return -EINVAL;
	retval = kstrtouint(buf, 10, &input);
	if (retval)
		return retval;

	if (input != 1)
		return -EINVAL;
@@ -1449,7 +1453,7 @@ static ssize_t fwu_sysfs_config_area_store(struct device *dev,
	int retval;
	unsigned long config_area;

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

@@ -1463,9 +1467,8 @@ static ssize_t fwu_sysfs_image_size_store(struct device *dev,
{
	int retval;
	unsigned long size;
	struct synaptics_rmi4_data *rmi4_data = fwu->rmi4_data;

	retval = sstrtoul(buf, 10, &size);
	retval = kstrtoul(buf, 10, &size);
	if (retval)
		return retval;

@@ -1474,12 +1477,8 @@ static ssize_t fwu_sysfs_image_size_store(struct device *dev,

	kfree(fwu->ext_data_source);
	fwu->ext_data_source = kzalloc(fwu->image_size, GFP_KERNEL);
	if (!fwu->ext_data_source) {
		dev_err(&rmi4_data->i2c_client->dev,
				"%s: Failed to alloc mem for image data\n",
				__func__);
	if (!fwu->ext_data_source)
		return -ENOMEM;
	}

	return count;
}
@@ -1525,8 +1524,6 @@ static void synaptics_rmi4_fwu_attn(struct synaptics_rmi4_data *rmi4_data,
{
	if (fwu->intr_mask & intr_mask)
		fwu_read_f34_flash_status();

	return;
}

static void synaptics_rmi4_fwu_work(struct work_struct *work)
@@ -1541,18 +1538,11 @@ static int synaptics_rmi4_fwu_init(struct synaptics_rmi4_data *rmi4_data)
	struct pdt_properties pdt_props;

	fwu = kzalloc(sizeof(*fwu), GFP_KERNEL);
	if (!fwu) {
		dev_err(&rmi4_data->i2c_client->dev,
				"%s: Failed to alloc mem for fwu\n",
				__func__);
	if (!fwu)
		goto exit;
	}

	fwu->fn_ptr = kzalloc(sizeof(*(fwu->fn_ptr)), GFP_KERNEL);
	if (!fwu->fn_ptr) {
		dev_err(&rmi4_data->i2c_client->dev,
				"%s: Failed to alloc mem for fn_ptr\n",
				__func__);
		retval = -ENOMEM;
		goto exit_free_fwu;
	}
@@ -1665,8 +1655,6 @@ static void synaptics_rmi4_fwu_remove(struct synaptics_rmi4_data *rmi4_data)
	kfree(fwu);

	complete(&remove_complete);

	return;
}

static int __init rmi4_fw_update_module_init(void)
@@ -1686,7 +1674,6 @@ static void __exit rmi4_fw_update_module_exit(void)
			synaptics_rmi4_fwu_remove,
			synaptics_rmi4_fwu_attn);
	wait_for_completion(&remove_complete);
	return;
}

module_init(rmi4_fw_update_module_init);
@@ -1695,4 +1682,3 @@ module_exit(rmi4_fw_update_module_exit);
MODULE_AUTHOR("Synaptics, Inc.");
MODULE_DESCRIPTION("RMI4 FW Update Module");
MODULE_LICENSE("GPL");
MODULE_VERSION(SYNAPTICS_RMI4_DRIVER_VERSION);
+49 −92
Original line number Diff line number Diff line
@@ -198,7 +198,7 @@ static struct device_attribute attrs[] = {
			synaptics_rmi4_full_pm_cycle_show,
			synaptics_rmi4_full_pm_cycle_store),
#endif
	__ATTR(reset, S_IWUGO,
	__ATTR(reset, (S_IWUSR | S_IWGRP),
			synaptics_rmi4_show_error,
			synaptics_rmi4_f01_reset_store),
	__ATTR(productinfo, S_IRUGO,
@@ -210,7 +210,7 @@ static struct device_attribute attrs[] = {
	__ATTR(flashprog, S_IRUGO,
			synaptics_rmi4_f01_flashprog_show,
			synaptics_rmi4_store_error),
	__ATTR(0dbutton, (S_IRUGO | S_IWUGO),
	__ATTR(0dbutton, (S_IRUGO | S_IWUSR | S_IWGRP),
			synaptics_rmi4_0dbutton_show,
			synaptics_rmi4_0dbutton_store),
};
@@ -232,11 +232,13 @@ static ssize_t synaptics_rmi4_full_pm_cycle_show(struct device *dev,
static ssize_t synaptics_rmi4_full_pm_cycle_store(struct device *dev,
		struct device_attribute *attr, const char *buf, size_t count)
{
	int ret;
	unsigned int input;
	struct synaptics_rmi4_data *rmi4_data = dev_get_drvdata(dev);

	if (sscanf(buf, "%u", &input) != 1)
		return -EINVAL;
	ret = kstrtouint(buf, 10, &input);
	if (ret)
		return ret;

	rmi4_data->full_pm_cycle = input > 0 ? 1 : 0;

@@ -251,8 +253,9 @@ static ssize_t synaptics_rmi4_f01_reset_store(struct device *dev,
	unsigned int reset;
	struct synaptics_rmi4_data *rmi4_data = dev_get_drvdata(dev);

	if (sscanf(buf, "%u", &reset) != 1)
		return -EINVAL;
	retval = kstrtouint(buf, 10, &reset);
	if (retval)
		return retval;

	if (reset != 1)
		return -EINVAL;
@@ -339,8 +342,9 @@ static ssize_t synaptics_rmi4_0dbutton_store(struct device *dev,

	rmi = &(rmi4_data->rmi4_mod_info);

	if (sscanf(buf, "%u", &input) != 1)
		return -EINVAL;
	retval = kstrtouint(buf, 10, &input);
	if (retval)
		return retval;

	input = input > 0 ? 1 : 0;

@@ -769,8 +773,6 @@ static void synaptics_rmi4_f1a_report(struct synaptics_rmi4_data *rmi4_data,
	}

	input_sync(rmi4_data->input_dev);

	return;
}

 /**
@@ -812,8 +814,6 @@ static void synaptics_rmi4_report_touch(struct synaptics_rmi4_data *rmi4_data,
	default:
		break;
	}

	return;
}

 /**
@@ -952,7 +952,7 @@ static int synaptics_rmi4_irq_enable(struct synaptics_rmi4_data *rmi4_data,
 *
 * Called by synaptics_rmi4_query_device().
 *
 * This funtion parses information from the Function 11 registers
 * This function parses information from the Function 11 registers
 * and determines the number of fingers supported, x and y data ranges,
 * offset to the associated interrupt status register, interrupt bit
 * mask, and gathers finger data acquisition capabilities from the query
@@ -1034,12 +1034,8 @@ static int synaptics_rmi4_f1a_alloc_mem(struct synaptics_rmi4_data *rmi4_data,
	struct synaptics_rmi4_f1a_handle *f1a;

	f1a = kzalloc(sizeof(*f1a), GFP_KERNEL);
	if (!f1a) {
		dev_err(&rmi4_data->i2c_client->dev,
				"%s: Failed to alloc mem for function handle\n",
				__func__);
	if (!f1a)
		return -ENOMEM;
	}

	fhandler->data = (void *)f1a;

@@ -1059,21 +1055,13 @@ static int synaptics_rmi4_f1a_alloc_mem(struct synaptics_rmi4_data *rmi4_data,

	f1a->button_data_buffer = kcalloc(f1a->button_bitmask_size,
			sizeof(*(f1a->button_data_buffer)), GFP_KERNEL);
	if (!f1a->button_data_buffer) {
		dev_err(&rmi4_data->i2c_client->dev,
				"%s: Failed to alloc mem for data buffer\n",
				__func__);
	if (!f1a->button_data_buffer)
		return -ENOMEM;
	}

	f1a->button_map = kcalloc(f1a->button_count,
			sizeof(*(f1a->button_map)), GFP_KERNEL);
	if (!f1a->button_map) {
		dev_err(&rmi4_data->i2c_client->dev,
				"%s: Failed to alloc mem for button map\n",
				__func__);
	if (!f1a->button_map)
		return -ENOMEM;
	}

	return 0;
}
@@ -1088,8 +1076,7 @@ static int synaptics_rmi4_capacitance_button_map(

	if (!pdata->capacitance_button_map) {
		dev_err(&rmi4_data->i2c_client->dev,
				"%s: capacitance_button_map is" \
				"NULL in board file\n",
				"%s: capacitance_button_map is NULL in board file\n",
				__func__);
		return -ENODEV;
	} else if (!pdata->capacitance_button_map->map) {
@@ -1097,7 +1084,7 @@ static int synaptics_rmi4_capacitance_button_map(
				"%s: Button map is missing in board file\n",
				__func__);
		return -ENODEV;
	} else {
	}
	if (pdata->capacitance_button_map->nbuttons !=
		f1a->button_count) {
		f1a->valid_button_count = min(f1a->button_count,
@@ -1109,7 +1096,6 @@ static int synaptics_rmi4_capacitance_button_map(
	for (ii = 0; ii < f1a->valid_button_count; ii++)
		f1a->button_map[ii] =
				pdata->capacitance_button_map->map[ii];
	}

	return 0;
}
@@ -1124,8 +1110,6 @@ static void synaptics_rmi4_f1a_kfree(struct synaptics_rmi4_fn *fhandler)
		kfree(f1a);
		fhandler->data = NULL;
	}

	return;
}

static int synaptics_rmi4_f1a_init(struct synaptics_rmi4_data *rmi4_data,
@@ -1256,7 +1240,7 @@ static int synaptics_rmi4_query_device_info(
 *
 * Called by synaptics_rmi4_probe().
 *
 * This funtion scans the page description table, records the offsets
 * This function scans the page description table, records the offsets
 * to the register types of Function $01, sets up the function handlers
 * for Function $11 and Function $12, determines the number of interrupt
 * sources from the sensor, adds valid Functions with data inputs to the
@@ -1421,7 +1405,8 @@ flash_prog_mode:
			list_for_each_entry(fhandler,
						&rmi->support_fn_list, link) {
				if (fhandler->num_of_data_sources) {
					rmi4_data->intr_mask[fhandler->intr_reg_num] |=
					rmi4_data->intr_mask
						[fhandler->intr_reg_num] |=
							fhandler->intr_mask;
				}
			}
@@ -1530,8 +1515,6 @@ static void synaptics_rmi4_detection_work(struct work_struct *work)
		}
	}
	mutex_unlock(&exp_fn_list_mutex);

	return;
}

/**
@@ -1589,8 +1572,6 @@ void synaptics_rmi4_new_function(enum exp_fn fn_type, bool insert,

exit:
	mutex_unlock(&exp_fn_list_mutex);

	return;
}
EXPORT_SYMBOL(synaptics_rmi4_new_function);

@@ -1600,7 +1581,7 @@ EXPORT_SYMBOL(synaptics_rmi4_new_function);
 * Called by the kernel when an association with an I2C device of the
 * same name is made (after doing i2c_add_driver).
 *
 * This funtion allocates and initializes the resources for the driver
 * This function allocates and initializes the resources for the driver
 * as an input driver, turns on the power to the sensor, queries the
 * sensor for its supported Functions and characteristics, registers
 * the driver to the input subsystem, sets up the interrupt, handles
@@ -1608,7 +1589,7 @@ EXPORT_SYMBOL(synaptics_rmi4_new_function);
 * and creates a work queue for detection of other expansion Function
 * modules.
 */
static int __devinit synaptics_rmi4_probe(struct i2c_client *client,
static int synaptics_rmi4_probe(struct i2c_client *client,
		const struct i2c_device_id *dev_id)
{
	int retval;
@@ -1637,26 +1618,19 @@ static int __devinit synaptics_rmi4_probe(struct i2c_client *client,
	}

	rmi4_data = kzalloc(sizeof(*rmi4_data) * 2, GFP_KERNEL);
	if (!rmi4_data) {
		dev_err(&client->dev,
				"%s: Failed to alloc mem for rmi4_data\n",
				__func__);
	if (!rmi4_data)
		return -ENOMEM;
	}

	rmi = &(rmi4_data->rmi4_mod_info);

	rmi4_data->input_dev = input_allocate_device();
	if (rmi4_data->input_dev == NULL) {
		dev_err(&client->dev,
				"%s: Failed to allocate input device\n",
				__func__);
		retval = -ENOMEM;
		goto err_input_device;
	}

	if (platform_data->regulator_en) {
		rmi4_data->regulator = regulator_get(&client->dev, "vdd");
		rmi4_data->regulator = devm_regulator_get(&client->dev, "vdd");
		if (IS_ERR(rmi4_data->regulator)) {
			dev_err(&client->dev,
					"%s: Failed to get regulator\n",
@@ -1664,7 +1638,9 @@ static int __devinit synaptics_rmi4_probe(struct i2c_client *client,
			retval = PTR_ERR(rmi4_data->regulator);
			goto err_regulator;
		}
		regulator_enable(rmi4_data->regulator);
		retval = regulator_enable(rmi4_data->regulator);
		if (retval)
			return retval;
	}

	rmi4_data->i2c_client = client;
@@ -1773,17 +1749,6 @@ static int __devinit synaptics_rmi4_probe(struct i2c_client *client,
			&rmi4_data->det_work,
			msecs_to_jiffies(EXP_FN_DET_INTERVAL));

	if (platform_data->gpio_config) {
		retval = platform_data->gpio_config(platform_data->irq_gpio,
							true);
		if (retval < 0) {
			dev_err(&client->dev,
					"%s: Failed to configure GPIO\n",
					__func__);
			goto err_gpio;
		}
	}

	rmi4_data->irq = gpio_to_irq(platform_data->irq_gpio);

	retval = synaptics_rmi4_irq_enable(rmi4_data, true);
@@ -1814,7 +1779,6 @@ err_sysfs:
	}

err_enable_irq:
err_gpio:
	input_unregister_device(rmi4_data->input_dev);

err_register_input:
@@ -1850,11 +1814,11 @@ err_input_device:
 * Called by the kernel when the association with an I2C device of the
 * same name is broken (when the driver is unloaded).
 *
 * This funtion terminates the work queue, stops sensor data acquisition,
 * This function terminates the work queue, stops sensor data acquisition,
 * frees the interrupt, unregisters the driver from the input subsystem,
 * turns off the power to the sensor, and frees other allocated resources.
 */
static int __devexit synaptics_rmi4_remove(struct i2c_client *client)
static int synaptics_rmi4_remove(struct i2c_client *client)
{
	unsigned char attr_count;
	struct synaptics_rmi4_fn *fhandler;
@@ -1940,11 +1904,8 @@ static void synaptics_rmi4_sensor_sleep(struct synaptics_rmi4_data *rmi4_data)
				__func__);
		rmi4_data->sensor_sleep = false;
		return;
	} else {
		rmi4_data->sensor_sleep = true;
	}

	return;
	rmi4_data->sensor_sleep = true;
}

 /**
@@ -1984,11 +1945,8 @@ static void synaptics_rmi4_sensor_wake(struct synaptics_rmi4_data *rmi4_data)
				__func__);
		rmi4_data->sensor_sleep = true;
		return;
	} else {
		rmi4_data->sensor_sleep = false;
	}

	return;
	rmi4_data->sensor_sleep = false;
}

#ifdef CONFIG_HAS_EARLYSUSPEND
@@ -2014,8 +1972,6 @@ static void synaptics_rmi4_early_suspend(struct early_suspend *h)

	if (rmi4_data->full_pm_cycle)
		synaptics_rmi4_suspend(&(rmi4_data->input_dev->dev));

	return;
}

 /**
@@ -2041,8 +1997,6 @@ static void synaptics_rmi4_late_resume(struct early_suspend *h)
		rmi4_data->touch_stopped = false;
		synaptics_rmi4_irq_enable(rmi4_data, true);
	}

	return;
}
#endif

@@ -2087,12 +2041,16 @@ static int synaptics_rmi4_suspend(struct device *dev)
 */
static int synaptics_rmi4_resume(struct device *dev)
{
	int ret;
	struct synaptics_rmi4_data *rmi4_data = dev_get_drvdata(dev);
	const struct synaptics_rmi4_platform_data *platform_data =
			rmi4_data->board;

	if (platform_data->regulator_en)
		regulator_enable(rmi4_data->regulator);
	if (platform_data->regulator_en) {
		ret = regulator_enable(rmi4_data->regulator);
		if (ret)
			return ret;
	}

	synaptics_rmi4_sensor_wake(rmi4_data);
	rmi4_data->touch_stopped = false;
@@ -2122,7 +2080,7 @@ static struct i2c_driver synaptics_rmi4_driver = {
#endif
	},
	.probe = synaptics_rmi4_probe,
	.remove = __devexit_p(synaptics_rmi4_remove),
	.remove = synaptics_rmi4_remove,
	.id_table = synaptics_rmi4_id_table,
};

@@ -2145,7 +2103,7 @@ static int __init synaptics_rmi4_init(void)
 *
 * Called by the kernel when the driver is unloaded.
 *
 * This funtion unregisters the driver from the I2C subsystem.
 * This function unregisters the driver from the I2C subsystem.
 *
 */
static void __exit synaptics_rmi4_exit(void)
@@ -2159,4 +2117,3 @@ module_exit(synaptics_rmi4_exit);
MODULE_AUTHOR("Synaptics, Inc.");
MODULE_DESCRIPTION("Synaptics RMI4 I2C Touch Driver");
MODULE_LICENSE("GPL v2");
MODULE_VERSION(SYNAPTICS_RMI4_DRIVER_VERSION);
+3 −15
Original line number Diff line number Diff line
@@ -30,20 +30,6 @@
#include <linux/earlysuspend.h>
#endif

#if (LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 38))
#define KERNEL_ABOVE_2_6_38
#endif

#ifdef KERNEL_ABOVE_2_6_38
#define sstrtoul(...) kstrtoul(__VA_ARGS__)
#else
#define sstrtoul(...) strict_strtoul(__VA_ARGS__)
#endif

#if (LINUX_VERSION_CODE > KERNEL_VERSION(3, 7, 0))
#define KERNEL_ABOVE_3_7
#endif

#define PDT_PROPS (0x00EF)
#define PDT_START (0x00E9)
#define PDT_END (0x000A)
@@ -176,7 +162,7 @@ struct synaptics_rmi4_device_info {
 * @det_work: work thread instance for expansion function detection
 * @det_workqueue: pointer to work queue for work thread instance
 * @early_suspend: instance to support early suspend power management
 * @current_page: current page in sensor to acess
 * @current_page: current page in sensor to access
 * @button_0d_enabled: flag for 0d button support
 * @full_pm_cycle: flag for full power management cycle in early suspend stage
 * @num_of_intr_regs: number of interrupt registers
@@ -205,7 +191,9 @@ struct synaptics_rmi4_data {
	struct mutex rmi4_io_ctrl_mutex;
	struct delayed_work det_work;
	struct workqueue_struct *det_workqueue;
#ifdef CONFIG_HAS_EARLYSUSPEND
	struct early_suspend early_suspend;
#endif
	unsigned char current_page;
	unsigned char button_0d_enabled;
	unsigned char full_pm_cycle;
Loading