From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A1998C3A5A8 for ; Wed, 4 Sep 2019 17:49:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8419B21670 for ; Wed, 4 Sep 2019 17:49:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732115AbfIDRt1 (ORCPT ); Wed, 4 Sep 2019 13:49:27 -0400 Received: from mga17.intel.com ([192.55.52.151]:54851 "EHLO mga17.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729594AbfIDRt1 (ORCPT ); Wed, 4 Sep 2019 13:49:27 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 04 Sep 2019 10:49:25 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,467,1559545200"; d="scan'208";a="194814550" Received: from enagase-mobl1.amr.corp.intel.com (HELO [10.251.133.230]) ([10.251.133.230]) by orsmga002.jf.intel.com with ESMTP; 04 Sep 2019 10:49:24 -0700 Subject: Re: [alsa-devel] [RFC PATCH 4/5] ASoC: SOF: Intel: hda: add SoundWire stream config/free callbacks To: Vinod Koul Cc: Guennadi Liakhovetski , alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, tiwai@suse.de, broonie@kernel.org, gregkh@linuxfoundation.org, jank@cadence.com, srinivas.kandagatla@linaro.org, slawomir.blauciak@intel.com, Bard liao , Rander Wang , Ranjani Sridharan , Liam Girdwood , Jaroslav Kysela , Takashi Iwai , Zhu Yingjiang , YueHaibing , Kai Vehmanen , Arnd Bergmann References: <20190821201720.17768-1-pierre-louis.bossart@linux.intel.com> <20190821201720.17768-5-pierre-louis.bossart@linux.intel.com> <20190822071835.GA30262@ubuntu> <20190904073549.GL2672@vkoul-mobl> <4de9613c-2da4-8d39-6f99-3039811673b8@linux.intel.com> <20190904165522.GC2672@vkoul-mobl> From: Pierre-Louis Bossart Message-ID: Date: Wed, 4 Sep 2019 12:49:24 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <20190904165522.GC2672@vkoul-mobl> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 9/4/19 11:55 AM, Vinod Koul wrote: > On 04-09-19, 08:31, Pierre-Louis Bossart wrote: >> On 9/4/19 2:35 AM, Vinod Koul wrote: >>> On 22-08-19, 08:53, Pierre-Louis Bossart wrote: >>>> Thanks for the review Guennadi >>>> >>>>>> +static int sdw_config_stream(void *arg, void *s, void *dai, >>>>>> + void *params, int link_id, int alh_stream_id) >>>>> >>>>> I realise, that these function prototypes aren't being introduced by these >>>>> patches, but just wondering whether such overly generic prototype is really >>>>> a good idea here, whether some of those "void *" pointers could be given >>>>> real types. The first one could be "struct device *" etc. >>>> >>>> In this case the 'arg' parameter is actually a private 'struct snd_sof_dev', >>>> as shown below [1]. We probably want to keep this relatively opaque, this is >>>> a context that doesn't need to be exposed to the SoundWire code. >>> >>> This does look bit ugly. >>> >>>> The dai and params are indeed cases where we could use stronger types, they >>>> are snd_soc_dai and hw_params respectively. I don't recall why the existing >>>> code is this way, Vinod and Sanyog may have the history of this. >>> >>> Yes we wanted to decouple the sdw and audio bits that is the reason why >>> none of the audio types are used here, but I think it should be revisited >>> and perhaps made as: >>> >>> sdw_config_stream(struct device *sdw, struct sdw_callback_ctx *ctx) >>> >>> where the callback context contains all the other args. That would make >>> it look lot neater too and of course use real structs if possible >> >> the suggested sdw_callbback_ctx is really intel-specific at the moment, e.g. >> the notion of link_id and alh_stream_id are due to the hardware, it's not >> generic at all. And in the latest code we also pass the dai->id. > > s/sdw_callback_ctx/intel_sdw_callback_ctx > > Yes this code is intel specific and this would be intel specific too ok, I'll fold all the fields in a structure then. That's a nice cleanup, thanks Guennadi and Vinod for the reviews. From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.2 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D30A6C3A5A8 for ; Wed, 4 Sep 2019 17:50:27 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E431A23400 for ; Wed, 4 Sep 2019 17:50:26 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="uJLk9ie+" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E431A23400 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.intel.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id D55691682; Wed, 4 Sep 2019 19:49:34 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz D55691682 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1567619424; bh=I9oB9MdkIn8n+S/YVN08qkezP2UcJBGUxQKds7rl+bU=; h=To:References:From:Date:In-Reply-To:Cc:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=uJLk9ie+FzC2LYAZ1MeZFUtIvP1Iipg0hw4nrjA2DP8/aRe2j/YzAt8/poqxSCKd/ tw7rSP0lVfHDpaLubuLInWtsmTOlE/Zrvs/g5gvo9H+lWd4LxScB2wjKH24KGkQs8Q l+oA6hUbLvStrcWWVvZMofcXlWoi12z6GHtzTm+s= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 3FD86F803A6; Wed, 4 Sep 2019 19:49:34 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id B4028F803D6; Wed, 4 Sep 2019 19:49:32 +0200 (CEST) Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id B2D88F80394 for ; Wed, 4 Sep 2019 19:49:27 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz B2D88F80394 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 04 Sep 2019 10:49:26 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,467,1559545200"; d="scan'208";a="194814550" Received: from enagase-mobl1.amr.corp.intel.com (HELO [10.251.133.230]) ([10.251.133.230]) by orsmga002.jf.intel.com with ESMTP; 04 Sep 2019 10:49:24 -0700 To: Vinod Koul References: <20190821201720.17768-1-pierre-louis.bossart@linux.intel.com> <20190821201720.17768-5-pierre-louis.bossart@linux.intel.com> <20190822071835.GA30262@ubuntu> <20190904073549.GL2672@vkoul-mobl> <4de9613c-2da4-8d39-6f99-3039811673b8@linux.intel.com> <20190904165522.GC2672@vkoul-mobl> From: Pierre-Louis Bossart Message-ID: Date: Wed, 4 Sep 2019 12:49:24 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <20190904165522.GC2672@vkoul-mobl> Content-Language: en-US Cc: Guennadi Liakhovetski , alsa-devel@alsa-project.org, Arnd Bergmann , Kai Vehmanen , Liam Girdwood , tiwai@suse.de, gregkh@linuxfoundation.org, Takashi Iwai , YueHaibing , linux-kernel@vger.kernel.org, Ranjani Sridharan , broonie@kernel.org, srinivas.kandagatla@linaro.org, jank@cadence.com, slawomir.blauciak@intel.com, Zhu Yingjiang , Bard liao , Rander Wang Subject: Re: [alsa-devel] [RFC PATCH 4/5] ASoC: SOF: Intel: hda: add SoundWire stream config/free callbacks X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" On 9/4/19 11:55 AM, Vinod Koul wrote: > On 04-09-19, 08:31, Pierre-Louis Bossart wrote: >> On 9/4/19 2:35 AM, Vinod Koul wrote: >>> On 22-08-19, 08:53, Pierre-Louis Bossart wrote: >>>> Thanks for the review Guennadi >>>> >>>>>> +static int sdw_config_stream(void *arg, void *s, void *dai, >>>>>> + void *params, int link_id, int alh_stream_id) >>>>> >>>>> I realise, that these function prototypes aren't being introduced by these >>>>> patches, but just wondering whether such overly generic prototype is really >>>>> a good idea here, whether some of those "void *" pointers could be given >>>>> real types. The first one could be "struct device *" etc. >>>> >>>> In this case the 'arg' parameter is actually a private 'struct snd_sof_dev', >>>> as shown below [1]. We probably want to keep this relatively opaque, this is >>>> a context that doesn't need to be exposed to the SoundWire code. >>> >>> This does look bit ugly. >>> >>>> The dai and params are indeed cases where we could use stronger types, they >>>> are snd_soc_dai and hw_params respectively. I don't recall why the existing >>>> code is this way, Vinod and Sanyog may have the history of this. >>> >>> Yes we wanted to decouple the sdw and audio bits that is the reason why >>> none of the audio types are used here, but I think it should be revisited >>> and perhaps made as: >>> >>> sdw_config_stream(struct device *sdw, struct sdw_callback_ctx *ctx) >>> >>> where the callback context contains all the other args. That would make >>> it look lot neater too and of course use real structs if possible >> >> the suggested sdw_callbback_ctx is really intel-specific at the moment, e.g. >> the notion of link_id and alh_stream_id are due to the hardware, it's not >> generic at all. And in the latest code we also pass the dai->id. > > s/sdw_callback_ctx/intel_sdw_callback_ctx > > Yes this code is intel specific and this would be intel specific too ok, I'll fold all the fields in a structure then. That's a nice cleanup, thanks Guennadi and Vinod for the reviews. _______________________________________________ Alsa-devel mailing list Alsa-devel@alsa-project.org https://mailman.alsa-project.org/mailman/listinfo/alsa-devel