mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Stephen Street <stephen@streetfiresound.com>
To: David Vrabel <dvrabel@arcom.com>
Cc: linux-kernel@vger.kernel.org, David Brownell <david-b@pacbell.net>
Subject: Re: [PATCH] spi: Add PXA2xx SSP SPI Driver
Date: Tue, 07 Feb 2006 13:17:34 -0800	[thread overview]
Message-ID: <1139347054.4549.437.camel@localhost.localdomain> (raw)
In-Reply-To: <43E88970.2020107@arcom.com>

On Tue, 2006-02-07 at 11:50 +0000, David Vrabel wrote:
> PXA27x has a clock speed of 13000000 Hz.
> 
Yea... And this affects the divisor calculation depending on type of CPU
and when the CPU is a PXA260 or PXA25x which SSP port.  And worse, the
SSP controller (as opposed to the NSSP/ASSP) on the PXA25x and PXA260
use a different divisor calculation:

Serial Bit Rate = SSP Port Clock / 2 / (SCR + 1)

The pxa_regs.h file is misleading and potentially inaccurate in this
respect.

> 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.
Yes, but see qualification above.  I will fix this as you suggest, with
some modifications. FYI The CPU differences also exposed a similar
problem with the DMA setup.  Thanks!

> 
> > +	/* 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.

Will do.

I will re-post the patch again to today.  Thanks for the help.

-Stephen


  parent reply	other threads:[~2006-02-07 21:17 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-02-07  3:06 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
2006-02-07 21:27     ` Stephen Street
2006-02-07 21:17   ` Stephen Street [this message]
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=1139347054.4549.437.camel@localhost.localdomain \
    --to=stephen@streetfiresound.com \
    --cc=david-b@pacbell.net \
    --cc=dvrabel@arcom.com \
    --cc=linux-kernel@vger.kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome