18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0-only */ 28c2ecf20Sopenharmony_ci/* 38c2ecf20Sopenharmony_ci * tegra30_i2s.h - Definitions for Tegra30 I2S driver 48c2ecf20Sopenharmony_ci * 58c2ecf20Sopenharmony_ci * Copyright (c) 2011,2012, NVIDIA CORPORATION. All rights reserved. 68c2ecf20Sopenharmony_ci */ 78c2ecf20Sopenharmony_ci 88c2ecf20Sopenharmony_ci#ifndef __TEGRA30_I2S_H__ 98c2ecf20Sopenharmony_ci#define __TEGRA30_I2S_H__ 108c2ecf20Sopenharmony_ci 118c2ecf20Sopenharmony_ci#include "tegra_pcm.h" 128c2ecf20Sopenharmony_ci 138c2ecf20Sopenharmony_ci/* Register offsets from TEGRA30_I2S*_BASE */ 148c2ecf20Sopenharmony_ci 158c2ecf20Sopenharmony_ci#define TEGRA30_I2S_CTRL 0x0 168c2ecf20Sopenharmony_ci#define TEGRA30_I2S_TIMING 0x4 178c2ecf20Sopenharmony_ci#define TEGRA30_I2S_OFFSET 0x08 188c2ecf20Sopenharmony_ci#define TEGRA30_I2S_CH_CTRL 0x0c 198c2ecf20Sopenharmony_ci#define TEGRA30_I2S_SLOT_CTRL 0x10 208c2ecf20Sopenharmony_ci#define TEGRA30_I2S_CIF_RX_CTRL 0x14 218c2ecf20Sopenharmony_ci#define TEGRA30_I2S_CIF_TX_CTRL 0x18 228c2ecf20Sopenharmony_ci#define TEGRA30_I2S_FLOWCTL 0x1c 238c2ecf20Sopenharmony_ci#define TEGRA30_I2S_TX_STEP 0x20 248c2ecf20Sopenharmony_ci#define TEGRA30_I2S_FLOW_STATUS 0x24 258c2ecf20Sopenharmony_ci#define TEGRA30_I2S_FLOW_TOTAL 0x28 268c2ecf20Sopenharmony_ci#define TEGRA30_I2S_FLOW_OVER 0x2c 278c2ecf20Sopenharmony_ci#define TEGRA30_I2S_FLOW_UNDER 0x30 288c2ecf20Sopenharmony_ci#define TEGRA30_I2S_LCOEF_1_4_0 0x34 298c2ecf20Sopenharmony_ci#define TEGRA30_I2S_LCOEF_1_4_1 0x38 308c2ecf20Sopenharmony_ci#define TEGRA30_I2S_LCOEF_1_4_2 0x3c 318c2ecf20Sopenharmony_ci#define TEGRA30_I2S_LCOEF_1_4_3 0x40 328c2ecf20Sopenharmony_ci#define TEGRA30_I2S_LCOEF_1_4_4 0x44 338c2ecf20Sopenharmony_ci#define TEGRA30_I2S_LCOEF_1_4_5 0x48 348c2ecf20Sopenharmony_ci#define TEGRA30_I2S_LCOEF_2_4_0 0x4c 358c2ecf20Sopenharmony_ci#define TEGRA30_I2S_LCOEF_2_4_1 0x50 368c2ecf20Sopenharmony_ci#define TEGRA30_I2S_LCOEF_2_4_2 0x54 378c2ecf20Sopenharmony_ci 388c2ecf20Sopenharmony_ci/* Fields in TEGRA30_I2S_CTRL */ 398c2ecf20Sopenharmony_ci 408c2ecf20Sopenharmony_ci#define TEGRA30_I2S_CTRL_XFER_EN_TX (1 << 31) 418c2ecf20Sopenharmony_ci#define TEGRA30_I2S_CTRL_XFER_EN_RX (1 << 30) 428c2ecf20Sopenharmony_ci#define TEGRA30_I2S_CTRL_CG_EN (1 << 29) 438c2ecf20Sopenharmony_ci#define TEGRA30_I2S_CTRL_SOFT_RESET (1 << 28) 448c2ecf20Sopenharmony_ci#define TEGRA30_I2S_CTRL_TX_FLOWCTL_EN (1 << 27) 458c2ecf20Sopenharmony_ci 468c2ecf20Sopenharmony_ci#define TEGRA30_I2S_CTRL_OBS_SEL_SHIFT 24 478c2ecf20Sopenharmony_ci#define TEGRA30_I2S_CTRL_OBS_SEL_MASK (7 << TEGRA30_I2S_CTRL_OBS_SEL_SHIFT) 488c2ecf20Sopenharmony_ci 498c2ecf20Sopenharmony_ci#define TEGRA30_I2S_FRAME_FORMAT_LRCK 0 508c2ecf20Sopenharmony_ci#define TEGRA30_I2S_FRAME_FORMAT_FSYNC 1 518c2ecf20Sopenharmony_ci 528c2ecf20Sopenharmony_ci#define TEGRA30_I2S_CTRL_FRAME_FORMAT_SHIFT 12 538c2ecf20Sopenharmony_ci#define TEGRA30_I2S_CTRL_FRAME_FORMAT_MASK (7 << TEGRA30_I2S_CTRL_FRAME_FORMAT_SHIFT) 548c2ecf20Sopenharmony_ci#define TEGRA30_I2S_CTRL_FRAME_FORMAT_LRCK (TEGRA30_I2S_FRAME_FORMAT_LRCK << TEGRA30_I2S_CTRL_FRAME_FORMAT_SHIFT) 558c2ecf20Sopenharmony_ci#define TEGRA30_I2S_CTRL_FRAME_FORMAT_FSYNC (TEGRA30_I2S_FRAME_FORMAT_FSYNC << TEGRA30_I2S_CTRL_FRAME_FORMAT_SHIFT) 568c2ecf20Sopenharmony_ci 578c2ecf20Sopenharmony_ci#define TEGRA30_I2S_CTRL_MASTER_ENABLE (1 << 10) 588c2ecf20Sopenharmony_ci 598c2ecf20Sopenharmony_ci#define TEGRA30_I2S_LRCK_LEFT_LOW 0 608c2ecf20Sopenharmony_ci#define TEGRA30_I2S_LRCK_RIGHT_LOW 1 618c2ecf20Sopenharmony_ci 628c2ecf20Sopenharmony_ci#define TEGRA30_I2S_CTRL_LRCK_SHIFT 9 638c2ecf20Sopenharmony_ci#define TEGRA30_I2S_CTRL_LRCK_MASK (1 << TEGRA30_I2S_CTRL_LRCK_SHIFT) 648c2ecf20Sopenharmony_ci#define TEGRA30_I2S_CTRL_LRCK_L_LOW (TEGRA30_I2S_LRCK_LEFT_LOW << TEGRA30_I2S_CTRL_LRCK_SHIFT) 658c2ecf20Sopenharmony_ci#define TEGRA30_I2S_CTRL_LRCK_R_LOW (TEGRA30_I2S_LRCK_RIGHT_LOW << TEGRA30_I2S_CTRL_LRCK_SHIFT) 668c2ecf20Sopenharmony_ci 678c2ecf20Sopenharmony_ci#define TEGRA30_I2S_CTRL_LPBK_ENABLE (1 << 8) 688c2ecf20Sopenharmony_ci 698c2ecf20Sopenharmony_ci#define TEGRA30_I2S_BIT_CODE_LINEAR 0 708c2ecf20Sopenharmony_ci#define TEGRA30_I2S_BIT_CODE_ULAW 1 718c2ecf20Sopenharmony_ci#define TEGRA30_I2S_BIT_CODE_ALAW 2 728c2ecf20Sopenharmony_ci 738c2ecf20Sopenharmony_ci#define TEGRA30_I2S_CTRL_BIT_CODE_SHIFT 4 748c2ecf20Sopenharmony_ci#define TEGRA30_I2S_CTRL_BIT_CODE_MASK (3 << TEGRA30_I2S_CTRL_BIT_CODE_SHIFT) 758c2ecf20Sopenharmony_ci#define TEGRA30_I2S_CTRL_BIT_CODE_LINEAR (TEGRA30_I2S_BIT_CODE_LINEAR << TEGRA30_I2S_CTRL_BIT_CODE_SHIFT) 768c2ecf20Sopenharmony_ci#define TEGRA30_I2S_CTRL_BIT_CODE_ULAW (TEGRA30_I2S_BIT_CODE_ULAW << TEGRA30_I2S_CTRL_BIT_CODE_SHIFT) 778c2ecf20Sopenharmony_ci#define TEGRA30_I2S_CTRL_BIT_CODE_ALAW (TEGRA30_I2S_BIT_CODE_ALAW << TEGRA30_I2S_CTRL_BIT_CODE_SHIFT) 788c2ecf20Sopenharmony_ci 798c2ecf20Sopenharmony_ci#define TEGRA30_I2S_BITS_8 1 808c2ecf20Sopenharmony_ci#define TEGRA30_I2S_BITS_12 2 818c2ecf20Sopenharmony_ci#define TEGRA30_I2S_BITS_16 3 828c2ecf20Sopenharmony_ci#define TEGRA30_I2S_BITS_20 4 838c2ecf20Sopenharmony_ci#define TEGRA30_I2S_BITS_24 5 848c2ecf20Sopenharmony_ci#define TEGRA30_I2S_BITS_28 6 858c2ecf20Sopenharmony_ci#define TEGRA30_I2S_BITS_32 7 868c2ecf20Sopenharmony_ci 878c2ecf20Sopenharmony_ci/* Sample container size; see {RX,TX}_MASK field in CH_CTRL below */ 888c2ecf20Sopenharmony_ci#define TEGRA30_I2S_CTRL_BIT_SIZE_SHIFT 0 898c2ecf20Sopenharmony_ci#define TEGRA30_I2S_CTRL_BIT_SIZE_MASK (7 << TEGRA30_I2S_CTRL_BIT_SIZE_SHIFT) 908c2ecf20Sopenharmony_ci#define TEGRA30_I2S_CTRL_BIT_SIZE_8 (TEGRA30_I2S_BITS_8 << TEGRA30_I2S_CTRL_BIT_SIZE_SHIFT) 918c2ecf20Sopenharmony_ci#define TEGRA30_I2S_CTRL_BIT_SIZE_12 (TEGRA30_I2S_BITS_12 << TEGRA30_I2S_CTRL_BIT_SIZE_SHIFT) 928c2ecf20Sopenharmony_ci#define TEGRA30_I2S_CTRL_BIT_SIZE_16 (TEGRA30_I2S_BITS_16 << TEGRA30_I2S_CTRL_BIT_SIZE_SHIFT) 938c2ecf20Sopenharmony_ci#define TEGRA30_I2S_CTRL_BIT_SIZE_20 (TEGRA30_I2S_BITS_20 << TEGRA30_I2S_CTRL_BIT_SIZE_SHIFT) 948c2ecf20Sopenharmony_ci#define TEGRA30_I2S_CTRL_BIT_SIZE_24 (TEGRA30_I2S_BITS_24 << TEGRA30_I2S_CTRL_BIT_SIZE_SHIFT) 958c2ecf20Sopenharmony_ci#define TEGRA30_I2S_CTRL_BIT_SIZE_28 (TEGRA30_I2S_BITS_28 << TEGRA30_I2S_CTRL_BIT_SIZE_SHIFT) 968c2ecf20Sopenharmony_ci#define TEGRA30_I2S_CTRL_BIT_SIZE_32 (TEGRA30_I2S_BITS_32 << TEGRA30_I2S_CTRL_BIT_SIZE_SHIFT) 978c2ecf20Sopenharmony_ci 988c2ecf20Sopenharmony_ci/* Fields in TEGRA30_I2S_TIMING */ 998c2ecf20Sopenharmony_ci 1008c2ecf20Sopenharmony_ci#define TEGRA30_I2S_TIMING_NON_SYM_ENABLE (1 << 12) 1018c2ecf20Sopenharmony_ci#define TEGRA30_I2S_TIMING_CHANNEL_BIT_COUNT_SHIFT 0 1028c2ecf20Sopenharmony_ci#define TEGRA30_I2S_TIMING_CHANNEL_BIT_COUNT_MASK_US 0x7ff 1038c2ecf20Sopenharmony_ci#define TEGRA30_I2S_TIMING_CHANNEL_BIT_COUNT_MASK (TEGRA30_I2S_TIMING_CHANNEL_BIT_COUNT_MASK_US << TEGRA30_I2S_TIMING_CHANNEL_BIT_COUNT_SHIFT) 1048c2ecf20Sopenharmony_ci 1058c2ecf20Sopenharmony_ci/* Fields in TEGRA30_I2S_OFFSET */ 1068c2ecf20Sopenharmony_ci 1078c2ecf20Sopenharmony_ci#define TEGRA30_I2S_OFFSET_RX_DATA_OFFSET_SHIFT 16 1088c2ecf20Sopenharmony_ci#define TEGRA30_I2S_OFFSET_RX_DATA_OFFSET_MASK_US 0x7ff 1098c2ecf20Sopenharmony_ci#define TEGRA30_I2S_OFFSET_RX_DATA_OFFSET_MASK (TEGRA30_I2S_OFFSET_RX_DATA_OFFSET_MASK_US << TEGRA30_I2S_OFFSET_RX_DATA_OFFSET_SHIFT) 1108c2ecf20Sopenharmony_ci#define TEGRA30_I2S_OFFSET_TX_DATA_OFFSET_SHIFT 0 1118c2ecf20Sopenharmony_ci#define TEGRA30_I2S_OFFSET_TX_DATA_OFFSET_MASK_US 0x7ff 1128c2ecf20Sopenharmony_ci#define TEGRA30_I2S_OFFSET_TX_DATA_OFFSET_MASK (TEGRA30_I2S_OFFSET_TX_DATA_OFFSET_MASK_US << TEGRA30_I2S_OFFSET_TX_DATA_OFFSET_SHIFT) 1138c2ecf20Sopenharmony_ci 1148c2ecf20Sopenharmony_ci/* Fields in TEGRA30_I2S_CH_CTRL */ 1158c2ecf20Sopenharmony_ci 1168c2ecf20Sopenharmony_ci/* (FSYNC width - 1) in bit clocks */ 1178c2ecf20Sopenharmony_ci#define TEGRA30_I2S_CH_CTRL_FSYNC_WIDTH_SHIFT 24 1188c2ecf20Sopenharmony_ci#define TEGRA30_I2S_CH_CTRL_FSYNC_WIDTH_MASK_US 0xff 1198c2ecf20Sopenharmony_ci#define TEGRA30_I2S_CH_CTRL_FSYNC_WIDTH_MASK (TEGRA30_I2S_CH_CTRL_FSYNC_WIDTH_MASK_US << TEGRA30_I2S_CH_CTRL_FSYNC_WIDTH_SHIFT) 1208c2ecf20Sopenharmony_ci 1218c2ecf20Sopenharmony_ci#define TEGRA30_I2S_HIGHZ_NO 0 1228c2ecf20Sopenharmony_ci#define TEGRA30_I2S_HIGHZ_YES 1 1238c2ecf20Sopenharmony_ci#define TEGRA30_I2S_HIGHZ_ON_HALF_BIT_CLK 2 1248c2ecf20Sopenharmony_ci 1258c2ecf20Sopenharmony_ci#define TEGRA30_I2S_CH_CTRL_HIGHZ_CTRL_SHIFT 12 1268c2ecf20Sopenharmony_ci#define TEGRA30_I2S_CH_CTRL_HIGHZ_CTRL_MASK (3 << TEGRA30_I2S_CH_CTRL_HIGHZ_CTRL_SHIFT) 1278c2ecf20Sopenharmony_ci#define TEGRA30_I2S_CH_CTRL_HIGHZ_CTRL_NO (TEGRA30_I2S_HIGHZ_NO << TEGRA30_I2S_CH_CTRL_HIGHZ_CTRL_SHIFT) 1288c2ecf20Sopenharmony_ci#define TEGRA30_I2S_CH_CTRL_HIGHZ_CTRL_YES (TEGRA30_I2S_HIGHZ_YES << TEGRA30_I2S_CH_CTRL_HIGHZ_CTRL_SHIFT) 1298c2ecf20Sopenharmony_ci#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) 1308c2ecf20Sopenharmony_ci 1318c2ecf20Sopenharmony_ci#define TEGRA30_I2S_MSB_FIRST 0 1328c2ecf20Sopenharmony_ci#define TEGRA30_I2S_LSB_FIRST 1 1338c2ecf20Sopenharmony_ci 1348c2ecf20Sopenharmony_ci#define TEGRA30_I2S_CH_CTRL_RX_BIT_ORDER_SHIFT 10 1358c2ecf20Sopenharmony_ci#define TEGRA30_I2S_CH_CTRL_RX_BIT_ORDER_MASK (1 << TEGRA30_I2S_CH_CTRL_RX_BIT_ORDER_SHIFT) 1368c2ecf20Sopenharmony_ci#define TEGRA30_I2S_CH_CTRL_RX_BIT_ORDER_MSB_FIRST (TEGRA30_I2S_MSB_FIRST << TEGRA30_I2S_CH_CTRL_RX_BIT_ORDER_SHIFT) 1378c2ecf20Sopenharmony_ci#define TEGRA30_I2S_CH_CTRL_RX_BIT_ORDER_LSB_FIRST (TEGRA30_I2S_LSB_FIRST << TEGRA30_I2S_CH_CTRL_RX_BIT_ORDER_SHIFT) 1388c2ecf20Sopenharmony_ci#define TEGRA30_I2S_CH_CTRL_TX_BIT_ORDER_SHIFT 9 1398c2ecf20Sopenharmony_ci#define TEGRA30_I2S_CH_CTRL_TX_BIT_ORDER_MASK (1 << TEGRA30_I2S_CH_CTRL_TX_BIT_ORDER_SHIFT) 1408c2ecf20Sopenharmony_ci#define TEGRA30_I2S_CH_CTRL_TX_BIT_ORDER_MSB_FIRST (TEGRA30_I2S_MSB_FIRST << TEGRA30_I2S_CH_CTRL_TX_BIT_ORDER_SHIFT) 1418c2ecf20Sopenharmony_ci#define TEGRA30_I2S_CH_CTRL_TX_BIT_ORDER_LSB_FIRST (TEGRA30_I2S_LSB_FIRST << TEGRA30_I2S_CH_CTRL_TX_BIT_ORDER_SHIFT) 1428c2ecf20Sopenharmony_ci 1438c2ecf20Sopenharmony_ci#define TEGRA30_I2S_POS_EDGE 0 1448c2ecf20Sopenharmony_ci#define TEGRA30_I2S_NEG_EDGE 1 1458c2ecf20Sopenharmony_ci 1468c2ecf20Sopenharmony_ci#define TEGRA30_I2S_CH_CTRL_EGDE_CTRL_SHIFT 8 1478c2ecf20Sopenharmony_ci#define TEGRA30_I2S_CH_CTRL_EGDE_CTRL_MASK (1 << TEGRA30_I2S_CH_CTRL_EGDE_CTRL_SHIFT) 1488c2ecf20Sopenharmony_ci#define TEGRA30_I2S_CH_CTRL_EGDE_CTRL_POS_EDGE (TEGRA30_I2S_POS_EDGE << TEGRA30_I2S_CH_CTRL_EGDE_CTRL_SHIFT) 1498c2ecf20Sopenharmony_ci#define TEGRA30_I2S_CH_CTRL_EGDE_CTRL_NEG_EDGE (TEGRA30_I2S_NEG_EDGE << TEGRA30_I2S_CH_CTRL_EGDE_CTRL_SHIFT) 1508c2ecf20Sopenharmony_ci 1518c2ecf20Sopenharmony_ci/* Sample size is # bits from BIT_SIZE minus this field */ 1528c2ecf20Sopenharmony_ci#define TEGRA30_I2S_CH_CTRL_RX_MASK_BITS_SHIFT 4 1538c2ecf20Sopenharmony_ci#define TEGRA30_I2S_CH_CTRL_RX_MASK_BITS_MASK_US 7 1548c2ecf20Sopenharmony_ci#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) 1558c2ecf20Sopenharmony_ci 1568c2ecf20Sopenharmony_ci#define TEGRA30_I2S_CH_CTRL_TX_MASK_BITS_SHIFT 0 1578c2ecf20Sopenharmony_ci#define TEGRA30_I2S_CH_CTRL_TX_MASK_BITS_MASK_US 7 1588c2ecf20Sopenharmony_ci#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) 1598c2ecf20Sopenharmony_ci 1608c2ecf20Sopenharmony_ci/* Fields in TEGRA30_I2S_SLOT_CTRL */ 1618c2ecf20Sopenharmony_ci 1628c2ecf20Sopenharmony_ci/* Number of slots in frame, minus 1 */ 1638c2ecf20Sopenharmony_ci#define TEGRA30_I2S_SLOT_CTRL_TOTAL_SLOTS_SHIFT 16 1648c2ecf20Sopenharmony_ci#define TEGRA30_I2S_SLOT_CTRL_TOTAL_SLOTS_MASK_US 7 1658c2ecf20Sopenharmony_ci#define TEGRA30_I2S_SLOT_CTRL_TOTAL_SLOTS_MASK (TEGRA30_I2S_SLOT_CTRL_TOTAL_SLOTS_MASK_US << TEGRA30_I2S_SLOT_CTRL_TOTAL_SLOTS_SHIFT) 1668c2ecf20Sopenharmony_ci 1678c2ecf20Sopenharmony_ci/* TDM mode slot enable bitmask */ 1688c2ecf20Sopenharmony_ci#define TEGRA30_I2S_SLOT_CTRL_RX_SLOT_ENABLES_SHIFT 8 1698c2ecf20Sopenharmony_ci#define TEGRA30_I2S_SLOT_CTRL_RX_SLOT_ENABLES_MASK (0xff << TEGRA30_I2S_SLOT_CTRL_RX_SLOT_ENABLES_SHIFT) 1708c2ecf20Sopenharmony_ci 1718c2ecf20Sopenharmony_ci#define TEGRA30_I2S_SLOT_CTRL_TX_SLOT_ENABLES_SHIFT 0 1728c2ecf20Sopenharmony_ci#define TEGRA30_I2S_SLOT_CTRL_TX_SLOT_ENABLES_MASK (0xff << TEGRA30_I2S_SLOT_CTRL_TX_SLOT_ENABLES_SHIFT) 1738c2ecf20Sopenharmony_ci 1748c2ecf20Sopenharmony_ci/* Fields in TEGRA30_I2S_CIF_RX_CTRL */ 1758c2ecf20Sopenharmony_ci/* Uses field from TEGRA30_AUDIOCIF_CTRL_* in tegra30_ahub.h */ 1768c2ecf20Sopenharmony_ci 1778c2ecf20Sopenharmony_ci/* Fields in TEGRA30_I2S_CIF_TX_CTRL */ 1788c2ecf20Sopenharmony_ci/* Uses field from TEGRA30_AUDIOCIF_CTRL_* in tegra30_ahub.h */ 1798c2ecf20Sopenharmony_ci 1808c2ecf20Sopenharmony_ci/* Fields in TEGRA30_I2S_FLOWCTL */ 1818c2ecf20Sopenharmony_ci 1828c2ecf20Sopenharmony_ci#define TEGRA30_I2S_FILTER_LINEAR 0 1838c2ecf20Sopenharmony_ci#define TEGRA30_I2S_FILTER_QUAD 1 1848c2ecf20Sopenharmony_ci 1858c2ecf20Sopenharmony_ci#define TEGRA30_I2S_FLOWCTL_FILTER_SHIFT 31 1868c2ecf20Sopenharmony_ci#define TEGRA30_I2S_FLOWCTL_FILTER_MASK (1 << TEGRA30_I2S_FLOWCTL_FILTER_SHIFT) 1878c2ecf20Sopenharmony_ci#define TEGRA30_I2S_FLOWCTL_FILTER_LINEAR (TEGRA30_I2S_FILTER_LINEAR << TEGRA30_I2S_FLOWCTL_FILTER_SHIFT) 1888c2ecf20Sopenharmony_ci#define TEGRA30_I2S_FLOWCTL_FILTER_QUAD (TEGRA30_I2S_FILTER_QUAD << TEGRA30_I2S_FLOWCTL_FILTER_SHIFT) 1898c2ecf20Sopenharmony_ci 1908c2ecf20Sopenharmony_ci/* Fields in TEGRA30_I2S_TX_STEP */ 1918c2ecf20Sopenharmony_ci 1928c2ecf20Sopenharmony_ci#define TEGRA30_I2S_TX_STEP_SHIFT 0 1938c2ecf20Sopenharmony_ci#define TEGRA30_I2S_TX_STEP_MASK_US 0xffff 1948c2ecf20Sopenharmony_ci#define TEGRA30_I2S_TX_STEP_MASK (TEGRA30_I2S_TX_STEP_MASK_US << TEGRA30_I2S_TX_STEP_SHIFT) 1958c2ecf20Sopenharmony_ci 1968c2ecf20Sopenharmony_ci/* Fields in TEGRA30_I2S_FLOW_STATUS */ 1978c2ecf20Sopenharmony_ci 1988c2ecf20Sopenharmony_ci#define TEGRA30_I2S_FLOW_STATUS_UNDERFLOW (1 << 31) 1998c2ecf20Sopenharmony_ci#define TEGRA30_I2S_FLOW_STATUS_OVERFLOW (1 << 30) 2008c2ecf20Sopenharmony_ci#define TEGRA30_I2S_FLOW_STATUS_MONITOR_INT_EN (1 << 4) 2018c2ecf20Sopenharmony_ci#define TEGRA30_I2S_FLOW_STATUS_COUNTER_CLR (1 << 3) 2028c2ecf20Sopenharmony_ci#define TEGRA30_I2S_FLOW_STATUS_MONITOR_CLR (1 << 2) 2038c2ecf20Sopenharmony_ci#define TEGRA30_I2S_FLOW_STATUS_COUNTER_EN (1 << 1) 2048c2ecf20Sopenharmony_ci#define TEGRA30_I2S_FLOW_STATUS_MONITOR_EN (1 << 0) 2058c2ecf20Sopenharmony_ci 2068c2ecf20Sopenharmony_ci/* 2078c2ecf20Sopenharmony_ci * There are no fields in TEGRA30_I2S_FLOW_TOTAL, TEGRA30_I2S_FLOW_OVER, 2088c2ecf20Sopenharmony_ci * TEGRA30_I2S_FLOW_UNDER; they are counters taking the whole register. 2098c2ecf20Sopenharmony_ci */ 2108c2ecf20Sopenharmony_ci 2118c2ecf20Sopenharmony_ci/* Fields in TEGRA30_I2S_LCOEF_* */ 2128c2ecf20Sopenharmony_ci 2138c2ecf20Sopenharmony_ci#define TEGRA30_I2S_LCOEF_COEF_SHIFT 0 2148c2ecf20Sopenharmony_ci#define TEGRA30_I2S_LCOEF_COEF_MASK_US 0xffff 2158c2ecf20Sopenharmony_ci#define TEGRA30_I2S_LCOEF_COEF_MASK (TEGRA30_I2S_LCOEF_COEF_MASK_US << TEGRA30_I2S_LCOEF_COEF_SHIFT) 2168c2ecf20Sopenharmony_ci 2178c2ecf20Sopenharmony_cistruct tegra30_i2s_soc_data { 2188c2ecf20Sopenharmony_ci void (*set_audio_cif)(struct regmap *regmap, 2198c2ecf20Sopenharmony_ci unsigned int reg, 2208c2ecf20Sopenharmony_ci struct tegra30_ahub_cif_conf *conf); 2218c2ecf20Sopenharmony_ci}; 2228c2ecf20Sopenharmony_ci 2238c2ecf20Sopenharmony_cistruct tegra30_i2s { 2248c2ecf20Sopenharmony_ci const struct tegra30_i2s_soc_data *soc_data; 2258c2ecf20Sopenharmony_ci struct snd_soc_dai_driver dai; 2268c2ecf20Sopenharmony_ci int cif_id; 2278c2ecf20Sopenharmony_ci struct clk *clk_i2s; 2288c2ecf20Sopenharmony_ci enum tegra30_ahub_txcif capture_i2s_cif; 2298c2ecf20Sopenharmony_ci enum tegra30_ahub_rxcif capture_fifo_cif; 2308c2ecf20Sopenharmony_ci char capture_dma_chan[8]; 2318c2ecf20Sopenharmony_ci struct snd_dmaengine_dai_dma_data capture_dma_data; 2328c2ecf20Sopenharmony_ci enum tegra30_ahub_rxcif playback_i2s_cif; 2338c2ecf20Sopenharmony_ci enum tegra30_ahub_txcif playback_fifo_cif; 2348c2ecf20Sopenharmony_ci char playback_dma_chan[8]; 2358c2ecf20Sopenharmony_ci struct snd_dmaengine_dai_dma_data playback_dma_data; 2368c2ecf20Sopenharmony_ci struct regmap *regmap; 2378c2ecf20Sopenharmony_ci struct snd_dmaengine_pcm_config dma_config; 2388c2ecf20Sopenharmony_ci}; 2398c2ecf20Sopenharmony_ci 2408c2ecf20Sopenharmony_ci#endif 241