diff options
Diffstat (limited to 'chip/host/spi_master.c')
-rw-r--r-- | chip/host/spi_master.c | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/chip/host/spi_master.c b/chip/host/spi_master.c new file mode 100644 index 0000000000..83bde96163 --- /dev/null +++ b/chip/host/spi_master.c @@ -0,0 +1,42 @@ +/* Copyright 2019 The Chromium OS Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + * + * Dummy Master SPI driver for unit test. + */ + +#include <stdint.h> + +#include "common.h" +#include "gpio.h" + +#include "spi.h" + +test_mockable int spi_enable(int port, int enable) +{ + return EC_SUCCESS; +} + +test_mockable int spi_transaction(const struct spi_device_t *spi_device, + const uint8_t *txdata, int txlen, + uint8_t *rxdata, int rxlen) +{ + return EC_SUCCESS; +} + +test_mockable int spi_transaction_async(const struct spi_device_t *spi_device, + const uint8_t *txdata, int txlen, + uint8_t *rxdata, int rxlen) +{ + return EC_SUCCESS; +} + +test_mockable int spi_transaction_flush(const struct spi_device_t *spi_device) +{ + return EC_SUCCESS; +} + +test_mockable int spi_transaction_wait(const struct spi_device_t *spi_device) +{ + return EC_SUCCESS; +} |