blob: b85c68eba42912abce719bbc81b3acf932674b1f [file] [log] [blame]
Banajit Goswamide8271c2017-01-18 00:28:59 -08001/*
Bhalchandra Gajare38d18972017-06-27 13:46:38 -07002 * Copyright (c) 2016-2017, The Linux Foundation. All rights reserved.
Banajit Goswamide8271c2017-01-18 00:28:59 -08003 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 and
6 * only version 2 as published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 */
13
14#ifndef __WCD_SPI_H__
15#define __WCD_SPI_H__
16
17struct wcd_spi_msg {
18 /*
19 * Caller's buffer pointer that holds data to
20 * be transmitted in case of data_write and
21 * data to be copied to in case of data_read.
22 */
23 void *data;
24
25 /* Length of data to write/read */
26 size_t len;
27
28 /*
29 * Address in remote memory to write to
30 * or read from.
31 */
32 u32 remote_addr;
33
34 /* Bitmask of flags, currently unused */
35 u32 flags;
36};
37
Bhalchandra Gajare38d18972017-06-27 13:46:38 -070038struct wcd_spi_ops {
39 struct spi_device *spi_dev;
40 int (*read_dev)(struct spi_device *spi, struct wcd_spi_msg *msg);
41 int (*write_dev)(struct spi_device *spi, struct wcd_spi_msg *msg);
42};
43
Banajit Goswamide8271c2017-01-18 00:28:59 -080044#endif /* End of __WCD_SPI_H__ */