Received: by 10.213.65.68 with SMTP id h4csp54064imn; Fri, 30 Mar 2018 00:25:46 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+swAsD1tObu5smRNuhOyhW0g8NfBM+pu3GliXqgnMoc1xOvvLz49MAonJl12LVKKdx/YN7 X-Received: by 10.101.87.138 with SMTP id b10mr7688460pgr.241.1522394746288; Fri, 30 Mar 2018 00:25:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522394746; cv=none; d=google.com; s=arc-20160816; b=QxTn3AGeYUtNYcSb/VV/tV/zmNNOf1AJDoJVkoOABsWC2WTSlB/Lr33E9rjyCv8X33 l6Q1+j5hPhjP1Wsn+Hv0A8QG6vcTEl93+91bj1cO5mnxT4HysGkAfs7gTDB1kXInEKqQ V0gP0jwRPkT+Szweg6Sn7PDSPM1BiISIwl5kgUHfspCb+iqL+dW6WUVfSudAmOwAr4p5 Lrd4neWB47VX7XsKsIjJOokiYWQi/JJXHhKIAkwy278APCWCtNQM2tkbScT3XdNhjMU5 tDaoTQcv76AuAD9f+5HVIeROP63HdIj9a/Y43JzVlV2yy18OAfcJ6R9Qjk8kvH88EMDd W4MA== 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=bSHryQu5VKb9W//3uhf5cp0fQV5+Mza8RO11VpMRlk4=; b=zMgtUABC4sf/Aoa+jvBNW3wN9Q/TED3TNHXMkvkmgvrcJ9L2qpTkLYP3cPxHGgEC62 p4WiPLVr2WrW/RYHxXwsbb9fnn4xRLSwzBTzfERkM7OlnGOfxA0vyYxTzRDV85wrEYa7 T3mJlAMCnNzrOXDdZ3HQXdqycI58OHX5gLh9/LTddFI+LOq+fQ5qFPpFLmC66EbqJSFj f2ujzzTWSZ1kxF5SyKzGNtPKAStRD0S5YYZSsfQcBEDVUTSo1mGqE2abimAa9Uy7XQom 0r5gYN6GnjSnRrrlV7HLHDl2coiuitAeUOwST9xFsDOGFhxBkZL9DgVJBUQLCUJUvUUR dStA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@orpaltech.com header.s=mailru header.b=ObeVCkML; 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 u9si5197969pgc.790.2018.03.30.00.25.32; Fri, 30 Mar 2018 00:25:46 -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=ObeVCkML; 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 S1752367AbeC3HYJ (ORCPT + 99 others); Fri, 30 Mar 2018 03:24:09 -0400 Received: from smtp57.i.mail.ru ([217.69.128.37]:43936 "EHLO smtp57.i.mail.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751085AbeC3HW5 (ORCPT ); Fri, 30 Mar 2018 03:22: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=bSHryQu5VKb9W//3uhf5cp0fQV5+Mza8RO11VpMRlk4=; b=ObeVCkMLqNao2h7tyI0Nr+tsp0a6qYEz/YC2Spjdd1lH53x2/vHlrMB3Hc0CRQ+nNKWmUXDWFk9WENPGgkP5W+ghD9F7ToqMppyKx7j2dJAPl8j6zLwAVpq1wALqlfn5wZN4vU3HvQANyTk6QWeDH62sgdMDRoVmOunxVoncceA=; Received: by smtp57.i.mail.ru with esmtpa (envelope-from ) id 1f1oNC-0001IV-Pd; Fri, 30 Mar 2018 10:22: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 2/6] spi: sun6i: handle chip select polarity flag Date: Fri, 30 Mar 2018 10:22:39 +0300 Message-Id: <20180330072243.19368-3-ssuloev@orpaltech.com> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180330072243.19368-1-ssuloev@orpaltech.com> References: <20180330072243.19368-1-ssuloev@orpaltech.com> Authentication-Results: smtp57.i.mail.ru; auth=pass smtp.auth=ssuloev@orpaltech.com smtp.mailfrom=ssuloev@orpaltech.com X-7FA49CB5: 0D63561A33F958A539CCA3AC6E934867BC0A8B6031D50A009606EB66F9EE38A7725E5C173C3A84C39D7D3120FB43BDE33E9F334EFAB29724B17145F0B7815491C4224003CC836476C0CAF46E325F83A50BF2EBBBDD9D6B0F05F538519369F3743B503F486389A921A5CC5B56E945C8DA X-Mailru-Sender: C5364AD02485212F3ACDC11E67D849176E7C3182A54F3193B3A26EEC0DFD2AE6069BFC61DABEEB110841D3AAAB1726C63DDE9B364B0DF289264D2CD8C2503E8C22A194DADEED8EEDCA01A23BA9CD1BE7ED14614B50AE0675 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 ff790dc..f992a7d 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