blob: a92655384f120b7b173cd55608972b4e3bd2cce3 [file] [log] [blame]
Abhi Singh3c545702024-11-18 10:29:36 -06001/*
2 * Copyright (c) 2025, Arm Limited. All rights reserved.
3 *
4 * SPDX-License-Identifier: BSD-3-Clause
5 */
6
7#ifndef GPIO_SPI_H
8#define GPIO_SPI_H
9
10#include <stdint.h>
11
12struct gpio_spi_data {
13 uint8_t cs_gpio, sclk_gpio, mosi_gpio, miso_gpio, reset_gpio;
14 uint32_t spi_delay_us;
15 unsigned int spi_mode;
16};
17
18struct spi_ops {
19 void (*get_access)(void);
20 void (*start)(void);
21 void (*stop)(void);
22 int (*xfer)(unsigned int bitlen, const void *dout, void *din);
23};
24
25struct spi_plat {
26 struct gpio_spi_data gpio_data;
27 const struct spi_ops *ops;
28};
29
30struct spi_plat *gpio_spi_init(struct gpio_spi_data *gpio_spi_data);
31
32#endif /* GPIO_SPI_H */