From patchwork Fri Aug 13 13:58:46 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Govindraj.R" X-Patchwork-Id: 119444 X-Patchwork-Delegate: khilman@deeprootsystems.com Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.4/8.14.3) with ESMTP id o7DDx38K030780 for ; Fri, 13 Aug 2010 13:59:03 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934393Ab0HMN7B (ORCPT ); Fri, 13 Aug 2010 09:59:01 -0400 Received: from comal.ext.ti.com ([198.47.26.152]:32819 "EHLO comal.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934386Ab0HMN7A (ORCPT ); Fri, 13 Aug 2010 09:59:00 -0400 Received: from dlep36.itg.ti.com ([157.170.170.91]) by comal.ext.ti.com (8.13.7/8.13.7) with ESMTP id o7DDwmf0003091 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 13 Aug 2010 08:58:48 -0500 Received: from webmail.ti.com (localhost [127.0.0.1]) by dlep36.itg.ti.com (8.13.8/8.13.8) with ESMTP id o7DDwhkL020690; Fri, 13 Aug 2010 08:58:44 -0500 (CDT) Received: from 192.168.10.88 (proxying for 10.24.255.18) (SquirrelMail authenticated user x0100947); by dbdmail.itg.ti.com with HTTP; Fri, 13 Aug 2010 19:28:46 +0530 (IST) Message-ID: <65423.192.168.10.88.1281707926.squirrel@dbdmail.itg.ti.com> Date: Fri, 13 Aug 2010 19:28:46 +0530 (IST) Subject: [PATCH 1/2 v3] OMAP-McSPI: Update platform McSPI files From: "Govindraj.R" To: spi-devel-general@lists.sourceforge.net, linux-omap@vger.kernel.org Cc: "Grant Likely" , "Tony Lindgren" , dbrownell@users.sourceforge.net, "Hemanth V" User-Agent: SquirrelMail/1.4.3a X-Mailer: SquirrelMail/1.4.3a MIME-Version: 1.0 X-Priority: 3 (Normal) Importance: Normal Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Fri, 13 Aug 2010 13:59:03 +0000 (UTC) diff --git a/arch/arm/mach-omap2/devices.c b/arch/arm/mach-omap2/devices.c index 2dbb265..fa99da1 100644 --- a/arch/arm/mach-omap2/devices.c +++ b/arch/arm/mach-omap2/devices.c @@ -251,6 +251,7 @@ static inline void omap_init_sti(void) {} static struct omap2_mcspi_platform_config omap2_mcspi1_config = { .num_cs = 4, + .force_cs_mode = 1, }; static struct resource omap2_mcspi1_resources[] = { @@ -273,6 +274,10 @@ static struct platform_device omap2_mcspi1 = { static struct omap2_mcspi_platform_config omap2_mcspi2_config = { .num_cs = 2, + .mode = OMAP2_MCSPI_MASTER, + .dma_mode = 0, + .force_cs_mode = 0, + .fifo_depth = 0, }; static struct resource omap2_mcspi2_resources[] = { diff --git a/arch/arm/plat-omap/include/plat/mcspi.h b/arch/arm/plat-omap/include/plat/mcspi.h index 1254e49..23b928b 100644 --- a/arch/arm/plat-omap/include/plat/mcspi.h +++ b/arch/arm/plat-omap/include/plat/mcspi.h @@ -1,8 +1,35 @@ #ifndef _OMAP2_MCSPI_H #define _OMAP2_MCSPI_H +#define OMAP2_MCSPI_MASTER 0 +#define OMAP2_MCSPI_SLAVE 1 + +/** + * struct omap2_mcspi_platform_config - McSPI controller configuration + * @num_cs: Number of chip selects or channels supported + * @mode: SPI is master or slave + * @dma_mode: Use only DMA for data transfers + * @force_cs_mode: Use force chip select mode or auto chip select mode + * @fifo_depth: FIFO depth in bytes, max value 64 + * + * @dma_mode when set to 1 uses only dma for data transfers + * else the default behaviour is to use PIO mode for transfer + * size of 8 bytes or less. This mode is useful when mcspi + * is configured as slave + * + * @force_cs_mode when set to 1 allows continuous transfer of multiple + * spi words without toggling the chip select line. + * + * @fifo_depth when set to non zero values enables FIFO. fifo_depth + * should be set as a multiple of buffer size used for read/write. + */ + struct omap2_mcspi_platform_config { - unsigned short num_cs; + u8 num_cs; + u8 mode; + u8 dma_mode; + u8 force_cs_mode; + unsigned short fifo_depth; }; struct omap2_mcspi_device_config {