18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0-or-later */
28c2ecf20Sopenharmony_ci/*
38c2ecf20Sopenharmony_ci * Freescale SPI controller driver cpm functions.
48c2ecf20Sopenharmony_ci *
58c2ecf20Sopenharmony_ci * Maintainer: Kumar Gala
68c2ecf20Sopenharmony_ci *
78c2ecf20Sopenharmony_ci * Copyright (C) 2006 Polycom, Inc.
88c2ecf20Sopenharmony_ci * Copyright 2010 Freescale Semiconductor, Inc.
98c2ecf20Sopenharmony_ci *
108c2ecf20Sopenharmony_ci * CPM SPI and QE buffer descriptors mode support:
118c2ecf20Sopenharmony_ci * Copyright (c) 2009  MontaVista Software, Inc.
128c2ecf20Sopenharmony_ci * Author: Anton Vorontsov <avorontsov@ru.mvista.com>
138c2ecf20Sopenharmony_ci */
148c2ecf20Sopenharmony_ci
158c2ecf20Sopenharmony_ci#ifndef __SPI_FSL_CPM_H__
168c2ecf20Sopenharmony_ci#define __SPI_FSL_CPM_H__
178c2ecf20Sopenharmony_ci
188c2ecf20Sopenharmony_ci#include "spi-fsl-lib.h"
198c2ecf20Sopenharmony_ci
208c2ecf20Sopenharmony_ci#ifdef CONFIG_FSL_SOC
218c2ecf20Sopenharmony_ciextern void fsl_spi_cpm_reinit_txrx(struct mpc8xxx_spi *mspi);
228c2ecf20Sopenharmony_ciextern int fsl_spi_cpm_bufs(struct mpc8xxx_spi *mspi,
238c2ecf20Sopenharmony_ci			    struct spi_transfer *t, bool is_dma_mapped);
248c2ecf20Sopenharmony_ciextern void fsl_spi_cpm_bufs_complete(struct mpc8xxx_spi *mspi);
258c2ecf20Sopenharmony_ciextern void fsl_spi_cpm_irq(struct mpc8xxx_spi *mspi, u32 events);
268c2ecf20Sopenharmony_ciextern int fsl_spi_cpm_init(struct mpc8xxx_spi *mspi);
278c2ecf20Sopenharmony_ciextern void fsl_spi_cpm_free(struct mpc8xxx_spi *mspi);
288c2ecf20Sopenharmony_ci#else
298c2ecf20Sopenharmony_cistatic inline void fsl_spi_cpm_reinit_txrx(struct mpc8xxx_spi *mspi) { }
308c2ecf20Sopenharmony_cistatic inline int fsl_spi_cpm_bufs(struct mpc8xxx_spi *mspi,
318c2ecf20Sopenharmony_ci				   struct spi_transfer *t,
328c2ecf20Sopenharmony_ci				   bool is_dma_mapped) { return 0; }
338c2ecf20Sopenharmony_cistatic inline void fsl_spi_cpm_bufs_complete(struct mpc8xxx_spi *mspi) { }
348c2ecf20Sopenharmony_cistatic inline void fsl_spi_cpm_irq(struct mpc8xxx_spi *mspi, u32 events) { }
358c2ecf20Sopenharmony_cistatic inline int fsl_spi_cpm_init(struct mpc8xxx_spi *mspi) { return 0; }
368c2ecf20Sopenharmony_cistatic inline void fsl_spi_cpm_free(struct mpc8xxx_spi *mspi) { }
378c2ecf20Sopenharmony_ci#endif
388c2ecf20Sopenharmony_ci
398c2ecf20Sopenharmony_ci#endif /* __SPI_FSL_CPM_H__ */
40