From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mike Frysinger Date: Sat, 8 Jan 2011 20:44:51 -0500 Subject: [U-Boot] [PATCH] spi: add new driver for OpenCores tiny_spi In-Reply-To: <1294530963-8606-1-git-send-email-thomas@wytron.com.tw> References: <1294530963-8606-1-git-send-email-thomas@wytron.com.tw> Message-ID: <201101082044.52773.vapier@gentoo.org> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Saturday, January 08, 2011 18:56:03 Thomas Chou wrote: > + */ > +#include space between comment and includes > +#include > +#define TINY_SPI_RXDATA 0 space between includes and defines > +static struct tiny_spi_host tiny_spi_host_list[] = CONFIG_SYS_TINY_SPI_LIST; i think you only read this, so you'll want to add "const" > +__attribute__((weak)) > +int spi_cs_is_valid(unsigned int bus, unsigned int cs) > + > +__attribute__((weak)) > +void spi_cs_activate(struct spi_slave *slave) > + > +__attribute__((weak)) > +void spi_cs_deactivate(struct spi_slave *slave) only reason i had these marked weak in the Blackfin SPI driver was because i didn't support GPIO CS's. now that that's fixed, i dropped the weak markings. either way is fine of course; just giving some background info. > + tiny_spi->baud = DIV_ROUND_UP(host->freq, hz * 2) - 1; > + if (tiny_spi->baud > (1 << host->baudwidth) - 1) > + tiny_spi->baud = (1 << host->baudwidth) - 1; might be simpler to use: tiny_spi->baud = max(DIV_ROUND_UP(host->freq, hz * 2), (1 << host->baudwidth)) - 1; otherwise code looks fine -mike -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 836 bytes Desc: This is a digitally signed message part. Url : http://lists.denx.de/pipermail/u-boot/attachments/20110108/25ee407c/attachment.pgp