[PATCH v2 3/3] input: rmi4: Remove set_page() call before core is initialized

Bjorn Andersson
2016-05-07T04:40:08Z

In the case of the chip not already being powered we can't call
set_page() before we're letting the core driver enable power to the
chip.

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
---
drivers/input/rmi4/rmi_i2c.c | 11 ++---------
drivers/input/rmi4/rmi_spi.c | 11 ++---------
2 files changed, 4 insertions(+), 18 deletions(-)

diff --git a/drivers/input/rmi4/rmi_i2c.c b/drivers/input/rmi4/rmi_i2c.c
index 18f6a9f4aeef..3e32b320c8d2 100644
--- a/drivers/input/rmi4/rmi_i2c.c
+++ b/drivers/input/rmi4/rmi_i2c.c
@@ -215,15 +215,8 @@ static int rmi_i2c_probe(struct i2c_client *client,

i2c_set_clientdata(client, rmi_i2c);

- /*
- * Setting the page to zero will (a) make sure the PSR is in a
- * known state, and (b) make sure we can talk to the device.
- */
- retval = rmi_set_page(rmi_i2c, 0);
- if (retval) {
- dev_err(&client->dev, "Failed to set page select to 0.\n");
- return retval;
- }
+ /* Invalidate current page to force rmi_set_page() on next access */
+ rmi_i2c->page = -1;

retval = rmi_register_transport_device(&rmi_i2c->xport);
if (retval) {
diff --git a/drivers/input/rmi4/rmi_spi.c b/drivers/input/rmi4/rmi_spi.c
index f3e9e488635c..36c6912685a7 100644
--- a/drivers/input/rmi4/rmi_spi.c
+++ b/drivers/input/rmi4/rmi_spi.c
@@ -410,15 +410,8 @@ static int rmi_spi_probe(struct spi_device *spi)
if (retval)
return retval;

- /*
- * Setting the page to zero will (a) make sure the PSR is in a
- * known state, and (b) make sure we can talk to the device.
- */
- retval = rmi_set_page(rmi_spi, 0);
- if (retval) {
- dev_err(&spi->dev, "Failed to set page select to 0.\n");
- return retval;
- }
+ /* Invalidate current page to force rmi_set_page() on next access */
+ rmi_spi->page = -1;

retval = rmi_register_transport_device(&rmi_spi->xport);
if (retval) {
--
2.5.0