Skip to content

Commit

Permalink
soundwire: export sdw_compute_slave_ports() function
Browse files Browse the repository at this point in the history
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
Link: https://lore.kernel.org/r/20230321050901.115439-2-Vijendar.Mukunda@amd.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
  • Loading branch information
Vijendar Mukunda authored and Vinod Koul committed Apr 12, 2023
1 parent acdae46 commit f346fdf
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
9 changes: 9 additions & 0 deletions drivers/soundwire/bus.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -201,5 +208,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 */
12 changes: 3 additions & 9 deletions drivers/soundwire/generic_bandwidth_allocation.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,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;
Expand Down Expand Up @@ -86,6 +79,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,
Expand Down

0 comments on commit f346fdf

Please sign in to comment.