Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] soundwire: export sdw_compute_slave_ports() function
@ 2023-02-01 16:59 Vijendar Mukunda
  2023-02-01 23:21 ` Pierre-Louis Bossart
  2023-02-08  6:33 ` Christoph Hellwig
  0 siblings, 2 replies; 6+ messages in thread
From: Vijendar Mukunda @ 2023-02-01 16:59 UTC (permalink / raw)
  To: broonie, alsa-devel
  Cc: Mastan.Katragadda, Sunilkumar.Dommati, Basavaraj.Hiregoudar,
	Pierre-Louis Bossart, open list, Vinod Koul, Mario.Limonciello,
	Vijendar Mukunda, arungopal.kondaveeti, Sanyog Kale, Bard Liao

Export sdw_compute_slave_ports() function to use it in another
soundwire manager module.
Move sdw_transport_data structure to bus header file to export
sdw_compute_slave_ports() function.

Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
---
 drivers/soundwire/bus.h                          |  9 +++++++++
 drivers/soundwire/generic_bandwidth_allocation.c | 12 +++---------
 2 files changed, 12 insertions(+), 9 deletions(-)

diff --git a/drivers/soundwire/bus.h b/drivers/soundwire/bus.h
index 7631ef5e71fb..141b99ac58de 100644
--- a/drivers/soundwire/bus.h
+++ b/drivers/soundwire/bus.h
@@ -144,6 +144,13 @@ struct sdw_master_runtime {
 	struct list_head bus_node;
 };
 
+struct sdw_transport_data {
+	int hstart;
+	int hstop;
+	int block_offset;
+	int sub_block_offset;
+};
+
 struct sdw_dpn_prop *sdw_get_slave_dpn_prop(struct sdw_slave *slave,
 					    enum sdw_data_direction direction,
 					    unsigned int port_num);
@@ -213,5 +220,7 @@ int sdw_bwrite_no_pm_unlocked(struct sdw_bus *bus, u16 dev_num, u32 addr, u8 val
 
 void sdw_clear_slave_status(struct sdw_bus *bus, u32 request);
 int sdw_slave_modalias(const struct sdw_slave *slave, char *buf, size_t size);
+void sdw_compute_slave_ports(struct sdw_master_runtime *m_rt,
+			     struct sdw_transport_data *t_data);
 
 #endif /* __SDW_BUS_H */
diff --git a/drivers/soundwire/generic_bandwidth_allocation.c b/drivers/soundwire/generic_bandwidth_allocation.c
index f7c66083a4dd..39543048baa7 100644
--- a/drivers/soundwire/generic_bandwidth_allocation.c
+++ b/drivers/soundwire/generic_bandwidth_allocation.c
@@ -28,15 +28,8 @@ struct sdw_group {
 	unsigned int *rates;
 };
 
-struct sdw_transport_data {
-	int hstart;
-	int hstop;
-	int block_offset;
-	int sub_block_offset;
-};
-
-static void sdw_compute_slave_ports(struct sdw_master_runtime *m_rt,
-				    struct sdw_transport_data *t_data)
+void sdw_compute_slave_ports(struct sdw_master_runtime *m_rt,
+			     struct sdw_transport_data *t_data)
 {
 	struct sdw_slave_runtime *s_rt = NULL;
 	struct sdw_port_runtime *p_rt;
@@ -85,6 +78,7 @@ static void sdw_compute_slave_ports(struct sdw_master_runtime *m_rt,
 		}
 	}
 }
+EXPORT_SYMBOL(sdw_compute_slave_ports);
 
 static void sdw_compute_master_ports(struct sdw_master_runtime *m_rt,
 				     struct sdw_group_params *params,
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] soundwire: export sdw_compute_slave_ports() function
  2023-02-01 16:59 [PATCH] soundwire: export sdw_compute_slave_ports() function Vijendar Mukunda
@ 2023-02-01 23:21 ` Pierre-Louis Bossart
  2023-02-07  6:14   ` Mukunda,Vijendar
  2023-02-08  6:33 ` Christoph Hellwig
  1 sibling, 1 reply; 6+ messages in thread
From: Pierre-Louis Bossart @ 2023-02-01 23:21 UTC (permalink / raw)
  To: Vijendar Mukunda, broonie, alsa-devel
  Cc: Mastan.Katragadda, Sunilkumar.Dommati, Basavaraj.Hiregoudar,
	open list, Vinod Koul, Mario.Limonciello, arungopal.kondaveeti,
	Sanyog Kale, Bard Liao



On 2/1/23 10:59, Vijendar Mukunda wrote:
> Export sdw_compute_slave_ports() function to use it in another
> soundwire manager module.
> Move sdw_transport_data structure to bus header file to export
> sdw_compute_slave_ports() function.
> 
> Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>


If a specific platform has a need to modify parts of the bit allocation
but can reuse parts of the code, that's fine. The 'generic bandwidth
allocation' was meant to be a reference, not a one-size-fits-all solution.

Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>

> ---
>  drivers/soundwire/bus.h                          |  9 +++++++++
>  drivers/soundwire/generic_bandwidth_allocation.c | 12 +++---------
>  2 files changed, 12 insertions(+), 9 deletions(-)
> 
> diff --git a/drivers/soundwire/bus.h b/drivers/soundwire/bus.h
> index 7631ef5e71fb..141b99ac58de 100644
> --- a/drivers/soundwire/bus.h
> +++ b/drivers/soundwire/bus.h
> @@ -144,6 +144,13 @@ struct sdw_master_runtime {
>  	struct list_head bus_node;
>  };
>  
> +struct sdw_transport_data {
> +	int hstart;
> +	int hstop;
> +	int block_offset;
> +	int sub_block_offset;
> +};
> +
>  struct sdw_dpn_prop *sdw_get_slave_dpn_prop(struct sdw_slave *slave,
>  					    enum sdw_data_direction direction,
>  					    unsigned int port_num);
> @@ -213,5 +220,7 @@ int sdw_bwrite_no_pm_unlocked(struct sdw_bus *bus, u16 dev_num, u32 addr, u8 val
>  
>  void sdw_clear_slave_status(struct sdw_bus *bus, u32 request);
>  int sdw_slave_modalias(const struct sdw_slave *slave, char *buf, size_t size);
> +void sdw_compute_slave_ports(struct sdw_master_runtime *m_rt,
> +			     struct sdw_transport_data *t_data);
>  
>  #endif /* __SDW_BUS_H */
> diff --git a/drivers/soundwire/generic_bandwidth_allocation.c b/drivers/soundwire/generic_bandwidth_allocation.c
> index f7c66083a4dd..39543048baa7 100644
> --- a/drivers/soundwire/generic_bandwidth_allocation.c
> +++ b/drivers/soundwire/generic_bandwidth_allocation.c
> @@ -28,15 +28,8 @@ struct sdw_group {
>  	unsigned int *rates;
>  };
>  
> -struct sdw_transport_data {
> -	int hstart;
> -	int hstop;
> -	int block_offset;
> -	int sub_block_offset;
> -};
> -
> -static void sdw_compute_slave_ports(struct sdw_master_runtime *m_rt,
> -				    struct sdw_transport_data *t_data)
> +void sdw_compute_slave_ports(struct sdw_master_runtime *m_rt,
> +			     struct sdw_transport_data *t_data)
>  {
>  	struct sdw_slave_runtime *s_rt = NULL;
>  	struct sdw_port_runtime *p_rt;
> @@ -85,6 +78,7 @@ static void sdw_compute_slave_ports(struct sdw_master_runtime *m_rt,
>  		}
>  	}
>  }
> +EXPORT_SYMBOL(sdw_compute_slave_ports);
>  
>  static void sdw_compute_master_ports(struct sdw_master_runtime *m_rt,
>  				     struct sdw_group_params *params,

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] soundwire: export sdw_compute_slave_ports() function
  2023-02-01 23:21 ` Pierre-Louis Bossart
@ 2023-02-07  6:14   ` Mukunda,Vijendar
  0 siblings, 0 replies; 6+ messages in thread
From: Mukunda,Vijendar @ 2023-02-07  6:14 UTC (permalink / raw)
  To: Pierre-Louis Bossart, broonie, alsa-devel, vkoul@kernel.org
  Cc: Mastan.Katragadda, Sunilkumar.Dommati, Basavaraj.Hiregoudar,
	open list, Mario.Limonciello, arungopal.kondaveeti, Sanyog Kale,
	Bard Liao

On 02/02/23 04:51, Pierre-Louis Bossart wrote:
>
> On 2/1/23 10:59, Vijendar Mukunda wrote:
>> Export sdw_compute_slave_ports() function to use it in another
>> soundwire manager module.
>> Move sdw_transport_data structure to bus header file to export
>> sdw_compute_slave_ports() function.
>>
>> Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
>
> If a specific platform has a need to modify parts of the bit allocation
> but can reuse parts of the code, that's fine. The 'generic bandwidth
> allocation' was meant to be a reference, not a one-size-fits-all solution.
>
> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
We will use vkoul soundwire git repository as base and will post the
patch.
>> ---
>>  drivers/soundwire/bus.h                          |  9 +++++++++
>>  drivers/soundwire/generic_bandwidth_allocation.c | 12 +++---------
>>  2 files changed, 12 insertions(+), 9 deletions(-)
>>
>> diff --git a/drivers/soundwire/bus.h b/drivers/soundwire/bus.h
>> index 7631ef5e71fb..141b99ac58de 100644
>> --- a/drivers/soundwire/bus.h
>> +++ b/drivers/soundwire/bus.h
>> @@ -144,6 +144,13 @@ struct sdw_master_runtime {
>>  	struct list_head bus_node;
>>  };
>>  
>> +struct sdw_transport_data {
>> +	int hstart;
>> +	int hstop;
>> +	int block_offset;
>> +	int sub_block_offset;
>> +};
>> +
>>  struct sdw_dpn_prop *sdw_get_slave_dpn_prop(struct sdw_slave *slave,
>>  					    enum sdw_data_direction direction,
>>  					    unsigned int port_num);
>> @@ -213,5 +220,7 @@ int sdw_bwrite_no_pm_unlocked(struct sdw_bus *bus, u16 dev_num, u32 addr, u8 val
>>  
>>  void sdw_clear_slave_status(struct sdw_bus *bus, u32 request);
>>  int sdw_slave_modalias(const struct sdw_slave *slave, char *buf, size_t size);
>> +void sdw_compute_slave_ports(struct sdw_master_runtime *m_rt,
>> +			     struct sdw_transport_data *t_data);
>>  
>>  #endif /* __SDW_BUS_H */
>> diff --git a/drivers/soundwire/generic_bandwidth_allocation.c b/drivers/soundwire/generic_bandwidth_allocation.c
>> index f7c66083a4dd..39543048baa7 100644
>> --- a/drivers/soundwire/generic_bandwidth_allocation.c
>> +++ b/drivers/soundwire/generic_bandwidth_allocation.c
>> @@ -28,15 +28,8 @@ struct sdw_group {
>>  	unsigned int *rates;
>>  };
>>  
>> -struct sdw_transport_data {
>> -	int hstart;
>> -	int hstop;
>> -	int block_offset;
>> -	int sub_block_offset;
>> -};
>> -
>> -static void sdw_compute_slave_ports(struct sdw_master_runtime *m_rt,
>> -				    struct sdw_transport_data *t_data)
>> +void sdw_compute_slave_ports(struct sdw_master_runtime *m_rt,
>> +			     struct sdw_transport_data *t_data)
>>  {
>>  	struct sdw_slave_runtime *s_rt = NULL;
>>  	struct sdw_port_runtime *p_rt;
>> @@ -85,6 +78,7 @@ static void sdw_compute_slave_ports(struct sdw_master_runtime *m_rt,
>>  		}
>>  	}
>>  }
>> +EXPORT_SYMBOL(sdw_compute_slave_ports);
>>  
>>  static void sdw_compute_master_ports(struct sdw_master_runtime *m_rt,
>>  				     struct sdw_group_params *params,


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH] soundwire: export sdw_compute_slave_ports() function
@ 2023-02-07  7:16 Vijendar Mukunda
  0 siblings, 0 replies; 6+ messages in thread
From: Vijendar Mukunda @ 2023-02-07  7:16 UTC (permalink / raw)
  To: vkoul
  Cc: moderated list:SOUNDWIRE SUBSYSTEM, open list,
	pierre-louis.bossart, Vijendar Mukunda, Sanyog Kale, Bard Liao

Export sdw_compute_slave_ports() function to use it in another
soundwire manager module.
Move sdw_transport_data structure to bus header file to export
sdw_compute_slave_ports() function.

Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/lkml/20230201165944.3169125-1-Vijendar.Mukunda@amd.com
---
 drivers/soundwire/bus.h                          |  9 +++++++++
 drivers/soundwire/generic_bandwidth_allocation.c | 12 +++---------
 2 files changed, 12 insertions(+), 9 deletions(-)

diff --git a/drivers/soundwire/bus.h b/drivers/soundwire/bus.h
index 7631ef5e71fb..141b99ac58de 100644
--- a/drivers/soundwire/bus.h
+++ b/drivers/soundwire/bus.h
@@ -144,6 +144,13 @@ struct sdw_master_runtime {
 	struct list_head bus_node;
 };
 
+struct sdw_transport_data {
+	int hstart;
+	int hstop;
+	int block_offset;
+	int sub_block_offset;
+};
+
 struct sdw_dpn_prop *sdw_get_slave_dpn_prop(struct sdw_slave *slave,
 					    enum sdw_data_direction direction,
 					    unsigned int port_num);
@@ -213,5 +220,7 @@ int sdw_bwrite_no_pm_unlocked(struct sdw_bus *bus, u16 dev_num, u32 addr, u8 val
 
 void sdw_clear_slave_status(struct sdw_bus *bus, u32 request);
 int sdw_slave_modalias(const struct sdw_slave *slave, char *buf, size_t size);
+void sdw_compute_slave_ports(struct sdw_master_runtime *m_rt,
+			     struct sdw_transport_data *t_data);
 
 #endif /* __SDW_BUS_H */
diff --git a/drivers/soundwire/generic_bandwidth_allocation.c b/drivers/soundwire/generic_bandwidth_allocation.c
index f7c66083a4dd..39543048baa7 100644
--- a/drivers/soundwire/generic_bandwidth_allocation.c
+++ b/drivers/soundwire/generic_bandwidth_allocation.c
@@ -28,15 +28,8 @@ struct sdw_group {
 	unsigned int *rates;
 };
 
-struct sdw_transport_data {
-	int hstart;
-	int hstop;
-	int block_offset;
-	int sub_block_offset;
-};
-
-static void sdw_compute_slave_ports(struct sdw_master_runtime *m_rt,
-				    struct sdw_transport_data *t_data)
+void sdw_compute_slave_ports(struct sdw_master_runtime *m_rt,
+			     struct sdw_transport_data *t_data)
 {
 	struct sdw_slave_runtime *s_rt = NULL;
 	struct sdw_port_runtime *p_rt;
@@ -85,6 +78,7 @@ static void sdw_compute_slave_ports(struct sdw_master_runtime *m_rt,
 		}
 	}
 }
+EXPORT_SYMBOL(sdw_compute_slave_ports);
 
 static void sdw_compute_master_ports(struct sdw_master_runtime *m_rt,
 				     struct sdw_group_params *params,
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] soundwire: export sdw_compute_slave_ports() function
  2023-02-01 16:59 [PATCH] soundwire: export sdw_compute_slave_ports() function Vijendar Mukunda
  2023-02-01 23:21 ` Pierre-Louis Bossart
@ 2023-02-08  6:33 ` Christoph Hellwig
  2023-02-08  7:19   ` Mukunda,Vijendar
  1 sibling, 1 reply; 6+ messages in thread
From: Christoph Hellwig @ 2023-02-08  6:33 UTC (permalink / raw)
  To: Vijendar Mukunda
  Cc: broonie, alsa-devel, Basavaraj.Hiregoudar, Sunilkumar.Dommati,
	Mario.Limonciello, Mastan.Katragadda, arungopal.kondaveeti,
	Vinod Koul, Bard Liao, Pierre-Louis Bossart, Sanyog Kale,
	open list

On Wed, Feb 01, 2023 at 10:29:44PM +0530, Vijendar Mukunda wrote:
> Export sdw_compute_slave_ports() function to use it in another
> soundwire manager module.
> Move sdw_transport_data structure to bus header file to export
> sdw_compute_slave_ports() function.

You might want to send this along with the actual user.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] soundwire: export sdw_compute_slave_ports() function
  2023-02-08  6:33 ` Christoph Hellwig
@ 2023-02-08  7:19   ` Mukunda,Vijendar
  0 siblings, 0 replies; 6+ messages in thread
From: Mukunda,Vijendar @ 2023-02-08  7:19 UTC (permalink / raw)
  To: Christoph Hellwig
  Cc: broonie, alsa-devel, Basavaraj.Hiregoudar, Sunilkumar.Dommati,
	Mario.Limonciello, Mastan.Katragadda, arungopal.kondaveeti,
	Vinod Koul, Bard Liao, Pierre-Louis Bossart, Sanyog Kale,
	open list

On 08/02/23 12:03, Christoph Hellwig wrote:
> On Wed, Feb 01, 2023 at 10:29:44PM +0530, Vijendar Mukunda wrote:
>> Export sdw_compute_slave_ports() function to use it in another
>> soundwire manager module.
>> Move sdw_transport_data structure to bus header file to export
>> sdw_compute_slave_ports() function.
> You might want to send this along with the actual user.
This is a dependent patch for our soundwire manager driver
patch series. Yesterday we have pushed this patch based on soundwire
git tree. If the patch is not picked, then we will resend this patch
as part of our patch series.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2023-02-08  7:18 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-02-01 16:59 [PATCH] soundwire: export sdw_compute_slave_ports() function Vijendar Mukunda
2023-02-01 23:21 ` Pierre-Louis Bossart
2023-02-07  6:14   ` Mukunda,Vijendar
2023-02-08  6:33 ` Christoph Hellwig
2023-02-08  7:19   ` Mukunda,Vijendar
  -- strict thread matches above, loose matches on Subject: below --
2023-02-07  7:16 Vijendar Mukunda

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox