diff options
author | Jack Rosenthal <jrosenth@chromium.org> | 2022-06-27 14:20:17 -0600 |
---|---|---|
committer | Chromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com> | 2022-07-01 20:49:43 +0000 |
commit | 2a1e548dc461046adc15d216c020c09665c2d53e (patch) | |
tree | ab684c8b2eda018209dffdff2f7fb56528ef1fa2 /chip | |
parent | f2733dc3d8b4808e4509f37fabd640aa203bbc1b (diff) | |
download | chrome-ec-2a1e548dc461046adc15d216c020c09665c2d53e.tar.gz |
chip/mchp/spi.c: Format with clang-format
BUG=b:236386294
BRANCH=none
TEST=none
Change-Id: If1bf877389c160a35b5c040f6f057298b22c98a4
Signed-off-by: Jack Rosenthal <jrosenth@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3729300
Reviewed-by: Jeremy Bettis <jbettis@chromium.org>
Diffstat (limited to 'chip')
-rw-r--r-- | chip/mchp/spi.c | 63 |
1 files changed, 22 insertions, 41 deletions
diff --git a/chip/mchp/spi.c b/chip/mchp/spi.c index 48712e8b7e..34db702f56 100644 --- a/chip/mchp/spi.c +++ b/chip/mchp/spi.c @@ -23,7 +23,7 @@ #include "tfdp_chip.h" #define CPUTS(outstr) cputs(CC_SPI, outstr) -#define CPRINTS(format, args...) cprints(CC_SPI, format, ## args) +#define CPRINTS(format, args...) cprints(CC_SPI, format, ##args) #define SPI_BYTE_TRANSFER_TIMEOUT_US (3 * MSEC) #define SPI_BYTE_TRANSFER_POLL_INTERVAL_US 100 @@ -33,49 +33,31 @@ #endif static const struct dma_option spi_rx_option[] = { - { - MCHP_DMAC_QMSPI0_RX, - (void *)(MCHP_QMSPI0_RX_FIFO_ADDR), - MCHP_DMA_XFER_SIZE(1) + MCHP_DMA_INC_MEM - }, + { MCHP_DMAC_QMSPI0_RX, (void *)(MCHP_QMSPI0_RX_FIFO_ADDR), + MCHP_DMA_XFER_SIZE(1) + MCHP_DMA_INC_MEM }, #if defined(CONFIG_MCHP_GPSPI) && !defined(LFW) #if CONFIG_MCHP_GPSPI & 0x01 - { - MCHP_DMAC_SPI0_RX, - (void *)&MCHP_SPI_RD(0), - MCHP_DMA_XFER_SIZE(1) + MCHP_DMA_INC_MEM - }, + { MCHP_DMAC_SPI0_RX, (void *)&MCHP_SPI_RD(0), + MCHP_DMA_XFER_SIZE(1) + MCHP_DMA_INC_MEM }, #endif #if CONFIG_MCHP_GPSPI & 0x02 - { - MCHP_DMAC_SPI1_RX, - (void *)&MCHP_SPI_RD(1), - MCHP_DMA_XFER_SIZE(1) + MCHP_DMA_INC_MEM - }, + { MCHP_DMAC_SPI1_RX, (void *)&MCHP_SPI_RD(1), + MCHP_DMA_XFER_SIZE(1) + MCHP_DMA_INC_MEM }, #endif #endif }; static const struct dma_option spi_tx_option[] = { - { - MCHP_DMAC_QMSPI0_TX, - (void *)(MCHP_QMSPI0_TX_FIFO_ADDR), - MCHP_DMA_XFER_SIZE(1) + MCHP_DMA_INC_MEM - }, + { MCHP_DMAC_QMSPI0_TX, (void *)(MCHP_QMSPI0_TX_FIFO_ADDR), + MCHP_DMA_XFER_SIZE(1) + MCHP_DMA_INC_MEM }, #if defined(CONFIG_MCHP_GPSPI) && !defined(LFW) #if CONFIG_MCHP_GPSPI & 0x01 - { - MCHP_DMAC_SPI0_TX, - (void *)&MCHP_SPI_TD(0), - MCHP_DMA_XFER_SIZE(1) + MCHP_DMA_INC_MEM - }, + { MCHP_DMAC_SPI0_TX, (void *)&MCHP_SPI_TD(0), + MCHP_DMA_XFER_SIZE(1) + MCHP_DMA_INC_MEM }, #endif #if CONFIG_MCHP_GPSPI & 0x02 - { - MCHP_DMAC_SPI1_TX, - (void *)&MCHP_SPI_TD(1), - MCHP_DMA_XFER_SIZE(1) + MCHP_DMA_INC_MEM - }, + { MCHP_DMAC_SPI1_TX, (void *)&MCHP_SPI_TD(1), + MCHP_DMA_XFER_SIZE(1) + MCHP_DMA_INC_MEM }, #endif #endif }; @@ -131,8 +113,7 @@ static void spi_mutex_unlock(uint8_t hw_port) * Public SPI interface */ -const void *spi_dma_option(const struct spi_device_t *spi_device, - int is_tx) +const void *spi_dma_option(const struct spi_device_t *spi_device, int is_tx) { uint32_t n; @@ -157,8 +138,8 @@ const void *spi_dma_option(const struct spi_device_t *spi_device, } int spi_transaction_async(const struct spi_device_t *spi_device, - const uint8_t *txdata, int txlen, - uint8_t *rxdata, int rxlen) + const uint8_t *txdata, int txlen, uint8_t *rxdata, + int rxlen) { int rc; @@ -169,13 +150,13 @@ int spi_transaction_async(const struct spi_device_t *spi_device, #if defined(CONFIG_MCHP_GPSPI) && !defined(LFW) case GPSPI0_PORT: case GPSPI1_PORT: - rc = gpspi_transaction_async(spi_device, txdata, - txlen, rxdata, rxlen); + rc = gpspi_transaction_async(spi_device, txdata, txlen, rxdata, + rxlen); break; #endif case QMSPI0_PORT: - rc = qmspi_transaction_async(spi_device, txdata, - txlen, rxdata, rxlen); + rc = qmspi_transaction_async(spi_device, txdata, txlen, rxdata, + rxlen); break; default: rc = EC_ERROR_INVAL; @@ -243,8 +224,8 @@ int spi_transaction_wait(const struct spi_device_t *spi_device) * without the overhead of DMA setup. */ int spi_transaction(const struct spi_device_t *spi_device, - const uint8_t *txdata, int txlen, - uint8_t *rxdata, int rxlen) + const uint8_t *txdata, int txlen, uint8_t *rxdata, + int rxlen) { int rc; |