From patchwork Thu Feb 13 02:18:15 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Axel Lin X-Patchwork-Id: 3641761 Return-Path: X-Original-To: patchwork-linux-spi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id BB4799F334 for ; Thu, 13 Feb 2014 02:18:28 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id F0A3520145 for ; Thu, 13 Feb 2014 02:18:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 227B120131 for ; Thu, 13 Feb 2014 02:18:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752107AbaBMCSW (ORCPT ); Wed, 12 Feb 2014 21:18:22 -0500 Received: from mail-pb0-f48.google.com ([209.85.160.48]:37452 "EHLO mail-pb0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752103AbaBMCSV (ORCPT ); Wed, 12 Feb 2014 21:18:21 -0500 Received: by mail-pb0-f48.google.com with SMTP id rr13so10070297pbb.21 for ; Wed, 12 Feb 2014 18:18:20 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:subject:from:to:cc:date:content-type :mime-version:content-transfer-encoding; bh=KesT9+PDyKdp+j+A5EorGF9T8VlvlA77dstNYGogkpY=; b=Ck4cynM5pcbKxJumMFTEBrSe6x7fpwo9jcELzN+1aXYRlYfv4KfSgYIptabNZrv3PM CNYuY+1t973CFLHgGXqdLnRRyH41LsUuUyHq6MOaYmwk4nMxSMH/g3TdKP73OQIsOjoZ tHcnwnMRwZNFP/tsqX2Inz0ucAEOIvduF6QqkRpHl8oht9wPM8TAuzMA/lqeCWUMKGNl CBCSWhBNHCUHzd+eeJsOeodZ/JUj2Lg3uzF5jCHgiSN7GRrhuUWmoIBJ76bDxTB/4lfX m3FCQehCslF83ZZoGlyKtI/v5F1vqGYxnOsCjmsy54H127zx64L/jaiQcNiF+eKfwJ3q VaNA== X-Gm-Message-State: ALoCoQkZxMGkdUekApocA2GfC0wxU383iUNS+qnuKN87fd/lNMuFtjPA8mty04Xq4O/UrVnJiy54 X-Received: by 10.68.11.199 with SMTP id s7mr19325470pbb.12.1392257900411; Wed, 12 Feb 2014 18:18:20 -0800 (PST) Received: from [192.168.1.102] (111-240-56-81.dynamic.hinet.net. [111.240.56.81]) by mx.google.com with ESMTPSA id js7sm714872pbc.35.2014.02.12.18.18.18 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 12 Feb 2014 18:18:19 -0800 (PST) Message-ID: <1392257895.3964.2.camel@phoenix> Subject: [PATCH] spi: sun6i: Fix define for SUN6I_TFR_CTL_CS_MASK From: Axel Lin To: Mark Brown Cc: Maxime Ripard , linux-spi@vger.kernel.org Date: Thu, 13 Feb 2014 10:18:15 +0800 X-Mailer: Evolution 3.6.4-0ubuntu1 Mime-Version: 1.0 Sender: linux-spi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org X-Spam-Status: No, score=-7.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Current code in sun6i_spi_set_cs() actually clears CPHA and CPOL bits which is obvious wrong. The define for SUN6I_TFR_CTL_CS_MASK is wrong. Fix it. Signed-off-by: Axel Lin Acked-by: Maxime Ripard --- drivers/spi/spi-sun6i.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/spi/spi-sun6i.c b/drivers/spi/spi-sun6i.c index 94d38d0..dacc8d6 100644 --- a/drivers/spi/spi-sun6i.c +++ b/drivers/spi/spi-sun6i.c @@ -36,8 +36,8 @@ #define SUN6I_TFR_CTL_CPHA BIT(0) #define SUN6I_TFR_CTL_CPOL BIT(1) #define SUN6I_TFR_CTL_SPOL BIT(2) -#define SUN6I_TFR_CTL_CS_MASK 0x3 -#define SUN6I_TFR_CTL_CS(cs) (((cs) & SUN6I_TFR_CTL_CS_MASK) << 4) +#define SUN6I_TFR_CTL_CS_MASK 0x30 +#define SUN6I_TFR_CTL_CS(cs) (((cs) << 4) & SUN6I_TFR_CTL_CS_MASK) #define SUN6I_TFR_CTL_CS_MANUAL BIT(6) #define SUN6I_TFR_CTL_CS_LEVEL BIT(7) #define SUN6I_TFR_CTL_DHB BIT(8)