Re: [PATCH 1/2] ASoC: simple-card: Introduce playback-only/capture only DAI link flags

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Aug 2, 2023 at 2:31 AM Kuninori Morimoto
<kuninori.morimoto.gx@xxxxxxxxxxx> wrote:
>
>
> Hi Daniel
>
> Thank you for your patch.
> This is not a big deal, but...
>
> > We need this to signal that DAI link supports only 1 direction that
> > can only be either playback or capture.
> (snip)
> > +     if (of_property_read_bool(node, "playback-only"))
> > +             is_playback_only = true;
> > +
> > +     if (of_property_read_bool(node, "capture-only"))
> > +             is_capture_only = true;
>
> More simply
>
>         is_playback_only = of_property_read_bool(node, "playback-only");
>         is_capture_only  = of_property_read_bool(node, "capture-only");


Good point. Will fix in v2.

>
> > +     ret = asoc_simple_parse_link_direction(dev, node, prefix,
> > +                                            &is_playback_only,
> > +                                            &is_capture_only);
> > +     if (ret < 0)
> > +             return 0;
> > +
> > +     dai_link->playback_only = is_playback_only;
> > +     dai_link->capture_only = is_capture_only;
>
> It doesn't overwrite when error case, so
> More simply
>
>         ret = asoc_simple_parse_link_direction(dev, node, prefix,
>                                                 &dai_link->playback_only,
>                                                 &dai_link->capture_only);

Can do this because dai_link->playback_only is a bitfield.




[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]


  Powered by Linux