1*2874c5fdSThomas Gleixner /* SPDX-License-Identifier: GPL-2.0-or-later */
2e8beacbbSAndreas Larsson /*
3e8beacbbSAndreas Larsson * Freescale SPI controller driver cpm functions.
4e8beacbbSAndreas Larsson *
5e8beacbbSAndreas Larsson * Maintainer: Kumar Gala
6e8beacbbSAndreas Larsson *
7e8beacbbSAndreas Larsson * Copyright (C) 2006 Polycom, Inc.
8e8beacbbSAndreas Larsson * Copyright 2010 Freescale Semiconductor, Inc.
9e8beacbbSAndreas Larsson *
10e8beacbbSAndreas Larsson * CPM SPI and QE buffer descriptors mode support:
11e8beacbbSAndreas Larsson * Copyright (c) 2009 MontaVista Software, Inc.
12e8beacbbSAndreas Larsson * Author: Anton Vorontsov <avorontsov@ru.mvista.com>
13e8beacbbSAndreas Larsson */
14e8beacbbSAndreas Larsson
15e8beacbbSAndreas Larsson #ifndef __SPI_FSL_CPM_H__
16e8beacbbSAndreas Larsson #define __SPI_FSL_CPM_H__
17e8beacbbSAndreas Larsson
18e8beacbbSAndreas Larsson #include "spi-fsl-lib.h"
19e8beacbbSAndreas Larsson
20e8beacbbSAndreas Larsson #ifdef CONFIG_FSL_SOC
21e8beacbbSAndreas Larsson extern void fsl_spi_cpm_reinit_txrx(struct mpc8xxx_spi *mspi);
22e8beacbbSAndreas Larsson extern int fsl_spi_cpm_bufs(struct mpc8xxx_spi *mspi,
23e8beacbbSAndreas Larsson struct spi_transfer *t, bool is_dma_mapped);
24e8beacbbSAndreas Larsson extern void fsl_spi_cpm_bufs_complete(struct mpc8xxx_spi *mspi);
25e8beacbbSAndreas Larsson extern void fsl_spi_cpm_irq(struct mpc8xxx_spi *mspi, u32 events);
26e8beacbbSAndreas Larsson extern int fsl_spi_cpm_init(struct mpc8xxx_spi *mspi);
27e8beacbbSAndreas Larsson extern void fsl_spi_cpm_free(struct mpc8xxx_spi *mspi);
28e8beacbbSAndreas Larsson #else
fsl_spi_cpm_reinit_txrx(struct mpc8xxx_spi * mspi)29e8beacbbSAndreas Larsson static inline void fsl_spi_cpm_reinit_txrx(struct mpc8xxx_spi *mspi) { }
fsl_spi_cpm_bufs(struct mpc8xxx_spi * mspi,struct spi_transfer * t,bool is_dma_mapped)30e8beacbbSAndreas Larsson static inline int fsl_spi_cpm_bufs(struct mpc8xxx_spi *mspi,
31e8beacbbSAndreas Larsson struct spi_transfer *t,
32e8beacbbSAndreas Larsson bool is_dma_mapped) { return 0; }
fsl_spi_cpm_bufs_complete(struct mpc8xxx_spi * mspi)33e8beacbbSAndreas Larsson static inline void fsl_spi_cpm_bufs_complete(struct mpc8xxx_spi *mspi) { }
fsl_spi_cpm_irq(struct mpc8xxx_spi * mspi,u32 events)34e8beacbbSAndreas Larsson static inline void fsl_spi_cpm_irq(struct mpc8xxx_spi *mspi, u32 events) { }
fsl_spi_cpm_init(struct mpc8xxx_spi * mspi)35e8beacbbSAndreas Larsson static inline int fsl_spi_cpm_init(struct mpc8xxx_spi *mspi) { return 0; }
fsl_spi_cpm_free(struct mpc8xxx_spi * mspi)36e8beacbbSAndreas Larsson static inline void fsl_spi_cpm_free(struct mpc8xxx_spi *mspi) { }
37e8beacbbSAndreas Larsson #endif
38e8beacbbSAndreas Larsson
39e8beacbbSAndreas Larsson #endif /* __SPI_FSL_CPM_H__ */
40