From ed77bdf4e4bea810014cdf68b771bcbe3d47163f Mon Sep 17 00:00:00 2001 From: Guenter Roeck Date: Sat, 21 Jan 2017 23:46:16 -0800 Subject: Input: synaptics-rmi4 - use local variables consistently If a function declares a variable to access a structure element, use it conssistently. Signed-off-by: Guenter Roeck Signed-off-by: Dmitry Torokhov --- drivers/input/rmi4/rmi_driver.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'drivers/input/rmi4/rmi_driver.c') diff --git a/drivers/input/rmi4/rmi_driver.c b/drivers/input/rmi4/rmi_driver.c index cb6efe693302..30397cc7283a 100644 --- a/drivers/input/rmi4/rmi_driver.c +++ b/drivers/input/rmi4/rmi_driver.c @@ -837,7 +837,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; @@ -1041,7 +1041,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; -- cgit v1.2.3 From ce363f0dec73b8ec2209a02a7271a9e67ed61368 Mon Sep 17 00:00:00 2001 From: Nick Dyer Date: Tue, 31 Jan 2017 15:44:49 -0800 Subject: Input: synaptics-rmi4 - add sysfs interfaces for hardware IDs These attributes provide various bits of information which may be enumerated under the RMI4 protocol to user space. This may be useful for displaying the particular version which is in use, or selecting the correct firmware to flash. Signed-off-by: Nick Dyer Tested-by: Chris Healy Signed-off-by: Dmitry Torokhov --- drivers/input/rmi4/rmi_driver.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/input/rmi4/rmi_driver.c') diff --git a/drivers/input/rmi4/rmi_driver.c b/drivers/input/rmi4/rmi_driver.c index 30397cc7283a..b3985500dd91 100644 --- a/drivers/input/rmi4/rmi_driver.c +++ b/drivers/input/rmi4/rmi_driver.c @@ -365,7 +365,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, -- cgit v1.2.3 From f32361b71ae5c81b8fb96f796ab947ba2ad17aa8 Mon Sep 17 00:00:00 2001 From: Benjamin Tissoires Date: Mon, 6 Feb 2017 09:57:01 -0800 Subject: Input: synaptics-rmi4 - add rmi_find_function() If a function needs to communicate with an other, it's better to have a way to retrieve this other. Reviewed-by: Andrew Duggan Signed-off-by: Benjamin Tissoires Signed-off-by: Dmitry Torokhov --- drivers/input/rmi4/rmi_driver.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'drivers/input/rmi4/rmi_driver.c') diff --git a/drivers/input/rmi4/rmi_driver.c b/drivers/input/rmi4/rmi_driver.c index b3985500dd91..23d705be39d4 100644 --- a/drivers/input/rmi4/rmi_driver.c +++ b/drivers/input/rmi4/rmi_driver.c @@ -266,6 +266,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; -- cgit v1.2.3