lkml.org 
[lkml]   [2006]   [Feb]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] spi: Add PXA2xx SSP SPI Driver
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.

> --- linux-2.6.16-rc2/drivers/spi/pxa2xx_spi.c 1969-12-31 16:00:00.000000000 -0800
> +++ linux-spi/drivers/spi/pxa2xx_spi.c 2006-02-06 18:39:45.339334630 -0800


> +#define CLOCK_SPEED_HZ 3686400

PXA27x has a clock speed of 13000000 Hz.

> + chip->cr0 = SSCR0_SerClkDiv((CLOCK_SPEED_HZ / spi->max_speed_hz) + 2)

Consider spi->max_speed_hz == CLOCK_SPEED_HZ which gives a divisor of 3
(when it should be 1).

You need SSCR0_SerClkDiv(CLOCK_SPEED_HZ / (spi->max_speed_hz + 1) + 1)
for the correct divisor and for proper rounding.

> + /* Attach to IRQ */
> + irq = platform_get_irq(pdev, 0);
> + if (irq == 0) {
> + dev_err(&pdev->dev, "irq resource not defined\n");
> + status = -ENODEV;
> + goto out_error_master_alloc;
> + }

Greg K-H has a patch pending that makes platform_get_irq() return -ENXIO
instead of 0 on error. This is required for SSP3 on the PXA27x which
uses IRQ 0.

> + /* Release IRQ */
> + irq = platform_get_irq(pdev, 0);
> + if (irq != 0)
> + free_irq(irq, drv_data);

Similarly.

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/
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2006-02-07 12:53    [W:0.081 / U:1.128 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site