linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: grant.likely@secretlab.ca (Grant Likely)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v3 1/2] spi: implemented driver for Cirrus EP93xx SPI controller
Date: Mon, 19 Apr 2010 13:05:55 -0600	[thread overview]
Message-ID: <j2hfa686aa41004191205jf61e53ectc994ab0e5a2c4c53@mail.gmail.com> (raw)
In-Reply-To: <o2g56d259a01004191152w9c2245fdgaa2d4ac1b9e95ed7@mail.gmail.com>

On Mon, Apr 19, 2010 at 12:52 PM, Martin Guy <martinwguy@gmail.com> wrote:
> On 4/19/10, Grant Likely <grant.likely@secretlab.ca> wrote:
>> ?>> > + ? ? ? /*
>> ?>> > + ? ? ? ?* Calculate divisors so that we can get speed according the
>> ?>> > + ? ? ? ?* following formula:
>> ?>> > + ? ? ? ?* ? ? ?rate = spi_clock_rate / (cpsr * (1 + scr))
>> ?>> > + ? ? ? ?*
>> ?>> > + ? ? ? ?* cpsr must be even number and starts from 2, scr can be any number
>> ?>> > + ? ? ? ?* between 0 and 255.
>> ?>> > + ? ? ? ?*/
>> ?>> > + ? ? ? for (cpsr = 2; cpsr <= 254; cpsr += 2) {
>> ?>> > + ? ? ? ? ? ? ? for (scr = 0; scr <= 255; scr++) {
>> ?>>
>> ?>> Non-deterministic.
> Eh? Some new meaning of "non-deterministic" that I wasn'f familiar with? :)
>
> Yes, it does look gross, but max clock rate is 3.7Mhz (7.4 in rev E2
> silicon), so if your slowest device is 400kHz, in practice it only
> runs the inner loop from 0 to less than 10.
> How slow do SPI devices go in reality? The 254*256 divisor gives 100Hz.

Fair enough.  s/non-deterministic/gross/  :-p  I just prefer to see
analytic solutions over numerical ones.  :-)  As I said, I won't
object to the driver because of these lines.

g.

-- 
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.

  reply	other threads:[~2010-04-19 19:05 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-13 14:10 [PATCH v3 0/2] spi: driver for Cirrus EP93xx SPI controller Mika Westerberg
2010-04-13 14:10 ` [PATCH v3 1/2] spi: implemented " Mika Westerberg
2010-04-13 14:10   ` [PATCH v3 2/2] ep93xx: SPI driver platform support code Mika Westerberg
2010-04-16 18:40     ` [spi-devel-general] " H Hartley Sweeten
2010-04-17  6:30   ` [PATCH v3 1/2] spi: implemented driver for Cirrus EP93xx SPI controller Grant Likely
2010-04-17 11:00     ` Mika Westerberg
2010-04-19 18:02       ` Grant Likely
2010-04-19 18:52         ` Martin Guy
2010-04-19 19:05           ` Grant Likely [this message]
2010-04-19 19:26             ` Martin Guy
2010-04-19 19:16         ` Martin Guy
2010-05-20  4:56           ` Grant Likely
2010-04-20  6:16         ` Mika Westerberg
2010-04-16 18:28 ` [spi-devel-general] [PATCH v3 0/2] spi: " H Hartley Sweeten
2010-04-17  4:59   ` Mika Westerberg
2010-04-17 18:43     ` Martin Guy
2010-04-18  5:33       ` Mika Westerberg
2010-04-19 17:04     ` H Hartley Sweeten
2010-04-19 17:44       ` Mika Westerberg
2010-04-19 18:11         ` H Hartley Sweeten

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=j2hfa686aa41004191205jf61e53ectc994ab0e5a2c4c53@mail.gmail.com \
    --to=grant.likely@secretlab.ca \
    --cc=linux-arm-kernel@lists.infradead.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;
as well as URLs for NNTP newsgroup(s).