From: Wolfgang Denk <wd@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v2] spi: add new driver for OpenCores tiny_spi
Date: Mon, 17 Jan 2011 22:23:22 +0100 [thread overview]
Message-ID: <20110117212322.46153D1CAD5@gemini.denx.de> (raw)
In-Reply-To: <1294626279-8601-1-git-send-email-thomas@wytron.com.tw>
Dear Thomas Chou,
In message <1294626279-8601-1-git-send-email-thomas@wytron.com.tw> you wrote:
> This patch adds support for OpenCores tiny_spi.
>
> http://opencores.org/project,tiny_spi
>
> Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
> ---
> for u-boot
> v2, use const and clean up as Mike suggested.
...
> +void spi_cs_activate(struct spi_slave *slave)
> +{
> + struct tiny_spi_slave *tiny_spi = to_tiny_spi_slave(slave);
> + unsigned int cs = slave->cs;
> + gpio_set_value(cs, tiny_spi->flg);
> + debug("%s: SPI_CS_GPIO:%x\n", __func__, gpio_get_value(cs));
> +}
Please separate declartations and code with a blank line. Please fix
globally.
...
> +int spi_claim_bus(struct spi_slave *slave)
> +{
> + struct tiny_spi_slave *tiny_spi = to_tiny_spi_slave(slave);
> + const struct tiny_spi_host *host = tiny_spi->host;
> + debug("%s: bus:%i cs:%i\n", __func__, slave->bus, slave->cs);
> + gpio_direction_output(slave->cs, !tiny_spi->flg);
> + writel(tiny_spi->mode, host->base + TINY_SPI_CONTROL);
> + writel(tiny_spi->baud, host->base + TINY_SPI_BAUD);
Please do not use base + offset notation. Use a proper C struct
instead. Please fix globally.
Best regards,
Wolfgang Denk
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
A conservative is a man who believes that nothing should be done for
the first time. - Alfred E. Wiggam
next prev parent reply other threads:[~2011-01-17 21:23 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
2011-01-10 2:24 ` [U-Boot] [PATCH v2] " Thomas Chou
2011-01-17 21:23 ` Wolfgang Denk [this message]
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=20110117212322.46153D1CAD5@gemini.denx.de \
--to=wd@denx.de \
--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.