xref: /linux/drivers/media/dvb-frontends/cxd2880/cxd2880_spi.h (revision c13aca79ff3c4af5fd31a5b2743a90eba6e36a26)
1 /* SPDX-License-Identifier: GPL-2.0 */
2 /*
3  * cxd2880_spi.h
4  * Sony CXD2880 DVB-T2/T tuner + demodulator driver
5  * SPI access definitions
6  *
7  * Copyright (C) 2016, 2017, 2018 Sony Semiconductor Solutions Corporation
8  */
9 
10 #ifndef CXD2880_SPI_H
11 #define CXD2880_SPI_H
12 
13 #include "cxd2880_common.h"
14 
15 enum cxd2880_spi_mode {
16 	CXD2880_SPI_MODE_0,
17 	CXD2880_SPI_MODE_1,
18 	CXD2880_SPI_MODE_2,
19 	CXD2880_SPI_MODE_3
20 };
21 
22 struct cxd2880_spi {
23 	int (*read)(struct cxd2880_spi *spi, u8 *data,
24 		    u32 size);
25 	int (*write)(struct cxd2880_spi *spi, const u8 *data,
26 		     u32 size);
27 	int (*write_read)(struct cxd2880_spi *spi,
28 			  const u8 *tx_data, u32 tx_size,
29 			  u8 *rx_data, u32 rx_size);
30 	u32 flags;
31 	void *user;
32 };
33 
34 #endif
35