Sheetal Tigadoli | 3bb1b4c | 2020-01-05 21:19:02 +0530 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2017 - 2020, Broadcom |
| 3 | * |
| 4 | * SPDX-License-Identifier: BSD-3-Clause |
| 5 | */ |
| 6 | |
| 7 | #include <spi.h> |
| 8 | |
| 9 | #include "iproc_qspi.h" |
| 10 | |
| 11 | int spi_init(void) |
| 12 | { |
| 13 | return iproc_qspi_setup(IPROC_QSPI_BUS, IPROC_QSPI_CS, |
| 14 | IPROC_QSPI_CLK_SPEED, IPROC_QSPI_MODE0); |
| 15 | } |
| 16 | |
| 17 | int spi_claim_bus(void) |
| 18 | { |
| 19 | return iproc_qspi_claim_bus(); |
| 20 | } |
| 21 | |
| 22 | void spi_release_bus(void) |
| 23 | { |
| 24 | iproc_qspi_release_bus(); |
| 25 | } |
| 26 | |
| 27 | int spi_xfer(uint32_t bitlen, const void *dout, |
| 28 | void *din, uint32_t flags) |
| 29 | { |
| 30 | return iproc_qspi_xfer(bitlen, dout, din, flags); |
| 31 | } |