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: 119446 Received: from lists.sourceforge.net (lists.sourceforge.net [216.34.181.88]) by demeter.kernel.org (8.14.4/8.14.3) with ESMTP id o7DDwxAM030758 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Fri, 13 Aug 2010 13:59:36 GMT Received: from localhost ([127.0.0.1] helo=sfs-ml-2.v29.ch3.sourceforge.com) by sfs-ml-2.v29.ch3.sourceforge.com with esmtp (Exim 4.69) (envelope-from ) id 1Ojumg-0007aS-PN; Fri, 13 Aug 2010 13:58:58 +0000 Received: from sog-mx-2.v43.ch3.sourceforge.com ([172.29.43.192] helo=mx.sourceforge.net) by sfs-ml-2.v29.ch3.sourceforge.com with esmtp (Exim 4.69) (envelope-from ) id 1Ojumf-0007aB-GL for spi-devel-general@lists.sourceforge.net; Fri, 13 Aug 2010 13:58:57 +0000 Received-SPF: pass (sog-mx-2.v43.ch3.sourceforge.com: domain of ti.com designates 198.47.26.152 as permitted sender) client-ip=198.47.26.152; envelope-from=govindraj.raja@ti.com; helo=comal.ext.ti.com; Received: from comal.ext.ti.com ([198.47.26.152]) by sog-mx-2.v43.ch3.sourceforge.com with esmtps (TLSv1:AES256-SHA:256) (Exim 4.69) id 1Ojumd-0004Er-9W for spi-devel-general@lists.sourceforge.net; Fri, 13 Aug 2010 13:58:57 +0000 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) From: "Govindraj.R" To: spi-devel-general@lists.sourceforge.net, linux-omap@vger.kernel.org User-Agent: SquirrelMail/1.4.3a X-Mailer: SquirrelMail/1.4.3a MIME-Version: 1.0 X-Priority: 3 (Normal) Importance: Normal X-Spam-Score: -1.5 (-) X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. -1.5 SPF_CHECK_PASS SPF reports sender host as permitted sender for sender-domain -0.0 T_RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -0.0 SPF_PASS SPF: sender matches SPF record 0.0 AWL AWL: From: address is in the auto white-list X-Headers-End: 1Ojumd-0004Er-9W Cc: Tony Lindgren , Hemanth V , dbrownell@users.sourceforge.net Subject: [spi-devel-general] [PATCH 1/2 v3] OMAP-McSPI: Update platform McSPI files X-BeenThere: spi-devel-general@lists.sourceforge.net X-Mailman-Version: 2.1.9 Precedence: list List-Id: Linux SPI core/device drivers discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: spi-devel-general-bounces@lists.sourceforge.net 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:37 +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 {