From: David Vrabel <dvrabel@arcom.com>
To: stephen@streetfiresound.com
Cc: linux-kernel@vger.kernel.org, david-b@pacbell.net
Subject: Re: [PATCH] spi: Add PXA2xx SSP SPI Driver
Date: Tue, 07 Feb 2006 15:05:28 +0000 [thread overview]
Message-ID: <43E8B738.8080602@arcom.com> (raw)
In-Reply-To: <43E88970.2020107@arcom.com>
[-- Attachment #1: Type: text/plain, Size: 738 bytes --]
David Vrabel wrote:
> stephen@streetfiresound.com wrote:
>
>>From: Stephen Street <stephen@streetfiresound.com>
>>
>>The driver turns a PXA2xx synchronous serial port (SSP) into a SPI master
>>controller (see Documentation/spi/spi_summary). The driver has the following
>>features:
>
>
> I've not tested this on my PXA27x platform yet (I'll try and get this
> done this tomorrow) but a few comments.
Found time to test it today.
I needed to use DMA for all transfers (not just ones >= dma_burst_size)
since at high clock rates (> ~5 MHz) PIO just can't keep up.
David Vrabel
--
David Vrabel, Design Engineer
Arcom, Clifton Road Tel: +44 (0)1223 411200 ext. 3233
Cambridge CB1 7EA, UK Web: http://www.arcom.com/
[-- Attachment #2: drivers-spi-pxa2xx-ssp-fixes --]
[-- Type: text/plain, Size: 1626 bytes --]
Index: linux-2.6-working/drivers/spi/pxa2xx_spi.c
===================================================================
--- linux-2.6-working.orig/drivers/spi/pxa2xx_spi.c 2006-02-07 12:43:32.000000000 +0000
+++ linux-2.6-working/drivers/spi/pxa2xx_spi.c 2006-02-07 14:13:47.000000000 +0000
@@ -43,7 +43,11 @@
MODULE_DESCRIPTION("PXA2xx SSP SPI Contoller");
MODULE_LICENSE("GPL");
-#define CLOCK_SPEED_HZ 3686400
+#if defined(CONFIG_PXA25x)
+# define CLOCK_SPEED_HZ 3686400
+#elif defined(CONFIG_PXA27x)
+# define CLOCK_SPEED_HZ 13000000
+#endif
#define MAX_BUSES 3
#define DMA_INT_MASK (DCSR_ENDINTR | DCSR_STARTINTR | DCSR_BUSERR)
@@ -429,9 +433,6 @@
if (!IS_DMA_ALIGNED(drv_data->rx) || !IS_DMA_ALIGNED(drv_data->tx))
return 0;
- if (drv_data->len < drv_data->cur_chip->dma_burst_size)
- return 0;
-
/* Modify setup if rx buffer is null */
if (drv_data->rx == NULL) {
*(u32 *)(drv_data->null_dma_buf) = 0;
@@ -1014,7 +1015,7 @@
chip->cr1 = SSCR1_LBM;
}
- chip->cr0 = SSCR0_SerClkDiv((CLOCK_SPEED_HZ / spi->max_speed_hz) + 2)
+ chip->cr0 = SSCR0_SerClkDiv(CLOCK_SPEED_HZ / (spi->max_speed_hz + 1) + 1)
| SSCR0_Motorola
| SSCR0_DataSize(spi->bits_per_word & 0x0f)
| SSCR0_SSE
@@ -1218,7 +1219,7 @@
/* Attach to IRQ */
irq = platform_get_irq(pdev, 0);
- if (irq == 0) {
+ if (irq < 0) {
dev_err(&pdev->dev, "irq resource not defined\n");
status = -ENODEV;
goto out_error_master_alloc;
@@ -1378,7 +1379,7 @@
/* Release IRQ */
irq = platform_get_irq(pdev, 0);
- if (irq != 0)
+ if (irq >= 0)
free_irq(irq, drv_data);
/* Disconnect from the SPI framework */
next prev parent reply other threads:[~2006-02-07 15:05 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-02-07 3:06 [PATCH] spi: Add PXA2xx SSP SPI Driver stephen
2006-02-07 4:22 ` [PATCH] pxa2xx_spi, board support for Lubbock David Brownell
2006-02-07 11:50 ` [PATCH] spi: Add PXA2xx SSP SPI Driver David Vrabel
2006-02-07 15:05 ` David Vrabel [this message]
2006-02-07 21:27 ` Stephen Street
2006-02-07 21:17 ` Stephen Street
2006-02-10 1:38 ` [PATCH] spi: Updated " Stephen Street
2006-02-10 2:18 ` Andrew Morton
2006-02-10 23:07 ` Stephen Street
2006-02-10 23:49 ` Andrew Morton
2006-02-10 17:40 ` Nicolas Pitre
2006-02-10 22:19 ` Stephen Street
2006-02-10 22:45 ` Nicolas Pitre
2006-02-10 23:22 ` Stephen Street
2006-02-14 1:35 ` [PATCH] spi: Code Review " Stephen Street
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=43E8B738.8080602@arcom.com \
--to=dvrabel@arcom.com \
--cc=david-b@pacbell.net \
--cc=linux-kernel@vger.kernel.org \
--cc=stephen@streetfiresound.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.