1278957Simp/*-
2278957Simp * Copyright (c) 2006 M. Warner Losh
3278957Simp * All rights reserved.
4278957Simp *
5278957Simp * Redistribution and use in source and binary forms, with or without
6278957Simp * modification, are permitted provided that the following conditions
7278957Simp * are met:
8278957Simp * 1. Redistributions of source code must retain the above copyright
9278957Simp *    notice, this list of conditions and the following disclaimer.
10278957Simp * 2. Redistributions in binary form must reproduce the above copyright
11278957Simp *    notice, this list of conditions and the following disclaimer in the
12278957Simp *    documentation and/or other materials provided with the distribution.
13278957Simp *
14278957Simp * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
15278957Simp * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16278957Simp * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17278957Simp * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
18278957Simp * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19278957Simp * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20278957Simp * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21278957Simp * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22278957Simp * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23278957Simp * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24278957Simp * SUCH DAMAGE.
25278957Simp *
26278957Simp * $FreeBSD$
27278957Simp */
28160370Simp
29160370Simpstruct spi_command {
30160370Simp	void	*tx_cmd;
31160370Simp	uint32_t tx_cmd_sz;
32160370Simp	void	*rx_cmd;
33160370Simp	uint32_t rx_cmd_sz;
34160370Simp	void	*tx_data;
35160370Simp	uint32_t tx_data_sz;
36160370Simp	void	*rx_data;
37160370Simp	uint32_t rx_data_sz;
38160370Simp};
39238965Simp
40300713Sadrian#define	SPI_COMMAND_INITIALIZER	{ 0 }
41300713Sadrian
42238965Simp#define	SPI_CHIP_SELECT_HIGH	0x1		/* Chip select high (else low) */
43