On Monday 23 January 2012 19:31:23 Simon Glass wrote: > On Sun, Jan 22, 2012 at 10:30 PM, Mike Frysinger wrote: > > This adds a SPI framework for people to hook up simulated SPI clients. > > I don't know the SPI interface as well as use - might be useful to > have a few comments and debug() things when things go wrong I think. > Please see below for some ideas.
i can add some more
> > +void spi_set_speed(struct spi_slave *slave, uint hz)
> > +{
>
> Should this store the value somewhere?
it could, but i'm not sure where it'd be used ... i don't want to get into
simulating the actual line transitions :). the SID project is for that level
of craziness:
http://sourceware.org/sid/
> > +struct spi_slave *spi_setup_slave(unsigned int bus, unsigned int cs,
> > + unsigned int max_hz, unsigned int mode)
> > +{
> > + struct sb_spi_slave *sss;
> > +
> > + if (!spi_cs_is_valid(bus, cs))
> > + return NULL;
> > +
> > + sss = malloc(sizeof(*sss));
> > + if (!sss)
> > + return NULL;
>
> Do we want a debug() message for this?
for memory failures, i don't generally think so. for other probe type
failures, sure.
> > +int spi_claim_bus(struct spi_slave *slave)
> > +{
>
> Should we track claim/release for debugging purposes?
ah, that'd be good
-mike
signature.asc
Description: This is a digitally signed message part.
_______________________________________________ U-Boot mailing list [email protected] http://lists.denx.de/mailman/listinfo/u-boot

