From patchwork Tue Apr 3 15:44:45 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergey Suloev X-Patchwork-Id: 10321505 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 619DB60390 for ; Tue, 3 Apr 2018 15:48:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5301E28BE2 for ; Tue, 3 Apr 2018 15:48:57 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 474D024BFE; Tue, 3 Apr 2018 15:48:57 +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=-1.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id BACE724BFE for ; Tue, 3 Apr 2018 15:48:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=yoAXsUMyKQzxX9X5aK5Bi53aOArAlTYtG2IVkQGBsu4=; b=IpQzaiQzlFm25aDL/JHOQea6zC g5knLbZEMetDzX/As4iBw1wR2jXzN21ZQ3a0tg4W3z7C2W1Rp7RE7VrxFy/E2NJq/koeCiJ3a4K5N UVXABfEKPjFR9ibaTwkRCcfEkQWk4xf4DyA8K+W3BNoXAvzElQDuSJb82Y1jyxgUPHzOZYvKtETGi S/DO5CbK+ag4SjlY6gNmf5hMn7WklFmPmb8c59wC0WnSzGg4e6FEqFk/t4bsGjatfPVrYj5GtbSNO Y7yem5LScXJdA8+Um1gQ4c6jgCncE1V+nGzkbpwoY0z4LFTwZKauGsk70+s+4NSsWZcimUOP4dYWs p7M3XkTg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1f3OAt-0006zZ-PU; Tue, 03 Apr 2018 15:48:43 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1f3OAo-0006uI-OS for linux-arm-kernel@bombadil.infradead.org; Tue, 03 Apr 2018 15:48:38 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=References:In-Reply-To:Message-Id:Date: Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=+428YPkX1IpGvgV5kxTuSp3K/xMbBpn23dGJQRsZ4es=; b=RB3tkc+qVGk23Z3xzTYA6YLk0 JhnW/fqEu5Syh5Gu3YtehbKZzFSw8XY4k4I1SpUpM2rJYmy5cork4k/CR+4McxMJki/bK7mYmT0WY M5djQeO6EnOt5z+jHCLwyWCnKTi4gCX+cvTYRiXTCiGG+wwyxFXtMHJeBNbalsni+yUSo5hAbVpAy R9mc7j1duQ+IrM8y7Fmjw8ZJHfjWtq1L+MKrMrxq+Va7LiU7yerjlUxh5FhdGLamMrzXRjYJvkIqA IwP9o/7pSa5APBmHS/u3TbiLSU2Ke9JTWB+txW+09O/df4JNSwGzbZqRWBb4QEo39NZC4DqOH1hjQ LIst2BLKA==; Received: from smtp57.i.mail.ru ([217.69.128.37]) by casper.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1f3O7P-0006gU-5G for linux-arm-kernel@lists.infradead.org; Tue, 03 Apr 2018 15:45:13 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=orpaltech.com; s=mailru; h=References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From; bh=+428YPkX1IpGvgV5kxTuSp3K/xMbBpn23dGJQRsZ4es=; b=GYdZir7ZYf0epz74NlQY0UB9DXikruuwL8KSJqOZ5b7sHEXZTTfVi3dZYYLnBFpDKv/V0y1qQNtcnG08GEnc+A1o/VcrK9EFdkRcd5YajIGcBOHpvkn5z+121UoXRV7UlYD8CCbYomJvIz3z+tGGwLzY3cPOgJ2yWUOL/UxxmP8=; Received: by smtp57.i.mail.ru with esmtpa (envelope-from ) id 1f3O7D-0002Dz-1h; Tue, 03 Apr 2018 18:44:55 +0300 From: Sergey Suloev To: Mark Brown , Maxime Ripard , Chen-Yu Tsai Subject: [PATCH v3 2/6] spi: sun6i: handle chip select polarity flag Date: Tue, 3 Apr 2018 18:44:45 +0300 Message-Id: <20180403154449.2443-3-ssuloev@orpaltech.com> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180403154449.2443-1-ssuloev@orpaltech.com> References: <20180403154449.2443-1-ssuloev@orpaltech.com> Authentication-Results: smtp57.i.mail.ru; auth=pass smtp.auth=ssuloev@orpaltech.com smtp.mailfrom=ssuloev@orpaltech.com X-7FA49CB5: 0D63561A33F958A5FA216DC9452C553C840FE9263A247D77057138FBDB211017725E5C173C3A84C3A1C30C8AFC676C8B5E1FC3F2CBF1C479FC839A7D10C5E1E9C4224003CC836476C0CAF46E325F83A50BF2EBBBDD9D6B0F05F538519369F3743B503F486389A921A5CC5B56E945C8DA X-Mailru-Sender: C5364AD02485212F3ACDC11E67D84917E5480C9E5D8D177AA658EDC73F7D5F16069BFC61DABEEB110841D3AAAB1726C63DDE9B364B0DF289264D2CD8C2503E8C22A194DADEED8EEDCA01A23BA9CD1BE7ED14614B50AE0675 X-Mras: OK X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180403_164507_267089_3F16AD14 X-CRM114-Status: GOOD ( 10.28 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Sergey Suloev , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-spi@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 The chip select polarity flag is declared as supported but is not handled in the code. Signed-off-by: Sergey Suloev --- drivers/spi/spi-sun6i.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/spi/spi-sun6i.c b/drivers/spi/spi-sun6i.c index 88ad45e..78acc1f 100644 --- a/drivers/spi/spi-sun6i.c +++ b/drivers/spi/spi-sun6i.c @@ -193,6 +193,12 @@ static void sun6i_spi_set_cs(struct spi_device *spi, bool enable) else reg &= ~SUN6I_TFR_CTL_CS_LEVEL; + /* Handle chip select "reverse" polarity */ + if (spi->mode & SPI_CS_HIGH) + reg &= ~SUN6I_TFR_CTL_SPOL; + else + reg |= SUN6I_TFR_CTL_SPOL; + /* We want to control the chip select manually */ reg |= SUN6I_TFR_CTL_CS_MANUAL;