Currently we use input/output and sink/source pins interchangeably. Remove the references to sink/source pins and replace with input/output pins everywhere for consistency and clarity.
Unified · Split
| @@ -88,14 +88,14 @@ · 87 unmodified lines | |||
| 88 | #define SOF_TKN_COMP_CPC 406 | 88 | #define SOF_TKN_COMP_CPC 406 |
| 89 | #define SOF_TKN_COMP_IS_PAGES 409 | 89 | #define SOF_TKN_COMP_IS_PAGES 409 |
| 90 | #define SOF_TKN_COMP_NUM_AUDIO_FORMATS 410 | 90 | #define SOF_TKN_COMP_NUM_AUDIO_FORMATS 410 |
| 91 | #define SOF_TKN_COMP_NUM_SINK_PINS 411 | 91 | #define SOF_TKN_COMP_NUM_INPUT_PINS 411 |
| 92 | #define SOF_TKN_COMP_NUM_SOURCE_PINS 412 | 92 | #define SOF_TKN_COMP_NUM_OUTPUT_PINS 412 |
| 93 | /* | 93 | /* |
| 94 | * The token for sink/source pin binding, it specifies the widget | 94 | * The token for input/output pin binding, it specifies the widget |
| 95 | * name that the sink/source pin is connected from/to. | 95 | * name that the input/output pin is connected from/to. |
| 96 | */ | 96 | */ |
| 97 | #define SOF_TKN_COMP_SINK_PIN_BINDING_WNAME 413 | 97 | #define SOF_TKN_COMP_INPUT_PIN_BINDING_WNAME 413 |
| 98 | #define SOF_TKN_COMP_SRC_PIN_BINDING_WNAME 414 | 98 | #define SOF_TKN_COMP_OUTPUT_PIN_BINDING_WNAME 414 |
| 99 | 99 | ||
| 100 | 100 | ||
| 101 | /* SSP */ | 101 | /* SSP */ |
| @@ -1698,17 +1698,17 @@ static int sof_ipc4_get_queue_id(struct snd_sof_widget *src_widget, · 1697 unmodified lines | |||
| 1698 | u32 num_pins; | 1698 | u32 num_pins; |
| 1699 | int i; | 1699 | int i; |
| 1700 | 1700 | ||
| 1701 | if (pin_type == SOF_PIN_TYPE_SOURCE) { | 1701 | if (pin_type == SOF_PIN_TYPE_OUTPUT) { |
| 1702 | current_swidget = src_widget; | 1702 | current_swidget = src_widget; |
| 1703 | pin_binding = src_widget->src_pin_binding; | 1703 | pin_binding = src_widget->output_pin_binding; |
| 1704 | queue_ida = &src_widget->src_queue_ida; | 1704 | queue_ida = &src_widget->output_queue_ida; |
| 1705 | num_pins = src_widget->num_source_pins; | 1705 | num_pins = src_widget->num_output_pins; |
| 1706 | buddy_name = sink_widget->widget->name; | 1706 | buddy_name = sink_widget->widget->name; |
| 1707 | } else { | 1707 | } else { |
| 1708 | current_swidget = sink_widget; | 1708 | current_swidget = sink_widget; |
| 1709 | pin_binding = sink_widget->sink_pin_binding; | 1709 | pin_binding = sink_widget->input_pin_binding; |
| 1710 | queue_ida = &sink_widget->sink_queue_ida; | 1710 | queue_ida = &sink_widget->input_queue_ida; |
| 1711 | num_pins = sink_widget->num_sink_pins; | 1711 | num_pins = sink_widget->num_input_pins; |
| 1712 | buddy_name = src_widget->widget->name; | 1712 | buddy_name = src_widget->widget->name; |
| 1713 | } | 1713 | } |
| 1714 | 1714 | ||
| @@ -1716,12 +1716,12 @@ static int sof_ipc4_get_queue_id(struct snd_sof_widget *src_widget, · 1 unmodified line | |||
| 1716 | 1716 | ||
| 1717 | if (num_pins < 1) { | 1717 | if (num_pins < 1) { |
| 1718 | dev_err(scomp->dev, "invalid %s num_pins: %d for queue allocation for %s\n", | 1718 | dev_err(scomp->dev, "invalid %s num_pins: %d for queue allocation for %s\n", |
| 1719 | (pin_type == SOF_PIN_TYPE_SOURCE ? "source" : "sink"), | 1719 | (pin_type == SOF_PIN_TYPE_OUTPUT ? "output" : "input"), |
| 1720 | num_pins, current_swidget->widget->name); | 1720 | num_pins, current_swidget->widget->name); |
| 1721 | return -EINVAL; | 1721 | return -EINVAL; |
| 1722 | } | 1722 | } |
| 1723 | 1723 | ||
| 1724 | /* If there is only one sink/source pin, queue id must be 0 */ | 1724 | /* If there is only one input/output pin, queue id must be 0 */ |
| 1725 | if (num_pins == 1) | 1725 | if (num_pins == 1) |
| 1726 | return 0; | 1726 | return 0; |
| 1727 | 1727 | ||
| @@ -1736,7 +1736,7 @@ static int sof_ipc4_get_queue_id(struct snd_sof_widget *src_widget, · 8 unmodified lines | |||
| 1736 | * mixed use pin binding array and ida for queue ID allocation. | 1736 | * mixed use pin binding array and ida for queue ID allocation. |
| 1737 | */ | 1737 | */ |
| 1738 | dev_err(scomp->dev, "no %s queue id found from pin binding array for %s\n", | 1738 | dev_err(scomp->dev, "no %s queue id found from pin binding array for %s\n", |
| 1739 | (pin_type == SOF_PIN_TYPE_SOURCE ? "source" : "sink"), | 1739 | (pin_type == SOF_PIN_TYPE_OUTPUT ? "output" : "input"), |
| 1740 | current_swidget->widget->name); | 1740 | current_swidget->widget->name); |
| 1741 | return -EINVAL; | 1741 | return -EINVAL; |
| 1742 | } | 1742 | } |
| @@ -1752,14 +1752,14 @@ static void sof_ipc4_put_queue_id(struct snd_sof_widget *swidget, int queue_id, · 9 unmodified lines | |||
| 1752 | char **pin_binding; | 1752 | char **pin_binding; |
| 1753 | int num_pins; | 1753 | int num_pins; |
| 1754 | 1754 | ||
| 1755 | if (pin_type == SOF_PIN_TYPE_SOURCE) { | 1755 | if (pin_type == SOF_PIN_TYPE_OUTPUT) { |
| 1756 | pin_binding = swidget->src_pin_binding; | 1756 | pin_binding = swidget->output_pin_binding; |
| 1757 | queue_ida = &swidget->src_queue_ida; | 1757 | queue_ida = &swidget->output_queue_ida; |
| 1758 | num_pins = swidget->num_source_pins; | 1758 | num_pins = swidget->num_output_pins; |
| 1759 | } else { | 1759 | } else { |
| 1760 | pin_binding = swidget->sink_pin_binding; | 1760 | pin_binding = swidget->input_pin_binding; |
| 1761 | queue_ida = &swidget->sink_queue_ida; | 1761 | queue_ida = &swidget->input_queue_ida; |
| 1762 | num_pins = swidget->num_sink_pins; | 1762 | num_pins = swidget->num_input_pins; |
| 1763 | } | 1763 | } |
| 1764 | 1764 | ||
| 1765 | /* Nothing to free if queue ID is not allocated with ida. */ | 1765 | /* Nothing to free if queue ID is not allocated with ida. */ |
| @@ -1829,7 +1829,7 @@ static int sof_ipc4_route_setup(struct snd_sof_dev *sdev, struct snd_sof_route * · 63 unmodified lines | |||
| 1829 | int ret; | 1829 | int ret; |
| 1830 | 1830 | ||
| 1831 | sroute->src_queue_id = sof_ipc4_get_queue_id(src_widget, sink_widget, | 1831 | sroute->src_queue_id = sof_ipc4_get_queue_id(src_widget, sink_widget, |
| 1832 | SOF_PIN_TYPE_SOURCE); | 1832 | SOF_PIN_TYPE_OUTPUT); |
| 1833 | if (sroute->src_queue_id < 0) { | 1833 | if (sroute->src_queue_id < 0) { |
| 1834 | dev_err(sdev->dev, "failed to get queue ID for source widget: %s\n", | 1834 | dev_err(sdev->dev, "failed to get queue ID for source widget: %s\n", |
| 1835 | src_widget->widget->name); | 1835 | src_widget->widget->name); |
| @@ -1837,12 +1837,12 @@ static int sof_ipc4_route_setup(struct snd_sof_dev *sdev, struct snd_sof_route * · 1 unmodified line | |||
| 1837 | } | 1837 | } |
| 1838 | 1838 | ||
| 1839 | sroute->dst_queue_id = sof_ipc4_get_queue_id(src_widget, sink_widget, | 1839 | sroute->dst_queue_id = sof_ipc4_get_queue_id(src_widget, sink_widget, |
| 1840 | SOF_PIN_TYPE_SINK); | 1840 | SOF_PIN_TYPE_INPUT); |
| 1841 | if (sroute->dst_queue_id < 0) { | 1841 | if (sroute->dst_queue_id < 0) { |
| 1842 | dev_err(sdev->dev, "failed to get queue ID for sink widget: %s\n", | 1842 | dev_err(sdev->dev, "failed to get queue ID for sink widget: %s\n", |
| 1843 | sink_widget->widget->name); | 1843 | sink_widget->widget->name); |
| 1844 | sof_ipc4_put_queue_id(src_widget, sroute->src_queue_id, | 1844 | sof_ipc4_put_queue_id(src_widget, sroute->src_queue_id, |
| 1845 | SOF_PIN_TYPE_SOURCE); | 1845 | SOF_PIN_TYPE_OUTPUT); |
| 1846 | return sroute->dst_queue_id; | 1846 | return sroute->dst_queue_id; |
| 1847 | } | 1847 | } |
| 1848 | 1848 | ||
| @@ -1886,8 +1886,8 @@ static int sof_ipc4_route_setup(struct snd_sof_dev *sdev, struct snd_sof_route * · 37 unmodified lines | |||
| 1886 | return ret; | 1886 | return ret; |
| 1887 | 1887 | ||
| 1888 | out: | 1888 | out: |
| 1889 | sof_ipc4_put_queue_id(src_widget, sroute->src_queue_id, SOF_PIN_TYPE_SOURCE); | 1889 | sof_ipc4_put_queue_id(src_widget, sroute->src_queue_id, SOF_PIN_TYPE_OUTPUT); |
| 1890 | sof_ipc4_put_queue_id(sink_widget, sroute->dst_queue_id, SOF_PIN_TYPE_SINK); | 1890 | sof_ipc4_put_queue_id(sink_widget, sroute->dst_queue_id, SOF_PIN_TYPE_INPUT); |
| 1891 | return ret; | 1891 | return ret; |
| 1892 | } | 1892 | } |
| 1893 | 1893 | ||
| @@ -1932,8 +1932,8 @@ static int sof_ipc4_route_free(struct snd_sof_dev *sdev, struct snd_sof_route *s · 38 unmodified lines | |||
| 1932 | src_widget->widget->name, sroute->src_queue_id, | 1932 | src_widget->widget->name, sroute->src_queue_id, |
| 1933 | sink_widget->widget->name, sroute->dst_queue_id); | 1933 | sink_widget->widget->name, sroute->dst_queue_id); |
| 1934 | out: | 1934 | out: |
| 1935 | sof_ipc4_put_queue_id(sink_widget, sroute->dst_queue_id, SOF_PIN_TYPE_SINK); | 1935 | sof_ipc4_put_queue_id(sink_widget, sroute->dst_queue_id, SOF_PIN_TYPE_INPUT); |
| 1936 | sof_ipc4_put_queue_id(src_widget, sroute->src_queue_id, SOF_PIN_TYPE_SOURCE); | 1936 | sof_ipc4_put_queue_id(src_widget, sroute->src_queue_id, SOF_PIN_TYPE_OUTPUT); |
| 1937 | 1937 | ||
| 1938 | return ret; | 1938 | return ret; |
| 1939 | } | 1939 | } |
| @@ -30,9 +30,9 @@ · 29 unmodified lines | |||
| 30 | */ | 30 | */ |
| 31 | #define SOF_WIDGET_MAX_NUM_PINS 8 | 31 | #define SOF_WIDGET_MAX_NUM_PINS 8 |
| 32 | 32 | ||
| 33 | /* The type of a widget pin is either sink or source */ | 33 | /* Widget pin type */ |
| 34 | #define SOF_PIN_TYPE_SINK 0 | 34 | #define SOF_PIN_TYPE_INPUT 0 |
| 35 | #define SOF_PIN_TYPE_SOURCE 1 | 35 | #define SOF_PIN_TYPE_OUTPUT 1 |
| 36 | 36 | ||
| 37 | /* max number of FE PCMs before BEs */ | 37 | /* max number of FE PCMs before BEs */ |
| 38 | #define SOF_BE_PCM_BASE 16 | 38 | #define SOF_BE_PCM_BASE 16 |
| @@ -433,31 +433,31 @@ struct snd_sof_widget { · 394 unmodified lines | |||
| 433 | struct snd_sof_tuple *tuples; | 433 | struct snd_sof_tuple *tuples; |
| 434 | 434 | ||
| 435 | /* | 435 | /* |
| 436 | * The allowed range for num_sink/source_pins is [0, SOF_WIDGET_MAX_NUM_PINS]. | 436 | * The allowed range for num_input/output_pins is [0, SOF_WIDGET_MAX_NUM_PINS]. |
| 437 | * Widgets may have zero sink or source pins, for example the tone widget has | 437 | * Widgets may have zero input or output pins, for example the tone widget has |
| 438 | * zero sink pins. | 438 | * zero input pins. |
| 439 | */ | 439 | */ |
| 440 | u32 num_sink_pins; | 440 | u32 num_input_pins; |
| 441 | u32 num_source_pins; | 441 | u32 num_output_pins; |
| 442 | 442 | ||
| 443 | /* | 443 | /* |
| 444 | * The sink/source pin binding array, it takes the form of | 444 | * The input/output pin binding array, it takes the form of |
| 445 | * [widget_name_connected_to_pin0, widget_name_connected_to_pin1, ...], | 445 | * [widget_name_connected_to_pin0, widget_name_connected_to_pin1, ...], |
| 446 | * with the index as the queue ID. | 446 | * with the index as the queue ID. |
| 447 | * | 447 | * |
| 448 | * The array is used for special pin binding. Note that even if there | 448 | * The array is used for special pin binding. Note that even if there |
| 449 | * is only one sink/source pin requires special pin binding, pin binding | 449 | * is only one input/output pin requires special pin binding, pin binding |
| 450 | * should be defined for all sink/source pins in topology, for pin(s) that | 450 | * should be defined for all input/output pins in topology, for pin(s) that |
| 451 | * are not used, give the value "NotConnected". | 451 | * are not used, give the value "NotConnected". |
| 452 | * | 452 | * |
| 453 | * If pin binding is not defined in topology, nothing to parse in the kernel, | 453 | * If pin binding is not defined in topology, nothing to parse in the kernel, |
| 454 | * sink_pin_binding and src_pin_binding shall be NULL. | 454 | * input_pin_binding and output_pin_binding shall be NULL. |
| 455 | */ | 455 | */ |
| 456 | char **sink_pin_binding; | 456 | char **input_pin_binding; |
| 457 | char **src_pin_binding; | 457 | char **output_pin_binding; |
| 458 | 458 | ||
| 459 | struct ida src_queue_ida; | 459 | struct ida output_queue_ida; |
| 460 | struct ida sink_queue_ida; | 460 | struct ida input_queue_ida; |
| 461 | 461 | ||
| 462 | void *private; /* core does not touch this */ | 462 | void *private; /* core does not touch this */ |
| 463 | }; | 463 | }; |
| @@ -416,19 +416,19 @@ static const struct sof_topology_token led_tokens[] = { · 415 unmodified lines | |||
| 416 | }; | 416 | }; |
| 417 | 417 | ||
| 418 | static const struct sof_topology_token comp_pin_tokens[] = { | 418 | static const struct sof_topology_token comp_pin_tokens[] = { |
| 419 | {SOF_TKN_COMP_NUM_SINK_PINS, SND_SOC_TPLG_TUPLE_TYPE_WORD, get_token_u32, | 419 | {SOF_TKN_COMP_NUM_INPUT_PINS, SND_SOC_TPLG_TUPLE_TYPE_WORD, get_token_u32, |
| 420 | offsetof(struct snd_sof_widget, num_sink_pins)}, | 420 | offsetof(struct snd_sof_widget, num_input_pins)}, |
| 421 | {SOF_TKN_COMP_NUM_SOURCE_PINS, SND_SOC_TPLG_TUPLE_TYPE_WORD, get_token_u32, | 421 | {SOF_TKN_COMP_NUM_OUTPUT_PINS, SND_SOC_TPLG_TUPLE_TYPE_WORD, get_token_u32, |
| 422 | offsetof(struct snd_sof_widget, num_source_pins)}, | 422 | offsetof(struct snd_sof_widget, num_output_pins)}, |
| 423 | }; | 423 | }; |
| 424 | 424 | ||
| 425 | static const struct sof_topology_token comp_sink_pin_binding_tokens[] = { | 425 | static const struct sof_topology_token comp_input_pin_binding_tokens[] = { |
| 426 | {SOF_TKN_COMP_SINK_PIN_BINDING_WNAME, SND_SOC_TPLG_TUPLE_TYPE_STRING, | 426 | {SOF_TKN_COMP_INPUT_PIN_BINDING_WNAME, SND_SOC_TPLG_TUPLE_TYPE_STRING, |
| 427 | get_token_string, 0}, | 427 | get_token_string, 0}, |
| 428 | }; | 428 | }; |
| 429 | 429 | ||
| 430 | static const struct sof_topology_token comp_src_pin_binding_tokens[] = { | 430 | static const struct sof_topology_token comp_output_pin_binding_tokens[] = { |
| 431 | {SOF_TKN_COMP_SRC_PIN_BINDING_WNAME, SND_SOC_TPLG_TUPLE_TYPE_STRING, | 431 | {SOF_TKN_COMP_OUTPUT_PIN_BINDING_WNAME, SND_SOC_TPLG_TUPLE_TYPE_STRING, |
| 432 | get_token_string, 0}, | 432 | get_token_string, 0}, |
| 433 | }; | 433 | }; |
| 434 | 434 | ||
| @@ -1286,12 +1286,12 @@ static void sof_free_pin_binding(struct snd_sof_widget *swidget, · 851 unmodified lines | |||
| 1286 | u32 num_pins; | 1286 | u32 num_pins; |
| 1287 | int i; | 1287 | int i; |
| 1288 | 1288 | ||
| 1289 | if (pin_type == SOF_PIN_TYPE_SINK) { | 1289 | if (pin_type == SOF_PIN_TYPE_INPUT) { |
| 1290 | pin_binding = swidget->sink_pin_binding; | 1290 | pin_binding = swidget->input_pin_binding; |
| 1291 | num_pins = swidget->num_sink_pins; | 1291 | num_pins = swidget->num_input_pins; |
| 1292 | } else { | 1292 | } else { |
| 1293 | pin_binding = swidget->src_pin_binding; | 1293 | pin_binding = swidget->output_pin_binding; |
| 1294 | num_pins = swidget->num_source_pins; | 1294 | num_pins = swidget->num_output_pins; |
| 1295 | } | 1295 | } |
| 1296 | 1296 | ||
| 1297 | if (pin_binding) { | 1297 | if (pin_binding) { |
| @@ -1313,14 +1313,14 @@ static int sof_parse_pin_binding(struct snd_sof_widget *swidget, · 15 unmodified lines | |||
| 1313 | int ret; | 1313 | int ret; |
| 1314 | int i; | 1314 | int i; |
| 1315 | 1315 | ||
| 1316 | if (pin_type == SOF_PIN_TYPE_SINK) { | 1316 | if (pin_type == SOF_PIN_TYPE_INPUT) { |
| 1317 | num_pins = swidget->num_sink_pins; | 1317 | num_pins = swidget->num_input_pins; |
| 1318 | pin_binding_token = comp_sink_pin_binding_tokens; | 1318 | pin_binding_token = comp_input_pin_binding_tokens; |
| 1319 | token_count = ARRAY_SIZE(comp_sink_pin_binding_tokens); | 1319 | token_count = ARRAY_SIZE(comp_input_pin_binding_tokens); |
| 1320 | } else { | 1320 | } else { |
| 1321 | num_pins = swidget->num_source_pins; | 1321 | num_pins = swidget->num_output_pins; |
| 1322 | pin_binding_token = comp_src_pin_binding_tokens; | 1322 | pin_binding_token = comp_output_pin_binding_tokens; |
| 1323 | token_count = ARRAY_SIZE(comp_src_pin_binding_tokens); | 1323 | token_count = ARRAY_SIZE(comp_output_pin_binding_tokens); |
| 1324 | } | 1324 | } |
| 1325 | 1325 | ||
| 1326 | memset(pin_binding, 0, SOF_WIDGET_MAX_NUM_PINS * sizeof(char *)); | 1326 | memset(pin_binding, 0, SOF_WIDGET_MAX_NUM_PINS * sizeof(char *)); |
| @@ -1337,10 +1337,10 @@ static int sof_parse_pin_binding(struct snd_sof_widget *swidget, · 10 unmodified lines | |||
| 1337 | ret = -ENOMEM; | 1337 | ret = -ENOMEM; |
| 1338 | goto err; | 1338 | goto err; |
| 1339 | } | 1339 | } |
| 1340 | if (pin_type == SOF_PIN_TYPE_SINK) | 1340 | if (pin_type == SOF_PIN_TYPE_INPUT) |
| 1341 | swidget->sink_pin_binding = pb; | 1341 | swidget->input_pin_binding = pb; |
| 1342 | else | 1342 | else |
| 1343 | swidget->src_pin_binding = pb; | 1343 | swidget->output_pin_binding = pb; |
| 1344 | } | 1344 | } |
| 1345 | 1345 | ||
| 1346 | return 0; | 1346 | return 0; |
| @@ -1379,8 +1379,8 @@ static int sof_widget_ready(struct snd_soc_component *scomp, int index, · 32 unmodified lines | |||
| 1379 | swidget->private = NULL; | 1379 | swidget->private = NULL; |
| 1380 | mutex_init(&swidget->setup_mutex); | 1380 | mutex_init(&swidget->setup_mutex); |
| 1381 | 1381 | ||
| 1382 | ida_init(&swidget->src_queue_ida); | 1382 | ida_init(&swidget->output_queue_ida); |
| 1383 | ida_init(&swidget->sink_queue_ida); | 1383 | ida_init(&swidget->input_queue_ida); |
| 1384 | 1384 | ||
| 1385 | ret = sof_parse_tokens(scomp, swidget, comp_pin_tokens, | 1385 | ret = sof_parse_tokens(scomp, swidget, comp_pin_tokens, |
| 1386 | ARRAY_SIZE(comp_pin_tokens), priv->array, | 1386 | ARRAY_SIZE(comp_pin_tokens), priv->array, |
| @@ -1391,29 +1391,29 @@ static int sof_widget_ready(struct snd_soc_component *scomp, int index, · 4 unmodified lines | |||
| 1391 | goto widget_free; | 1391 | goto widget_free; |
| 1392 | } | 1392 | } |
| 1393 | 1393 | ||
| 1394 | if (swidget->num_sink_pins > SOF_WIDGET_MAX_NUM_PINS || | 1394 | if (swidget->num_input_pins > SOF_WIDGET_MAX_NUM_PINS || |
| 1395 | swidget->num_source_pins > SOF_WIDGET_MAX_NUM_PINS) { | 1395 | swidget->num_output_pins > SOF_WIDGET_MAX_NUM_PINS) { |
| 1396 | dev_err(scomp->dev, "invalid pins for %s: [sink: %d, src: %d]\n", | 1396 | dev_err(scomp->dev, "invalid pins for %s: [input: %d, output: %d]\n", |
| 1397 | swidget->widget->name, swidget->num_sink_pins, swidget->num_source_pins); | 1397 | swidget->widget->name, swidget->num_input_pins, swidget->num_output_pins); |
| 1398 | ret = -EINVAL; | 1398 | ret = -EINVAL; |
| 1399 | goto widget_free; | 1399 | goto widget_free; |
| 1400 | } | 1400 | } |
| 1401 | 1401 | ||
| 1402 | if (swidget->num_sink_pins > 1) { | 1402 | if (swidget->num_input_pins > 1) { |
| 1403 | ret = sof_parse_pin_binding(swidget, priv, SOF_PIN_TYPE_SINK); | 1403 | ret = sof_parse_pin_binding(swidget, priv, SOF_PIN_TYPE_INPUT); |
| 1404 | /* on parsing error, pin binding is not allocated, nothing to free. */ | 1404 | /* on parsing error, pin binding is not allocated, nothing to free. */ |
| 1405 | if (ret < 0) { | 1405 | if (ret < 0) { |
| 1406 | dev_err(scomp->dev, "failed to parse sink pin binding for %s\n", | 1406 | dev_err(scomp->dev, "failed to parse input pin binding for %s\n", |
| 1407 | w->name); | 1407 | w->name); |
| 1408 | goto widget_free; | 1408 | goto widget_free; |
| 1409 | } | 1409 | } |
| 1410 | } | 1410 | } |
| 1411 | 1411 | ||
| 1412 | if (swidget->num_source_pins > 1) { | 1412 | if (swidget->num_output_pins > 1) { |
| 1413 | ret = sof_parse_pin_binding(swidget, priv, SOF_PIN_TYPE_SOURCE); | 1413 | ret = sof_parse_pin_binding(swidget, priv, SOF_PIN_TYPE_OUTPUT); |
| 1414 | /* on parsing error, pin binding is not allocated, nothing to free. */ | 1414 | /* on parsing error, pin binding is not allocated, nothing to free. */ |
| 1415 | if (ret < 0) { | 1415 | if (ret < 0) { |
| 1416 | dev_err(scomp->dev, "failed to parse source pin binding for %s\n", | 1416 | dev_err(scomp->dev, "failed to parse output pin binding for %s\n", |
| 1417 | w->name); | 1417 | w->name); |
| 1418 | goto widget_free; | 1418 | goto widget_free; |
| 1419 | } | 1419 | } |
| @@ -1422,7 +1422,7 @@ static int sof_widget_ready(struct snd_soc_component *scomp, int index, · 2 unmodified lines | |||
| 1422 | dev_dbg(scomp->dev, | 1422 | dev_dbg(scomp->dev, |
| 1423 | "tplg: widget %d (%s) is ready [type: %d, pipe: %d, pins: %d / %d, stream: %s]\n", | 1423 | "tplg: widget %d (%s) is ready [type: %d, pipe: %d, pins: %d / %d, stream: %s]\n", |
| 1424 | swidget->comp_id, w->name, swidget->id, index, | 1424 | swidget->comp_id, w->name, swidget->id, index, |
| 1425 | swidget->num_sink_pins, swidget->num_source_pins, | 1425 | swidget->num_input_pins, swidget->num_output_pins, |
| 1426 | strnlen(w->sname, SNDRV_CTL_ELEM_ID_NAME_MAXLEN) > 0 ? w->sname : "none"); | 1426 | strnlen(w->sname, SNDRV_CTL_ELEM_ID_NAME_MAXLEN) > 0 ? w->sname : "none"); |
| 1427 | 1427 | ||
| 1428 | widget_ops = tplg_ops ? tplg_ops->widget : NULL; | 1428 | widget_ops = tplg_ops ? tplg_ops->widget : NULL; |
| @@ -1643,11 +1643,11 @@ out: · 214 unmodified lines | |||
| 1643 | if (widget_ops && widget_ops[swidget->id].ipc_free) | 1643 | if (widget_ops && widget_ops[swidget->id].ipc_free) |
| 1644 | widget_ops[swidget->id].ipc_free(swidget); | 1644 | widget_ops[swidget->id].ipc_free(swidget); |
| 1645 | 1645 | ||
| 1646 | ida_destroy(&swidget->src_queue_ida); | 1646 | ida_destroy(&swidget->output_queue_ida); |
| 1647 | ida_destroy(&swidget->sink_queue_ida); | 1647 | ida_destroy(&swidget->input_queue_ida); |
| 1648 | 1648 | ||
| 1649 | sof_free_pin_binding(swidget, SOF_PIN_TYPE_SINK); | 1649 | sof_free_pin_binding(swidget, SOF_PIN_TYPE_INPUT); |
| 1650 | sof_free_pin_binding(swidget, SOF_PIN_TYPE_SOURCE); | 1650 | sof_free_pin_binding(swidget, SOF_PIN_TYPE_OUTPUT); |
| 1651 | 1651 | ||
| 1652 | kfree(swidget->tuples); | 1652 | kfree(swidget->tuples); |
| 1653 | 1653 | ||