1/* SPDX-License-Identifier: GPL-2.0-only */ 2/* 3 * Header for the SUDMAC driver 4 * 5 * Copyright (C) 2013 Renesas Solutions Corp. 6 */ 7#ifndef SUDMAC_H 8#define SUDMAC_H 9 10#include <linux/dmaengine.h> 11#include <linux/shdma-base.h> 12#include <linux/types.h> 13 14/* Used by slave DMA clients to request DMA to/from a specific peripheral */ 15struct sudmac_slave { 16 struct shdma_slave shdma_slave; /* Set by the platform */ 17}; 18 19/* 20 * Supplied by platforms to specify, how a DMA channel has to be configured for 21 * a certain peripheral 22 */ 23struct sudmac_slave_config { 24 int slave_id; 25}; 26 27struct sudmac_channel { 28 unsigned long offset; 29 unsigned long config; 30 unsigned long wait; /* The configuable range is 0 to 3 */ 31 unsigned long dint_end_bit; 32}; 33 34struct sudmac_pdata { 35 const struct sudmac_slave_config *slave; 36 int slave_num; 37 const struct sudmac_channel *channel; 38 int channel_num; 39}; 40 41/* Definitions for the sudmac_channel.config */ 42#define SUDMAC_TX_BUFFER_MODE BIT(0) 43#define SUDMAC_RX_END_MODE BIT(1) 44 45/* Definitions for the sudmac_channel.dint_end_bit */ 46#define SUDMAC_DMA_BIT_CH0 BIT(0) 47#define SUDMAC_DMA_BIT_CH1 BIT(1) 48 49#endif 50