@@ -130,12 +130,12 @@ static const struct sof_topology_token comp_ext_tokens[] = {
130
130
131
131
static const struct sof_topology_token gain_tokens [] = {
132
132
{SOF_TKN_GAIN_RAMP_TYPE , SND_SOC_TPLG_TUPLE_TYPE_WORD ,
133
- get_token_u32 , offsetof(struct sof_ipc4_gain_data , curve_type )},
133
+ get_token_u32 , offsetof(struct sof_ipc4_gain_params , curve_type )},
134
134
{SOF_TKN_GAIN_RAMP_DURATION ,
135
135
SND_SOC_TPLG_TUPLE_TYPE_WORD , get_token_u32 ,
136
- offsetof(struct sof_ipc4_gain_data , curve_duration_l )},
136
+ offsetof(struct sof_ipc4_gain_params , curve_duration_l )},
137
137
{SOF_TKN_GAIN_VAL , SND_SOC_TPLG_TUPLE_TYPE_WORD ,
138
- get_token_u32 , offsetof(struct sof_ipc4_gain_data , init_val )},
138
+ get_token_u32 , offsetof(struct sof_ipc4_gain_params , init_val )},
139
139
};
140
140
141
141
/* SRC */
@@ -720,24 +720,24 @@ static int sof_ipc4_widget_setup_comp_pga(struct snd_sof_widget *swidget)
720
720
721
721
swidget -> private = gain ;
722
722
723
- gain -> data .channels = SOF_IPC4_GAIN_ALL_CHANNELS_MASK ;
724
- gain -> data .init_val = SOF_IPC4_VOL_ZERO_DB ;
723
+ gain -> data .params . channels = SOF_IPC4_GAIN_ALL_CHANNELS_MASK ;
724
+ gain -> data .params . init_val = SOF_IPC4_VOL_ZERO_DB ;
725
725
726
- ret = sof_ipc4_get_audio_fmt (scomp , swidget , & gain -> available_fmt , & gain -> base_config );
726
+ ret = sof_ipc4_get_audio_fmt (scomp , swidget , & gain -> available_fmt , & gain -> data . base_config );
727
727
if (ret )
728
728
goto err ;
729
729
730
- ret = sof_update_ipc_object (scomp , & gain -> data , SOF_GAIN_TOKENS , swidget -> tuples ,
731
- swidget -> num_tuples , sizeof (gain -> data ), 1 );
730
+ ret = sof_update_ipc_object (scomp , & gain -> data . params , SOF_GAIN_TOKENS ,
731
+ swidget -> tuples , swidget -> num_tuples , sizeof (gain -> data ), 1 );
732
732
if (ret ) {
733
733
dev_err (scomp -> dev , "Parsing gain tokens failed\n" );
734
734
goto err ;
735
735
}
736
736
737
737
dev_dbg (scomp -> dev ,
738
738
"pga widget %s: ramp type: %d, ramp duration %d, initial gain value: %#x\n" ,
739
- swidget -> widget -> name , gain -> data .curve_type , gain -> data . curve_duration_l ,
740
- gain -> data .init_val );
739
+ swidget -> widget -> name , gain -> data .params . curve_type ,
740
+ gain -> data .params . curve_duration_l , gain -> data . params . init_val );
741
741
742
742
ret = sof_ipc4_widget_setup_msg (swidget , & gain -> msg );
743
743
if (ret )
@@ -1826,7 +1826,7 @@ static int sof_ipc4_prepare_gain_module(struct snd_sof_widget *swidget,
1826
1826
u32 out_ref_rate , out_ref_channels , out_ref_valid_bits ;
1827
1827
int ret ;
1828
1828
1829
- ret = sof_ipc4_init_input_audio_fmt (sdev , swidget , & gain -> base_config ,
1829
+ ret = sof_ipc4_init_input_audio_fmt (sdev , swidget , & gain -> data . base_config ,
1830
1830
pipeline_params , available_fmt );
1831
1831
if (ret < 0 )
1832
1832
return ret ;
@@ -1836,7 +1836,7 @@ static int sof_ipc4_prepare_gain_module(struct snd_sof_widget *swidget,
1836
1836
out_ref_channels = SOF_IPC4_AUDIO_FORMAT_CFG_CHANNELS_COUNT (in_fmt -> fmt_cfg );
1837
1837
out_ref_valid_bits = SOF_IPC4_AUDIO_FORMAT_CFG_V_BIT_DEPTH (in_fmt -> fmt_cfg );
1838
1838
1839
- ret = sof_ipc4_init_output_audio_fmt (sdev , & gain -> base_config , available_fmt ,
1839
+ ret = sof_ipc4_init_output_audio_fmt (sdev , & gain -> data . base_config , available_fmt ,
1840
1840
out_ref_rate , out_ref_channels , out_ref_valid_bits );
1841
1841
if (ret < 0 ) {
1842
1842
dev_err (sdev -> dev , "Failed to initialize output format for %s" ,
@@ -1845,7 +1845,7 @@ static int sof_ipc4_prepare_gain_module(struct snd_sof_widget *swidget,
1845
1845
}
1846
1846
1847
1847
/* update pipeline memory usage */
1848
- sof_ipc4_update_resource_usage (sdev , swidget , & gain -> base_config );
1848
+ sof_ipc4_update_resource_usage (sdev , swidget , & gain -> data . base_config );
1849
1849
1850
1850
return 0 ;
1851
1851
}
@@ -2324,9 +2324,8 @@ static int sof_ipc4_widget_setup(struct snd_sof_dev *sdev, struct snd_sof_widget
2324
2324
{
2325
2325
struct sof_ipc4_gain * gain = swidget -> private ;
2326
2326
2327
- ipc_size = sizeof (struct sof_ipc4_base_module_cfg ) +
2328
- sizeof (struct sof_ipc4_gain_data );
2329
- ipc_data = gain ;
2327
+ ipc_size = sizeof (gain -> data );
2328
+ ipc_data = & gain -> data ;
2330
2329
2331
2330
msg = & gain -> msg ;
2332
2331
break ;
0 commit comments