From patchwork Mon Feb 13 12:05:53 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: viniciusfre@gmail.com X-Patchwork-Id: 9569423 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 BC74760572 for ; Mon, 13 Feb 2017 12:06:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C75ED26CFC for ; Mon, 13 Feb 2017 12:06:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BB5FE28354; Mon, 13 Feb 2017 12:06:49 +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=-6.3 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5454226CFC for ; Mon, 13 Feb 2017 12:06:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752593AbdBMMGs (ORCPT ); Mon, 13 Feb 2017 07:06:48 -0500 Received: from mail-qk0-f193.google.com ([209.85.220.193]:36039 "EHLO mail-qk0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751966AbdBMMGs (ORCPT ); Mon, 13 Feb 2017 07:06:48 -0500 Received: by mail-qk0-f193.google.com with SMTP id p22so6591585qka.3 for ; Mon, 13 Feb 2017 04:06:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=cBJR8sQ8QTDG41QqUEQCLfjsfderxqI/hsTihPJLgb4=; b=F1W6deoB3JRIVgAr73DVp2WCyv63WNRNeN56RfeT64ze7nqbo04+cq++Bwpvw0yB43 0wCnl6gUkgbTLO+2tFsJYyJug1RJ2WCIeLGFaSfZPeyla/RdYMUm2zbBZ+Sk15dHL1XY aqmeA0355E9aZxibj9GcApcvKWdmYN1FB9XN5bgF48SgAzZI/fSrr795CgalF1DiJXkG KpJK4k1a70Csqi0aGUBq0LagxnhMr/jaMN0ncRKVddIRiYLRaBOH8bjuBjFbIf9gl1/7 /gbgv9vt5Ovhg1uFFgsbhzIZMCno9uhomgM7Nb58t9zdXxksqv5CWvQASPgPt9ne1Jd4 h7aQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=cBJR8sQ8QTDG41QqUEQCLfjsfderxqI/hsTihPJLgb4=; b=JpQm5scpmSGd8JA0LjVR4ePj72jxfJT0zDjwyq/3J4VtogKqaqcCA7RW1NcC5kMSrB pNBSpL1fyk4yErET3N9EhhfawPRu6JrChOxsXs4+T9jXsTlsrMuGdRqp4U0ngpsRdbfV KBy/DE0XJecmf+VFpc4U595hmp2UnrO0mdX7ss+qc0qaXwnTViuMTuoKVkU8FtW/X0z5 r6svXRZK4aFDE7rXjhe31kHdsaS77NeUjXmXRLuc6BWOHbunnVbtyvuqjlFLSuqUnAaG aBXE7olcTuH5jzQeOsEUviWe+ua0AOOOGmO48Ye08bvtzIvHWGCYWL2JmcCqaadlNlY9 F4OA== X-Gm-Message-State: AMke39nNoxc5cCPnOHNMse/OmoPW1RZQEfvNS4XFHxKER+0DMtLPSJLhqC9oMOuBIsdd5A== X-Received: by 10.55.66.68 with SMTP id p65mr19947232qka.187.1486987607357; Mon, 13 Feb 2017 04:06:47 -0800 (PST) Received: from debianpc.localdomain (177.207.69.220.dynamic.adsl.gvt.net.br. [177.207.69.220]) by smtp.googlemail.com with ESMTPSA id h41sm5665626qth.59.2017.02.13.04.06.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 13 Feb 2017 04:06:46 -0800 (PST) From: Vinicius Maciel To: linux-sunxi@googlegroups.com Cc: broonie@kernel.org, maxime.ripard@free-electrons.com, wens@csie.org, linux-spi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Vinicius Maciel Subject: [PATCH] spi/sun6i: Add Master Sample Data Mode for SPI Date: Mon, 13 Feb 2017 09:05:53 -0300 Message-Id: <20170213120553.6479-1-viniciusfre@gmail.com> X-Mailer: git-send-email 2.11.0 Sender: linux-spi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP In order to work appropriately, some SPI chips, such as max11043, require SPI master samples the data at the correct edge. This patch add Master Sample Data Mode bit in normal sample mode. Signed-off-by: Vinicius Maciel --- drivers/spi/spi-sun6i.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/spi/spi-sun6i.c b/drivers/spi/spi-sun6i.c index e3114832c485..170f4ad407dd 100644 --- a/drivers/spi/spi-sun6i.c +++ b/drivers/spi/spi-sun6i.c @@ -43,6 +43,7 @@ #define SUN6I_TFR_CTL_CS_LEVEL BIT(7) #define SUN6I_TFR_CTL_DHB BIT(8) #define SUN6I_TFR_CTL_FBS BIT(12) +#define SUN6I_TFR_CTL_SDM BIT(13) #define SUN6I_TFR_CTL_XCH BIT(31) #define SUN6I_INT_CTL_REG 0x10 @@ -342,6 +343,8 @@ static int sun6i_spi_runtime_resume(struct device *dev) sun6i_spi_write(sspi, SUN6I_GBL_CTL_REG, SUN6I_GBL_CTL_BUS_ENABLE | SUN6I_GBL_CTL_MASTER | SUN6I_GBL_CTL_TP); + sun6i_spi_write(sspi, SUN6I_TFR_CTL_REG, + SUN6I_TFR_CTL_SDM); return 0;