From patchwork Sat May 7 04:40:08 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Andersson X-Patchwork-Id: 9037401 Return-Path: X-Original-To: patchwork-linux-input@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 6A624BF29F for ; Sat, 7 May 2016 04:40:34 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8FB87203B1 for ; Sat, 7 May 2016 04:40:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A1F28203B4 for ; Sat, 7 May 2016 04:40:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751780AbcEGEkX (ORCPT ); Sat, 7 May 2016 00:40:23 -0400 Received: from mail-pf0-f174.google.com ([209.85.192.174]:34962 "EHLO mail-pf0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751566AbcEGEkQ (ORCPT ); Sat, 7 May 2016 00:40:16 -0400 Received: by mail-pf0-f174.google.com with SMTP id 77so56174946pfv.2 for ; Fri, 06 May 2016 21:40:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=rBxCyXctQCg7TiYCf7RwF0XCK9UjW3FrJz2sYZWc278=; b=Pi5wEyxRmuZTbH2blCb5PpTuCOnA1r/h3k46cAxzkz9oZ66QV6JbKlKCkdM+F8Diqw +Rve6uXqRsanKdv98VdrDKDmQIZOyNM+FcNP63s3y5V+0IweF20aT+tMDVJvo/EvmruA VFmt7SbA1kwLgknW8+h0VM4cDg2RqgWEurssk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=rBxCyXctQCg7TiYCf7RwF0XCK9UjW3FrJz2sYZWc278=; b=NXrH5iQ/HbGwyJXd7RxUYRfALn2Q/cVEEjV9wRSRlqxBNmjAnYQ0YW1eSYghCiZcuK zGJiEUGDVqEpW72Ii/jKDfA267wawpTNEBA5HFDufs3is6gVj8j2LzAYd5JvYoGooFfA oBzG0TUenjbpyXxkV5yA3cPJ49rXVLvwqnWaTDRLGB9TOrpp2OezIdw6/kjKgwtfiTa8 ynLKqXQkax/EIvnH38LhC1Tm9pEZBp8kVWCAJ2/merEKdPyn6kgIUQCzjMAk3j0HqPkE bm6aProVec+ab7u6i7/kM5oFKlPnl9NhPuBBjud0U1RC6zWAiFfcZZb28NdF7Qpkarh/ pB/A== X-Gm-Message-State: AOPr4FWhcqhFXQZavbL4bfGR463Yj97EyaDf2eO9HbTaLIYPwMRMiF+l3HmWDpkuKatMn0FV X-Received: by 10.98.78.132 with SMTP id c126mr33645581pfb.129.1462596014794; Fri, 06 May 2016 21:40:14 -0700 (PDT) Received: from localhost.localdomain (ip68-111-223-48.sd.sd.cox.net. [68.111.223.48]) by smtp.gmail.com with ESMTPSA id k78sm24443222pfk.70.2016.05.06.21.40.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 06 May 2016 21:40:14 -0700 (PDT) From: Bjorn Andersson To: Dmitry Torokhov , Rob Herring , Pawel Moll , Mark Rutland , Ian Campbell , Andrew Duggan , Christopher Heiny 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 Message-Id: <1462596008-21381-4-git-send-email-bjorn.andersson@linaro.org> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1462596008-21381-1-git-send-email-bjorn.andersson@linaro.org> References: <1462596008-21381-1-git-send-email-bjorn.andersson@linaro.org> Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Spam-Status: No, score=-8.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- 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) {