soundwire: export sdw_compute_slave_ports() function
PATCH 1/1 soundwire: export sdw_compute_slave_ports() function
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.
--- drivers/soundwire/bus.h | 9 +++++++++ drivers/soundwire/generic_bandwidth_allocation.c | 12 +++--------- 2 files changed, 12 insertions(+), 9 deletions(-)
drivers/soundwire/bus.h +9 -0
@@ -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 valvoid 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 */
drivers/soundwire/generic_bandwidth_allocation.c +3 -9
@@ -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,
Signature · 1 line
2.34.1
Quoted 6 lines · Vijendar Mukunda
Export
sdw_compute_slave_ports()function to use it in another soundwire manager module.
Movesdw_transport_datastructure to bus header file to exportsdw_compute_slave_ports()function.Signed-off-by Vijendar Mukunda <[email protected]>
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.
Quoted 61 lines
--- drivers/soundwire/bus.h | 9 +++++++++ drivers/soundwire/generic_bandwidth_allocation.c | 12 +++--------- 2 files changed, 12 insertions(+), 9 deletions(-)drivers/soundwire/bus.h +9
-0@@ -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 valvoid 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 */ drivers/soundwire/generic_bandwidth_allocation.c +3
-9@@ -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,
Quoted 7 lines · Pierre-Louis Bossart
Quoted 5 lines · Vijendar Mukunda
Export
sdw_compute_slave_ports()function to use it in another soundwire manager module.
Movesdw_transport_datastructure to bus header file to exportsdw_compute_slave_ports()function.
Quoted 7 lines
Quoted 1 line
Signed-off-by Vijendar Mukunda <[email protected]>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 <[email protected]>
We will use vkoul soundwire git repository as base and will post the patch.
Quoted 61 lines
Quoted 61 lines
--- drivers/soundwire/bus.h | 9 +++++++++ drivers/soundwire/generic_bandwidth_allocation.c | 12 +++--------- 2 files changed, 12 insertions(+), 9 deletions(-)drivers/soundwire/bus.h +9
-0@@ -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 valvoid 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 */ drivers/soundwire/generic_bandwidth_allocation.c +3
-9@@ -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,
Quoted 4 lines · Vijendar Mukunda
Export
sdw_compute_slave_ports()function to use it in another soundwire manager module.
Movesdw_transport_datastructure to bus header file to exportsdw_compute_slave_ports()function.
You might want to send this along with the actual user.
Quoted 6 lines · Christoph Hellwig
Quoted 4 lines · Vijendar Mukunda
Export
sdw_compute_slave_ports()function to use it in another soundwire manager module.
Movesdw_transport_datastructure to bus header file to exportsdw_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.