From patchwork Fri Dec 24 23:13:53 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Chou X-Patchwork-Id: 76641 X-Patchwork-Delegate: afleming@freescale.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id AA257B70D5 for ; Sat, 25 Dec 2010 10:14:49 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 3FFE22807D; Sat, 25 Dec 2010 00:14:48 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id DV8Ts90PBXGj; Sat, 25 Dec 2010 00:14:48 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 7ECE528084; Sat, 25 Dec 2010 00:14:45 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 4545928084 for ; Sat, 25 Dec 2010 00:14:43 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ElX81e-11qgb for ; Sat, 25 Dec 2010 00:14:42 +0100 (CET) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from www.wytron.com.tw (www.wytron.com.tw [211.75.82.101]) by theia.denx.de (Postfix) with ESMTPS id 8B4522807D for ; Sat, 25 Dec 2010 00:14:42 +0100 (CET) Received: from c5 ([192.168.1.250] helo=darkstar.wytron.com.tw) by www.wytron.com.tw with esmtp (Exim 4.69) (envelope-from ) id 1PWGqN-0006f6-KB; Sat, 25 Dec 2010 07:14:39 +0800 From: Thomas Chou To: Andy Fleming Date: Sat, 25 Dec 2010 07:13:53 +0800 Message-Id: <1293232433-2985-1-git-send-email-thomas@wytron.com.tw> X-Mailer: git-send-email 1.7.3.4 In-Reply-To: <1293174969-18653-3-git-send-email-thomas@wytron.com.tw> References: <1293174969-18653-3-git-send-email-thomas@wytron.com.tw> X-SA-Exim-Connect-IP: 192.168.1.250 X-SA-Exim-Mail-From: thomas@wytron.com.tw X-SA-Exim-Scanned: No (on www.wytron.com.tw); SAEximRunCond expanded to false Cc: u-boot@lists.denx.de, nios2-dev@sopc.et.ntust.edu.tw Subject: [U-Boot] [PATCH 2/4 v2] spi: add spi_set_speed func X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.9 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de This func helps mmc_spi driver set correct speed for mmc/sd, as mmc card needs 400KHz clock for spi mode initialization. Signed-off-by: Thomas Chou --- v2 remove weak func as Mike suggested. include/spi.h | 8 ++++++++ 1 files changed, 8 insertions(+), 0 deletions(-) diff --git a/include/spi.h b/include/spi.h index 320e50e..7887d0f 100644 --- a/include/spi.h +++ b/include/spi.h @@ -176,6 +176,14 @@ void spi_cs_activate(struct spi_slave *slave); void spi_cs_deactivate(struct spi_slave *slave); /*----------------------------------------------------------------------- + * Set transfer speed. + * This sets a new speed to be applied for next spi_xfer(). + * slave: The SPI slave + * hz: The transfer speed + */ +void spi_set_speed(struct spi_slave *slave, uint hz); + +/*----------------------------------------------------------------------- * Write 8 bits, then read 8 bits. * slave: The SPI slave we're communicating with * byte: Byte to be written