On Fri, Sep 18, 2009 at 05:02,  <[email protected]> wrote:
> Revision 7382 Author bhsong Date 2009-09-18 05:02:09 -0400 (Fri, 18 Sep
> 2009)
>
> Log Message
>
> A better fix for SPI CS issue as discussed with Mike.
> The aim of bfin_spi_cs_activer/deactive is making the cs level low/high.It
> is
> wrong&redundant to do enable/disable CS every time in bfin_spi_cs_active()/
> deactive(). What we should do is only setting the level of CS level in these
> two functions.
> Then we can enable CS only while requesting it, and disable CS while
> releasing.

hmm, how about a minor optimization.  the only places we use
chip->flag is in the active/deactive and enable/disable function.
based on the assumption that we will call active/deactive a lot more
than enable/disable (at the minimum, we'll call it the same number of
times), how about we save FLG# instead of FLS#.  then the funcs would
be:
enable() { write_FLAG(read_FLAG() | (chip->flag >> 8)); }
disable() { write_FLAG(read_FLAG() & ~(chip->flag >> 8)); }
active() { write_FLAG(read_FLAG() | chip->flag); }
deactive() { write_FLAG(read_FLAG() & ~chip->flag); }
-mike
_______________________________________________
Linux-kernel-commits mailing list
[email protected]
https://blackfin.uclinux.org/mailman/listinfo/linux-kernel-commits

Reply via email to