@@ -416,19 +416,19 @@ static const struct sof_topology_token led_tokens[] = {
416416};
417417
418418static const struct sof_topology_token comp_pin_tokens [] = {
419- {SOF_TKN_COMP_NUM_SINK_PINS , SND_SOC_TPLG_TUPLE_TYPE_WORD , get_token_u32 ,
420- offsetof(struct snd_sof_widget , num_sink_pins )},
421- {SOF_TKN_COMP_NUM_SOURCE_PINS , SND_SOC_TPLG_TUPLE_TYPE_WORD , get_token_u32 ,
422- offsetof(struct snd_sof_widget , num_source_pins )},
419+ {SOF_TKN_COMP_NUM_INPUT_PINS , SND_SOC_TPLG_TUPLE_TYPE_WORD , get_token_u32 ,
420+ offsetof(struct snd_sof_widget , num_input_pins )},
421+ {SOF_TKN_COMP_NUM_OUTPUT_PINS , SND_SOC_TPLG_TUPLE_TYPE_WORD , get_token_u32 ,
422+ offsetof(struct snd_sof_widget , num_output_pins )},
423423};
424424
425- static const struct sof_topology_token comp_sink_pin_binding_tokens [] = {
426- {SOF_TKN_COMP_SINK_PIN_BINDING_WNAME , SND_SOC_TPLG_TUPLE_TYPE_STRING ,
425+ static const struct sof_topology_token comp_input_pin_binding_tokens [] = {
426+ {SOF_TKN_COMP_INPUT_PIN_BINDING_WNAME , SND_SOC_TPLG_TUPLE_TYPE_STRING ,
427427 get_token_string , 0 },
428428};
429429
430- static const struct sof_topology_token comp_src_pin_binding_tokens [] = {
431- {SOF_TKN_COMP_SRC_PIN_BINDING_WNAME , SND_SOC_TPLG_TUPLE_TYPE_STRING ,
430+ static const struct sof_topology_token comp_output_pin_binding_tokens [] = {
431+ {SOF_TKN_COMP_OUTPUT_PIN_BINDING_WNAME , SND_SOC_TPLG_TUPLE_TYPE_STRING ,
432432 get_token_string , 0 },
433433};
434434
@@ -1318,12 +1318,12 @@ static void sof_free_pin_binding(struct snd_sof_widget *swidget,
13181318 u32 num_pins ;
13191319 int i ;
13201320
1321- if (pin_type == SOF_PIN_TYPE_SINK ) {
1322- pin_binding = swidget -> sink_pin_binding ;
1323- num_pins = swidget -> num_sink_pins ;
1321+ if (pin_type == SOF_PIN_TYPE_INPUT ) {
1322+ pin_binding = swidget -> input_pin_binding ;
1323+ num_pins = swidget -> num_input_pins ;
13241324 } else {
1325- pin_binding = swidget -> src_pin_binding ;
1326- num_pins = swidget -> num_source_pins ;
1325+ pin_binding = swidget -> output_pin_binding ;
1326+ num_pins = swidget -> num_output_pins ;
13271327 }
13281328
13291329 if (pin_binding ) {
@@ -1345,14 +1345,14 @@ static int sof_parse_pin_binding(struct snd_sof_widget *swidget,
13451345 int ret ;
13461346 int i ;
13471347
1348- if (pin_type == SOF_PIN_TYPE_SINK ) {
1349- num_pins = swidget -> num_sink_pins ;
1350- pin_binding_token = comp_sink_pin_binding_tokens ;
1351- token_count = ARRAY_SIZE (comp_sink_pin_binding_tokens );
1348+ if (pin_type == SOF_PIN_TYPE_INPUT ) {
1349+ num_pins = swidget -> num_input_pins ;
1350+ pin_binding_token = comp_input_pin_binding_tokens ;
1351+ token_count = ARRAY_SIZE (comp_input_pin_binding_tokens );
13521352 } else {
1353- num_pins = swidget -> num_source_pins ;
1354- pin_binding_token = comp_src_pin_binding_tokens ;
1355- token_count = ARRAY_SIZE (comp_src_pin_binding_tokens );
1353+ num_pins = swidget -> num_output_pins ;
1354+ pin_binding_token = comp_output_pin_binding_tokens ;
1355+ token_count = ARRAY_SIZE (comp_output_pin_binding_tokens );
13561356 }
13571357
13581358 memset (pin_binding , 0 , SOF_WIDGET_MAX_NUM_PINS * sizeof (char * ));
@@ -1369,10 +1369,10 @@ static int sof_parse_pin_binding(struct snd_sof_widget *swidget,
13691369 ret = - ENOMEM ;
13701370 goto err ;
13711371 }
1372- if (pin_type == SOF_PIN_TYPE_SINK )
1373- swidget -> sink_pin_binding = pb ;
1372+ if (pin_type == SOF_PIN_TYPE_INPUT )
1373+ swidget -> input_pin_binding = pb ;
13741374 else
1375- swidget -> src_pin_binding = pb ;
1375+ swidget -> output_pin_binding = pb ;
13761376 }
13771377
13781378 return 0 ;
@@ -1411,8 +1411,8 @@ static int sof_widget_ready(struct snd_soc_component *scomp, int index,
14111411 swidget -> private = NULL ;
14121412 mutex_init (& swidget -> setup_mutex );
14131413
1414- ida_init (& swidget -> src_queue_ida );
1415- ida_init (& swidget -> sink_queue_ida );
1414+ ida_init (& swidget -> output_queue_ida );
1415+ ida_init (& swidget -> input_queue_ida );
14161416
14171417 ret = sof_parse_tokens (scomp , swidget , comp_pin_tokens ,
14181418 ARRAY_SIZE (comp_pin_tokens ), priv -> array ,
@@ -1423,29 +1423,29 @@ static int sof_widget_ready(struct snd_soc_component *scomp, int index,
14231423 goto widget_free ;
14241424 }
14251425
1426- if (swidget -> num_sink_pins > SOF_WIDGET_MAX_NUM_PINS ||
1427- swidget -> num_source_pins > SOF_WIDGET_MAX_NUM_PINS ) {
1428- dev_err (scomp -> dev , "invalid pins for %s: [sink : %d, src : %d]\n" ,
1429- swidget -> widget -> name , swidget -> num_sink_pins , swidget -> num_source_pins );
1426+ if (swidget -> num_input_pins > SOF_WIDGET_MAX_NUM_PINS ||
1427+ swidget -> num_output_pins > SOF_WIDGET_MAX_NUM_PINS ) {
1428+ dev_err (scomp -> dev , "invalid pins for %s: [input : %d, output : %d]\n" ,
1429+ swidget -> widget -> name , swidget -> num_input_pins , swidget -> num_output_pins );
14301430 ret = - EINVAL ;
14311431 goto widget_free ;
14321432 }
14331433
1434- if (swidget -> num_sink_pins > 1 ) {
1435- ret = sof_parse_pin_binding (swidget , priv , SOF_PIN_TYPE_SINK );
1434+ if (swidget -> num_input_pins > 1 ) {
1435+ ret = sof_parse_pin_binding (swidget , priv , SOF_PIN_TYPE_INPUT );
14361436 /* on parsing error, pin binding is not allocated, nothing to free. */
14371437 if (ret < 0 ) {
1438- dev_err (scomp -> dev , "failed to parse sink pin binding for %s\n" ,
1438+ dev_err (scomp -> dev , "failed to parse input pin binding for %s\n" ,
14391439 w -> name );
14401440 goto widget_free ;
14411441 }
14421442 }
14431443
1444- if (swidget -> num_source_pins > 1 ) {
1445- ret = sof_parse_pin_binding (swidget , priv , SOF_PIN_TYPE_SOURCE );
1444+ if (swidget -> num_output_pins > 1 ) {
1445+ ret = sof_parse_pin_binding (swidget , priv , SOF_PIN_TYPE_OUTPUT );
14461446 /* on parsing error, pin binding is not allocated, nothing to free. */
14471447 if (ret < 0 ) {
1448- dev_err (scomp -> dev , "failed to parse source pin binding for %s\n" ,
1448+ dev_err (scomp -> dev , "failed to parse output pin binding for %s\n" ,
14491449 w -> name );
14501450 goto widget_free ;
14511451 }
@@ -1454,7 +1454,7 @@ static int sof_widget_ready(struct snd_soc_component *scomp, int index,
14541454 dev_dbg (scomp -> dev ,
14551455 "tplg: widget %d (%s) is ready [type: %d, pipe: %d, pins: %d / %d, stream: %s]\n" ,
14561456 swidget -> comp_id , w -> name , swidget -> id , index ,
1457- swidget -> num_sink_pins , swidget -> num_source_pins ,
1457+ swidget -> num_input_pins , swidget -> num_output_pins ,
14581458 strnlen (w -> sname , SNDRV_CTL_ELEM_ID_NAME_MAXLEN ) > 0 ? w -> sname : "none" );
14591459
14601460 widget_ops = tplg_ops ? tplg_ops -> widget : NULL ;
@@ -1675,11 +1675,11 @@ static int sof_widget_unload(struct snd_soc_component *scomp,
16751675 if (widget_ops && widget_ops [swidget -> id ].ipc_free )
16761676 widget_ops [swidget -> id ].ipc_free (swidget );
16771677
1678- ida_destroy (& swidget -> src_queue_ida );
1679- ida_destroy (& swidget -> sink_queue_ida );
1678+ ida_destroy (& swidget -> output_queue_ida );
1679+ ida_destroy (& swidget -> input_queue_ida );
16801680
1681- sof_free_pin_binding (swidget , SOF_PIN_TYPE_SINK );
1682- sof_free_pin_binding (swidget , SOF_PIN_TYPE_SOURCE );
1681+ sof_free_pin_binding (swidget , SOF_PIN_TYPE_INPUT );
1682+ sof_free_pin_binding (swidget , SOF_PIN_TYPE_OUTPUT );
16831683
16841684 kfree (swidget -> tuples );
16851685
0 commit comments