From patchwork Tue Jun 28 02:41:13 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andi Shyti X-Patchwork-Id: 9201689 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 9A10E607D3 for ; Tue, 28 Jun 2016 02:42:12 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 79EE7285E0 for ; Tue, 28 Jun 2016 02:42:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5991F285E2; Tue, 28 Jun 2016 02:42:12 +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 9BB3F285E0 for ; Tue, 28 Jun 2016 02:42:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751942AbcF1CmK (ORCPT ); Mon, 27 Jun 2016 22:42:10 -0400 Received: from mailout2.samsung.com ([203.254.224.25]:43002 "EHLO mailout2.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751740AbcF1CmJ (ORCPT ); Mon, 27 Jun 2016 22:42:09 -0400 Received: from epcpsbgr1.samsung.com (u141.gpu120.samsung.co.kr [203.254.230.141]) by mailout2.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0O9G03311NH5ND50@mailout2.samsung.com>; Tue, 28 Jun 2016 11:41:29 +0900 (KST) Received: from epcpsbgm2new.samsung.com ( [172.20.52.113]) by epcpsbgr1.samsung.com (EPCPMTA) with SMTP id 00.DB.05174.9D3E1775; Tue, 28 Jun 2016 11:41:29 +0900 (KST) X-AuditID: cbfee68d-f79876d000001436-ba-5771e3d944c2 Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm2new.samsung.com (EPCPMTA) with SMTP id 25.27.04429.8D3E1775; Mon, 27 Jun 2016 19:41:28 -0700 (MST) Received: from samsunx.samsung ([10.113.63.54]) by mmp2.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0O9G00A9QNH1H050@mmp2.samsung.com>; Tue, 28 Jun 2016 11:41:28 +0900 (KST) From: Andi Shyti To: Kukjin Kim , Krzysztof Kozlowski , Mark Brown Cc: Jaehoon Chung , linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org, Andi Shyti , Andi Shyti Subject: [PATCH v2 3/5] spi: s3c64xx: do not configure the device twice Date: Tue, 28 Jun 2016 11:41:13 +0900 Message-id: <1467081676-8442-4-git-send-email-andi.shyti@samsung.com> X-Mailer: git-send-email 2.8.1 In-reply-to: <1467081676-8442-1-git-send-email-andi.shyti@samsung.com> References: <1467081676-8442-1-git-send-email-andi.shyti@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrJLMWRmVeSWpSXmKPExsWyRsSkUPfm48JwgzuXpCy2H3nGarH4x3Mm i6kPn7BZ3PjVxmrx+oWhRf/j18wWmx5fY7W4vGsOm8WM8/uYLBo/3mR34PK4vuQTs8emVZ1s HpuX1Hv0bVnF6PF5k1wAaxSXTUpqTmZZapG+XQJXxpzVjewF23kqtr17zdzAuICri5GTQ0LA ROLUu92MELaYxIV769m6GLk4hARWMEqsu76ODaZo2s9rTBCJWYwSd748Z4VwPjJKNH6+wAJS xSagKdF0+wdYh4hAscSTq//BipgFvjFKLDg5EWyHsIC7xO8Xk9lBbBYBVYmdM74DFXFw8Aq4 Snx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WZValB9fVJqTWnyI0RToronMUqLJ+cAUkFcSb2hsYmZkaWRuaGFkbK4k zvv4/7owIYH0xJLU7NTUgtQimD4mDk6pBsY5ZRfYN811Zn5q9mjbkdlHZ5qy/njOynN/7sYm vxc64ir3L9iItfnfedOsoRDGFtLbuUhUeFLpZr2FTQ0HnhUfmvBNykJe6INa0nqFy//+KVx6 Jx2et/F+5I2pa5JvScVNmffY55eghNq6Uynqf9vMXfo1lvU+XDLnrcK6s1ufTF+386SDzm1v JZbijERDLeai4kQAGNPhh8kCAAA= DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected 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 At the start of the transfer, the spi_config function is called twice, the first time when the 3c64xx_spi_prepare_message is called and the second time with the s3c64xx_spi_transfer_one, both called from the spi framework. Remove the first call at the prepare message because in that point we don't have the imformation about "bit per word" and frequency. Signed-off-by: Andi Shyti --- drivers/spi/spi-s3c64xx.c | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/drivers/spi/spi-s3c64xx.c b/drivers/spi/spi-s3c64xx.c index 14269b0..c65a9e6 100644 --- a/drivers/spi/spi-s3c64xx.c +++ b/drivers/spi/spi-s3c64xx.c @@ -676,16 +676,6 @@ static int s3c64xx_spi_prepare_message(struct spi_master *master, struct spi_device *spi = msg->spi; struct s3c64xx_spi_csinfo *cs = spi->controller_data; - /* If Master's(controller) state differs from that needed by Slave */ - if (sdd->cur_speed != spi->max_speed_hz - || sdd->cur_mode != spi->mode - || sdd->cur_bpw != spi->bits_per_word) { - sdd->cur_bpw = spi->bits_per_word; - sdd->cur_speed = spi->max_speed_hz; - sdd->cur_mode = spi->mode; - s3c64xx_spi_config(sdd); - } - /* Configure feedback delay */ writel(cs->fb_delay & 0x3, sdd->regs + S3C64XX_SPI_FB_CLK); @@ -712,6 +702,7 @@ static int s3c64xx_spi_transfer_one(struct spi_master *master, if (bpw != sdd->cur_bpw || speed != sdd->cur_speed) { sdd->cur_bpw = bpw; sdd->cur_speed = speed; + sdd->cur_mode = spi->mode; s3c64xx_spi_config(sdd); }