linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
To: Vinod Koul <vkoul@kernel.org>
Cc: alsa-devel@alsa-project.org, tiwai@suse.de,
	gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org,
	Ranjani Sridharan <ranjani.sridharan@linux.intel.com>,
	broonie@kernel.org, srinivas.kandagatla@linaro.org,
	jank@cadence.com, slawomir.blauciak@intel.com,
	Sanyog Kale <sanyog.r.kale@intel.com>,
	Bard liao <yung-chuan.liao@linux.intel.com>,
	Rander Wang <rander.wang@linux.intel.com>
Subject: Re: [alsa-devel] [PATCH 1/3] soundwire: remove bitfield for unique_id, use u8
Date: Thu, 24 Oct 2019 07:42:13 -0500	[thread overview]
Message-ID: <3b41953e-df3b-cf20-dae9-f3635c532895@linux.intel.com> (raw)
In-Reply-To: <20191024112955.GC2620@vkoul-mobl>

On 10/24/19 6:29 AM, Vinod Koul wrote:
> On 22-10-19, 18:48, Pierre-Louis Bossart wrote:
>> There is no good reason why the unique_id needs to be stored as 4
>> bits. The code will work without changes with a u8 since all values
> 
> Well this was due to the fact the slave id defined by MIPI has unique id
> as 4 bits. In fact if you look closely there are other fields in
> sdw_slave_id doing this

it's not because we extract 4 bits that we need to store the information 
in 4 bits.

> 
>> are already filtered while parsing the ACPI tables and Slave devID
>> registers.
>>
>> Use u8 representation. This will allow us to encode a
>> "IGNORE_UNIQUE_ID" value to account for firmware/BIOS creativity.
> 
> Why are we shoving firmware/BIOS issues into the core?

The core uses a matching formula which is too strict and does not work 
on multiple platforms.

You can argue that the BIOS should be fixed, but the counter argument is 
that the practice of ignoring the unique ID is allowed by the MIPI standard.

> 
>>
>> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
>> ---
>>   include/linux/soundwire/sdw.h | 4 +++-
>>   1 file changed, 3 insertions(+), 1 deletion(-)
>>
>> diff --git a/include/linux/soundwire/sdw.h b/include/linux/soundwire/sdw.h
>> index 688b40e65c89..28745b9ba279 100644
>> --- a/include/linux/soundwire/sdw.h
>> +++ b/include/linux/soundwire/sdw.h
>> @@ -403,6 +403,8 @@ int sdw_slave_read_prop(struct sdw_slave *slave);
>>    * SDW Slave Structures and APIs
>>    */
>>   
>> +#define SDW_IGNORED_UNIQUE_ID 0xFF
>> +
>>   /**
>>    * struct sdw_slave_id - Slave ID
>>    * @mfg_id: MIPI Manufacturer ID
>> @@ -418,7 +420,7 @@ struct sdw_slave_id {
>>   	__u16 mfg_id;
>>   	__u16 part_id;
>>   	__u8 class_id;
>> -	__u8 unique_id:4;
>> +	__u8 unique_id;
>>   	__u8 sdw_version:4;
>>   };
>>   
>> -- 
>> 2.20.1
> 


  reply	other threads:[~2019-10-24 12:42 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-22 23:48 [PATCH 0/3] soundwire: use UniqueID only when relevant Pierre-Louis Bossart
2019-10-22 23:48 ` [PATCH 1/3] soundwire: remove bitfield for unique_id, use u8 Pierre-Louis Bossart
2019-10-24 11:29   ` Vinod Koul
2019-10-24 12:42     ` Pierre-Louis Bossart [this message]
2019-10-22 23:48 ` [PATCH 2/3] soundwire: slave: add helper to extract slave ID Pierre-Louis Bossart
2019-10-22 23:48 ` [PATCH 3/3] soundwire: ignore uniqueID when irrelevant Pierre-Louis Bossart
2019-10-24 11:39   ` Vinod Koul
2019-10-24 12:59     ` [alsa-devel] " Pierre-Louis Bossart
2019-11-06 19:30 ` [alsa-devel] [PATCH 0/3] soundwire: use UniqueID only when relevant Pierre-Louis Bossart
2019-11-09 11:18 ` Vinod Koul

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3b41953e-df3b-cf20-dae9-f3635c532895@linux.intel.com \
    --to=pierre-louis.bossart@linux.intel.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=jank@cadence.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rander.wang@linux.intel.com \
    --cc=ranjani.sridharan@linux.intel.com \
    --cc=sanyog.r.kale@intel.com \
    --cc=slawomir.blauciak@intel.com \
    --cc=srinivas.kandagatla@linaro.org \
    --cc=tiwai@suse.de \
    --cc=vkoul@kernel.org \
    --cc=yung-chuan.liao@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).