[PATCH V2] spi: tegra114: add spi driver
Stephen Warren
swarren at wwwdotorg.org
Fri Feb 22 06:15:15 EST 2013
On 02/21/2013 12:10 AM, Laxman Dewangan wrote:
> Add SPI driver for NVIDIA's Tegra114 SPI controller. This controller
> is different than the older SoCs SPI controller in internal design as
> well as register interface.
Looks good. Just a couple of nits mentioned below, then,
Reviewed-by: Stephen Warren <swarren at nvidia.com>
Note: There are a few minor diffs between this file and
spi-tegra20-slink.c. It might be worth eliminating as many as possible,
perhaps in a followon patch.
> diff --git a/Documentation/devicetree/bindings/spi/nvidia,tegra114-spi.txt b/Documentation/devicetree/bindings/spi/nvidia,tegra114-spi.txt
> +NVIDIA Tegra114 SPI controller.
> +
> +Required properties:
> +- compatible : should be "nvidia,tegra114-spi".
> +- reg: Should contain SPI registers location and length.
> +- interrupts: Should contain SPI interrupts.
> +- nvidia,dma-request-selector : The Tegra DMA controller's phandle and
> + request selector for this SPI controller.
The binding should specify that a clock named "spi" needs to be
provided, using the standard properties in ../clock/clock-bindings.txt
> diff --git a/drivers/spi/Makefile b/drivers/spi/Makefile
> obj-$(CONFIG_SPI_SIRF) += spi-sirf.o
> obj-$(CONFIG_SPI_TEGRA20_SFLASH) += spi-tegra20-sflash.o
> obj-$(CONFIG_SPI_TEGRA20_SLINK) += spi-tegra20-slink.o
> +obj-$(CONFIG_SPI_TEGRA114) += spi-tegra114.o
While Tegra114 is newer, it should really be listed before the Tegra20
entries, since the Makefile is alpha-numerically sorted right now I believe.
> diff --git a/drivers/spi/spi-tegra114.c b/drivers/spi/spi-tegra114.c
> +static struct platform_driver tegra_spi_driver = {
> + .driver = {
> + .name = "spi-tegra114",
> + .owner = THIS_MODULE,
> + .pm = &tegra_spi_pm_ops,
> + .of_match_table = of_match_ptr(tegra_spi_of_match),
No need to use of_match_ptr() there; just use the raw value since
CONFIG_OF is guaranteed to be enabled.
More information about the devicetree-discuss
mailing list