From patchwork Mon Nov 21 05:54:02 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sanchayan X-Patchwork-Id: 9438797 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 59AD3600BA for ; Mon, 21 Nov 2016 06:05:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4B86A286FC for ; Mon, 21 Nov 2016 06:05:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3E4012898B; Mon, 21 Nov 2016 06:05:54 +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=-4.1 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 2CEB0286FC for ; Mon, 21 Nov 2016 06:05:50 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1c8hiN-0006f2-GR; Mon, 21 Nov 2016 06:04:27 +0000 Received: from mail-pf0-x244.google.com ([2607:f8b0:400e:c00::244]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1c8hhY-0006Ay-A7 for linux-arm-kernel@lists.infradead.org; Mon, 21 Nov 2016 06:03:38 +0000 Received: by mail-pf0-x244.google.com with SMTP id 144so17620263pfv.0 for ; Sun, 20 Nov 2016 22:03:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=dhtX0rOIdmZqDJhRQ17/G5l1K4RrPbKNopsBFCUWHw0=; b=mn6fdZX+CgdIUcG9xs9GvLHVxisKcR4a0GgJ8l382/TRFm8OBtVMSf1ove+VRw2WMU aTMrcXxxuZIoOA89lj3E/ehSDCN5/KAO2O84LmJTmacG6gBOJr+MtW1vPdona0B8FdAl aYEFHEtJf/7n/J7rZhQKsYreqEpwjlueKjKiBwsU+rpRLbYKabCSS3pU26/3b5AcDSNs ZSV9138v1hwB3GJp8dc9bB/YE1etGtwh7uyq3dbt7T619yvLcSnrTU9v6wfrWgz92/tT S7aeb3ydEMXZmPmLI6KfwVakWNPpfI05/7ljMz3K/BNg7koZedfXC4YRoJtT3d9hjHyq 4aeQ== 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:in-reply-to:references; bh=dhtX0rOIdmZqDJhRQ17/G5l1K4RrPbKNopsBFCUWHw0=; b=Md4HuT4yCtZGN6h1ifwtFFnVxaGoNe7VWfI9HmvPoSiwTLsa4dYKW6g6YvyOlG7ZFg AQlEDWdl2JM15T3JXDFxzmeuV7M1VddpndpWzOHwK/D28XTYdt9Jj4NhSF2SX2ggEqFZ B9LL9MJBbmcSyVWJJya0H20MYzlZeZGDUIBLrwcePiFZpfZWd4F000eLSuqliK8+XfxW /fHG/57PMyYKYHOd8aWdfxhJoqwh7eX49aJIXZWP6XJAgiyhv2LGG+qhsKlY/edzIkyi 2lkl92MsOg7JAZujd2UQhbfIgi+wSxr5cJ6zyialLhafrRb9r2PkJ95rBS6HlDoXH65s yHnw== X-Gm-Message-State: AKaTC03EnsXNtvxeEdLAh60+J0SuLbqS/6SL/hSSwPl7Jx76fh7eY4OJC9w+4Avmq2rE3Q== X-Received: by 10.99.5.21 with SMTP id 21mr28602666pgf.32.1479708194562; Sun, 20 Nov 2016 22:03:14 -0800 (PST) Received: from localhost ([115.115.243.34]) by smtp.gmail.com with ESMTPSA id i194sm16018832pgc.46.2016.11.20.22.03.13 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 20 Nov 2016 22:03:14 -0800 (PST) From: Sanchayan Maity To: broonie@kernel.org Subject: [PATCH v2 2/4] spi: spi-fsl-dspi: Fix continuous selection format Date: Mon, 21 Nov 2016 11:24:02 +0530 Message-Id: <1317eff8a40789c47311c219d9cfb4105863bd9f.1479706671.git.maitysanchayan@gmail.com> X-Mailer: git-send-email 2.10.2 In-Reply-To: References: In-Reply-To: References: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20161120_220336_624207_6A328E0F X-CRM114-Status: UNSURE ( 9.18 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Sanchayan Maity , linux-spi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, stefan@agner.ch, linux-kernel@vger.kernel.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Current DMA implementation was not handling the continuous selection format viz. SPI chip select would be deasserted even between sequential serial transfers. Use the cs_change variable and correctly set or reset the CONT bit accordingly for case where peripherals require the chip select to be asserted between sequential transfers. Signed-off-by: Sanchayan Maity --- drivers/spi/spi-fsl-dspi.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/spi/spi-fsl-dspi.c b/drivers/spi/spi-fsl-dspi.c index b1ee1f5..41422cd 100644 --- a/drivers/spi/spi-fsl-dspi.c +++ b/drivers/spi/spi-fsl-dspi.c @@ -261,6 +261,8 @@ static int dspi_next_xfer_dma_submit(struct fsl_dspi *dspi) dspi->dma->tx_dma_buf[i] = SPI_PUSHR_TXDATA(val) | SPI_PUSHR_PCS(dspi->cs) | SPI_PUSHR_CTAS(0); + if (!dspi->cs_change) + dspi->dma->tx_dma_buf[i] |= SPI_PUSHR_CONT; dspi->tx += tx_word + 1; dma->tx_desc = dmaengine_prep_slave_single(dma->chan_tx,