lkml.org 
[lkml]   [2005]   [Dec]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH/RFC] SPI: async message handing library update
Hi David --

just a cuple of notes here and below...

General one: how is it supposed to set SPI bus clock in this model? I
guess that the only option is to set it in txrx_*.
That is not optimal since it means setting clock for each transfer which
is not an optimal solution, better have a function (bitbang->set_clock
or whatever) )to set clock per message.

> if (!spi->max_speed_hz)
> spi->max_speed_hz = 500 * 1000;
>
> /* nsecs = max(50, (clock period)/2), be optimistic */
> cs->nsecs = (1000000000/2) / (spi->max_speed_hz);
> if (cs->nsecs < 50)
> cs->nsecs = 50;
>
>
Suggest not to hardcode values here.

> /* set up default clock polarity, and activate chip */
> if (!chipselect) {
> bitbang->chipselect(spi, 1);
> ndelay(nsecs);
>
>
Suggest special enum/define for chipselect value.

> /* protocol tweaks before next transfer */
> if (t->delay_usecs)
> udelay(t->delay_usecs);
>
>
Suggest nsecs here as well.

Generic note: haven't tested that with DMA, will have more comments
prolly...
Another one: I just feel comfortabel with using 'bitbang' term for the
variety of SPI stuff which this library suits.

Vitaly
-
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: 2005-12-20 19:04    [W:0.182 / U:0.316 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site