linux/sound/soc/codecs/tas2552.h

/* SPDX-License-Identifier: GPL-2.0-only */
/*
 * tas2552.h - ALSA SoC Texas Instruments TAS2552 Mono Audio Amplifier
 *
 * Copyright (C) 2014 Texas Instruments Incorporated -  https://www.ti.com
 *
 * Author: Dan Murphy <[email protected]>
 */

#ifndef __TAS2552_H__
#define __TAS2552_H__

/* Register Address Map */
#define TAS2552_DEVICE_STATUS
#define TAS2552_CFG_1
#define TAS2552_CFG_2
#define TAS2552_CFG_3
#define TAS2552_DOUT
#define TAS2552_SER_CTRL_1
#define TAS2552_SER_CTRL_2
#define TAS2552_OUTPUT_DATA
#define TAS2552_PLL_CTRL_1
#define TAS2552_PLL_CTRL_2
#define TAS2552_PLL_CTRL_3
#define TAS2552_BTIP
#define TAS2552_BTS_CTRL
#define TAS2552_RESERVED_0D
#define TAS2552_LIMIT_RATE_HYS
#define TAS2552_LIMIT_RELEASE
#define TAS2552_LIMIT_INT_COUNT
#define TAS2552_PDM_CFG
#define TAS2552_PGA_GAIN
#define TAS2552_EDGE_RATE_CTRL
#define TAS2552_BOOST_APT_CTRL
#define TAS2552_VER_NUM
#define TAS2552_VBAT_DATA
#define TAS2552_MAX_REG

/* CFG1 Register Masks */
#define TAS2552_DEV_RESET
#define TAS2552_SWS
#define TAS2552_MUTE
#define TAS2552_PLL_SRC_MCLK
#define TAS2552_PLL_SRC_BCLK
#define TAS2552_PLL_SRC_IVCLKIN
#define TAS2552_PLL_SRC_1_8_FIXED
#define TAS2552_PLL_SRC_MASK

/* CFG2 Register Masks */
#define TAS2552_CLASSD_EN
#define TAS2552_BOOST_EN
#define TAS2552_APT_EN
#define TAS2552_PLL_ENABLE
#define TAS2552_LIM_EN
#define TAS2552_IVSENSE_EN

/* CFG3 Register Masks */
#define TAS2552_WCLK_FREQ_8KHZ
#define TAS2552_WCLK_FREQ_11_12KHZ
#define TAS2552_WCLK_FREQ_16KHZ
#define TAS2552_WCLK_FREQ_22_24KHZ
#define TAS2552_WCLK_FREQ_32KHZ
#define TAS2552_WCLK_FREQ_44_48KHZ
#define TAS2552_WCLK_FREQ_88_96KHZ
#define TAS2552_WCLK_FREQ_176_192KHZ
#define TAS2552_WCLK_FREQ_MASK
#define TAS2552_DIN_SRC_SEL_MUTED
#define TAS2552_DIN_SRC_SEL_LEFT
#define TAS2552_DIN_SRC_SEL_RIGHT
#define TAS2552_DIN_SRC_SEL_AVG_L_R
#define TAS2552_PDM_IN_SEL
#define TAS2552_I2S_OUT_SEL
#define TAS2552_ANALOG_IN_SEL

/* DOUT Register Masks */
#define TAS2552_SDOUT_TRISTATE

/* Serial Interface Control Register Masks */
#define TAS2552_WORDLENGTH_16BIT
#define TAS2552_WORDLENGTH_20BIT
#define TAS2552_WORDLENGTH_24BIT
#define TAS2552_WORDLENGTH_32BIT
#define TAS2552_WORDLENGTH_MASK
#define TAS2552_DATAFORMAT_I2S
#define TAS2552_DATAFORMAT_DSP
#define TAS2552_DATAFORMAT_RIGHT_J
#define TAS2552_DATAFORMAT_LEFT_J
#define TAS2552_DATAFORMAT_MASK
#define TAS2552_CLKSPERFRAME_32
#define TAS2552_CLKSPERFRAME_64
#define TAS2552_CLKSPERFRAME_128
#define TAS2552_CLKSPERFRAME_256
#define TAS2552_CLKSPERFRAME_MASK
#define TAS2552_BCLKDIR
#define TAS2552_WCLKDIR

/* OUTPUT_DATA register */
#define TAS2552_DATA_OUT_I_DATA
#define TAS2552_DATA_OUT_V_DATA
#define TAS2552_DATA_OUT_VBAT_DATA
#define TAS2552_DATA_OUT_VBOOST_DATA
#define TAS2552_DATA_OUT_PGA_GAIN
#define TAS2552_DATA_OUT_IV_DATA
#define TAS2552_DATA_OUT_VBAT_VBOOST_GAIN
#define TAS2552_DATA_OUT_DISABLED
#define TAS2552_L_DATA_OUT(x)
#define TAS2552_R_DATA_OUT(x)
#define TAS2552_PDM_DATA_SEL_I
#define TAS2552_PDM_DATA_SEL_V
#define TAS2552_PDM_DATA_SEL_I_V
#define TAS2552_PDM_DATA_SEL_V_I
#define TAS2552_PDM_DATA_SEL_MASK

/* PDM CFG Register */
#define TAS2552_PDM_CLK_SEL_PLL
#define TAS2552_PDM_CLK_SEL_IVCLKIN
#define TAS2552_PDM_CLK_SEL_BCLK
#define TAS2552_PDM_CLK_SEL_MCLK
#define TAS2552_PDM_CLK_SEL_MASK
#define TAS2552_PDM_DATA_ES

/* Boost Auto-pass through register */
#define TAS2552_APT_DELAY_50
#define TAS2552_APT_DELAY_75
#define TAS2552_APT_DELAY_125
#define TAS2552_APT_DELAY_200
#define TAS2552_APT_THRESH_05_02
#define TAS2552_APT_THRESH_10_07
#define TAS2552_APT_THRESH_14_11
#define TAS2552_APT_THRESH_20_17

/* PLL Control Register */
#define TAS2552_PLL_J_MASK
#define TAS2552_PLL_D_UPPER(x)
#define TAS2552_PLL_D_LOWER(x)
#define TAS2552_PLL_BYPASS

#endif