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

Commit d5e6e0fa authored by Dmitry Torokhov's avatar Dmitry Torokhov
Browse files

Merge branch 'synaptics-rmi4' into next

Bring in latest RMI4 support in preparation to the merge window.
parents 57b8443d f32361b7
Loading
Loading
Loading
Loading
+12 −16
Original line number Diff line number Diff line
@@ -9,9 +9,11 @@ config RMI4_CORE

	  If unsure, say Y.

if RMI4_CORE

config RMI4_I2C
	tristate "RMI4 I2C Support"
	depends on RMI4_CORE && I2C
	depends on I2C
	help
	  Say Y here if you want to support RMI4 devices connected to an I2C
	  bus.
@@ -20,7 +22,7 @@ config RMI4_I2C

config RMI4_SPI
	tristate "RMI4 SPI Support"
	depends on RMI4_CORE && SPI
	depends on SPI
	help
	  Say Y here if you want to support RMI4 devices connected to a SPI
	  bus.
@@ -29,7 +31,7 @@ config RMI4_SPI

config RMI4_SMB
	tristate "RMI4 SMB Support"
	depends on RMI4_CORE && I2C
	depends on I2C
	help
	  Say Y here if you want to support RMI4 devices connected to an SMB
	  bus.
@@ -41,7 +43,6 @@ config RMI4_SMB

config RMI4_F03
	bool "RMI4 Function 03 (PS2 Guest)"
	depends on RMI4_CORE
	depends on SERIO=y || RMI4_CORE=SERIO
	help
	  Say Y here if you want to add support for RMI4 function 03.
@@ -51,12 +52,10 @@ config RMI4_F03

config RMI4_2D_SENSOR
	bool
	depends on RMI4_CORE

config RMI4_F11
	bool "RMI4 Function 11 (2D pointing)"
	select RMI4_2D_SENSOR
	depends on RMI4_CORE
	help
	  Say Y here if you want to add support for RMI4 function 11.

@@ -67,7 +66,6 @@ config RMI4_F11
config RMI4_F12
	bool "RMI4 Function 12 (2D pointing)"
	select RMI4_2D_SENSOR
	depends on RMI4_CORE
	help
	  Say Y here if you want to add support for RMI4 function 12.

@@ -77,7 +75,6 @@ config RMI4_F12

config RMI4_F30
	bool "RMI4 Function 30 (GPIO LED)"
	depends on RMI4_CORE
	help
	  Say Y here if you want to add support for RMI4 function 30.

@@ -86,7 +83,6 @@ config RMI4_F30

config RMI4_F34
	bool "RMI4 Function 34 (Device reflash)"
	depends on RMI4_CORE
	select FW_LOADER
	help
	  Say Y here if you want to add support for RMI4 function 34.
@@ -97,7 +93,6 @@ config RMI4_F34

config RMI4_F54
	bool "RMI4 Function 54 (Analog diagnostics)"
	depends on RMI4_CORE
	depends on VIDEO_V4L2=y || (RMI4_CORE=m && VIDEO_V4L2=m)
	select VIDEOBUF2_VMALLOC
	select RMI4_F55
@@ -109,9 +104,10 @@ config RMI4_F54

config RMI4_F55
	bool "RMI4 Function 55 (Sensor tuning)"
	depends on RMI4_CORE
	help
	  Say Y here if you want to add support for RMI4 function 55

	  Function 55 provides access to the RMI4 touch sensor tuning
	  mechanism.

endif # RMI_CORE
+6 −1
Original line number Diff line number Diff line
@@ -144,8 +144,13 @@ static void rmi_2d_sensor_set_input_params(struct rmi_2d_sensor *sensor)
	int input_flags = 0;

	if (sensor->report_abs) {
		if (sensor->axis_align.swap_axes)
		if (sensor->axis_align.swap_axes) {
			swap(sensor->max_x, sensor->max_y);
			swap(sensor->axis_align.clip_x_low,
			     sensor->axis_align.clip_y_low);
			swap(sensor->axis_align.clip_x_high,
			     sensor->axis_align.clip_y_high);
		}

		sensor->min_x = sensor->axis_align.clip_x_low;
		if (sensor->axis_align.clip_x_high)
+2 −2
Original line number Diff line number Diff line
@@ -261,10 +261,10 @@ int __rmi_register_function_handler(struct rmi_function_handler *handler,
	driver->probe = rmi_function_probe;
	driver->remove = rmi_function_remove;

	error = driver_register(&handler->driver);
	error = driver_register(driver);
	if (error) {
		pr_err("driver_register() failed for %s, error: %d\n",
			handler->driver.name, error);
			driver->name, error);
		return error;
	}

+16 −3
Original line number Diff line number Diff line
@@ -265,6 +265,19 @@ static int rmi_irq_init(struct rmi_device *rmi_dev)
	return 0;
}

struct rmi_function *rmi_find_function(struct rmi_device *rmi_dev, u8 number)
{
	struct rmi_driver_data *data = dev_get_drvdata(&rmi_dev->dev);
	struct rmi_function *entry;

	list_for_each_entry(entry, &data->function_list, node) {
		if (entry->fd.function_number == number)
			return entry;
	}

	return NULL;
}

static int suspend_one_function(struct rmi_function *fn)
{
	struct rmi_function_handler *fh;
@@ -364,7 +377,7 @@ static void rmi_driver_set_input_name(struct rmi_device *rmi_dev,
				struct input_dev *input)
{
	struct rmi_driver_data *data = dev_get_drvdata(&rmi_dev->dev);
	char *device_name = rmi_f01_get_product_ID(data->f01_container);
	const char *device_name = rmi_f01_get_product_ID(data->f01_container);
	char *name;

	name = devm_kasprintf(&rmi_dev->dev, GFP_KERNEL,
@@ -836,7 +849,7 @@ static int rmi_create_function(struct rmi_device *rmi_dev,
			       void *ctx, const struct pdt_entry *pdt)
{
	struct device *dev = &rmi_dev->dev;
	struct rmi_driver_data *data = dev_get_drvdata(&rmi_dev->dev);
	struct rmi_driver_data *data = dev_get_drvdata(dev);
	int *current_irq_count = ctx;
	struct rmi_function *fn;
	int i;
@@ -1040,7 +1053,7 @@ int rmi_probe_interrupts(struct rmi_driver_data *data)
	}

	if (data->bootloader_mode)
		dev_warn(&rmi_dev->dev, "Device in bootloader mode.\n");
		dev_warn(dev, "Device in bootloader mode.\n");

	data->irq_count = irq_count;
	data->num_of_irq_regs = (data->irq_count + 7) / 8;
+2 −1
Original line number Diff line number Diff line
@@ -93,6 +93,7 @@ bool rmi_is_physical_driver(struct device_driver *);
int rmi_register_physical_driver(void);
void rmi_unregister_physical_driver(void);
void rmi_free_function_list(struct rmi_device *rmi_dev);
struct rmi_function *rmi_find_function(struct rmi_device *rmi_dev, u8 number);
int rmi_enable_sensor(struct rmi_device *rmi_dev);
int rmi_scan_pdt(struct rmi_device *rmi_dev, void *ctx,
		 int (*callback)(struct rmi_device *rmi_dev, void *ctx,
@@ -104,7 +105,7 @@ int rmi_init_functions(struct rmi_driver_data *data);
int rmi_initial_reset(struct rmi_device *rmi_dev, void *ctx,
		      const struct pdt_entry *pdt);

char *rmi_f01_get_product_ID(struct rmi_function *fn);
const char *rmi_f01_get_product_ID(struct rmi_function *fn);

#ifdef CONFIG_RMI4_F34
int rmi_f34_create_sysfs(struct rmi_device *rmi_dev);
Loading