From patchwork Thu Jul 1 11:58:33 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Wang X-Patchwork-Id: 109094 X-Patchwork-Delegate: grant.likely@secretlab.ca 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 o61Bx8QQ006523 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Thu, 1 Jul 2010 11:59:44 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 1OUIQ3-0003Xb-OS; Thu, 01 Jul 2010 11:59:03 +0000 Received: from sfi-mx-2.v28.ch3.sourceforge.com ([172.29.28.122] helo=mx.sourceforge.net) by sfs-ml-2.v29.ch3.sourceforge.com with esmtp (Exim 4.69) (envelope-from ) id 1OUIQ2-0003XU-0O for spi-devel-general@lists.sourceforge.net; Thu, 01 Jul 2010 11:59:02 +0000 Received-SPF: pass (sfi-mx-2.v28.ch3.sourceforge.com: domain of gmail.com designates 209.85.212.175 as permitted sender) client-ip=209.85.212.175; envelope-from=jason77.wang@gmail.com; helo=mail-px0-f175.google.com; Received: from mail-px0-f175.google.com ([209.85.212.175]) by sfi-mx-2.v28.ch3.sourceforge.com with esmtp (Exim 4.69) id 1OUIPy-0003F6-V7 for spi-devel-general@lists.sourceforge.net; Thu, 01 Jul 2010 11:58:59 +0000 Received: by pxi12 with SMTP id 12so911916pxi.34 for ; Thu, 01 Jul 2010 04:58:53 -0700 (PDT) Received: by 10.142.229.13 with SMTP id b13mr4401584wfh.341.1277985533109; Thu, 01 Jul 2010 04:58:53 -0700 (PDT) Received: from [192.168.0.183] ([180.77.200.247]) by mx.google.com with ESMTPS id 33sm6024681wfg.21.2010.07.01.04.58.44 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 01 Jul 2010 04:58:51 -0700 (PDT) Message-ID: <4C2C82E9.2010103@gmail.com> Date: Thu, 01 Jul 2010 19:58:33 +0800 From: jason User-Agent: Thunderbird 2.0.0.24 (X11/20100317) MIME-Version: 1.0 To: roman.tereshonkov@nokia.com References: <1277381565-6305-1-git-send-email-jason77.wang@gmail.com> <4C24A182.4060009@gmail.com> <4C289CCB.7010409@gmail.com> In-Reply-To: X-Spam-Score: -0.8 (/) 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 SPF_PASS SPF: sender matches SPF record -0.0 DKIM_VERIFIED Domain Keys Identified Mail: signature passes verification 0.0 DKIM_SIGNED Domain Keys Identified Mail: message has a signature 0.7 AWL AWL: From: address is in the auto white-list X-Headers-End: 1OUIPy-0003F6-V7 Cc: david-b@pacbell.net, linux-arm-kernel@lists.infradead.org, spi-devel-general@lists.sourceforge.net Subject: Re: [spi-devel-general] [PATCH] spi/omap2_mcspi: disable and enable chan between each SPI transfer 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]); Thu, 01 Jul 2010 11:59:45 +0000 (UTC) diff --git a/drivers/spi/omap2_mcspi.c b/drivers/spi/omap2_mcspi.c index b3a94ca..893a124 100644 --- a/drivers/spi/omap2_mcspi.c +++ b/drivers/spi/omap2_mcspi.c @@ -40,6 +40,8 @@ #include #include +#define VERBOSE + #define OMAP2_MCSPI_MAX_FREQ 48000000 /* OMAP2 has 3 SPI controllers, while OMAP3 has 4 */ @@ -502,6 +504,11 @@ omap2_mcspi_txrx_pio(struct spi_device *spi, struct spi_transfer *xfer) goto out; } +#ifdef VERBOSE + dev_dbg(&spi->dev, "status reg: %08x\n", + __raw_readl(chstat_reg)); +#endif + if (c == 1 && tx == NULL && (l & OMAP2_MCSPI_CHCONF_TURBO)) { omap2_mcspi_set_enable(spi, 0); @@ -893,7 +900,7 @@ static void omap2_mcspi_work(struct work_struct *work) spi = m->spi; cs = spi->controller_state; cd = spi->controller_data; - + printk("======SPI MESSAGE BEGIN======\n"); omap2_mcspi_set_enable(spi, 1); list_for_each_entry(t, &m->transfers, transfer_list) { if (t->tx_buf == NULL && t->rx_buf == NULL && t->len) { @@ -971,7 +978,7 @@ static void omap2_mcspi_work(struct work_struct *work) omap2_mcspi_force_cs(spi, 0); omap2_mcspi_set_enable(spi, 0); - + printk(".....SPI MESSAGE END.....\n"); m->status = status; m->complete(m->context); -- 1.5.6.5 test2 patch: Subject: [PATCH] SPI/test2: print tx data & rx data when ads7846 works when we touch the top-left corner of the touchscreen, the ads7846 driver will send a read-y command(one 8-bit word, 0x93) and receive y coordinate(two 8-bit words, MSB 12bits are meaningful). now print all tx word and rx word. In test2, i revert the commit a330ce2 "omap2_mcspi: Flush posted writes". Signed-off-by: Jason Wang --- drivers/spi/omap2_mcspi.c | 13 ++++++++++--- 1 files changed, 10 insertions(+), 3 deletions(-) diff --git a/drivers/spi/omap2_mcspi.c b/drivers/spi/omap2_mcspi.c index b3a94ca..cf8066e 100644 --- a/drivers/spi/omap2_mcspi.c +++ b/drivers/spi/omap2_mcspi.c @@ -40,6 +40,8 @@ #include #include +#define VERBOSE + #define OMAP2_MCSPI_MAX_FREQ 48000000 /* OMAP2 has 3 SPI controllers, while OMAP3 has 4 */ @@ -204,7 +206,7 @@ static inline void mcspi_write_chconf0(const struct spi_device *spi, u32 val) cs->chconf0 = val; mcspi_write_cs_reg(spi, OMAP2_MCSPI_CHCONF0, val); - mcspi_read_cs_reg(spi, OMAP2_MCSPI_CHCONF0); + /* mcspi_read_cs_reg(spi, OMAP2_MCSPI_CHCONF0); */ } static void omap2_mcspi_set_dma_req(const struct spi_device *spi, @@ -502,6 +504,11 @@ omap2_mcspi_txrx_pio(struct spi_device *spi, struct spi_transfer *xfer) goto out; } +#ifdef VERBOSE + dev_dbg(&spi->dev, "status reg: %08x\n", + __raw_readl(chstat_reg)); +#endif + if (c == 1 && tx == NULL && (l & OMAP2_MCSPI_CHCONF_TURBO)) { omap2_mcspi_set_enable(spi, 0); @@ -893,7 +900,7 @@ static void omap2_mcspi_work(struct work_struct *work) spi = m->spi; cs = spi->controller_state; cd = spi->controller_data; - + printk("======SPI MESSAGE BEGIN======\n"); omap2_mcspi_set_enable(spi, 1); list_for_each_entry(t, &m->transfers, transfer_list) { if (t->tx_buf == NULL && t->rx_buf == NULL && t->len) { @@ -971,7 +978,7 @@ static void omap2_mcspi_work(struct work_struct *work) omap2_mcspi_force_cs(spi, 0); omap2_mcspi_set_enable(spi, 0); - + printk(".....SPI MESSAGE END.....\n"); m->status = status; m->complete(m->context); -- 1.5.6.5 test3 patch: Subject: [PATCH] SPI/test3: print tx data & rx data when ads7846 works when we touch the top-left corner of the touchscreen, the ads7846 driver will send a read-y command(one 8-bit word, 0x93) and receive y coordinate(two 8-bit words, MSB 12bits are meaningful). now print all tx word and rx word. In test3, i add disable channel and reenable channel between each SPI transfer. Signed-off-by: Jason Wang --- drivers/spi/omap2_mcspi.c | 21 +++++++++++++++------ 1 files changed, 15 insertions(+), 6 deletions(-) diff --git a/drivers/spi/omap2_mcspi.c b/drivers/spi/omap2_mcspi.c index b3a94ca..7449365 100644 --- a/drivers/spi/omap2_mcspi.c +++ b/drivers/spi/omap2_mcspi.c @@ -40,6 +40,8 @@ #include #include +#define VERBOSE + #define OMAP2_MCSPI_MAX_FREQ 48000000 /* OMAP2 has 3 SPI controllers, while OMAP3 has 4 */ @@ -408,7 +410,6 @@ omap2_mcspi_txrx_dma(struct spi_device *spi, struct spi_transfer *xfer) count -= (word_len <= 8) ? 2 : (word_len <= 16) ? 4 : /* word_len <= 32 */ 8; - omap2_mcspi_set_enable(spi, 1); return count; }