From: Stephen Warren <swarren@wwwdotorg.org>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v2 06/13] spi: add common fdt SPI driver interface
Date: Tue, 19 Mar 2013 12:24:48 -0600 [thread overview]
Message-ID: <5148AD70.5010209@wwwdotorg.org> (raw)
In-Reply-To: <1363496294-31160-7-git-send-email-amartin@nvidia.com>
On 03/16/2013 10:58 PM, Allen Martin wrote:
> Add a common interface to fdt based SPI drivers. Each driver is
> represented by a table entry in fdt_spi_drivers[]. If there are
> multiple SPI drivers in the table, the first driver to return success
> from spi_init() will be registered as the SPI driver.
> diff --git a/drivers/spi/fdt_spi.c b/drivers/spi/fdt_spi.c
> +static struct fdt_spi_driver fdt_spi_drivers[] = {
> +#ifdef CONFIG_TEGRA20_SFLASH
> + {
> + .compat = COMPAT_NVIDIA_TEGRA20_SFLASH,
> + .max_ctrls = 1,
> + .init = tegra20_spi_init,
> + .claim_bus = tegra20_spi_claim_bus,
> + .cs_is_valid = tegra20_spi_cs_is_valid,
> + .setup_slave = tegra20_spi_setup_slave,
> + .free_slave = tegra20_spi_free_slave,
> + .cs_activate = tegra20_spi_cs_activate,
> + .cs_deactivate = tegra20_spi_cs_deactivate,
> + .xfer = tegra20_spi_xfer,
> + },
> +#endif
> +#ifdef CONFIG_TEGRA20_SLINK
> + {
> + .compat = COMPAT_NVIDIA_TEGRA20_SLINK,
> + .max_ctrls = CONFIG_TEGRA_SLINK_CTRLS,
> + .init = tegra30_spi_init,
> + .claim_bus = tegra30_spi_claim_bus,
> + .cs_is_valid = tegra30_spi_cs_is_valid,
> + .setup_slave = tegra30_spi_setup_slave,
> + .free_slave = tegra30_spi_free_slave,
> + .cs_activate = tegra30_spi_cs_activate,
> + .cs_deactivate = tegra30_spi_cs_deactivate,
> + .xfer = tegra30_spi_xfer,
> + },
> +#endif
> +};
In the future, it would be nice if we could build up that table
automatically, with each driver providing its own struct inside the
driver file, and using e.g. linker scripts to piece together the structs
into one large table. That would avoid the need to list each one here,
and to prototype all those functions in a header file.
It'd also be nice to allow multiple driver to be active at once.
Still, that's certainly all something that's quite suitable for
follow-on patches later; not something that needs to be addressed in
this series.
next prev parent reply other threads:[~2013-03-19 18:24 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-17 4:58 [U-Boot] [PATCH v2 00/13] tegra114 SPI driver Allen Martin
2013-03-17 4:58 ` [U-Boot] [PATCH v2 01/13] tegra: remove support for UART SPI switch Allen Martin
2013-03-19 18:14 ` Stephen Warren
2013-03-19 19:01 ` Simon Glass
2013-03-19 19:13 ` Stephen Warren
2013-03-21 21:04 ` Simon Glass
2013-03-17 4:58 ` [U-Boot] [PATCH v2 02/13] tegra: spi: rename tegra SPI drivers Allen Martin
2013-03-17 4:58 ` [U-Boot] [PATCH v2 03/13] tegra: spi: remove non fdt support Allen Martin
2013-03-17 4:58 ` [U-Boot] [PATCH v2 04/13] tegra: spi: pull register structs out of headers Allen Martin
2013-03-17 4:58 ` [U-Boot] [PATCH v2 05/13] tegra20: spi: move fdt probe to spi_init Allen Martin
2013-03-17 4:58 ` [U-Boot] [PATCH v2 06/13] spi: add common fdt SPI driver interface Allen Martin
2013-03-19 18:24 ` Stephen Warren [this message]
2013-03-21 21:05 ` Simon Glass
2013-03-17 4:58 ` [U-Boot] [PATCH v2 07/13] sf: winbond: add W25Q32DW Allen Martin
2013-05-23 7:45 ` Jagan Teki
2013-05-24 20:39 ` Jagan Teki
2013-05-29 0:28 ` Allen Martin
2013-05-29 1:00 ` Jagan Teki
2013-03-17 4:58 ` [U-Boot] [PATCH v2 08/13] tegra114: fdt: add compatible string for tegra114 SPI ctrl Allen Martin
2013-03-17 4:58 ` [U-Boot] [PATCH v2 09/13] tegra114: fdt: add apbdma block Allen Martin
2013-03-17 4:58 ` [U-Boot] [PATCH v2 10/13] tegra114: fdt: add SPI blocks Allen Martin
2013-03-17 4:58 ` [U-Boot] [PATCH v2 11/13] tegra114: dalmore: fdt: enable dalmore SPI controller Allen Martin
2013-03-17 4:58 ` [U-Boot] [PATCH v2 12/13] tegra114: add SPI driver Allen Martin
2013-03-19 21:22 ` Simon Glass
2013-03-17 4:58 ` [U-Boot] [PATCH v2 13/13] tegra114: dalmore: config: enable SPI Allen Martin
2013-03-18 19:34 ` [U-Boot] [PATCH v2 00/13] tegra114 SPI driver Tom Warren
2013-03-19 18:23 ` Stephen Warren
2013-03-21 21:07 ` Simon Glass
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=5148AD70.5010209@wwwdotorg.org \
--to=swarren@wwwdotorg.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox