lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87eemdr38y.wl-kuninori.morimoto.gx@renesas.com>
Date:   05 Oct 2020 08:20:02 +0900
From:   Kuninori Morimoto <kuninori.morimoto.gx@...esas.com>
To:     Sameer Pujar <spujar@...dia.com>
Cc:     <broonie@...nel.org>, <lgirdwood@...il.com>, <robh+dt@...nel.org>,
        <pierre-louis.bossart@...ux.intel.com>, <perex@...ex.cz>,
        <tiwai@...e.com>, <thierry.reding@...il.com>,
        <jonathanh@...dia.com>, <alsa-devel@...a-project.org>,
        <devicetree@...r.kernel.org>, <linux-tegra@...r.kernel.org>,
        <linux-kernel@...r.kernel.org>, <sharadg@...dia.com>,
        <mkumard@...dia.com>, <viswanathl@...dia.com>,
        <rlokhande@...dia.com>, <dramesh@...dia.com>,
        <atalambedu@...dia.com>, <nwartikar@...dia.com>,
        <swarren@...dia.com>, <nicoleotsuka@...il.com>
Subject: Re: [PATCH v3 10/13] ASoC: tegra: Add audio graph based card driver


Hi Sameer

> > This is just an idea,
> > but can we use hooks here somehow ?
> > 
> >          .ops_hook_pre
> >          .ops_hook_func
> >          .ops_hook_post
> > 
> >          if (priv->ops_hook_pre->func)
> >                  priv->ops_hook_pre->func_pre(...);
> > 
> >          if (priv->ops_hook_func->func)
> >                  priv->ops_hook_func->func(...); /* driver's function */
> >          else
> >                  graph_func(...);        /* audio-graph function */
> > 
> >          if (priv->ops_hook_post->func)
> >                  priv->ops_hook_post->func(...);
> 
> Right now I just required to populate some flags or structures and do
> not have any specific pre()/post() functions to be called. Can this be
> reserved for later?

Yeah, of course :)

> > These are almost same as graph_probe().
> > Maybe we can separate graph_probe() and export function ?
> 
> Yes possible, I can move more stuff into graph_parse_of() which is
> already an exported function in the current series. This can be
> utilized by both generic audio graph and Tegra audio graph.
> 
> Something like below,
> 
> static int tegra_audio_graph_probe(struct platform_device *pdev)
> {
>         struct tegra_audio_priv *priv;
>         struct device *dev = &pdev->dev;
>         struct snd_soc_card *card;
> 
>         priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
>         if (!priv)
>                 return -ENOMEM;
> 
>         card = simple_priv_to_card(&priv->simple);
> 
>         card->owner = THIS_MODULE;
>         card->dev = dev;
>         card->probe = tegra_audio_graph_card_probe;
> 
>         /* graph_parse_of() depends on below */
>         card->component_chaining = 1;
>         priv->simple.ops = &tegra_audio_graph_ops;
>         priv->simple.force_dpcm = 1;
> 
>         return graph_parse_of(&priv->simple);
> }

I think graph side can handle card->owner / card->dev,
but, it looks good to me

Thank you for your help !!

Best regards
---
Kuninori Morimoto

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ