Skip to content

Commit 3dd10d0

Browse files
committed
soundwire: use maximum sdw bus rate when BPT stream is running
We should get as much as bandwidth for the BPT stream. Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
1 parent 0388134 commit 3dd10d0

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

drivers/soundwire/generic_bandwidth_allocation.c

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -566,8 +566,12 @@ static int sdw_compute_bus_params(struct sdw_bus *bus)
566566
clk_buf = NULL;
567567
}
568568

569-
/* If dynamic scaling is not supported, don't try higher freq */
570-
if (!is_clock_scaling_supported(bus))
569+
/*
570+
* If dynamic scaling is not supported, don't try higher freq.
571+
* Use the maximum freq to get maximum bandwidth and no need to try another freq
572+
* if BPT stream is running
573+
*/
574+
if (!is_clock_scaling_supported(bus) || bus->bpt_stream_refcount)
571575
clk_values = 1;
572576

573577
for (i = 0; i < clk_values; i++) {
@@ -578,6 +582,10 @@ static int sdw_compute_bus_params(struct sdw_bus *bus)
578582
(bus->params.max_dr_freq >> clk_buf[i]) :
579583
clk_buf[i] * SDW_DOUBLE_RATE_FACTOR;
580584

585+
/* Use maximum freq to get maximum bandwidth if BPT stream is running */
586+
if (bus->bpt_stream_refcount)
587+
curr_dr_freq = bus->params.max_dr_freq;
588+
581589
if (curr_dr_freq * (mstr_prop->default_col - 1) >=
582590
bus->params.bandwidth * mstr_prop->default_col)
583591
break;

0 commit comments

Comments
 (0)