From patchwork Sun Mar 2 14:25:10 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Axel Lin X-Patchwork-Id: 3749511 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 CD3969F1EE for ; Sun, 2 Mar 2014 14:25:17 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 02FED201B4 for ; Sun, 2 Mar 2014 14:25:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2292C20136 for ; Sun, 2 Mar 2014 14:25:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753455AbaCBOZP (ORCPT ); Sun, 2 Mar 2014 09:25:15 -0500 Received: from mail-pd0-f181.google.com ([209.85.192.181]:39251 "EHLO mail-pd0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752251AbaCBOZO (ORCPT ); Sun, 2 Mar 2014 09:25:14 -0500 Received: by mail-pd0-f181.google.com with SMTP id p10so2674784pdj.12 for ; Sun, 02 Mar 2014 06:25:14 -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=UDM7UdLtENUR4HIjBwzithad3acpiJN/cL8pwXoDhuo=; b=hZWgiUSAMfgtopMkT9RRwMXaUv1EkCK00Ji3Nf6nloJws0rPvHehL0ggHz163PzyYP CkNuHL9tx8m2RCMKa3gd5u8G6Y/xV1KGLpzVXFhO7esOpbwIAsh+qOCFli+VH3RdmQ+3 UvaUtQieasZHY+asz63KAAQUpDv7ORjw3/mHksaY7ap8nDWTJOZizYRTk1GNKvQgveRg Rj7tgI2gXgtDMqORjQDnnq5qoURhLN/xvYnl6TcyhSMvH6U8NSwGVfRJdL7iEUirRFru vPQnOXDn+ByTdM6il1ZTtdzowLo/oGkWS7LTmPugFQKdUUZSUhs5Bf17y6g2H+tcfuox KSoA== X-Gm-Message-State: ALoCoQn2RnM2vcZ1tzgs4FUdmwAi5N2lG29uuwdzEETZnUoFo3vax1kXqmyGFK3IX/lsD6BrMB/b X-Received: by 10.68.249.34 with SMTP id yr2mr4000454pbc.11.1393770314418; Sun, 02 Mar 2014 06:25:14 -0800 (PST) Received: from [192.168.0.102] (218-164-136-100.dynamic.hinet.net. [218.164.136.100]) by mx.google.com with ESMTPSA id it4sm25934602pbc.39.2014.03.02.06.25.12 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 02 Mar 2014 06:25:13 -0800 (PST) Message-ID: <1393770310.4044.0.camel@phoenix> Subject: [PATCH 1/2] spi: sun4i: Set bits_per_word_mask to only support 8 bits word length From: Axel Lin To: Mark Brown Cc: Maxime Ripard , linux-spi@vger.kernel.org Date: Sun, 02 Mar 2014 22:25:10 +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=-6.9 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 This controller only supports 8 bits word length. Set bits_per_word_mask so spi core will reject transfers that attempt to use an unsupported bits_per_word value. Signed-off-by: Axel Lin Acked-by: Maxime Ripard --- drivers/spi/spi-sun4i.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/spi/spi-sun4i.c b/drivers/spi/spi-sun4i.c index 3f82705..d266a87 100644 --- a/drivers/spi/spi-sun4i.c +++ b/drivers/spi/spi-sun4i.c @@ -392,6 +392,7 @@ static int sun4i_spi_probe(struct platform_device *pdev) master->transfer_one = sun4i_spi_transfer_one; master->num_chipselect = 4; master->mode_bits = SPI_CPOL | SPI_CPHA | SPI_CS_HIGH | SPI_LSB_FIRST; + master->bits_per_word_mask = SPI_BPW_MASK(8); master->dev.of_node = pdev->dev.of_node; master->auto_runtime_pm = true;