diff mbox series

[v3,1/5] soundwire: add static port mapping support

Message ID 20210312113929.17512-2-srinivas.kandagatla@linaro.org
State Superseded
Headers show
Series soundwire: add static port map support | expand

Commit Message

Srinivas Kandagatla March 12, 2021, 11:39 a.m. UTC
Some of the SoundWire device ports are statically mapped to Controller
ports during design, however there is no way to expose this information
to the controller. Controllers like Qualcomm ones use this info to setup
static bandwidth parameters for those ports.

A generic port allocation is not possible in this cases!
So this patch adds a new member m_port_map to struct sdw_slave to expose
this static map.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>

---
 include/linux/soundwire/sdw.h | 2 ++
 1 file changed, 2 insertions(+)

-- 
2.21.0

Comments

Pierre-Louis Bossart March 12, 2021, 4:56 p.m. UTC | #1
On 3/12/21 5:39 AM, Srinivas Kandagatla wrote:
> Some of the SoundWire device ports are statically mapped to Controller

> ports during design, however there is no way to expose this information

> to the controller. Controllers like Qualcomm ones use this info to setup

> static bandwidth parameters for those ports.

> 

> A generic port allocation is not possible in this cases!

> So this patch adds a new member m_port_map to struct sdw_slave to expose

> this static map.

> 

> Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>

> ---

>   include/linux/soundwire/sdw.h | 2 ++

>   1 file changed, 2 insertions(+)

> 

> diff --git a/include/linux/soundwire/sdw.h b/include/linux/soundwire/sdw.h

> index d08039d65825..b032d6ac0b39 100644

> --- a/include/linux/soundwire/sdw.h

> +++ b/include/linux/soundwire/sdw.h

> @@ -614,6 +614,7 @@ struct sdw_slave_ops {

>    * @debugfs: Slave debugfs

>    * @node: node for bus list

>    * @port_ready: Port ready completion flag for each Slave port

> + * @m_port_map: static Master port map for each Slave port0 to port14


did you mean port1..port14?

DP0 is a special case that's not supposed to be used for audio transport 
but rather extended control and command?

>    * @dev_num: Current Device Number, values can be 0 or dev_num_sticky

>    * @dev_num_sticky: one-time static Device Number assigned by Bus

>    * @probed: boolean tracking driver state

> @@ -645,6 +646,7 @@ struct sdw_slave {

>   #endif

>   	struct list_head node;

>   	struct completion port_ready[SDW_MAX_PORTS];

> +	unsigned int m_port_map[SDW_MAX_PORTS];

>   	enum sdw_clk_stop_mode curr_clk_stop_mode;

>   	u16 dev_num;

>   	u16 dev_num_sticky;

>
Srinivas Kandagatla March 15, 2021, 9:54 a.m. UTC | #2
On 12/03/2021 16:56, Pierre-Louis Bossart wrote:
> 

> 

> On 3/12/21 5:39 AM, Srinivas Kandagatla wrote:

>> Some of the SoundWire device ports are statically mapped to Controller

>> ports during design, however there is no way to expose this information

>> to the controller. Controllers like Qualcomm ones use this info to setup

>> static bandwidth parameters for those ports.

>>

>> A generic port allocation is not possible in this cases!

>> So this patch adds a new member m_port_map to struct sdw_slave to expose

>> this static map.

>>

>> Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>

>> ---

>>   include/linux/soundwire/sdw.h | 2 ++

>>   1 file changed, 2 insertions(+)

>>

>> diff --git a/include/linux/soundwire/sdw.h 

>> b/include/linux/soundwire/sdw.h

>> index d08039d65825..b032d6ac0b39 100644

>> --- a/include/linux/soundwire/sdw.h

>> +++ b/include/linux/soundwire/sdw.h

>> @@ -614,6 +614,7 @@ struct sdw_slave_ops {

>>    * @debugfs: Slave debugfs

>>    * @node: node for bus list

>>    * @port_ready: Port ready completion flag for each Slave port

>> + * @m_port_map: static Master port map for each Slave port0 to port14

> 

> did you mean port1..port14?

> 

Yes I agree its port1..port14, will update this in next version.

--srini
> DP0 is a special case that's not supposed to be used for audio transport 

> but rather extended control and command? >

>>    * @dev_num: Current Device Number, values can be 0 or dev_num_sticky

>>    * @dev_num_sticky: one-time static Device Number assigned by Bus

>>    * @probed: boolean tracking driver state

>> @@ -645,6 +646,7 @@ struct sdw_slave {

>>   #endif

>>       struct list_head node;

>>       struct completion port_ready[SDW_MAX_PORTS];

>> +    unsigned int m_port_map[SDW_MAX_PORTS];

>>       enum sdw_clk_stop_mode curr_clk_stop_mode;

>>       u16 dev_num;

>>       u16 dev_num_sticky;

>>
diff mbox series

Patch

diff --git a/include/linux/soundwire/sdw.h b/include/linux/soundwire/sdw.h
index d08039d65825..b032d6ac0b39 100644
--- a/include/linux/soundwire/sdw.h
+++ b/include/linux/soundwire/sdw.h
@@ -614,6 +614,7 @@  struct sdw_slave_ops {
  * @debugfs: Slave debugfs
  * @node: node for bus list
  * @port_ready: Port ready completion flag for each Slave port
+ * @m_port_map: static Master port map for each Slave port0 to port14
  * @dev_num: Current Device Number, values can be 0 or dev_num_sticky
  * @dev_num_sticky: one-time static Device Number assigned by Bus
  * @probed: boolean tracking driver state
@@ -645,6 +646,7 @@  struct sdw_slave {
 #endif
 	struct list_head node;
 	struct completion port_ready[SDW_MAX_PORTS];
+	unsigned int m_port_map[SDW_MAX_PORTS];
 	enum sdw_clk_stop_mode curr_clk_stop_mode;
 	u16 dev_num;
 	u16 dev_num_sticky;