@@ -62,6 +62,58 @@ struct fsl_xcvr {
6262 u32 spdif_constr_rates_list [SPDIF_NUM_RATES ];
6363};
6464
65+ static const char * const inc_mode [] = {
66+ "On enabled and bitcount increment" , "On enabled"
67+ };
68+
69+ static SOC_ENUM_SINGLE_DECL (transmit_tstmp_enum ,
70+ FSL_XCVR_TX_DPTH_CNTR_CTRL ,
71+ FSL_XCVR_TX_DPTH_CNTR_CTRL_TSINC_SHIFT , inc_mode ) ;
72+ static SOC_ENUM_SINGLE_DECL (receive_tstmp_enum ,
73+ FSL_XCVR_RX_DPTH_CNTR_CTRL ,
74+ FSL_XCVR_RX_DPTH_CNTR_CTRL_TSINC_SHIFT , inc_mode ) ;
75+
76+ static const struct snd_kcontrol_new fsl_xcvr_timestamp_ctrls [] = {
77+ FSL_ASOC_SINGLE_EXT ("Transmit Timestamp Control Switch" , FSL_XCVR_TX_DPTH_CNTR_CTRL ,
78+ FSL_XCVR_TX_DPTH_CNTR_CTRL_TSEN_SHIFT , 1 , 0 ,
79+ fsl_asoc_get_volsw , fsl_asoc_put_volsw ),
80+ FSL_ASOC_ENUM_EXT ("Transmit Timestamp Increment" , transmit_tstmp_enum ,
81+ fsl_asoc_get_enum_double , fsl_asoc_put_enum_double ),
82+ FSL_ASOC_SINGLE_EXT ("Transmit Timestamp Reset Switch" , FSL_XCVR_TX_DPTH_CNTR_CTRL ,
83+ FSL_XCVR_TX_DPTH_CNTR_CTRL_RTSC_SHIFT , 1 , 0 ,
84+ fsl_asoc_get_volsw , fsl_asoc_put_volsw ),
85+ FSL_ASOC_SINGLE_EXT ("Transmit Bit Counter Reset Switch" , FSL_XCVR_TX_DPTH_CNTR_CTRL ,
86+ FSL_XCVR_TX_DPTH_CNTR_CTRL_RBC_SHIFT , 1 , 0 ,
87+ fsl_asoc_get_volsw , fsl_asoc_put_volsw ),
88+ FSL_ASOC_SINGLE_XR_SX_EXT_RO ("Transmit Timestamp Counter" , FSL_XCVR_TX_DPTH_TSCR ,
89+ 1 , 32 , 0 , 0xffffffff , 0 , fsl_asoc_get_xr_sx ),
90+ FSL_ASOC_SINGLE_XR_SX_EXT_RO ("Transmit Bit Counter" , FSL_XCVR_TX_DPTH_BCR ,
91+ 1 , 32 , 0 , 0xffffffff , 0 , fsl_asoc_get_xr_sx ),
92+ FSL_ASOC_SINGLE_XR_SX_EXT_RO ("Transmit Bit Count Timestamp" , FSL_XCVR_TX_DPTH_BCTR ,
93+ 1 , 32 , 0 , 0xffffffff , 0 , fsl_asoc_get_xr_sx ),
94+ FSL_ASOC_SINGLE_XR_SX_EXT_RO ("Transmit Latched Timestamp Counter" , FSL_XCVR_TX_DPTH_BCRR ,
95+ 1 , 32 , 0 , 0xffffffff , 0 , fsl_asoc_get_xr_sx ),
96+ FSL_ASOC_SINGLE_EXT ("Receive Timestamp Control Switch" , FSL_XCVR_RX_DPTH_CNTR_CTRL ,
97+ FSL_XCVR_RX_DPTH_CNTR_CTRL_TSEN_SHIFT , 1 , 0 ,
98+ fsl_asoc_get_volsw , fsl_asoc_put_volsw ),
99+ FSL_ASOC_ENUM_EXT ("Receive Timestamp Increment" , receive_tstmp_enum ,
100+ fsl_asoc_get_enum_double , fsl_asoc_put_enum_double ),
101+ FSL_ASOC_SINGLE_EXT ("Receive Timestamp Reset Switch" , FSL_XCVR_RX_DPTH_CNTR_CTRL ,
102+ FSL_XCVR_RX_DPTH_CNTR_CTRL_RTSC_SHIFT , 1 , 0 ,
103+ fsl_asoc_get_volsw , fsl_asoc_put_volsw ),
104+ FSL_ASOC_SINGLE_EXT ("Receive Bit Counter Reset Switch" , FSL_XCVR_RX_DPTH_CNTR_CTRL ,
105+ FSL_XCVR_RX_DPTH_CNTR_CTRL_RBC_SHIFT , 1 , 0 ,
106+ fsl_asoc_get_volsw , fsl_asoc_put_volsw ),
107+ FSL_ASOC_SINGLE_XR_SX_EXT_RO ("Receive Timestamp Counter" , FSL_XCVR_RX_DPTH_TSCR ,
108+ 1 , 32 , 0 , 0xffffffff , 0 , fsl_asoc_get_xr_sx ),
109+ FSL_ASOC_SINGLE_XR_SX_EXT_RO ("Receive Bit Counter" , FSL_XCVR_RX_DPTH_BCR ,
110+ 1 , 32 , 0 , 0xffffffff , 0 , fsl_asoc_get_xr_sx ),
111+ FSL_ASOC_SINGLE_XR_SX_EXT_RO ("Receive Bit Count Timestamp" , FSL_XCVR_RX_DPTH_BCTR ,
112+ 1 , 32 , 0 , 0xffffffff , 0 , fsl_asoc_get_xr_sx ),
113+ FSL_ASOC_SINGLE_XR_SX_EXT_RO ("Receive Latched Timestamp Counter" , FSL_XCVR_RX_DPTH_BCRR ,
114+ 1 , 32 , 0 , 0xffffffff , 0 , fsl_asoc_get_xr_sx ),
115+ };
116+
65117static const struct fsl_xcvr_pll_conf {
66118 u8 mfi ; /* min=0x18, max=0x38 */
67119 u32 mfn ; /* signed int, 2's compl., min=0x3FFF0000, max=0x00010000 */
@@ -1070,8 +1122,20 @@ static struct snd_soc_dai_driver fsl_xcvr_dai = {
10701122 },
10711123};
10721124
1125+ static int fsl_xcvr_component_probe (struct snd_soc_component * component )
1126+ {
1127+ struct fsl_xcvr * xcvr = snd_soc_component_get_drvdata (component );
1128+
1129+ snd_soc_component_init_regmap (component , xcvr -> regmap );
1130+
1131+ return 0 ;
1132+ }
1133+
10731134static const struct snd_soc_component_driver fsl_xcvr_comp = {
10741135 .name = "fsl-xcvr-dai" ,
1136+ .probe = fsl_xcvr_component_probe ,
1137+ .controls = fsl_xcvr_timestamp_ctrls ,
1138+ .num_controls = ARRAY_SIZE (fsl_xcvr_timestamp_ctrls ),
10751139 .legacy_dai_naming = 1 ,
10761140};
10771141
0 commit comments