From patchwork Mon Apr 14 06:29:58 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Barry Song <21cnbao@gmail.com> X-Patchwork-Id: 3976701 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 592E09F2CC for ; Mon, 14 Apr 2014 06:30:59 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 91122201CE for ; Mon, 14 Apr 2014 06:30:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id AA385201C8 for ; Mon, 14 Apr 2014 06:30:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750823AbaDNGa5 (ORCPT ); Mon, 14 Apr 2014 02:30:57 -0400 Received: from mail-pd0-f171.google.com ([209.85.192.171]:60860 "EHLO mail-pd0-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750751AbaDNGa4 (ORCPT ); Mon, 14 Apr 2014 02:30:56 -0400 Received: by mail-pd0-f171.google.com with SMTP id r10so7706440pdi.16 for ; Sun, 13 Apr 2014 23:30:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Y++ZiqgOA4MSH41Nriwqsmh1L1jdqh5oa5JX6UiqOss=; b=PJwvKscJZ5nzWEBm4AbAfUFmlRWZ4m0m86CLhG/Y+5tlaR7Q9iHtkpWOg6uq47WaFV X3E70lcszTkdfPbo4lrJw6EjyfIRT0LXQT0seixoA8UD2fxanP3qTZXkKWG5ekzhoIsR t2z/GBJyErk31jghH856Zq1odM3HmVDKe031IyJO6LGCtVpTU/DGHWzY7rjD1G1wjZLg 7WeJFvH1sUZ05vG+EEne1RZDnfAX2tYOWCMLDenFcP9iC3dyZwfvFQnSevX3dd8cUuPk SB1jMkXEuJ0EgRzMeZcMcC5c2KnRNLFJ9+cZ5dBkl6uat+WrG2wZTRN22bN+531JU09z +SCg== X-Received: by 10.66.180.141 with SMTP id do13mr42085191pac.93.1397457056102; Sun, 13 Apr 2014 23:30:56 -0700 (PDT) Received: from localhost.localdomain ([117.136.8.58]) by mx.google.com with ESMTPSA id cz3sm31653608pbc.9.2014.04.13.23.30.52 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 13 Apr 2014 23:30:55 -0700 (PDT) From: Barry Song <21cnbao@gmail.com> To: broonie@kernel.org, linux-spi@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org, workgroup.linux@csr.com, Qipan Li , Barry Song Subject: [PATCH 2/5] spi: sirf: set SPI controller in RISC IO chipselect mode Date: Mon, 14 Apr 2014 14:29:58 +0800 Message-Id: <1397457001-5266-3-git-send-email-21cnbao@gmail.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1397457001-5266-1-git-send-email-21cnbao@gmail.com> References: <1397457001-5266-1-git-send-email-21cnbao@gmail.com> 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.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, 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 From: Qipan Li SPI bitbang supply "chipselect" interface for change chip-select line , in the SiRFSoC SPI controller, we need to enable "SPI_CS_IO_MODE", otherwise, spi_sirfsoc_chipselect() has no effect. now the driver is working is because SPI controller will control CS automatically without SPI_CS_IO_MODE. this patch makes the CS controller really controlled by software. Signed-off-by: Qipan Li Signed-off-by: Barry Song --- drivers/spi/spi-sirf.c | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-) diff --git a/drivers/spi/spi-sirf.c b/drivers/spi/spi-sirf.c index 51d7c98..9b30743 100644 --- a/drivers/spi/spi-sirf.c +++ b/drivers/spi/spi-sirf.c @@ -559,6 +559,11 @@ spi_sirfsoc_setup_transfer(struct spi_device *spi, struct spi_transfer *t) regval &= ~SIRFSOC_SPI_CMD_MODE; sspi->tx_by_cmd = false; } + /* + * set spi controller in RISC chipselect mode, we are controlling CS by + * software BITBANG_CS_ACTIVE and BITBANG_CS_INACTIVE. + */ + regval |= SIRFSOC_SPI_CS_IO_MODE; writel(regval, sspi->base + SIRFSOC_SPI_CTRL); if (IS_DMA_VALID(t)) {