devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bjorn Andersson <bjorn.andersson@linaro.org>
To: Dmitry Torokhov <dmitry.torokhov@gmail.com>,
	Rob Herring <robh+dt@kernel.org>, Pawel Moll <pawel.moll@arm.com>,
	Mark Rutland <mark.rutland@arm.com>,
	Ian Campbell <ijc+devicetree@hellion.org.uk>,
	Andrew Duggan <aduggan@synaptics.com>,
	Christopher Heiny <cheiny@synaptics.com>
Cc: linux-input@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: [PATCH v2 3/3] input: rmi4: Remove set_page() call before core is initialized
Date: Fri,  6 May 2016 21:40:08 -0700	[thread overview]
Message-ID: <1462596008-21381-4-git-send-email-bjorn.andersson@linaro.org> (raw)
In-Reply-To: <1462596008-21381-1-git-send-email-bjorn.andersson@linaro.org>

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


  parent reply	other threads:[~2016-05-07  4:40 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-30 16:57 [PATCH] Input: synaptics-rmi4: Support regulator supplies Bjorn Andersson
     [not found] ` <1459357049-5608-1-git-send-email-bjorn.andersson-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2016-03-31 18:19   ` Dmitry Torokhov
2016-03-31 19:14     ` Bjorn Andersson
2016-04-01  1:47       ` Andrew Duggan
2016-04-21 22:37         ` Bjorn Andersson
2016-05-05 20:55           ` Andrew Duggan
     [not found]             ` <572BB344.6030100-Gq53QDLGkWKakBO8gow8eQ@public.gmane.org>
2016-05-06  0:58               ` Bjorn Andersson
2016-05-07  4:40                 ` [PATCH v2 0/3] input: rmi4: Regulator supply support Bjorn Andersson
2016-05-07  4:40                   ` [PATCH v2 1/3] input: rmi4: Move IRQ handling to rmi_driver Bjorn Andersson
2016-05-07  4:40                   ` [PATCH v2 2/3] input: rmi4: Acquire and enable VDD and VIO supplies Bjorn Andersson
2016-05-09 19:58                     ` Rob Herring
2016-05-07  4:40                   ` Bjorn Andersson [this message]
2016-05-10  0:36                   ` [PATCH v2 0/3] input: rmi4: Regulator supply support Andrew Duggan
     [not found]                     ` <57312CFB.2040304-Gq53QDLGkWKakBO8gow8eQ@public.gmane.org>
2016-05-10 15:49                       ` Bjorn Andersson
2016-05-11 23:30                         ` Andrew Duggan
2016-05-12  3:05                           ` Bjorn Andersson
2016-05-13  0:52                             ` Andrew Duggan
2016-05-13 22:29                               ` Bjorn Andersson
2016-05-16 23:55                                 ` Andrew Duggan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1462596008-21381-4-git-send-email-bjorn.andersson@linaro.org \
    --to=bjorn.andersson@linaro.org \
    --cc=aduggan@synaptics.com \
    --cc=cheiny@synaptics.com \
    --cc=devicetree@vger.kernel.org \
    --cc=dmitry.torokhov@gmail.com \
    --cc=ijc+devicetree@hellion.org.uk \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=pawel.moll@arm.com \
    --cc=robh+dt@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).