]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - include/spi.h
Merge branch 'tx48-rel'
[karo-tx-uboot.git] / include / spi.h
index 1638b503945071c9ccbd5486a870ac1814160779..c0dab578bfa53533efe72cb6f6bb70c162c03d84 100644 (file)
@@ -2,23 +2,7 @@
  * (C) Copyright 2001
  * Gerald Van Baren, Custom IDEAS, vanbaren@cideas.com.
  *
- * See file CREDITS for list of people who contributed to this
- * project.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * 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
+ * SPDX-License-Identifier:    GPL-2.0+
  */
 
 #ifndef _SPI_H_
@@ -247,4 +231,20 @@ static inline int spi_w8r8(struct spi_slave *slave, unsigned char byte)
        return ret < 0 ? ret : din[1];
 }
 
+/**
+ * Set up a SPI slave for a particular device tree node
+ *
+ * This calls spi_setup_slave() with the correct bus number. Call
+ * spi_free_slave() to free it later.
+ *
+ * @param blob         Device tree blob
+ * @param node         SPI peripheral node to use
+ * @param cs           Chip select to use
+ * @param max_hz       Maximum SCK rate in Hz (0 for default)
+ * @param mode         Clock polarity, clock phase and other parameters
+ * @return pointer to new spi_slave structure
+ */
+struct spi_slave *spi_setup_slave_fdt(const void *blob, int node,
+               unsigned int cs, unsigned int max_hz, unsigned int mode);
+
 #endif /* _SPI_H_ */