* [PATCH 06/26] Input: synaptics-rmi4 - add a reset callback
@ 2015-11-05 23:38 Andrew Duggan
2015-11-09 13:00 ` Linus Walleij
0 siblings, 1 reply; 2+ messages in thread
From: Andrew Duggan @ 2015-11-05 23:38 UTC (permalink / raw)
To: linux-input, linux-kernel
Cc: Benjamin Tissoires, Dmitry Torokhov, Linus Walleij,
Benjamin Tissoires, Christopher Heiny, Stephen Chandler Paul
From: Benjamin Tissoires <benjamin.tissoires@redhat.com>
When a device is physically reset, the transport layer may need to reset
its state too and also do extra work to make the device accessible on the
bus.
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Tested-by: Andrew Duggan <aduggan@synaptics.com>
---
drivers/input/rmi4/rmi_bus.h | 1 +
drivers/input/rmi4/rmi_driver.c | 8 ++++++++
2 files changed, 9 insertions(+)
diff --git a/drivers/input/rmi4/rmi_bus.h b/drivers/input/rmi4/rmi_bus.h
index d4cfc85..41d6c3d 100644
--- a/drivers/input/rmi4/rmi_bus.h
+++ b/drivers/input/rmi4/rmi_bus.h
@@ -197,6 +197,7 @@ struct rmi_transport_ops {
int (*enable_device) (struct rmi_transport_dev *xport);
void (*disable_device) (struct rmi_transport_dev *xport);
+ int (*reset)(struct rmi_transport_dev *xport, u16 reset_addr);
};
/**
diff --git a/drivers/input/rmi4/rmi_driver.c b/drivers/input/rmi4/rmi_driver.c
index 264bc62..81e7c55 100644
--- a/drivers/input/rmi4/rmi_driver.c
+++ b/drivers/input/rmi4/rmi_driver.c
@@ -611,6 +611,14 @@ static int rmi_initial_reset(struct rmi_device *rmi_dev,
const struct rmi_device_platform_data *pdata =
rmi_get_platform_data(rmi_dev);
+ if (rmi_dev->xport->ops->reset) {
+ if (rmi_dev->xport->ops->reset(rmi_dev->xport,
+ cmd_addr))
+ return error;
+
+ return RMI_SCAN_DONE;
+ }
+
error = rmi_write_block(rmi_dev, cmd_addr, &cmd_buf, 1);
if (error) {
dev_err(&rmi_dev->dev,
--
2.1.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH 06/26] Input: synaptics-rmi4 - add a reset callback
2015-11-05 23:38 [PATCH 06/26] Input: synaptics-rmi4 - add a reset callback Andrew Duggan
@ 2015-11-09 13:00 ` Linus Walleij
0 siblings, 0 replies; 2+ messages in thread
From: Linus Walleij @ 2015-11-09 13:00 UTC (permalink / raw)
To: Andrew Duggan
Cc: Linux Input, linux-kernel@vger.kernel.org, Benjamin Tissoires,
Dmitry Torokhov, Benjamin Tissoires, Christopher Heiny,
Stephen Chandler Paul
On Fri, Nov 6, 2015 at 12:38 AM, Andrew Duggan <aduggan@synaptics.com> wrote:
> From: Benjamin Tissoires <benjamin.tissoires@redhat.com>
>
> When a device is physically reset, the transport layer may need to reset
> its state too and also do extra work to make the device accessible on the
> bus.
>
> Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
> Tested-by: Andrew Duggan <aduggan@synaptics.com>
Tested-by: Linus Walleij <linus.walleij@linaro.org>
Yours,
Linus Walleij
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-11-09 13:00 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-11-05 23:38 [PATCH 06/26] Input: synaptics-rmi4 - add a reset callback Andrew Duggan
2015-11-09 13:00 ` Linus Walleij
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).