Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp995404ybe; Wed, 4 Sep 2019 10:52:27 -0700 (PDT) X-Google-Smtp-Source: APXvYqyDUHh0qtniy5pqPvBbHjWmxEAiHeXuZNjDU64TPanNgLd8y4C6UKS47PVVO2Sxan58bFWV X-Received: by 2002:a63:5048:: with SMTP id q8mr35572377pgl.446.1567619547514; Wed, 04 Sep 2019 10:52:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567619547; cv=none; d=google.com; s=arc-20160816; b=rVVCCXM0FVabq2DxFOUxs7Po5H+iT8wm8pPHirKm2iHuMCUqR26OkRg36dnBZZ4lnw T2TA8ZEQkbotFKRrH3HpYf5gVU9Zbnuu5V22F7lnVB8uHQ9pNnkM1AeuSLExS0XgKaHe HrlK7AO6hRJ5Qh90zZqSe5HyQfUCj9hVYEX9DBsOrNRPNeMYGnDpR22pUSuHLN9/WcEr tjelnb5VYNwJzU77GIaJl8nZpD0VIgqmJtTAzwK2EZLWtmWx0fyTe5KQk10hX9f7h+5r Jy82B/V5Ftk6gHoA/4kumjiCeWabj8J4lTACa5RlS6tygXggDxHxxnpPF+lmAZe2ht3m j/+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=YxVWEStHqNo+RJQgTHuBzEDAl3nX8AycC1gm90dVmDI=; b=cUK2KdAjpEnoSnZ5qahUgztGayRth+XIvE6Os5Pn6N+e5Zp7lZ29hVED90Vl/AdMvB 3wCvaUkjCIui1jWMoz1FZVEmFztNDOm9z5joDW+Aznx1s1NQi0gVKz5+Z4cfVm9ydNLA xVii9gICHRQtK6WUHMDWo4tizT4pyfO9lCo6RCZI1fRJ7cSQ1KE+DzLip4toa631vbmn ze0rOeNoT964o/stgSmVN/rHIvuWIZ7pX6cWyuKqIkxaSbhxvghU5rU1xuRrjHTe+pkv lmAWOLSs8TBcWLJcOa0p5osAANs2caJF8QOP1PaAmlKd1lpQX5/kFJp1i2i7xTdKl+Gr /qiw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ci9si290727plb.103.2019.09.04.10.52.12; Wed, 04 Sep 2019 10:52:27 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732030AbfIDRt1 (ORCPT + 99 others); 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.