2022-06-07 22:11:13 +08:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0-only */
|
2009-05-15 04:01:59 +08:00
|
|
|
/*
|
2012-08-27 21:26:41 +08:00
|
|
|
* TI DaVinci Audio Serial Port support
|
|
|
|
*
|
2020-08-12 09:34:19 +08:00
|
|
|
* Copyright (C) 2012 Texas Instruments Incorporated - https://www.ti.com/
|
2009-05-15 04:01:59 +08:00
|
|
|
*/
|
|
|
|
|
2012-08-27 21:26:41 +08:00
|
|
|
#ifndef __DAVINCI_ASP_H
|
|
|
|
#define __DAVINCI_ASP_H
|
2009-05-15 04:01:59 +08:00
|
|
|
|
2012-10-17 22:08:03 +08:00
|
|
|
#include <linux/genalloc.h>
|
|
|
|
|
2014-02-03 20:51:51 +08:00
|
|
|
struct davinci_mcasp_pdata {
|
2009-06-05 18:28:08 +08:00
|
|
|
u32 tx_dma_offset;
|
|
|
|
u32 rx_dma_offset;
|
2012-08-27 21:26:41 +08:00
|
|
|
int asp_chan_q; /* event queue number for ASP channel */
|
|
|
|
int ram_chan_q; /* event queue number for RAM channel */
|
2009-11-19 08:49:51 +08:00
|
|
|
/*
|
|
|
|
* Allowing this is more efficient and eliminates left and right swaps
|
|
|
|
* caused by underruns, but will swap the left and right channels
|
|
|
|
* when compared to previous behavior.
|
|
|
|
*/
|
|
|
|
unsigned enable_channel_combine:1;
|
2009-11-19 08:49:53 +08:00
|
|
|
unsigned sram_size_playback;
|
|
|
|
unsigned sram_size_capture;
|
2012-10-17 22:08:03 +08:00
|
|
|
struct gen_pool *sram_pool;
|
2009-06-05 18:28:08 +08:00
|
|
|
|
2010-07-06 16:39:03 +08:00
|
|
|
/*
|
|
|
|
* If McBSP peripheral gets the clock from an external pin,
|
|
|
|
* there are three chooses, that are MCBSP_CLKX, MCBSP_CLKR
|
|
|
|
* and MCBSP_CLKS.
|
|
|
|
* Depending on different hardware connections it is possible
|
|
|
|
* to use this setting to change the behaviour of McBSP
|
2012-08-27 21:26:41 +08:00
|
|
|
* driver.
|
2010-07-06 16:39:03 +08:00
|
|
|
*/
|
|
|
|
int clk_input_pin;
|
|
|
|
|
2010-07-06 16:39:04 +08:00
|
|
|
/*
|
|
|
|
* This flag works when both clock and FS are outputs for the cpu
|
|
|
|
* and makes clock more accurate (FS is not symmetrical and the
|
|
|
|
* clock is very fast.
|
|
|
|
* The clock becoming faster is named
|
|
|
|
* i2s continuous serial clock (I2S_SCK) and it is an externally
|
|
|
|
* visible bit clock.
|
|
|
|
*
|
|
|
|
* first line : WordSelect
|
|
|
|
* second line : ContinuousSerialClock
|
|
|
|
* third line: SerialData
|
|
|
|
*
|
|
|
|
* SYMMETRICAL APPROACH:
|
|
|
|
* _______________________ LEFT
|
|
|
|
* _| RIGHT |______________________|
|
|
|
|
* _ _ _ _ _ _ _ _
|
|
|
|
* _| |_| |_ x16 _| |_| |_| |_| |_ x16 _| |_| |_
|
|
|
|
* _ _ _ _ _ _ _ _
|
|
|
|
* _/ \_/ \_ ... _/ \_/ \_/ \_/ \_ ... _/ \_/ \_
|
|
|
|
* \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/
|
|
|
|
*
|
|
|
|
* ACCURATE CLOCK APPROACH:
|
|
|
|
* ______________ LEFT
|
|
|
|
* _| RIGHT |_______________________________|
|
|
|
|
* _ _ _ _ _ _ _ _ _
|
|
|
|
* _| |_ x16 _| |_| |_ x16 _| |_| |_| |_| |_| |_| |
|
|
|
|
* _ _ _ _ dummy cycles
|
|
|
|
* _/ \_ ... _/ \_/ \_ ... _/ \__________________
|
|
|
|
* \_/ \_/ \_/ \_/
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
bool i2s_accurate_sck;
|
|
|
|
|
2009-06-05 18:28:08 +08:00
|
|
|
/* McASP specific fields */
|
|
|
|
int tdm_slots;
|
|
|
|
u8 op_mode;
|
2018-11-16 21:41:41 +08:00
|
|
|
u8 dismod;
|
2009-06-05 18:28:08 +08:00
|
|
|
u8 num_serializer;
|
|
|
|
u8 *serial_dir;
|
2009-08-12 05:01:59 +08:00
|
|
|
u8 version;
|
|
|
|
u8 txnumevt;
|
|
|
|
u8 rxnumevt;
|
2013-10-18 23:37:43 +08:00
|
|
|
int tx_dma_channel;
|
|
|
|
int rx_dma_channel;
|
2009-08-12 05:01:59 +08:00
|
|
|
};
|
2014-02-03 20:51:51 +08:00
|
|
|
/* TODO: Fix arch/arm/mach-davinci/ users and remove this define */
|
|
|
|
#define snd_platform_data davinci_mcasp_pdata
|
2009-08-12 05:01:59 +08:00
|
|
|
|
|
|
|
enum {
|
|
|
|
MCASP_VERSION_1 = 0, /* DM646x */
|
|
|
|
MCASP_VERSION_2, /* DA8xx/OMAPL1x */
|
2012-09-03 16:10:40 +08:00
|
|
|
MCASP_VERSION_3, /* TI81xx/AM33xx */
|
2013-11-14 17:35:34 +08:00
|
|
|
MCASP_VERSION_4, /* DRA7xxx */
|
2021-07-06 03:42:47 +08:00
|
|
|
MCASP_VERSION_OMAP, /* OMAP4/5 */
|
2009-06-05 18:28:08 +08:00
|
|
|
};
|
|
|
|
|
2012-08-27 21:26:41 +08:00
|
|
|
enum mcbsp_clk_input_pin {
|
|
|
|
MCBSP_CLKR = 0, /* as in DM365 */
|
2010-07-06 16:39:03 +08:00
|
|
|
MCBSP_CLKS,
|
|
|
|
};
|
|
|
|
|
2009-06-05 18:28:08 +08:00
|
|
|
#define INACTIVE_MODE 0
|
|
|
|
#define TX_MODE 1
|
|
|
|
#define RX_MODE 2
|
|
|
|
|
|
|
|
#define DAVINCI_MCASP_IIS_MODE 0
|
|
|
|
#define DAVINCI_MCASP_DIT_MODE 1
|
|
|
|
|
2012-08-27 21:26:41 +08:00
|
|
|
#endif
|