Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0+ */
0002 /*
0003  * tfa9879.h  --  driver for NXP Semiconductors TFA9879
0004  *
0005  * Copyright (C) 2014 Axentia Technologies AB
0006  * Author: Peter Rosin <peda@axentia.se>
0007  */
0008 
0009 #ifndef _TFA9879_H
0010 #define _TFA9879_H
0011 
0012 #define TFA9879_DEVICE_CONTROL      0x00
0013 #define TFA9879_SERIAL_INTERFACE_1  0x01
0014 #define TFA9879_PCM_IOM2_FORMAT_1   0x02
0015 #define TFA9879_SERIAL_INTERFACE_2  0x03
0016 #define TFA9879_PCM_IOM2_FORMAT_2   0x04
0017 #define TFA9879_EQUALIZER_A1        0x05
0018 #define TFA9879_EQUALIZER_A2        0x06
0019 #define TFA9879_EQUALIZER_B1        0x07
0020 #define TFA9879_EQUALIZER_B2        0x08
0021 #define TFA9879_EQUALIZER_C1        0x09
0022 #define TFA9879_EQUALIZER_C2        0x0a
0023 #define TFA9879_EQUALIZER_D1        0x0b
0024 #define TFA9879_EQUALIZER_D2        0x0c
0025 #define TFA9879_EQUALIZER_E1        0x0d
0026 #define TFA9879_EQUALIZER_E2        0x0e
0027 #define TFA9879_BYPASS_CONTROL      0x0f
0028 #define TFA9879_DYNAMIC_RANGE_COMPR 0x10
0029 #define TFA9879_BASS_TREBLE     0x11
0030 #define TFA9879_HIGH_PASS_FILTER    0x12
0031 #define TFA9879_VOLUME_CONTROL      0x13
0032 #define TFA9879_MISC_CONTROL        0x14
0033 #define TFA9879_MISC_STATUS     0x15
0034 
0035 /* TFA9879_DEVICE_CONTROL */
0036 #define TFA9879_INPUT_SEL_MASK      0x0010
0037 #define TFA9879_INPUT_SEL_SHIFT     4
0038 #define TFA9879_OPMODE_MASK     0x0008
0039 #define TFA9879_OPMODE_SHIFT        3
0040 #define TFA9879_RESET_MASK      0x0002
0041 #define TFA9879_RESET_SHIFT     1
0042 #define TFA9879_POWERUP_MASK        0x0001
0043 #define TFA9879_POWERUP_SHIFT       0
0044 
0045 /* TFA9879_SERIAL_INTERFACE */
0046 #define TFA9879_MONO_SEL_MASK       0x0c00
0047 #define TFA9879_MONO_SEL_SHIFT      10
0048 #define TFA9879_MONO_SEL_LEFT       0
0049 #define TFA9879_MONO_SEL_RIGHT      1
0050 #define TFA9879_MONO_SEL_BOTH       2
0051 #define TFA9879_I2S_FS_MASK     0x03c0
0052 #define TFA9879_I2S_FS_SHIFT        6
0053 #define TFA9879_I2S_FS_8000     0
0054 #define TFA9879_I2S_FS_11025        1
0055 #define TFA9879_I2S_FS_12000        2
0056 #define TFA9879_I2S_FS_16000        3
0057 #define TFA9879_I2S_FS_22050        4
0058 #define TFA9879_I2S_FS_24000        5
0059 #define TFA9879_I2S_FS_32000        6
0060 #define TFA9879_I2S_FS_44100        7
0061 #define TFA9879_I2S_FS_48000        8
0062 #define TFA9879_I2S_FS_64000        9
0063 #define TFA9879_I2S_FS_88200        10
0064 #define TFA9879_I2S_FS_96000        11
0065 #define TFA9879_I2S_SET_MASK        0x0038
0066 #define TFA9879_I2S_SET_SHIFT       3
0067 #define TFA9879_I2S_SET_MSB_J_24    2
0068 #define TFA9879_I2S_SET_I2S_24      3
0069 #define TFA9879_I2S_SET_LSB_J_16    4
0070 #define TFA9879_I2S_SET_LSB_J_18    5
0071 #define TFA9879_I2S_SET_LSB_J_20    6
0072 #define TFA9879_I2S_SET_LSB_J_24    7
0073 #define TFA9879_SCK_POL_MASK        0x0004
0074 #define TFA9879_SCK_POL_SHIFT       2
0075 #define TFA9879_SCK_POL_NORMAL      0
0076 #define TFA9879_SCK_POL_INVERSE     1
0077 #define TFA9879_I_MODE_MASK     0x0003
0078 #define TFA9879_I_MODE_SHIFT        0
0079 #define TFA9879_I_MODE_I2S      0
0080 #define TFA9879_I_MODE_PCM_IOM2_SHORT   1
0081 #define TFA9879_I_MODE_PCM_IOM2_LONG    2
0082 
0083 /* TFA9879_PCM_IOM2_FORMAT */
0084 #define TFA9879_PCM_FS_MASK     0x0800
0085 #define TFA9879_PCM_FS_SHIFT        11
0086 #define TFA9879_A_LAW_MASK      0x0400
0087 #define TFA9879_A_LAW_SHIFT     10
0088 #define TFA9879_PCM_COMP_MASK       0x0200
0089 #define TFA9879_PCM_COMP_SHIFT      9
0090 #define TFA9879_PCM_DL_MASK     0x0100
0091 #define TFA9879_PCM_DL_SHIFT        8
0092 #define TFA9879_D1_SLOT_MASK        0x00f0
0093 #define TFA9879_D1_SLOT_SHIFT       4
0094 #define TFA9879_D2_SLOT_MASK        0x000f
0095 #define TFA9879_D2_SLOT_SHIFT       0
0096 
0097 /* TFA9879_EQUALIZER_X1 */
0098 #define TFA9879_T1_MASK         0x8000
0099 #define TFA9879_T1_SHIFT        15
0100 #define TFA9879_K1M_MASK        0x7ff0
0101 #define TFA9879_K1M_SHIFT       4
0102 #define TFA9879_K1E_MASK        0x000f
0103 #define TFA9879_K1E_SHIFT       0
0104 
0105 /* TFA9879_EQUALIZER_X2 */
0106 #define TFA9879_T2_MASK         0x8000
0107 #define TFA9879_T2_SHIFT        15
0108 #define TFA9879_K2M_MASK        0x7800
0109 #define TFA9879_K2M_SHIFT       11
0110 #define TFA9879_K2E_MASK        0x0700
0111 #define TFA9879_K2E_SHIFT       8
0112 #define TFA9879_K0_MASK         0x00fe
0113 #define TFA9879_K0_SHIFT        1
0114 #define TFA9879_S_MASK          0x0001
0115 #define TFA9879_S_SHIFT         0
0116 
0117 /* TFA9879_BYPASS_CONTROL */
0118 #define TFA9879_L_OCP_MASK      0x00c0
0119 #define TFA9879_L_OCP_SHIFT     6
0120 #define TFA9879_L_OTP_MASK      0x0030
0121 #define TFA9879_L_OTP_SHIFT     4
0122 #define TFA9879_CLIPCTRL_MASK       0x0008
0123 #define TFA9879_CLIPCTRL_SHIFT      3
0124 #define TFA9879_HPF_BP_MASK     0x0004
0125 #define TFA9879_HPF_BP_SHIFT        2
0126 #define TFA9879_DRC_BP_MASK     0x0002
0127 #define TFA9879_DRC_BP_SHIFT        1
0128 #define TFA9879_EQ_BP_MASK      0x0001
0129 #define TFA9879_EQ_BP_SHIFT     0
0130 
0131 /* TFA9879_DYNAMIC_RANGE_COMPR */
0132 #define TFA9879_AT_LVL_MASK     0xf000
0133 #define TFA9879_AT_LVL_SHIFT        12
0134 #define TFA9879_AT_RATE_MASK        0x0f00
0135 #define TFA9879_AT_RATE_SHIFT       8
0136 #define TFA9879_RL_LVL_MASK     0x00f0
0137 #define TFA9879_RL_LVL_SHIFT        4
0138 #define TFA9879_RL_RATE_MASK        0x000f
0139 #define TFA9879_RL_RATE_SHIFT       0
0140 
0141 /* TFA9879_BASS_TREBLE */
0142 #define TFA9879_G_TRBLE_MASK        0x3e00
0143 #define TFA9879_G_TRBLE_SHIFT       9
0144 #define TFA9879_F_TRBLE_MASK        0x0180
0145 #define TFA9879_F_TRBLE_SHIFT       7
0146 #define TFA9879_G_BASS_MASK     0x007c
0147 #define TFA9879_G_BASS_SHIFT        2
0148 #define TFA9879_F_BASS_MASK     0x0003
0149 #define TFA9879_F_BASS_SHIFT        0
0150 
0151 /* TFA9879_HIGH_PASS_FILTER */
0152 #define TFA9879_HP_CTRL_MASK        0x00ff
0153 #define TFA9879_HP_CTRL_SHIFT       0
0154 
0155 /* TFA9879_VOLUME_CONTROL */
0156 #define TFA9879_ZR_CRSS_MASK        0x1000
0157 #define TFA9879_ZR_CRSS_SHIFT       12
0158 #define TFA9879_VOL_MASK        0x00ff
0159 #define TFA9879_VOL_SHIFT       0
0160 
0161 /* TFA9879_MISC_CONTROL */
0162 #define TFA9879_DE_PHAS_MASK        0x0c00
0163 #define TFA9879_DE_PHAS_SHIFT       10
0164 #define TFA9879_H_MUTE_MASK     0x0200
0165 #define TFA9879_H_MUTE_SHIFT        9
0166 #define TFA9879_S_MUTE_MASK     0x0100
0167 #define TFA9879_S_MUTE_SHIFT        8
0168 #define TFA9879_P_LIM_MASK      0x00ff
0169 #define TFA9879_P_LIM_SHIFT     0
0170 
0171 /* TFA9879_MISC_STATUS */
0172 #define TFA9879_PS_MASK         0x4000
0173 #define TFA9879_PS_SHIFT        14
0174 #define TFA9879_PORA_MASK       0x2000
0175 #define TFA9879_PORA_SHIFT      13
0176 #define TFA9879_AMP_MASK        0x0600
0177 #define TFA9879_AMP_SHIFT       9
0178 #define TFA9879_IBP_2_MASK      0x0100
0179 #define TFA9879_IBP_2_SHIFT     8
0180 #define TFA9879_OFP_2_MASK      0x0080
0181 #define TFA9879_OFP_2_SHIFT     7
0182 #define TFA9879_UFP_2_MASK      0x0040
0183 #define TFA9879_UFP_2_SHIFT     6
0184 #define TFA9879_IBP_1_MASK      0x0020
0185 #define TFA9879_IBP_1_SHIFT     5
0186 #define TFA9879_OFP_1_MASK      0x0010
0187 #define TFA9879_OFP_1_SHIFT     4
0188 #define TFA9879_UFP_1_MASK      0x0008
0189 #define TFA9879_UFP_1_SHIFT     3
0190 #define TFA9879_OCPOKA_MASK     0x0004
0191 #define TFA9879_OCPOKA_SHIFT        2
0192 #define TFA9879_OCPOKB_MASK     0x0002
0193 #define TFA9879_OCPOKB_SHIFT        1
0194 #define TFA9879_OTPOK_MASK      0x0001
0195 #define TFA9879_OTPOK_SHIFT     0
0196 
0197 #endif