From: Mike Frysinger <vapier@gentoo.org>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] spi: add new driver for OpenCores tiny_spi
Date: Sat, 8 Jan 2011 20:44:51 -0500 [thread overview]
Message-ID: <201101082044.52773.vapier@gentoo.org> (raw)
In-Reply-To: <1294530963-8606-1-git-send-email-thomas@wytron.com.tw>
On Saturday, January 08, 2011 18:56:03 Thomas Chou wrote:
> + */
> +#include <common.h>
space between comment and includes
> +#include <asm/gpio.h>
> +#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
next prev parent reply other threads:[~2011-01-09 1:44 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-01-08 23:56 [U-Boot] [PATCH] spi: add new driver for OpenCores tiny_spi Thomas Chou
2011-01-09 1:44 ` Mike Frysinger [this message]
2011-01-10 2:24 ` [U-Boot] [PATCH v2] " Thomas Chou
2011-01-17 21:23 ` Wolfgang Denk
2011-01-18 2:08 ` Thomas Chou
2011-01-18 4:09 ` [U-Boot] [PATCH v3] " Thomas Chou
2011-04-11 19:54 ` Wolfgang Denk
2011-04-12 5:48 ` [U-Boot] [PATCH v4] " Thomas Chou
2011-04-30 19:02 ` Wolfgang Denk
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=201101082044.52773.vapier@gentoo.org \
--to=vapier@gentoo.org \
--cc=u-boot@lists.denx.de \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.