xref: /openbmc/linux/sound/soc/tegra/tegra30_i2s.h (revision 75bf465f0bc33e9b776a46d6a1b9b990f5fb7c37)
1*9952f691SThomas Gleixner /* SPDX-License-Identifier: GPL-2.0-only */
24fb0384fSStephen Warren /*
34fb0384fSStephen Warren  * tegra30_i2s.h - Definitions for Tegra30 I2S driver
44fb0384fSStephen Warren  *
54fb0384fSStephen Warren  * Copyright (c) 2011,2012, NVIDIA CORPORATION.  All rights reserved.
64fb0384fSStephen Warren  */
74fb0384fSStephen Warren 
84fb0384fSStephen Warren #ifndef __TEGRA30_I2S_H__
94fb0384fSStephen Warren #define __TEGRA30_I2S_H__
104fb0384fSStephen Warren 
114fb0384fSStephen Warren #include "tegra_pcm.h"
124fb0384fSStephen Warren 
134fb0384fSStephen Warren /* Register offsets from TEGRA30_I2S*_BASE */
144fb0384fSStephen Warren 
154fb0384fSStephen Warren #define TEGRA30_I2S_CTRL				0x0
164fb0384fSStephen Warren #define TEGRA30_I2S_TIMING				0x4
174fb0384fSStephen Warren #define TEGRA30_I2S_OFFSET				0x08
184fb0384fSStephen Warren #define TEGRA30_I2S_CH_CTRL				0x0c
194fb0384fSStephen Warren #define TEGRA30_I2S_SLOT_CTRL				0x10
204fb0384fSStephen Warren #define TEGRA30_I2S_CIF_RX_CTRL				0x14
214fb0384fSStephen Warren #define TEGRA30_I2S_CIF_TX_CTRL				0x18
224fb0384fSStephen Warren #define TEGRA30_I2S_FLOWCTL				0x1c
234fb0384fSStephen Warren #define TEGRA30_I2S_TX_STEP				0x20
244fb0384fSStephen Warren #define TEGRA30_I2S_FLOW_STATUS				0x24
254fb0384fSStephen Warren #define TEGRA30_I2S_FLOW_TOTAL				0x28
264fb0384fSStephen Warren #define TEGRA30_I2S_FLOW_OVER				0x2c
274fb0384fSStephen Warren #define TEGRA30_I2S_FLOW_UNDER				0x30
284fb0384fSStephen Warren #define TEGRA30_I2S_LCOEF_1_4_0				0x34
294fb0384fSStephen Warren #define TEGRA30_I2S_LCOEF_1_4_1				0x38
304fb0384fSStephen Warren #define TEGRA30_I2S_LCOEF_1_4_2				0x3c
314fb0384fSStephen Warren #define TEGRA30_I2S_LCOEF_1_4_3				0x40
324fb0384fSStephen Warren #define TEGRA30_I2S_LCOEF_1_4_4				0x44
334fb0384fSStephen Warren #define TEGRA30_I2S_LCOEF_1_4_5				0x48
344fb0384fSStephen Warren #define TEGRA30_I2S_LCOEF_2_4_0				0x4c
354fb0384fSStephen Warren #define TEGRA30_I2S_LCOEF_2_4_1				0x50
364fb0384fSStephen Warren #define TEGRA30_I2S_LCOEF_2_4_2				0x54
374fb0384fSStephen Warren 
384fb0384fSStephen Warren /* Fields in TEGRA30_I2S_CTRL */
394fb0384fSStephen Warren 
404fb0384fSStephen Warren #define TEGRA30_I2S_CTRL_XFER_EN_TX			(1 << 31)
414fb0384fSStephen Warren #define TEGRA30_I2S_CTRL_XFER_EN_RX			(1 << 30)
424fb0384fSStephen Warren #define TEGRA30_I2S_CTRL_CG_EN				(1 << 29)
434fb0384fSStephen Warren #define TEGRA30_I2S_CTRL_SOFT_RESET			(1 << 28)
444fb0384fSStephen Warren #define TEGRA30_I2S_CTRL_TX_FLOWCTL_EN			(1 << 27)
454fb0384fSStephen Warren 
464fb0384fSStephen Warren #define TEGRA30_I2S_CTRL_OBS_SEL_SHIFT			24
474fb0384fSStephen Warren #define TEGRA30_I2S_CTRL_OBS_SEL_MASK			(7 << TEGRA30_I2S_CTRL_OBS_SEL_SHIFT)
484fb0384fSStephen Warren 
494fb0384fSStephen Warren #define TEGRA30_I2S_FRAME_FORMAT_LRCK			0
504fb0384fSStephen Warren #define TEGRA30_I2S_FRAME_FORMAT_FSYNC			1
514fb0384fSStephen Warren 
524fb0384fSStephen Warren #define TEGRA30_I2S_CTRL_FRAME_FORMAT_SHIFT		12
534fb0384fSStephen Warren #define TEGRA30_I2S_CTRL_FRAME_FORMAT_MASK		(7                              << TEGRA30_I2S_CTRL_FRAME_FORMAT_SHIFT)
544fb0384fSStephen Warren #define TEGRA30_I2S_CTRL_FRAME_FORMAT_LRCK		(TEGRA30_I2S_FRAME_FORMAT_LRCK  << TEGRA30_I2S_CTRL_FRAME_FORMAT_SHIFT)
554fb0384fSStephen Warren #define TEGRA30_I2S_CTRL_FRAME_FORMAT_FSYNC		(TEGRA30_I2S_FRAME_FORMAT_FSYNC << TEGRA30_I2S_CTRL_FRAME_FORMAT_SHIFT)
564fb0384fSStephen Warren 
574fb0384fSStephen Warren #define TEGRA30_I2S_CTRL_MASTER_ENABLE			(1 << 10)
584fb0384fSStephen Warren 
594fb0384fSStephen Warren #define TEGRA30_I2S_LRCK_LEFT_LOW			0
604fb0384fSStephen Warren #define TEGRA30_I2S_LRCK_RIGHT_LOW			1
614fb0384fSStephen Warren 
624fb0384fSStephen Warren #define TEGRA30_I2S_CTRL_LRCK_SHIFT			9
634fb0384fSStephen Warren #define TEGRA30_I2S_CTRL_LRCK_MASK			(1                          << TEGRA30_I2S_CTRL_LRCK_SHIFT)
644fb0384fSStephen Warren #define TEGRA30_I2S_CTRL_LRCK_L_LOW			(TEGRA30_I2S_LRCK_LEFT_LOW  << TEGRA30_I2S_CTRL_LRCK_SHIFT)
654fb0384fSStephen Warren #define TEGRA30_I2S_CTRL_LRCK_R_LOW			(TEGRA30_I2S_LRCK_RIGHT_LOW << TEGRA30_I2S_CTRL_LRCK_SHIFT)
664fb0384fSStephen Warren 
674fb0384fSStephen Warren #define TEGRA30_I2S_CTRL_LPBK_ENABLE			(1 << 8)
684fb0384fSStephen Warren 
694fb0384fSStephen Warren #define TEGRA30_I2S_BIT_CODE_LINEAR			0
704fb0384fSStephen Warren #define TEGRA30_I2S_BIT_CODE_ULAW			1
714fb0384fSStephen Warren #define TEGRA30_I2S_BIT_CODE_ALAW			2
724fb0384fSStephen Warren 
734fb0384fSStephen Warren #define TEGRA30_I2S_CTRL_BIT_CODE_SHIFT			4
744fb0384fSStephen Warren #define TEGRA30_I2S_CTRL_BIT_CODE_MASK			(3                           << TEGRA30_I2S_CTRL_BIT_CODE_SHIFT)
754fb0384fSStephen Warren #define TEGRA30_I2S_CTRL_BIT_CODE_LINEAR		(TEGRA30_I2S_BIT_CODE_LINEAR << TEGRA30_I2S_CTRL_BIT_CODE_SHIFT)
764fb0384fSStephen Warren #define TEGRA30_I2S_CTRL_BIT_CODE_ULAW			(TEGRA30_I2S_BIT_CODE_ULAW   << TEGRA30_I2S_CTRL_BIT_CODE_SHIFT)
774fb0384fSStephen Warren #define TEGRA30_I2S_CTRL_BIT_CODE_ALAW			(TEGRA30_I2S_BIT_CODE_ALAW   << TEGRA30_I2S_CTRL_BIT_CODE_SHIFT)
784fb0384fSStephen Warren 
794fb0384fSStephen Warren #define TEGRA30_I2S_BITS_8				1
804fb0384fSStephen Warren #define TEGRA30_I2S_BITS_12				2
814fb0384fSStephen Warren #define TEGRA30_I2S_BITS_16				3
824fb0384fSStephen Warren #define TEGRA30_I2S_BITS_20				4
834fb0384fSStephen Warren #define TEGRA30_I2S_BITS_24				5
844fb0384fSStephen Warren #define TEGRA30_I2S_BITS_28				6
854fb0384fSStephen Warren #define TEGRA30_I2S_BITS_32				7
864fb0384fSStephen Warren 
874fb0384fSStephen Warren /* Sample container size; see {RX,TX}_MASK field in CH_CTRL below */
884fb0384fSStephen Warren #define TEGRA30_I2S_CTRL_BIT_SIZE_SHIFT			0
894fb0384fSStephen Warren #define TEGRA30_I2S_CTRL_BIT_SIZE_MASK			(7                   << TEGRA30_I2S_CTRL_BIT_SIZE_SHIFT)
904fb0384fSStephen Warren #define TEGRA30_I2S_CTRL_BIT_SIZE_8			(TEGRA30_I2S_BITS_8  << TEGRA30_I2S_CTRL_BIT_SIZE_SHIFT)
914fb0384fSStephen Warren #define TEGRA30_I2S_CTRL_BIT_SIZE_12			(TEGRA30_I2S_BITS_12 << TEGRA30_I2S_CTRL_BIT_SIZE_SHIFT)
924fb0384fSStephen Warren #define TEGRA30_I2S_CTRL_BIT_SIZE_16			(TEGRA30_I2S_BITS_16 << TEGRA30_I2S_CTRL_BIT_SIZE_SHIFT)
934fb0384fSStephen Warren #define TEGRA30_I2S_CTRL_BIT_SIZE_20			(TEGRA30_I2S_BITS_20 << TEGRA30_I2S_CTRL_BIT_SIZE_SHIFT)
944fb0384fSStephen Warren #define TEGRA30_I2S_CTRL_BIT_SIZE_24			(TEGRA30_I2S_BITS_24 << TEGRA30_I2S_CTRL_BIT_SIZE_SHIFT)
954fb0384fSStephen Warren #define TEGRA30_I2S_CTRL_BIT_SIZE_28			(TEGRA30_I2S_BITS_28 << TEGRA30_I2S_CTRL_BIT_SIZE_SHIFT)
964fb0384fSStephen Warren #define TEGRA30_I2S_CTRL_BIT_SIZE_32			(TEGRA30_I2S_BITS_32 << TEGRA30_I2S_CTRL_BIT_SIZE_SHIFT)
974fb0384fSStephen Warren 
984fb0384fSStephen Warren /* Fields in TEGRA30_I2S_TIMING */
994fb0384fSStephen Warren 
1004fb0384fSStephen Warren #define TEGRA30_I2S_TIMING_NON_SYM_ENABLE		(1 << 12)
1014fb0384fSStephen Warren #define TEGRA30_I2S_TIMING_CHANNEL_BIT_COUNT_SHIFT	0
1020af18c5cSStephen Warren #define TEGRA30_I2S_TIMING_CHANNEL_BIT_COUNT_MASK_US	0x7ff
1034fb0384fSStephen Warren #define TEGRA30_I2S_TIMING_CHANNEL_BIT_COUNT_MASK	(TEGRA30_I2S_TIMING_CHANNEL_BIT_COUNT_MASK_US << TEGRA30_I2S_TIMING_CHANNEL_BIT_COUNT_SHIFT)
1044fb0384fSStephen Warren 
1054fb0384fSStephen Warren /* Fields in TEGRA30_I2S_OFFSET */
1064fb0384fSStephen Warren 
1074fb0384fSStephen Warren #define TEGRA30_I2S_OFFSET_RX_DATA_OFFSET_SHIFT		16
1084fb0384fSStephen Warren #define TEGRA30_I2S_OFFSET_RX_DATA_OFFSET_MASK_US	0x7ff
1094fb0384fSStephen Warren #define TEGRA30_I2S_OFFSET_RX_DATA_OFFSET_MASK		(TEGRA30_I2S_OFFSET_RX_DATA_OFFSET_MASK_US << TEGRA30_I2S_OFFSET_RX_DATA_OFFSET_SHIFT)
1104fb0384fSStephen Warren #define TEGRA30_I2S_OFFSET_TX_DATA_OFFSET_SHIFT		0
1114fb0384fSStephen Warren #define TEGRA30_I2S_OFFSET_TX_DATA_OFFSET_MASK_US	0x7ff
1124fb0384fSStephen Warren #define TEGRA30_I2S_OFFSET_TX_DATA_OFFSET_MASK		(TEGRA30_I2S_OFFSET_TX_DATA_OFFSET_MASK_US << TEGRA30_I2S_OFFSET_TX_DATA_OFFSET_SHIFT)
1134fb0384fSStephen Warren 
1144fb0384fSStephen Warren /* Fields in TEGRA30_I2S_CH_CTRL */
1154fb0384fSStephen Warren 
1164fb0384fSStephen Warren /* (FSYNC width - 1) in bit clocks */
1174fb0384fSStephen Warren #define TEGRA30_I2S_CH_CTRL_FSYNC_WIDTH_SHIFT		24
1184fb0384fSStephen Warren #define TEGRA30_I2S_CH_CTRL_FSYNC_WIDTH_MASK_US		0xff
1194fb0384fSStephen Warren #define TEGRA30_I2S_CH_CTRL_FSYNC_WIDTH_MASK		(TEGRA30_I2S_CH_CTRL_FSYNC_WIDTH_MASK_US << TEGRA30_I2S_CH_CTRL_FSYNC_WIDTH_SHIFT)
1204fb0384fSStephen Warren 
1214fb0384fSStephen Warren #define TEGRA30_I2S_HIGHZ_NO				0
1224fb0384fSStephen Warren #define TEGRA30_I2S_HIGHZ_YES				1
1234fb0384fSStephen Warren #define TEGRA30_I2S_HIGHZ_ON_HALF_BIT_CLK		2
1244fb0384fSStephen Warren 
1254fb0384fSStephen Warren #define TEGRA30_I2S_CH_CTRL_HIGHZ_CTRL_SHIFT		12
1264fb0384fSStephen Warren #define TEGRA30_I2S_CH_CTRL_HIGHZ_CTRL_MASK		(3                                 << TEGRA30_I2S_CH_CTRL_HIGHZ_CTRL_SHIFT)
1274fb0384fSStephen Warren #define TEGRA30_I2S_CH_CTRL_HIGHZ_CTRL_NO		(TEGRA30_I2S_HIGHZ_NO              << TEGRA30_I2S_CH_CTRL_HIGHZ_CTRL_SHIFT)
1284fb0384fSStephen Warren #define TEGRA30_I2S_CH_CTRL_HIGHZ_CTRL_YES		(TEGRA30_I2S_HIGHZ_YES             << TEGRA30_I2S_CH_CTRL_HIGHZ_CTRL_SHIFT)
1294fb0384fSStephen Warren #define TEGRA30_I2S_CH_CTRL_HIGHZ_CTRL_ON_HALF_BIT_CLK	(TEGRA30_I2S_HIGHZ_ON_HALF_BIT_CLK << TEGRA30_I2S_CH_CTRL_HIGHZ_CTRL_SHIFT)
1304fb0384fSStephen Warren 
1314fb0384fSStephen Warren #define TEGRA30_I2S_MSB_FIRST				0
1324fb0384fSStephen Warren #define TEGRA30_I2S_LSB_FIRST				1
1334fb0384fSStephen Warren 
1344fb0384fSStephen Warren #define TEGRA30_I2S_CH_CTRL_RX_BIT_ORDER_SHIFT		10
1354fb0384fSStephen Warren #define TEGRA30_I2S_CH_CTRL_RX_BIT_ORDER_MASK		(1                     << TEGRA30_I2S_CH_CTRL_RX_BIT_ORDER_SHIFT)
1364fb0384fSStephen Warren #define TEGRA30_I2S_CH_CTRL_RX_BIT_ORDER_MSB_FIRST	(TEGRA30_I2S_MSB_FIRST << TEGRA30_I2S_CH_CTRL_RX_BIT_ORDER_SHIFT)
1374fb0384fSStephen Warren #define TEGRA30_I2S_CH_CTRL_RX_BIT_ORDER_LSB_FIRST	(TEGRA30_I2S_LSB_FIRST << TEGRA30_I2S_CH_CTRL_RX_BIT_ORDER_SHIFT)
1384fb0384fSStephen Warren #define TEGRA30_I2S_CH_CTRL_TX_BIT_ORDER_SHIFT		9
1394fb0384fSStephen Warren #define TEGRA30_I2S_CH_CTRL_TX_BIT_ORDER_MASK		(1                     << TEGRA30_I2S_CH_CTRL_TX_BIT_ORDER_SHIFT)
1404fb0384fSStephen Warren #define TEGRA30_I2S_CH_CTRL_TX_BIT_ORDER_MSB_FIRST	(TEGRA30_I2S_MSB_FIRST << TEGRA30_I2S_CH_CTRL_TX_BIT_ORDER_SHIFT)
1414fb0384fSStephen Warren #define TEGRA30_I2S_CH_CTRL_TX_BIT_ORDER_LSB_FIRST	(TEGRA30_I2S_LSB_FIRST << TEGRA30_I2S_CH_CTRL_TX_BIT_ORDER_SHIFT)
1424fb0384fSStephen Warren 
1434fb0384fSStephen Warren #define TEGRA30_I2S_POS_EDGE				0
1444fb0384fSStephen Warren #define TEGRA30_I2S_NEG_EDGE				1
1454fb0384fSStephen Warren 
1464fb0384fSStephen Warren #define TEGRA30_I2S_CH_CTRL_EGDE_CTRL_SHIFT		8
1474fb0384fSStephen Warren #define TEGRA30_I2S_CH_CTRL_EGDE_CTRL_MASK		(1                    << TEGRA30_I2S_CH_CTRL_EGDE_CTRL_SHIFT)
1484fb0384fSStephen Warren #define TEGRA30_I2S_CH_CTRL_EGDE_CTRL_POS_EDGE		(TEGRA30_I2S_POS_EDGE << TEGRA30_I2S_CH_CTRL_EGDE_CTRL_SHIFT)
1494fb0384fSStephen Warren #define TEGRA30_I2S_CH_CTRL_EGDE_CTRL_NEG_EDGE		(TEGRA30_I2S_NEG_EDGE << TEGRA30_I2S_CH_CTRL_EGDE_CTRL_SHIFT)
1504fb0384fSStephen Warren 
1514fb0384fSStephen Warren /* Sample size is # bits from BIT_SIZE minus this field */
1524fb0384fSStephen Warren #define TEGRA30_I2S_CH_CTRL_RX_MASK_BITS_SHIFT		4
1534fb0384fSStephen Warren #define TEGRA30_I2S_CH_CTRL_RX_MASK_BITS_MASK_US	7
1544fb0384fSStephen Warren #define TEGRA30_I2S_CH_CTRL_RX_MASK_BITS_MASK		(TEGRA30_I2S_CH_CTRL_RX_MASK_BITS_MASK_US << TEGRA30_I2S_CH_CTRL_RX_MASK_BITS_SHIFT)
1554fb0384fSStephen Warren 
1564fb0384fSStephen Warren #define TEGRA30_I2S_CH_CTRL_TX_MASK_BITS_SHIFT		0
1574fb0384fSStephen Warren #define TEGRA30_I2S_CH_CTRL_TX_MASK_BITS_MASK_US	7
1584fb0384fSStephen Warren #define TEGRA30_I2S_CH_CTRL_TX_MASK_BITS_MASK		(TEGRA30_I2S_CH_CTRL_TX_MASK_BITS_MASK_US << TEGRA30_I2S_CH_CTRL_TX_MASK_BITS_SHIFT)
1594fb0384fSStephen Warren 
1604fb0384fSStephen Warren /* Fields in TEGRA30_I2S_SLOT_CTRL */
1614fb0384fSStephen Warren 
1624fb0384fSStephen Warren /* Number of slots in frame, minus 1 */
1634fb0384fSStephen Warren #define TEGRA30_I2S_SLOT_CTRL_TOTAL_SLOTS_SHIFT		16
1644fb0384fSStephen Warren #define TEGRA30_I2S_SLOT_CTRL_TOTAL_SLOTS_MASK_US	7
165279fef50SEdward Cragg #define TEGRA30_I2S_SLOT_CTRL_TOTAL_SLOTS_MASK		(TEGRA30_I2S_SLOT_CTRL_TOTAL_SLOTS_MASK_US << TEGRA30_I2S_SLOT_CTRL_TOTAL_SLOTS_SHIFT)
1664fb0384fSStephen Warren 
1674fb0384fSStephen Warren /* TDM mode slot enable bitmask */
1684fb0384fSStephen Warren #define TEGRA30_I2S_SLOT_CTRL_RX_SLOT_ENABLES_SHIFT	8
1694fb0384fSStephen Warren #define TEGRA30_I2S_SLOT_CTRL_RX_SLOT_ENABLES_MASK	(0xff << TEGRA30_I2S_SLOT_CTRL_RX_SLOT_ENABLES_SHIFT)
1704fb0384fSStephen Warren 
1714fb0384fSStephen Warren #define TEGRA30_I2S_SLOT_CTRL_TX_SLOT_ENABLES_SHIFT	0
1724fb0384fSStephen Warren #define TEGRA30_I2S_SLOT_CTRL_TX_SLOT_ENABLES_MASK	(0xff << TEGRA30_I2S_SLOT_CTRL_TX_SLOT_ENABLES_SHIFT)
1734fb0384fSStephen Warren 
1744fb0384fSStephen Warren /* Fields in TEGRA30_I2S_CIF_RX_CTRL */
1754fb0384fSStephen Warren /* Uses field from TEGRA30_AUDIOCIF_CTRL_* in tegra30_ahub.h */
1764fb0384fSStephen Warren 
1774fb0384fSStephen Warren /* Fields in TEGRA30_I2S_CIF_TX_CTRL */
1784fb0384fSStephen Warren /* Uses field from TEGRA30_AUDIOCIF_CTRL_* in tegra30_ahub.h */
1794fb0384fSStephen Warren 
1804fb0384fSStephen Warren /* Fields in TEGRA30_I2S_FLOWCTL */
1814fb0384fSStephen Warren 
1824fb0384fSStephen Warren #define TEGRA30_I2S_FILTER_LINEAR			0
1834fb0384fSStephen Warren #define TEGRA30_I2S_FILTER_QUAD				1
1844fb0384fSStephen Warren 
1854fb0384fSStephen Warren #define TEGRA30_I2S_FLOWCTL_FILTER_SHIFT		31
1864fb0384fSStephen Warren #define TEGRA30_I2S_FLOWCTL_FILTER_MASK			(1                         << TEGRA30_I2S_FLOWCTL_FILTER_SHIFT)
1874fb0384fSStephen Warren #define TEGRA30_I2S_FLOWCTL_FILTER_LINEAR		(TEGRA30_I2S_FILTER_LINEAR << TEGRA30_I2S_FLOWCTL_FILTER_SHIFT)
1884fb0384fSStephen Warren #define TEGRA30_I2S_FLOWCTL_FILTER_QUAD			(TEGRA30_I2S_FILTER_QUAD   << TEGRA30_I2S_FLOWCTL_FILTER_SHIFT)
1894fb0384fSStephen Warren 
1904fb0384fSStephen Warren /* Fields in TEGRA30_I2S_TX_STEP */
1914fb0384fSStephen Warren 
1924fb0384fSStephen Warren #define TEGRA30_I2S_TX_STEP_SHIFT			0
1934fb0384fSStephen Warren #define TEGRA30_I2S_TX_STEP_MASK_US			0xffff
1944fb0384fSStephen Warren #define TEGRA30_I2S_TX_STEP_MASK			(TEGRA30_I2S_TX_STEP_MASK_US << TEGRA30_I2S_TX_STEP_SHIFT)
1954fb0384fSStephen Warren 
1964fb0384fSStephen Warren /* Fields in TEGRA30_I2S_FLOW_STATUS */
1974fb0384fSStephen Warren 
1984fb0384fSStephen Warren #define TEGRA30_I2S_FLOW_STATUS_UNDERFLOW		(1 << 31)
1994fb0384fSStephen Warren #define TEGRA30_I2S_FLOW_STATUS_OVERFLOW		(1 << 30)
2004fb0384fSStephen Warren #define TEGRA30_I2S_FLOW_STATUS_MONITOR_INT_EN		(1 << 4)
2014fb0384fSStephen Warren #define TEGRA30_I2S_FLOW_STATUS_COUNTER_CLR		(1 << 3)
2024fb0384fSStephen Warren #define TEGRA30_I2S_FLOW_STATUS_MONITOR_CLR		(1 << 2)
2034fb0384fSStephen Warren #define TEGRA30_I2S_FLOW_STATUS_COUNTER_EN		(1 << 1)
2044fb0384fSStephen Warren #define TEGRA30_I2S_FLOW_STATUS_MONITOR_EN		(1 << 0)
2054fb0384fSStephen Warren 
2064fb0384fSStephen Warren /*
2074fb0384fSStephen Warren  * There are no fields in TEGRA30_I2S_FLOW_TOTAL, TEGRA30_I2S_FLOW_OVER,
2084fb0384fSStephen Warren  * TEGRA30_I2S_FLOW_UNDER; they are counters taking the whole register.
2094fb0384fSStephen Warren  */
2104fb0384fSStephen Warren 
2114fb0384fSStephen Warren /* Fields in TEGRA30_I2S_LCOEF_* */
2124fb0384fSStephen Warren 
2134fb0384fSStephen Warren #define TEGRA30_I2S_LCOEF_COEF_SHIFT			0
2144fb0384fSStephen Warren #define TEGRA30_I2S_LCOEF_COEF_MASK_US			0xffff
2154fb0384fSStephen Warren #define TEGRA30_I2S_LCOEF_COEF_MASK			(TEGRA30_I2S_LCOEF_COEF_MASK_US << TEGRA30_I2S_LCOEF_COEF_SHIFT)
2164fb0384fSStephen Warren 
2175e049fceSStephen Warren struct tegra30_i2s_soc_data {
2185e049fceSStephen Warren 	void (*set_audio_cif)(struct regmap *regmap,
2195e049fceSStephen Warren 			      unsigned int reg,
2205e049fceSStephen Warren 			      struct tegra30_ahub_cif_conf *conf);
2215e049fceSStephen Warren };
2225e049fceSStephen Warren 
2234fb0384fSStephen Warren struct tegra30_i2s {
2245e049fceSStephen Warren 	const struct tegra30_i2s_soc_data *soc_data;
2254fb0384fSStephen Warren 	struct snd_soc_dai_driver dai;
2264fb0384fSStephen Warren 	int cif_id;
2274fb0384fSStephen Warren 	struct clk *clk_i2s;
2284fb0384fSStephen Warren 	enum tegra30_ahub_txcif capture_i2s_cif;
2294fb0384fSStephen Warren 	enum tegra30_ahub_rxcif capture_fifo_cif;
2305608bd3eSStephen Warren 	char capture_dma_chan[8];
2313489d506SLars-Peter Clausen 	struct snd_dmaengine_dai_dma_data capture_dma_data;
2324fb0384fSStephen Warren 	enum tegra30_ahub_rxcif playback_i2s_cif;
2334fb0384fSStephen Warren 	enum tegra30_ahub_txcif playback_fifo_cif;
2345608bd3eSStephen Warren 	char playback_dma_chan[8];
2353489d506SLars-Peter Clausen 	struct snd_dmaengine_dai_dma_data playback_dma_data;
2364fb0384fSStephen Warren 	struct regmap *regmap;
2375608bd3eSStephen Warren 	struct snd_dmaengine_pcm_config dma_config;
2384fb0384fSStephen Warren };
2394fb0384fSStephen Warren 
2404fb0384fSStephen Warren #endif
241