From patchwork Thu Jul 27 15:49:33 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 9867157 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id F0ABA603F9 for ; Thu, 27 Jul 2017 15:49:39 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E2F54285DA for ; Thu, 27 Jul 2017 15:49:39 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D7D492864F; Thu, 27 Jul 2017 15:49:39 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5E50C285F5 for ; Thu, 27 Jul 2017 15:49:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751684AbdG0Ptj (ORCPT ); Thu, 27 Jul 2017 11:49:39 -0400 Received: from mga03.intel.com ([134.134.136.65]:24039 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751113AbdG0Pti (ORCPT ); Thu, 27 Jul 2017 11:49:38 -0400 Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 27 Jul 2017 08:49:38 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.40,421,1496127600"; d="scan'208";a="997879136" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga003.jf.intel.com with ESMTP; 27 Jul 2017 08:49:35 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 4DE07D8; Thu, 27 Jul 2017 18:49:34 +0300 (EEST) From: Andy Shevchenko To: Mark Brown , linux-spi@vger.kernel.org Cc: Andy Shevchenko , Mika Westerberg Subject: [PATCH v1] spi: pxa2xx: Don't touch CS pin until we have a transfer pending Date: Thu, 27 Jul 2017 18:49:33 +0300 Message-Id: <20170727154933.14143-1-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.13.2 Sender: linux-spi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP GPIO descriptors, when being requested, may configure pin at the same time. In case of SPI chip select we shouldn't do any assumptions of the state of pin since we don't know yet what chip is connected there and if it uses high or low active state. So, leave the state of pin as is until transfer will start. Fixes: 99f499cd6504 ("spi: pxa2xx: Add support for GPIO descriptor chip selects") Cc: Mika Westerberg Signed-off-by: Andy Shevchenko Acked-by: Mika Westeberg --- Note, while it has Fixes tag, it relies on 676a4e3bab44 to be reverted for newest kernel. Revert had been sent earlier today. drivers/spi/spi-pxa2xx.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/spi/spi-pxa2xx.c b/drivers/spi/spi-pxa2xx.c index 38d053682892..6e5af88b7c6f 100644 --- a/drivers/spi/spi-pxa2xx.c +++ b/drivers/spi/spi-pxa2xx.c @@ -1769,8 +1769,7 @@ static int pxa2xx_spi_probe(struct platform_device *pdev) for (i = 0; i < master->num_chipselect; i++) { struct gpio_desc *gpiod; - gpiod = devm_gpiod_get_index(dev, "cs", i, - GPIOD_OUT_HIGH); + gpiod = devm_gpiod_get_index(dev, "cs", i, GPIOD_ASIS); if (IS_ERR(gpiod)) { /* Means use native chip select */ if (PTR_ERR(gpiod) == -ENOENT)