dmaengine: ti: k3-udma-glue: Add function to parse channel by ID
authorSiddharth Vadapalli <s-vadapalli@ti.com>
Wed, 24 Jan 2024 12:43:16 +0000 (18:13 +0530)
committerVinod Koul <vkoul@kernel.org>
Tue, 30 Jan 2024 16:43:51 +0000 (22:13 +0530)
commit81a1f90f20af71728f900f245aa69e9425fdef84
tree7d0c9cf923a34e75a78a9d3ff05c4c352512ff8d
parent7510bf84c4e318bff63b13183929a4272e1d2b5d
dmaengine: ti: k3-udma-glue: Add function to parse channel by ID

The existing helper function of_k3_udma_glue_parse() fetches the DMA
Channel thread ID from the device-tree node. This makes it necessary to
have a device-tree node with the Channel thread IDs populated. However,
in the case where the thread ID is known by alternate methods (an
example being that of Firmware running on remote core sharing details of
the thread IDs), there is no equivalent function to implement the
functionality of the existing of_k3_udma_glue_parse() function. In such
cases, the driver utilizing the DMA APIs might not even have a
device-tree node to begin with, since it could be probed with other
methods (RPMsg-Bus for example).

Add the of_k3_udma_glue_parse_chn_by_id() helper function which accepts
the thread ID as an argument, thereby making it unnecessary to have a
device-tree node for obtaining the thread ID.

Since of_k3_udma_glue_parse() and of_k3_udma_glue_parse_chn_by_id()
share a lot of code in common, create a new function to handle the
common code which is named as of_k3_udma_glue_parse_chn_common().

Signed-off-by: Siddharth Vadapalli <s-vadapalli@ti.com>
Acked-by: Peter Ujfalusi <peter.ujfalusi@gmail.com>
Link: https://lore.kernel.org/r/20240124124319.820002-2-s-vadapalli@ti.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
drivers/dma/ti/k3-udma-glue.c