Re: [PATCH v2 2/3] soundwire: qcom: add multi-master support

From: Srinivas Kandagatla

Date: Mon Nov 23 2026 - 07:34:48 EST


On 10/3/26 8:41 AM, Vinod Koul wrote:
> On 01-10-26, 12:06, Srinivas Kandagatla wrote:
>>
>>
>> On 10/1/26 11:53 AM, Pierre-Louis Bossart wrote:
>>>
>>>> @@ -192,6 +194,13 @@ struct qcom_swrm_ctrl {
>>>> const unsigned int *reg_layout;
>>>> void __iomem *mmio;
>>>> struct reset_control *audio_cgcr;
>>>> + u8 num_lanes;
>>>> + bool is_dependent;
>>>> + struct qcom_swrm_ctrl *peer_ctrl;
>>>> + u8 peer_first_lane;
>>>> + u8 num_peer_lanes;
>>>> + bool is_primary;
>>>> + u32 peer_dpn_offset;
>>>
>>> nit-pick: do you need both is_dependent and is_primary? One would think
>>> that a single variable would be enough, no?
>> I did try to do that which made the code bit confusing to read.
>
> I am viewing it that both should be set always for this mode. Do you
> have a case where it wont be the case..?
these are mutually exclusive, will add an enum with in v3 along with
role member.

>
>>> also without context it's hard to understand if lanes are independent in
>>> terms of transport or not, not sure what 'peer' means in a multi-master
>>> setup with a primary controller and N dependent ones? Code like this
>> For now its one, but Yes, technically we could have more dependent ones,
>> I wanted to keep the patchset simple and right now the only have one
>> peer and i dont know if we have other setups with more dependent
>> controrllers.
>
> Lets add the logic when we have such scenarios and keep now for one peer.
> Does Qualcomm roadmap envision more controllers?

There is only one dependent per master that is supported as part of this
series, there is no platform that i am aware of would allow me to test
or support the multiple dependents.

I can add a defensive check to not support multiple dependents if that
helps.

We can always extend this as an when we have that usecase which can be
tested.

--srini
>