From mboxrd@z Thu Jan 1 00:00:00 1970 From: Pierre-Louis Bossart Subject: Re: [PATCH 04/14] soundwire: Add MIPI DisCo property helpers Date: Sun, 22 Oct 2017 15:44:47 +0530 Message-ID: References: <1508382211-3154-1-git-send-email-vinod.koul@intel.com> <1508382211-3154-5-git-send-email-vinod.koul@intel.com> <20171021092046.p6wsssjkonjjdidt@sirena.org.uk> <20171021113718.GG30097@localhost> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit Return-path: Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by alsa0.perex.cz (Postfix) with ESMTP id 7310E266D69 for ; Sun, 22 Oct 2017 12:14:54 +0200 (CEST) In-Reply-To: <20171021113718.GG30097@localhost> Content-Language: en-US List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org To: Vinod Koul , Mark Brown Cc: ALSA , Charles Keepax , Sudheer Papothi , Takashi , Greg Kroah-Hartman , plai@codeaurora.org, LKML , patches.audio@intel.com, srinivas.kandagatla@linaro.org, Shreyas NC , Sanyog Kale , Sagar Dharia , alan@linux.intel.com List-Id: alsa-devel@alsa-project.org On 10/21/17 5:07 PM, Vinod Koul wrote: > On Sat, Oct 21, 2017 at 10:20:46AM +0100, Mark Brown wrote: >> On Thu, Oct 19, 2017 at 08:33:20AM +0530, Vinod Koul wrote: >> >>> + /* device is probed so let's read the properties now */ >>> + if (slave->ops && slave->ops->read_prop) >>> + slave->ops->read_prop(slave); >> >> Is it valid for us to not be able to read the properties? > > Practically no. Without the values bus wont work The notion of read is a bit overloaded here. What is needed is that the information is provided to the bus, whether you read it from firmware or a table in the codec driver is an implementation choice - see below. > >> >>> + fwnode_property_read_u32(node, "mipi-sdw-port-max-wordlength", >>> + &dpn[i].max_word); >>> + fwnode_property_read_u32(node, "mipi-sdw-port-min-wordlength", >>> + &dpn[i].min_word); >> >> Don't we know this stuff simply by virtue of knowing what device we're >> talking to (given that there aren't class devices)? > > Well I think the spec is midway to device class so they added it to make it > generic :) The properties are needed so that the bus can perform all the transport-related stuff. As explained in the patches, we are not making assumptions on how the codec driver is written, the implementation can either get the properties from firmware (DT or ACPI) or hard-code them in the driver. The only property that needs to be defined is for multi-lane setups, since the topology is not known to a codec driver.