Banajit Goswami | de8271c | 2017-01-18 00:28:59 -0800 | [diff] [blame] | 1 | /* |
Bhalchandra Gajare | 38d1897 | 2017-06-27 13:46:38 -0700 | [diff] [blame] | 2 | * Copyright (c) 2016-2017, The Linux Foundation. All rights reserved. |
Banajit Goswami | de8271c | 2017-01-18 00:28:59 -0800 | [diff] [blame] | 3 | * |
| 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 | |
| 17 | struct 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 Gajare | 38d1897 | 2017-06-27 13:46:38 -0700 | [diff] [blame] | 38 | struct 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 Goswami | de8271c | 2017-01-18 00:28:59 -0800 | [diff] [blame] | 44 | #endif /* End of __WCD_SPI_H__ */ |