Received: by 10.213.65.68 with SMTP id h4csp3667387imn; Tue, 3 Apr 2018 08:48:26 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/scVA64a6xLXn7iXPrugs3xby48nJMzf7lCtuLjEyplXLldEcX/UzsueAOgA3uyoQ5EmqO X-Received: by 10.98.153.204 with SMTP id t73mr11012678pfk.121.1522770505943; Tue, 03 Apr 2018 08:48:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522770505; cv=none; d=google.com; s=arc-20160816; b=svVxivCziJpayRBsj/TYming59GrLQrXdhMu1Lyl+KDeTLrOnWCfqcWtQfEiMeCUK9 ao3yyH0xtVZZjMx2+PYDD2jRL/adi5n9d3cK937W7xaveENcgdmzL1+xEYN9mkyWTFlu leiofg7b861juDZGdlFFy/LJVzL7qVT5vYz5WUtHYpiRSb2NKPd6z6L8LrPIGB903htd ktBjT853iiM/Sc4fycAa/6214WIgwR2z4vOU1pgEOcaVgDs6DsX8ykvsBpPKebMMHLds eoKDtyvCO+4Z1Me7yH+Y8Llnrl01dD4iAbNkGmHh8HFfAaKGd8tp2CQBafXiFXEycAXg mKXA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=+428YPkX1IpGvgV5kxTuSp3K/xMbBpn23dGJQRsZ4es=; b=z984tn5eZbDmROKrYvieI7sdQKPGO4z15k/ZgRc9JilST8SX8WNSVCUcAiZlXhPYwD GqNJl6g1zqvhKtlDQ2d3uQ4Xf4/LfZFh5rOfHoGyDaXgChVpYpjSoEnkHtYROczrF7ko b1rpCbWFIOusUURdifABaFQjbFm8XksL4qoJJ1Q1zUTTg2HLb+qjpXH5t6vRLjw3evW3 oEoOI+H2ch2PsUYYLqPzGnXg72QuX4wUMTBgDX4JqegAoj6e0dNuhwhmrVs+k2AP9Bcr Y5K2fyBFZEE7dfqlCwyieKPOaak1JhdKu6fhwC4dG6g+HkXtWvC31eaER4eqiF60zQET N4RQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@orpaltech.com header.s=mailru header.b=GYdZir7Z; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w33-v6si782263plb.176.2018.04.03.08.48.11; Tue, 03 Apr 2018 08:48:25 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@orpaltech.com header.s=mailru header.b=GYdZir7Z; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752718AbeDCPqU (ORCPT + 99 others); Tue, 3 Apr 2018 11:46:20 -0400 Received: from smtp57.i.mail.ru ([217.69.128.37]:43002 "EHLO smtp57.i.mail.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752117AbeDCPo5 (ORCPT ); Tue, 3 Apr 2018 11:44:57 -0400 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 Cc: linux-spi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Sergey Suloev 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 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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; -- 2.16.2