1 /* SPDX-License-Identifier: GPL-2.0-only */ 2 /* 3 * TI DaVinci Audio Serial Port support 4 * 5 * Copyright (C) 2012 Texas Instruments Incorporated - https://www.ti.com/ 6 */ 7 8 #ifndef __DAVINCI_ASP_H 9 #define __DAVINCI_ASP_H 10 11 #include <linux/genalloc.h> 12 13 struct davinci_mcasp_pdata { 14 u32 tx_dma_offset; 15 u32 rx_dma_offset; 16 int asp_chan_q; /* event queue number for ASP channel */ 17 int ram_chan_q; /* event queue number for RAM channel */ 18 /* 19 * Allowing this is more efficient and eliminates left and right swaps 20 * caused by underruns, but will swap the left and right channels 21 * when compared to previous behavior. 22 */ 23 unsigned enable_channel_combine:1; 24 unsigned sram_size_playback; 25 unsigned sram_size_capture; 26 struct gen_pool *sram_pool; 27 28 /* 29 * This flag works when both clock and FS are outputs for the cpu 30 * and makes clock more accurate (FS is not symmetrical and the 31 * clock is very fast. 32 * The clock becoming faster is named 33 * i2s continuous serial clock (I2S_SCK) and it is an externally 34 * visible bit clock. 35 * 36 * first line : WordSelect 37 * second line : ContinuousSerialClock 38 * third line: SerialData 39 * 40 * SYMMETRICAL APPROACH: 41 * _______________________ LEFT 42 * _| RIGHT |______________________| 43 * _ _ _ _ _ _ _ _ 44 * _| |_| |_ x16 _| |_| |_| |_| |_ x16 _| |_| |_ 45 * _ _ _ _ _ _ _ _ 46 * _/ \_/ \_ ... _/ \_/ \_/ \_/ \_ ... _/ \_/ \_ 47 * \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ 48 * 49 * ACCURATE CLOCK APPROACH: 50 * ______________ LEFT 51 * _| RIGHT |_______________________________| 52 * _ _ _ _ _ _ _ _ _ 53 * _| |_ x16 _| |_| |_ x16 _| |_| |_| |_| |_| |_| | 54 * _ _ _ _ dummy cycles 55 * _/ \_ ... _/ \_/ \_ ... _/ \__________________ 56 * \_/ \_/ \_/ \_/ 57 * 58 */ 59 bool i2s_accurate_sck; 60 61 /* McASP specific fields */ 62 int tdm_slots_tx; 63 int tdm_slots_rx; 64 u8 op_mode; 65 u8 dismod; 66 u8 num_serializer; 67 u8 *serial_dir; 68 u8 version; 69 u8 txnumevt; 70 u8 rxnumevt; 71 int tx_dma_channel; 72 int rx_dma_channel; 73 }; 74 /* TODO: Fix arch/arm/mach-davinci/ users and remove this define */ 75 #define snd_platform_data davinci_mcasp_pdata 76 77 enum { 78 MCASP_VERSION_1 = 0, /* DM646x */ 79 MCASP_VERSION_2, /* DA8xx/OMAPL1x */ 80 MCASP_VERSION_3, /* TI81xx/AM33xx */ 81 MCASP_VERSION_4, /* DRA7xxx */ 82 MCASP_VERSION_OMAP, /* OMAP4/5 */ 83 }; 84 85 #define INACTIVE_MODE 0 86 #define TX_MODE 1 87 #define RX_MODE 2 88 89 #define DAVINCI_MCASP_IIS_MODE 0 90 #define DAVINCI_MCASP_DIT_MODE 1 91 92 #endif 93