mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-11-15 09:27:35 +00:00
78f47b7353
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. Signed-off-by: Allen Martin <amartin@nvidia.com> Signed-off-by: Tom Warren <twarren@nvidia.com> Reviewed-by: Stephen Warren <swarren@nvidia.com>
41 lines
1.5 KiB
C
41 lines
1.5 KiB
C
/*
|
|
* NVIDIA Tegra SPI-SLINK controller
|
|
*
|
|
* Copyright 2010-2013 NVIDIA Corporation
|
|
*
|
|
* This software may be used and distributed according to the
|
|
* terms of the GNU Public License, Version 2, incorporated
|
|
* herein by reference.
|
|
*
|
|
* This program is free software; you can redistribute it and/or
|
|
* modify it under the terms of the GNU General Public License
|
|
* Version 2 as published by the Free Software Foundation.
|
|
*
|
|
* This program is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
* GNU General Public License for more details.
|
|
*
|
|
* You should have received a copy of the GNU General Public License
|
|
* along with this program; if not, write to the Free Software
|
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
|
* MA 02111-1307 USA
|
|
*/
|
|
|
|
#ifndef _TEGRA30_SPI_H_
|
|
#define _TEGRA30_SPI_H_
|
|
|
|
#include <asm/types.h>
|
|
|
|
int tegra30_spi_init(int *node_list, int count);
|
|
int tegra30_spi_cs_is_valid(unsigned int bus, unsigned int cs);
|
|
struct spi_slave *tegra30_spi_setup_slave(unsigned int bus, unsigned int cs,
|
|
unsigned int max_hz, unsigned int mode);
|
|
void tegra30_spi_free_slave(struct spi_slave *slave);
|
|
int tegra30_spi_claim_bus(struct spi_slave *slave);
|
|
void tegra30_spi_cs_activate(struct spi_slave *slave);
|
|
void tegra30_spi_cs_deactivate(struct spi_slave *slave);
|
|
int tegra30_spi_xfer(struct spi_slave *slave, unsigned int bitlen,
|
|
const void *data_out, void *data_in, unsigned long flags);
|
|
|
|
#endif /* _TEGRA30_SPI_H_ */
|