162306a36Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0-or-later */
262306a36Sopenharmony_ci/*
362306a36Sopenharmony_ci * Freescale SPI controller driver cpm functions.
462306a36Sopenharmony_ci *
562306a36Sopenharmony_ci * Maintainer: Kumar Gala
662306a36Sopenharmony_ci *
762306a36Sopenharmony_ci * Copyright (C) 2006 Polycom, Inc.
862306a36Sopenharmony_ci * Copyright 2010 Freescale Semiconductor, Inc.
962306a36Sopenharmony_ci *
1062306a36Sopenharmony_ci * CPM SPI and QE buffer descriptors mode support:
1162306a36Sopenharmony_ci * Copyright (c) 2009  MontaVista Software, Inc.
1262306a36Sopenharmony_ci * Author: Anton Vorontsov <avorontsov@ru.mvista.com>
1362306a36Sopenharmony_ci */
1462306a36Sopenharmony_ci
1562306a36Sopenharmony_ci#ifndef __SPI_FSL_CPM_H__
1662306a36Sopenharmony_ci#define __SPI_FSL_CPM_H__
1762306a36Sopenharmony_ci
1862306a36Sopenharmony_ci#include "spi-fsl-lib.h"
1962306a36Sopenharmony_ci
2062306a36Sopenharmony_ci#ifdef CONFIG_FSL_SOC
2162306a36Sopenharmony_ciextern void fsl_spi_cpm_reinit_txrx(struct mpc8xxx_spi *mspi);
2262306a36Sopenharmony_ciextern int fsl_spi_cpm_bufs(struct mpc8xxx_spi *mspi,
2362306a36Sopenharmony_ci			    struct spi_transfer *t, bool is_dma_mapped);
2462306a36Sopenharmony_ciextern void fsl_spi_cpm_bufs_complete(struct mpc8xxx_spi *mspi);
2562306a36Sopenharmony_ciextern void fsl_spi_cpm_irq(struct mpc8xxx_spi *mspi, u32 events);
2662306a36Sopenharmony_ciextern int fsl_spi_cpm_init(struct mpc8xxx_spi *mspi);
2762306a36Sopenharmony_ciextern void fsl_spi_cpm_free(struct mpc8xxx_spi *mspi);
2862306a36Sopenharmony_ci#else
2962306a36Sopenharmony_cistatic inline void fsl_spi_cpm_reinit_txrx(struct mpc8xxx_spi *mspi) { }
3062306a36Sopenharmony_cistatic inline int fsl_spi_cpm_bufs(struct mpc8xxx_spi *mspi,
3162306a36Sopenharmony_ci				   struct spi_transfer *t,
3262306a36Sopenharmony_ci				   bool is_dma_mapped) { return 0; }
3362306a36Sopenharmony_cistatic inline void fsl_spi_cpm_bufs_complete(struct mpc8xxx_spi *mspi) { }
3462306a36Sopenharmony_cistatic inline void fsl_spi_cpm_irq(struct mpc8xxx_spi *mspi, u32 events) { }
3562306a36Sopenharmony_cistatic inline int fsl_spi_cpm_init(struct mpc8xxx_spi *mspi) { return 0; }
3662306a36Sopenharmony_cistatic inline void fsl_spi_cpm_free(struct mpc8xxx_spi *mspi) { }
3762306a36Sopenharmony_ci#endif
3862306a36Sopenharmony_ci
3962306a36Sopenharmony_ci#endif /* __SPI_FSL_CPM_H__ */
40