Skip to content

Commit

Permalink
soundwire: generic_bandwidth_allocation: check required freq accurately
Browse files Browse the repository at this point in the history
Currently, we check curr_dr_freq roughly by "if (curr_dr_freq <=
bus->params.bandwidth)" in sdw_compute_bus_params() and check it
accurately in sdw_select_row_col(). It works if we only support one
freq. But, we need to check it accurately in sdw_select_row_col() to
give it a chance to use a higher freq or use multi-lane.

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/20241218080155.102405-11-yung-chuan.liao@linux.intel.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
  • Loading branch information
Bard Liao authored and Vinod Koul committed Dec 23, 2024
1 parent cf44ae3 commit 4a7927d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/soundwire/generic_bandwidth_allocation.c
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,8 @@ static int sdw_compute_bus_params(struct sdw_bus *bus)
(bus->params.max_dr_freq >> clk_buf[i]) :
clk_buf[i] * SDW_DOUBLE_RATE_FACTOR;

if (curr_dr_freq <= bus->params.bandwidth)
if (curr_dr_freq * (mstr_prop->default_col - 1) <
bus->params.bandwidth * mstr_prop->default_col)
continue;

break;
Expand Down

0 comments on commit 4a7927d

Please sign in to comment.