1 /* SPDX-License-Identifier: GPL-2.0-only */ 1 /* SPDX-License-Identifier: GPL-2.0-only */ 2 /* 2 /* 3 * tegra210_ope.h - Definitions for Tegra210 O 3 * tegra210_ope.h - Definitions for Tegra210 OPE driver 4 * 4 * 5 * Copyright (c) 2022, NVIDIA CORPORATION. All 5 * Copyright (c) 2022, NVIDIA CORPORATION. All rights reserved. 6 * 6 * 7 */ 7 */ 8 8 9 #ifndef __TEGRA210_OPE_H__ 9 #ifndef __TEGRA210_OPE_H__ 10 #define __TEGRA210_OPE_H__ 10 #define __TEGRA210_OPE_H__ 11 11 12 #include <linux/regmap.h> 12 #include <linux/regmap.h> 13 #include <sound/soc.h> 13 #include <sound/soc.h> 14 14 15 #include "tegra210_peq.h" 15 #include "tegra210_peq.h" 16 16 17 /* 17 /* 18 * OPE_RX registers are with respect to XBAR. 18 * OPE_RX registers are with respect to XBAR. 19 * The data comes from XBAR to OPE 19 * The data comes from XBAR to OPE 20 */ 20 */ 21 #define TEGRA210_OPE_RX_STATUS 21 #define TEGRA210_OPE_RX_STATUS 0xc 22 #define TEGRA210_OPE_RX_INT_STATUS 22 #define TEGRA210_OPE_RX_INT_STATUS 0x10 23 #define TEGRA210_OPE_RX_INT_MASK 23 #define TEGRA210_OPE_RX_INT_MASK 0x14 24 #define TEGRA210_OPE_RX_INT_SET 24 #define TEGRA210_OPE_RX_INT_SET 0x18 25 #define TEGRA210_OPE_RX_INT_CLEAR 25 #define TEGRA210_OPE_RX_INT_CLEAR 0x1c 26 #define TEGRA210_OPE_RX_CIF_CTRL 26 #define TEGRA210_OPE_RX_CIF_CTRL 0x20 27 27 28 /* 28 /* 29 * OPE_TX registers are with respect to XBAR. 29 * OPE_TX registers are with respect to XBAR. 30 * The data goes out from OPE to XBAR 30 * The data goes out from OPE to XBAR 31 */ 31 */ 32 #define TEGRA210_OPE_TX_STATUS 32 #define TEGRA210_OPE_TX_STATUS 0x4c 33 #define TEGRA210_OPE_TX_INT_STATUS 33 #define TEGRA210_OPE_TX_INT_STATUS 0x50 34 #define TEGRA210_OPE_TX_INT_MASK 34 #define TEGRA210_OPE_TX_INT_MASK 0x54 35 #define TEGRA210_OPE_TX_INT_SET 35 #define TEGRA210_OPE_TX_INT_SET 0x58 36 #define TEGRA210_OPE_TX_INT_CLEAR 36 #define TEGRA210_OPE_TX_INT_CLEAR 0x5c 37 #define TEGRA210_OPE_TX_CIF_CTRL 37 #define TEGRA210_OPE_TX_CIF_CTRL 0x60 38 38 39 /* OPE Gloabal registers */ 39 /* OPE Gloabal registers */ 40 #define TEGRA210_OPE_ENABLE 40 #define TEGRA210_OPE_ENABLE 0x80 41 #define TEGRA210_OPE_SOFT_RESET 41 #define TEGRA210_OPE_SOFT_RESET 0x84 42 #define TEGRA210_OPE_CG 42 #define TEGRA210_OPE_CG 0x88 43 #define TEGRA210_OPE_STATUS 43 #define TEGRA210_OPE_STATUS 0x8c 44 #define TEGRA210_OPE_INT_STATUS 44 #define TEGRA210_OPE_INT_STATUS 0x90 45 #define TEGRA210_OPE_DIR 45 #define TEGRA210_OPE_DIR 0x94 46 46 47 /* Fields for TEGRA210_OPE_ENABLE */ 47 /* Fields for TEGRA210_OPE_ENABLE */ 48 #define TEGRA210_OPE_EN_SHIFT 48 #define TEGRA210_OPE_EN_SHIFT 0 49 #define TEGRA210_OPE_EN 49 #define TEGRA210_OPE_EN (1 << TEGRA210_OPE_EN_SHIFT) 50 50 51 /* Fields for TEGRA210_OPE_SOFT_RESET */ 51 /* Fields for TEGRA210_OPE_SOFT_RESET */ 52 #define TEGRA210_OPE_SOFT_RESET_SHIFT 52 #define TEGRA210_OPE_SOFT_RESET_SHIFT 0 53 #define TEGRA210_OPE_SOFT_RESET_EN 53 #define TEGRA210_OPE_SOFT_RESET_EN (1 << TEGRA210_OPE_SOFT_RESET_SHIFT) 54 54 55 #define TEGRA210_OPE_DIR_SHIFT 55 #define TEGRA210_OPE_DIR_SHIFT 0 56 56 57 struct tegra210_ope { 57 struct tegra210_ope { 58 struct regmap *regmap; 58 struct regmap *regmap; 59 struct regmap *peq_regmap; 59 struct regmap *peq_regmap; 60 struct regmap *mbdrc_regmap; 60 struct regmap *mbdrc_regmap; 61 u32 peq_biquad_gains[TEGRA210_PEQ_GAIN 61 u32 peq_biquad_gains[TEGRA210_PEQ_GAIN_PARAM_SIZE_PER_CH]; 62 u32 peq_biquad_shifts[TEGRA210_PEQ_SHI 62 u32 peq_biquad_shifts[TEGRA210_PEQ_SHIFT_PARAM_SIZE_PER_CH]; 63 unsigned int data_dir; 63 unsigned int data_dir; 64 }; 64 }; 65 65 66 /* Extension of soc_bytes structure defined in 66 /* Extension of soc_bytes structure defined in sound/soc.h */ 67 struct tegra_soc_bytes { 67 struct tegra_soc_bytes { 68 struct soc_bytes soc; 68 struct soc_bytes soc; 69 u32 shift; /* Used as offset for AHUB 69 u32 shift; /* Used as offset for AHUB RAM related programing */ 70 }; 70 }; 71 71 72 /* Utility structures for using mixer control 72 /* Utility structures for using mixer control of type snd_soc_bytes */ 73 #define TEGRA_SOC_BYTES_EXT(xname, xbase, xreg 73 #define TEGRA_SOC_BYTES_EXT(xname, xbase, xregs, xshift, xmask, \ 74 xhandler_get, xhan 74 xhandler_get, xhandler_put, xinfo) \ 75 { 75 { \ 76 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 76 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, \ 77 .name = xname, 77 .name = xname, \ 78 .info = xinfo, 78 .info = xinfo, \ 79 .get = xhandler_get, 79 .get = xhandler_get, \ 80 .put = xhandler_put, 80 .put = xhandler_put, \ 81 .private_value = ((unsigned long)&(str 81 .private_value = ((unsigned long)&(struct tegra_soc_bytes) \ 82 { 82 { \ 83 .soc.base = xbase, 83 .soc.base = xbase, \ 84 .soc.num_regs = xregs, 84 .soc.num_regs = xregs, \ 85 .soc.mask = xmask, 85 .soc.mask = xmask, \ 86 .shift = xshift 86 .shift = xshift \ 87 }) 87 }) \ 88 } 88 } 89 89 90 #endif 90 #endif 91 91
Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.