Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp2885141pxk; Sun, 4 Oct 2020 16:21:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzTJT4noUT+q5lwhcrQnd2azLhHvtGF/X06I+kDJJYc4q+EG7D3tVmhWAwkW3ZwRWr693ay X-Received: by 2002:a50:8ad4:: with SMTP id k20mr2491456edk.385.1601853697549; Sun, 04 Oct 2020 16:21:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601853697; cv=none; d=google.com; s=arc-20160816; b=JB7YSkfZiDn+5BDtWt4yTxCQkpNU/b4on2QygH2K3U4qMBYbic+9/Mj3aO3VchewT8 Sop05RwvJMtIWWH+RH7EUcf0BlEROSSbZSHI/UCaR1nwV+20QFaJILNcBLRx3b4E8Ugl 8GZSXJgKJrscavEsQz3mXuFuKG+5DA0FXZV4etYo4L/do+wriNrGhdw7L+f91CFkjH25 G7q1cJfncQHddRtq1uFAPArHmXZRbEcLvBhUqMaDVn1FgWDu0ZTh9pU/sCIbd+ffI00W tP8L0aHEyK+gaGqtvfTxye9QRJ1yxW2xgraGHRwSKVCCGitVQw+zgBypAVrJkB0OEAC9 KuDg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:subject:cc:to:from:message-id :date; bh=JoCpK3oWOO99TEz1mbffRL2C9UtXdoGtxNpHcBg8Wwg=; b=h4D1Rvb0LnsbbQ9x0suv8ec4AUDx18kNR39MayqBcsIVVvpxfaGAqQRLpclM6aDg+B N6Z5peK5VjSVPWutzr8GON3MT9a0Q958lzqX+YgORtDTynQBuL1snalJjvROpt7JvJol ZuNCcCg8N10OVVwPx2bLe6d1cIbQscjaBfEgshd5TNfmg6PedAVHfHPF/3AX85vD+W8K o7YdkldcJA38B8kv7+ARo3AuN6DhsQx4FaYWe43Hwr1LoPillUiWt6ZQqFr327EXA5la PKzptj54qUgzWCEv5GsgnYV79KUDmLvUCEWpCp+ocn7ARBoCq66ODxF+TECtjkoWH9pV DGag== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q12si3835045edr.141.2020.10.04.16.21.14; Sun, 04 Oct 2020 16:21:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725863AbgJDXUD convert rfc822-to-8bit (ORCPT + 99 others); Sun, 4 Oct 2020 19:20:03 -0400 Received: from relmlor1.renesas.com ([210.160.252.171]:28260 "EHLO relmlie5.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725836AbgJDXUD (ORCPT ); Sun, 4 Oct 2020 19:20:03 -0400 Date: 05 Oct 2020 08:20:02 +0900 X-IronPort-AV: E=Sophos;i="5.77,336,1596466800"; d="scan'208";a="58884013" Received: from unknown (HELO relmlir6.idc.renesas.com) ([10.200.68.152]) by relmlie5.idc.renesas.com with ESMTP; 05 Oct 2020 08:20:02 +0900 Received: from mercury.renesas.com (unknown [10.166.252.133]) by relmlir6.idc.renesas.com (Postfix) with ESMTP id E798041272A2; Mon, 5 Oct 2020 08:20:01 +0900 (JST) Message-ID: <87eemdr38y.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto To: Sameer Pujar Cc: , , , , , , , , , , , , , , , , , , , , Subject: Re: [PATCH v3 10/13] ASoC: tegra: Add audio graph based card driver In-Reply-To: <25771697-fc85-b377-ae99-a5e0957ba02d@nvidia.com> References: <1601573587-15288-1-git-send-email-spujar@nvidia.com> <1601573587-15288-11-git-send-email-spujar@nvidia.com> <87362xkxdv.wl-kuninori.morimoto.gx@renesas.com> <25771697-fc85-b377-ae99-a5e0957ba02d@nvidia.com> User-Agent: Wanderlust/2.15.9 Emacs/26.3 Mule/6.0 MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8BIT Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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