[PATCH 0/2] ASoC: qcom: Refactor of_xlate_dai_name into common helper

Harendra Gautam posted 2 patches 2 days, 20 hours ago
sound/soc/qcom/common.c    | 34 ++++++++++++++++++++++++++++++++++
sound/soc/qcom/common.h    |  5 +++++
sound/soc/qcom/lpass-cpu.c | 19 +++++--------------
3 files changed, 44 insertions(+), 14 deletions(-)
[PATCH 0/2] ASoC: qcom: Refactor of_xlate_dai_name into common helper
Posted by Harendra Gautam 2 days, 20 hours ago
Multiple Qualcomm ASoC CPU DAI drivers implement the same logic to
resolve a sound-dai phandle argument to a DAI name: iterate the
component's DAI driver array and match by ID. This is currently
duplicated between lpass-cpu.c and qaif-cpu.c.

This series extracts the common logic into a shared helper
asoc_qcom_of_xlate_dai_name() in common.c and refactors lpass-cpu.c
to use it. The QAIF driver (in a separate series) will also use this
helper instead of its own private implementation.

Patch 1: Add asoc_qcom_of_xlate_dai_name() to common.c/h
Patch 2: Refactor lpass-cpu.c to use the new helper

Harendra Gautam (2):
  ASoC: qcom: Add generic of_xlate_dai_name helper to common
  ASoC: qcom: lpass-cpu: Use asoc_qcom_of_xlate_dai_name helper

 sound/soc/qcom/common.c    | 34 ++++++++++++++++++++++++++++++++++
 sound/soc/qcom/common.h    |  5 +++++
 sound/soc/qcom/lpass-cpu.c | 19 +++++--------------
 3 files changed, 44 insertions(+), 14 deletions(-)

-- 
2.34.1
Re: [PATCH 0/2] ASoC: qcom: Refactor of_xlate_dai_name into common helper
Posted by Srinivas Kandagatla 2 days, 19 hours ago

On 6/5/26 10:28 AM, Harendra Gautam wrote:
> Multiple Qualcomm ASoC CPU DAI drivers implement the same logic to
> resolve a sound-dai phandle argument to a DAI name: iterate the
> component's DAI driver array and match by ID. This is currently
> duplicated between lpass-cpu.c and qaif-cpu.c.
> 
> This series extracts the common logic into a shared helper
> asoc_qcom_of_xlate_dai_name() in common.c and refactors lpass-cpu.c
> to use it. The QAIF driver (in a separate series) will also use this
> helper instead of its own private implementation.
> 
> Patch 1: Add asoc_qcom_of_xlate_dai_name() to common.c/h
> Patch 2: Refactor lpass-cpu.c to use the new helper

series itself does not make sense, as you only have one user for this at
the moment.

Please consider making it part of the series that actually has more than
one user for this.


--srini
> 
> Harendra Gautam (2):
>   ASoC: qcom: Add generic of_xlate_dai_name helper to common
>   ASoC: qcom: lpass-cpu: Use asoc_qcom_of_xlate_dai_name helper
> 
>  sound/soc/qcom/common.c    | 34 ++++++++++++++++++++++++++++++++++
>  sound/soc/qcom/common.h    |  5 +++++
>  sound/soc/qcom/lpass-cpu.c | 19 +++++--------------
>  3 files changed, 44 insertions(+), 14 deletions(-)
>
Re: [PATCH 0/2] ASoC: qcom: Refactor of_xlate_dai_name into common helper
Posted by Mark Brown 2 days, 17 hours ago
On Fri, Jun 05, 2026 at 10:41:33AM +0100, Srinivas Kandagatla wrote:

> Please consider making it part of the series that actually has more than
> one user for this.

Or at least identify additional users that will be added soon, it might
make sense to cut down the size of a larger series by splitting out the
API addition.  That's especially true if there's multiple new users that
each need their own series.