Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp1578799ybi; Sat, 8 Jun 2019 13:06:01 -0700 (PDT) X-Google-Smtp-Source: APXvYqyW4B3Tmcqjo1AziiOsRp7DcCiyVMqCdGVHT0Hhhg7MoHasIxXrS5aXCiS87OEGiTDyzxTj X-Received: by 2002:a63:4714:: with SMTP id u20mr8769164pga.347.1560024361164; Sat, 08 Jun 2019 13:06:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560024361; cv=none; d=google.com; s=arc-20160816; b=sNzmzuJ38SpVnFovRbyQ/8Un/5f+Imn9dKAz6RVXcB6739ocetwEn784PZAwYgYnRi nHoFW7UNtwHSWCLeKTwMGkQr6p7gXJNZiqjtwwKn3sRa3ovHLZe+5k1kBnamMfPH50pS yEYl5C7BFQ+WUibq+ZCfn+qT3MEO7yXrse8ioA3S3qoo3jNgSxqGxwG+PgYqbvSOgBSy 3aP6GhOsoqII/W01J8zQ3PMgGiOAfGlh2USdmfqPEhH70EFx18tmjp6jrWZS/0zprEw9 yShEJhTi6UD+gCaTQZOIwKb0bzLqCmthLuTUEHRdQy77R0SEvW3yjcoH2xOe0Pi8mwND MXUg== 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=z7TJGBGD11p/NJjGyTQbnmDlF8b8mI1e+Qfc2+Dzn5M=; b=M93LC7THSJRGYBQ48ByTgPl4z54MNbn6IbKfIkkTF5gSHUX5z9BkXw/HDyfq+ryiGT XwH2Yfg4uELnoaoaabl5OVdWmmCErdO4i1pBCaXBLvK21Qw7AS13zw0PKZjNZe2TKDqt O3uksrgei30SyVZtdzxBONQ8l+LDEzKMg0ecftFQUuxM46gSEoJ5XgLF0Vyx/Qqz3p73 K/1LDA49BP6xVNRK6WKm26FiBNwAV7po0fwLfoAtlA1ieWgAmrTg5m5CsVleNhvxLCQ/ Cewi9J3wOQup/4ZcLv1szW1g+2jGyEr4NgfMQEz5fmLEIg4HZ8tlr9AMReh2cBwKWeVv oXag== 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 e96si5693922plb.123.2019.06.08.13.05.44; Sat, 08 Jun 2019 13:06:01 -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 S1727441AbfFHUEi (ORCPT + 99 others); Sat, 8 Jun 2019 16:04:38 -0400 Received: from mga14.intel.com ([192.55.52.115]:52446 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727215AbfFHUEi (ORCPT ); Sat, 8 Jun 2019 16:04:38 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 08 Jun 2019 13:04:37 -0700 X-ExtLoop1: 1 Received: from crojewsk-mobl1.ger.corp.intel.com (HELO [10.251.93.16]) ([10.251.93.16]) by orsmga006.jf.intel.com with ESMTP; 08 Jun 2019 13:04:33 -0700 Subject: Re: [alsa-devel] [RFC PATCH 3/6] soundwire: core: define SDW_MAX_PORT To: Pierre-Louis Bossart , Srinivas Kandagatla , broonie@kernel.org, vkoul@kernel.org Cc: mark.rutland@arm.com, devicetree@vger.kernel.org, alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, robh+dt@kernel.org References: <20190607085643.932-1-srinivas.kandagatla@linaro.org> <20190607085643.932-4-srinivas.kandagatla@linaro.org> From: Cezary Rojewski Message-ID: <641a22e7-6998-2a6a-bd90-ddf75d0cd9c8@intel.com> Date: Sat, 8 Jun 2019 22:04:32 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2019-06-07 14:31, Pierre-Louis Bossart wrote: > On 6/7/19 3:56 AM, Srinivas Kandagatla wrote: >> This patch adds SDW_MAX_PORT so that other driver can use it. >> >> Signed-off-by: Srinivas Kandagatla >> --- >>   include/linux/soundwire/sdw.h | 1 + >>   1 file changed, 1 insertion(+) >> >> diff --git a/include/linux/soundwire/sdw.h >> b/include/linux/soundwire/sdw.h >> index aac68e879fae..80ca997e4e5d 100644 >> --- a/include/linux/soundwire/sdw.h >> +++ b/include/linux/soundwire/sdw.h >> @@ -36,6 +36,7 @@ struct sdw_slave; >>   #define SDW_FRAME_CTRL_BITS        48 >>   #define SDW_MAX_DEVICES            11 >> +#define SDW_MAX_PORTS    14 > > That's an ambiguous definition. > You can have 16 ports per the SoundWire spec, but DP0 is reserved for > control and DP15 is an alias for all ports (same idea as device 15 for > broadcast operations but limited to a single device), which leaves 14 > ports for audio usages. > > In the MIPI specs, specifically the DisCo part, the difference is called > about with the the DP0 and DPn notations, so this could be SDW_MAX_DPn. > Alternatively you could use SDW_MAX_AUDIO_PORTS which is more > self-explanatory and does not require in-depth familiarity with the spec. > This ambiguity spreads even further. Look at the name of #define below. DP0 is by no means invalid. It's specific and has some optional registers, yes, but that's because of its engagement in BPT. Given the fact SDW does not care about type of data being transported, even "AUDIO" seems misleading here. Though it's still better than no specifier at all. >>   #define SDW_VALID_PORT_RANGE(n)        ((n) <= 14 && (n) >= 1) >>   #define SDW_DAI_ID_RANGE_START        100 >> >