From patchwork Fri Mar 30 12:50:43 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergey Suloev X-Patchwork-Id: 10317811 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 5B66A60212 for ; Fri, 30 Mar 2018 14:50:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 499C02A5AE for ; Fri, 30 Mar 2018 14:50:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3E2F92A5B0; Fri, 30 Mar 2018 14:50:48 +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 9D4BD2A5AE for ; Fri, 30 Mar 2018 14:50:47 +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=hzh7G7a8PgWDx49Tgz87tAx+XTYR9XPnKh4UFhJRgIc=; b=IFCTuP79bXSxw+0gPEGoiQoitb XTkzce6KUiulz3ipYNL++BUdxmTQpsnsW1NkhkgUdTHYvHPOD41AYtUJFZm9gJdxTLQ6Ge0z0/Adw EeXqaHHkGYbznNh3aNKtYf6OlNAGR5H6dKY3iUA06QXPCWHOThBDWX1XYYbv+AC8s93K+HGcguCTj krigex117BQ8aNGvUH67s+BMS3E8TLK1MruR5so6ixdvlVBQZvPSd/d0oFHuORkUfcR8G8BO0q9ep kbUbhwvJCehFhHbpAcleyAdR/DFa9p/i4N6asqaJ/N9LX+w8bqAsL7hY8uiMueOW0vWGxCiUhv/ss /6osdyBw==; 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 1f1vMT-0004cr-I6; Fri, 30 Mar 2018 14:50:37 +0000 Received: from [2001:8b0:10b:1231::1] (helo=merlin.infradead.org) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1f1v99-0002BA-Pj for linux-arm-kernel@bombadil.infradead.org; Fri, 30 Mar 2018 14:36:51 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.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=QPMj0p/F7sIbvrYR4HlfQimE9qc5LRtmnEGWnYNZH/s=; b=gNlaja/dYkSVQMnQdtKsVYemw Ot4BNq1RqwSG6qIX4Vw8pOdjDPNZFQedjB0RvV2Sh4TFBfJJI/qEWkB+OMdqdO9ogq6RaUh+Z+lEO qZHuDkuX/QL3NVss9I4bFYP8n4N+9aqxYCGwGUspXas4QApVnpbQT1pfoG50mTOZi+2t6bzBGt1do WbJcct124wP4llGcm9nZyPO9T5W+DIS1UrWW4NMmNjM8nGcsa4bK1+ecp+K2d47y6EFNvloyvKVJl oGpRL/7kqK8R4IOtPVI2YoCqCNw3UQIP2LHV9Nc6czYAbSCEN6hu04lL2w1PZDKmE0uzuRyIy8tlu bXc07V0Zg==; Received: from smtp58.i.mail.ru ([217.69.128.38]) by merlin.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1f1tV0-0001S9-3u for linux-arm-kernel@lists.infradead.org; Fri, 30 Mar 2018 12:51:19 +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=QPMj0p/F7sIbvrYR4HlfQimE9qc5LRtmnEGWnYNZH/s=; b=mvfM7vWtCWlTyNcLYHEV8Z8SnYiT/hHVXXMg/fgqg9RSTaXRs5baFX+aMvKGYxFyjRgGPug9UUUZCkpml6F4DZYPnKpge9Vek0cbCbFaEg5uyVFnYKggN76ssnBheC9ccYlA/YuDUlU6MFpRHZya5rYJtrwJGTBZb30iK19JjoM=; Received: by smtp58.i.mail.ru with esmtpa (envelope-from ) id 1f1tUe-0001cV-37; Fri, 30 Mar 2018 15:50:56 +0300 From: Sergey Suloev To: Mark Brown , Maxime Ripard , Chen-Yu Tsai Subject: [PATCH v2 2/6] spi: sun6i: handle chip select polarity flag Date: Fri, 30 Mar 2018 15:50:43 +0300 Message-Id: <20180330125047.13936-3-ssuloev@orpaltech.com> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180330125047.13936-1-ssuloev@orpaltech.com> References: <20180330125047.13936-1-ssuloev@orpaltech.com> Authentication-Results: smtp58.i.mail.ru; auth=pass smtp.auth=ssuloev@orpaltech.com smtp.mailfrom=ssuloev@orpaltech.com X-7FA49CB5: 0D63561A33F958A5FA02BF12BAC891C926FD46E76099F7CD5705F49E3A860CED725E5C173C3A84C30584FF81F342DA0743748A6DB685256DBAAD9279A72BC9ABC4224003CC836476C0CAF46E325F83A50BF2EBBBDD9D6B0F5D41B9178041F3E72623479134186CDE6BA297DBC24807EABDAD6C7F3747799A X-Mailru-Sender: C5364AD02485212F3ACDC11E67D8491781A4B80ABAA47B337E57963255478D82069BFC61DABEEB110841D3AAAB1726C63DDE9B364B0DF289264D2CD8C2503E8C22A194DADEED8EEDCA01A23BA9CD1BE7ED14614B50AE0675 X-Mras: OK X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180330_085118_309557_CF5A688A X-CRM114-Status: UNSURE ( 8.79 ) X-CRM114-Notice: Please train this message. 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;