Received: by 10.213.65.68 with SMTP id h4csp3827933imn; Tue, 3 Apr 2018 11:17:22 -0700 (PDT) X-Google-Smtp-Source: AIpwx48+wkeMqlc7YPf0lssULE/eHlQrwiAuajLd4DqVCrkUfRmrnJ2vgnRDaQR9YWTrWWdxWAL2 X-Received: by 2002:a17:902:d698:: with SMTP id v24-v6mr10984835ply.314.1522779442955; Tue, 03 Apr 2018 11:17:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522779442; cv=none; d=google.com; s=arc-20160816; b=jru5jMfbDRtZhIPDzPCdP+mxk2fQrv5xY2ZExGUdDWjmPrLZ2fAZqw5dYuRa625CCr 9FA96CA/Iq+RI+lVxCZWaz2xdDNece80i8riWENJz6TX8ItpB4gD8qZtmOpblqdQIBMg keZaovBr1fdxEWvTuEi0n72cygM8ka49dRb/jNsASA0W7QJK8oOggOmucuYa7HUHjYL/ FGBLqHG86QwPPxjW0WU8B/j8kYQPTyKkZlSQ1CYEedt6H9ZshDxHIWm6p+FoGWOe1ffy IIfXWKlS1vlXfCqerNrBAzyabd/Q2pCLB58L4kTnro0bAdYrRihbQr7sHzJGEr0HODIt m0qg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature :arc-authentication-results; bh=0WFKFyeMfoby/42Q0dvee0IZbeyW1yliTeHZJd/vRMQ=; b=TWVgAOkhHKV8NZRfbSP6JibyLX/Mg/eS/yix56Sc4FxcNJw0p08Q2lZgZsFOATMVjQ s5nL1SOmG/4RT3scXWkhaM7SImkd3cjyDIwurx30oIauQ+fOXfzPgRku4AGX3/kmASYL /cnT0/vd4gBBvyuu51y4S2d+qhPEFRiIhrVEAK0jYj1LkHXgtWHCePYk5sbHrx5hS61t wKpraFeWHZBCaZrkRRydE3Z3u1NewfrmpVh5EBILg+so6gMHKm6SJHP6AwjMMFyyYEG5 SkKwtO3Iv/wpiikhQeUFH8Oa0jr9biVU2AiVVsoorjB6NCvFpN3O1kdsG2M1hQjiRgQe Idig== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=cGEn3j68; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y13si2523216pfl.111.2018.04.03.11.17.08; Tue, 03 Apr 2018 11:17:22 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=cGEn3j68; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752834AbeDCSPu (ORCPT + 99 others); Tue, 3 Apr 2018 14:15:50 -0400 Received: from mail-wm0-f54.google.com ([74.125.82.54]:36857 "EHLO mail-wm0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752688AbeDCSPs (ORCPT ); Tue, 3 Apr 2018 14:15:48 -0400 Received: by mail-wm0-f54.google.com with SMTP id x82so36935487wmg.1 for ; Tue, 03 Apr 2018 11:15:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding:content-language; bh=0WFKFyeMfoby/42Q0dvee0IZbeyW1yliTeHZJd/vRMQ=; b=cGEn3j687BZbRfqR0qhXXqhk0kZJuTZbAJnjnBPcgms2b0QBmr4xzCqTvSmTRFu5IA Lba1C2cqm9iqsiUJy0lc2w7xFtIJK4ABlmKMSoN5XsfNUyWPtCj9FUk3DIVRfJL6gTU0 Ky2RS92az+9PwZbc5ifvzQ8WxZq0AEyLhsQeNl7w5WMImP82Mf9ZJk0yzp6SEhRwMfMV it+7pCdajEXS3E4tW/jiriKnRfEa6ZNwjoBP4bZndykZisBAQYieSGyRck1LHMF/xlW0 KjnOgvoMIkhD9rRGf8H59CTQPfStzHLM4iCh6aQkdkewkHkmCLvFFdqHOPMP+05xf+Ur iMCw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=0WFKFyeMfoby/42Q0dvee0IZbeyW1yliTeHZJd/vRMQ=; b=lSHLDrCDemREyvAnkFkUaKY92BYG7XPGkVvgRGDU7ugSfLSCKBhFl46FgmqKu38nVC gyBEoxmyOPro/of3EIRTZEyAmdMt5r6qpidk0hmndYv/zyou8bIoQiaDBfXumnVQqPU/ bJu2ItBIwJWDIcJ5O5CMCyXRQmXt4YZZa/dgK3U1RJR0KsGSjwjdfotYPTmhUD5HuJ6H 49SfpEMBB0ohB0IfPxgX6l4fiXbJivqXYun/rWBbqqUZGTW+R7MyIUc8qD4OV2NUvHHG z/nqW2ACfd7mWt7O8C2OetHe7MK4kaJPDc7G1YoJxur6cJp0COb/VlHMa7WCpgqkqSnM nXyQ== X-Gm-Message-State: AElRT7EqtpqSFApwU1pMu2iVnGmmfw2WBdQjbjsN48ZTSL2BDQRipCIX hIwdKy9/zxIGmLhwBnH5gSQ= X-Received: by 10.80.212.41 with SMTP id t41mr16985017edh.75.1522779346916; Tue, 03 Apr 2018 11:15:46 -0700 (PDT) Received: from [192.168.1.3] (x4dba8717.dyn.telefonica.de. [77.186.135.23]) by smtp.gmail.com with ESMTPSA id j15sm2098738edj.42.2018.04.03.11.15.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 03 Apr 2018 11:15:46 -0700 (PDT) Subject: Re: [alsa-devel] [PATCH v3 0/2] ASoC: topology: Improve parsing hw_configs To: Pierre-Louis Bossart Cc: alsa-devel@alsa-project.org, Takashi Iwai , Pan Xiuli , linux-kernel@vger.kernel.org, Liam Girdwood , Mark Brown References: <20180327205632.3677-1-k.marinushkin@gmail.com> <17f0767a-2dea-92dd-a88e-a3f3e670d0d2@gmail.com> <461bbabf-7c36-1361-8f66-5abbe3c7f4d8@linux.intel.com> <260f1850-37f2-fffa-fb33-4b5ff823ba0b@linux.intel.com> From: Kirill Marinushkin Message-ID: <21dd211e-2b93-b5af-0606-726432e40795@gmail.com> Date: Tue, 3 Apr 2018 20:16:23 +0200 User-Agent: Mozilla/5.0 (X11; Linux i686; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: <260f1850-37f2-fffa-fb33-4b5ff823ba0b@linux.intel.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 04/03/18 19:21, Pierre-Louis Bossart wrote: > > > On 04/03/2018 12:15 AM, Kirill Marinushkin wrote: >> On 04/03/18 02:57, Pierre-Louis Bossart wrote: >>> >>> On 04/02/2018 04:17 PM, Kirill Marinushkin wrote: >>>> Hello Pierre-Louis, >>>> >>>> I explicitly clarified with Takashi: to have this patch series merged, we >>>> need a >>>> tag "Reviewed-by" from you. >>> I am fine with the changes, but maybe while we are at it, we should clarify >>> what mclk_direction means? >> That's a good idea to have it solved within this patch series. >> >>>      __u8 mclk_direction;    /* 0 for input, 1 for output */ >>> >>> This is really awful and might benefit for additional clarity using >>> codec-centric conventions. >>> >> I agree that having a clear naming will avoid confusion for future usage. >> I see from the code, that this variable is ignored. So we have no technical >> restriction on how to interpret this. >> I suggest to do similar to what we did for bclk_master: >> >> /* DAI mclk_direction */ >> #define SND_SOC_TPLG_MCLK_CO        0 /* for codec, mclk is output */ >> #define SND_SOC_TPLG_MCLK_CI          1 /* for codec, mclk is input */ >> >>> We also had a discussion internally and can't figure out why the strings are >>> different from the fields in the structure, I feel it'd be simpler to align >>> config and code to avoid issues but keep existing notation for backwards >>> compatibility, e.g. >>> >>> if (strcmp(id, "mclk_freq") == 0) || strcmp(id, "mclk_rate") == 0) { >>>          if (snd_config_get_string(n, &val) < 0) >>>                  return -EINVAL; >>> >>>              hw_cfg->mclk_rate = atoi(val); >>>              continue; >>> } >> I agree with this. I will also do the same (keeping backwards-compatibility) >> for: >> >> "format" => "fmt" >> "bclk" => "bclk_master" >> "bclk_freq" => "bclk_rate" >> "bclk_invert" => "invert_bclk" >> "fsync" => "fsync_master" >> "fsync_invert" => "invert_fsync" >> "fsync_freq" => "fsync_rate" >> "mclk_freq" => "mclk_rate" >> "mclk" => "mclk_direction" >> "pm_gate_clocks" => "clock_gated" >> >> If you agree with both proposals, I will add patches to this patch series, and >> re-send as patch v4. >> Or can we handle it in a better way? > A v4 is fine with me. > > These topology definitions appear in hindsight quite problematic, there are > missing definitions and capabilities, e.g we have the ability to 'gate the > clock' but without knowing which clock, and we have no ability to force the > mclk/bclk/fsync on (be it on demand from a codec driver or on startup as a > system requirement). And there is no real extension capability with a protocol > version. The net effect is that people will have to create custom tokens and > parsing for things that should be common... > Yes, definitions which you mentioned really can become a problem. But, I see from the header that topology files support versioning: ~~~~ #define SND_SOC_TPLG_ABI_VERSION    0x5    /* current version */ ~~~~ So, in future such problems can be solved by incrementing the version, if no backwards capabilities are available. Before I continue with the patch v4, I want to clarify with you, so that we avoid the misunderstanding: * in the existing 4 patches, I will add a tag   "Reviewed-by: Pierre-Louis Bossart " * in the new 2 patches, which we recently discussed, I will add a tag   "Acked-by: Pierre-Louis Bossart " Do you agree with that? Best Regards, Kirill > Thanks > -Pierre