xref: /freebsd/sys/dev/spibus/spi.h (revision 46b39c90f44e166cdad703e5aceab54047cf54f2)
1*46b39c90SWarner Losh /*-
2*46b39c90SWarner Losh  * Copyright (c) 2006 M. Warner Losh
3*46b39c90SWarner Losh  * All rights reserved.
4*46b39c90SWarner Losh  *
5*46b39c90SWarner Losh  * Redistribution and use in source and binary forms, with or without
6*46b39c90SWarner Losh  * modification, are permitted provided that the following conditions
7*46b39c90SWarner Losh  * are met:
8*46b39c90SWarner Losh  * 1. Redistributions of source code must retain the above copyright
9*46b39c90SWarner Losh  *    notice, this list of conditions and the following disclaimer.
10*46b39c90SWarner Losh  * 2. Redistributions in binary form must reproduce the above copyright
11*46b39c90SWarner Losh  *    notice, this list of conditions and the following disclaimer in the
12*46b39c90SWarner Losh  *    documentation and/or other materials provided with the distribution.
13*46b39c90SWarner Losh  *
14*46b39c90SWarner Losh  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
15*46b39c90SWarner Losh  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16*46b39c90SWarner Losh  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17*46b39c90SWarner Losh  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
18*46b39c90SWarner Losh  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19*46b39c90SWarner Losh  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20*46b39c90SWarner Losh  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21*46b39c90SWarner Losh  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22*46b39c90SWarner Losh  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23*46b39c90SWarner Losh  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24*46b39c90SWarner Losh  * SUCH DAMAGE.
25*46b39c90SWarner Losh  *
26*46b39c90SWarner Losh  * $FreeBSD$
27*46b39c90SWarner Losh  */
289a795dfaSWarner Losh 
299a795dfaSWarner Losh struct spi_command {
309a795dfaSWarner Losh 	void	*tx_cmd;
319a795dfaSWarner Losh 	uint32_t tx_cmd_sz;
329a795dfaSWarner Losh 	void	*rx_cmd;
339a795dfaSWarner Losh 	uint32_t rx_cmd_sz;
349a795dfaSWarner Losh 	void	*tx_data;
359a795dfaSWarner Losh 	uint32_t tx_data_sz;
369a795dfaSWarner Losh 	void	*rx_data;
379a795dfaSWarner Losh 	uint32_t rx_data_sz;
389a795dfaSWarner Losh };
39cc906398SWarner Losh 
40cc906398SWarner Losh #define	SPI_CHIP_SELECT_HIGH	0x1		/* Chip select high (else low) */
41