lkml.org 
[lkml]   [2020]   [Jul]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 04/10] ASoC: audio-graph: Support for empty end point
    Date
    For open platforms, which can support pluggable audio cards, Codec
    endpoint is not fixed always. It actually depends on the compatible
    HW module that is going to be connected. From SoC side the given I/O
    interface is always available. Hence such links have fixed CPU endpoint
    but no Codec endpoint. This patch helps to support such links where
    user can populate Codec endpoint only and its fields in Platform DT
    depending on the plugged HW.

    Signed-off-by: Sameer Pujar <spujar@nvidia.com>
    ---
    sound/soc/generic/audio-graph-card.c | 16 +++++++++++++---
    1 file changed, 13 insertions(+), 3 deletions(-)

    diff --git a/sound/soc/generic/audio-graph-card.c b/sound/soc/generic/audio-graph-card.c
    index b1903f9..caa8a77 100644
    --- a/sound/soc/generic/audio-graph-card.c
    +++ b/sound/soc/generic/audio-graph-card.c
    @@ -216,6 +216,14 @@ static int graph_dai_link_of_dpcm(struct asoc_simple_priv *priv,
    struct snd_soc_dai_link_component *codecs = dai_link->codecs;
    int ret;

    + /*
    + * Codec endpoint can be NULL for pluggable audio HW.
    + * Platform DT can populate the Codec endpoint depending on the
    + * external codec.
    + */
    + if (!ep)
    + return 0;
    +
    port = of_get_parent(ep);
    ports = of_get_parent(port);
    node = of_graph_get_port_parent(ep);
    @@ -532,9 +540,11 @@ static int graph_count_dpcm(struct asoc_simple_priv *priv,
    li->dais++; /* 1xCPU */

    /* Codec */
    - li->link++; /* 1xdummy-Codec */
    - li->conf++; /* 1xdummy-Codec */
    - li->dais++; /* 1xCodec */
    + if (codec_ep) {
    + li->link++; /* 1xdummy-Codec */
    + li->conf++; /* 1xdummy-Codec */
    + li->dais++; /* 1xCodec */
    + }

    dev_dbg(dev, "Count As DPCM\n");

    --
    2.7.4
    \
     
     \ /
      Last update: 2020-07-19 07:11    [W:3.147 / U:0.120 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site