Files
linux-nv-oot/sound
Sameer Pujar c2a88a3b26 ASoC: tegra-alt: new helpers to manage DAI links
Idea is to expose dai links or codec confs via members of machine driver
structure. The 'struct tegra_asoc' is used to group dai link related
members, which would be included in the 'struct tegra_machine'. This helps
to simplify the code like mentioned below.
 * no need of having t21x or t18x specific helper functions
 * no need of having global variables. Currently we use few global members
   for t21x.
 * currently we have separate helpers to first pass DT dai-links and then
   append with the dai-links defined in machine-alt utility code. In the
   current patch new helper{tegra_asoc_populate_dai_links()} combines both
   of the operations. The same is true for codec conf helpers as well and
   tegra_asoc_populate_codec_confs() alone is sufficient.
 * machine driver codec_init() and set_dai_ops() for easy reading.

In summary,
 tegra_asoc_populate_dai_links() combines following.
   * tegra_machine_new_codec_links()
   * tegra_machine_append_dai_link()
   * tegra_machine_append_dai_link_t18x()

 tegra_asoc_populate_codec_confs() combines following.
   * tegra_machine_new_codec_conf()
   * tegra_machine_append_codec_conf()
   * tegra_machine_append_codec_conf_t18x()

 machine->asoc->dai_links/codec_confs replaces below helpers.
   * tegra_machine_get_dai_link()
   * tegra_machine_get_dai_link_t18x()
   * tegra_machine_get_codec_dai_link_idx_t18x()
   * tegra_machine_get_codec_conf()
   * tegra_machine_get_codec_conf_t18x()

Machine driver(tegra_machine_driver_mobile.c) exposes add_dai_links()
helper to setup dai links. This will be used in the subsequent patches in
the series. Few structures are moved to machine-alt header files for reuse
if needed by other machine drivers. Also release_asoc_phandles() is exposed
to balance refcounts, during error paths, by calling of_node_put() for DAI
links and codec conf.

Bug 200503387
Bug 200516191

Change-Id: I39c888068b8a1e8e0b1ca277270e9dd84044b150
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2151459
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Mohan Kumar D <mkumard@nvidia.com>
Reviewed-by: Ravindra Lokhande <rlokhande@nvidia.com>
Reviewed-by: Sharad Gupta <sharadg@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2022-09-29 15:30:21 +05:30
..