2 * This file is part of the coreboot project.
4 * Copyright 2018 Google LLC
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * version 2 as published by the Free Software Foundation.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 #ifndef _SPI_BITBANG_H_
16 #define _SPI_BITBANG_H_
20 struct spi_bitbang_ops
{
21 int (*get_miso
)(const struct spi_bitbang_ops
*ops
);
22 void (*set_mosi
)(const struct spi_bitbang_ops
*ops
, int value
);
23 void (*set_clk
)(const struct spi_bitbang_ops
*ops
, int value
);
24 void (*set_cs
)(const struct spi_bitbang_ops
*ops
, int value
);
27 int spi_bitbang_claim_bus(const struct spi_bitbang_ops
*ops
);
28 void spi_bitbang_release_bus(const struct spi_bitbang_ops
*ops
);
29 int spi_bitbang_xfer(const struct spi_bitbang_ops
*ops
, const void *dout
,
30 size_t bytes_out
, void *din
, size_t bytes_in
);
32 #endif /* _SPI_BITBANG_H_ */