Skip to content

Commit a92d4cb

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 cdadd72 commit a92d4cb

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
@@ -570,8 +570,12 @@ static int sdw_compute_bus_params(struct sdw_bus *bus)
570570
clk_buf = NULL;
571571
}
572572

573-
/* If dynamic scaling is not supported, don't try higher freq */
574-
if (!is_clock_scaling_supported(bus))
573+
/*
574+
* If dynamic scaling is not supported, don't try higher freq.
575+
* Use the maximum freq to get maximum bandwidth and no need to try another freq
576+
* if BPT stream is running
577+
*/
578+
if (!is_clock_scaling_supported(bus) || bus->bpt_stream_refcount)
575579
clk_values = 1;
576580

577581
for (i = 0; i < clk_values; i++) {
@@ -582,6 +586,10 @@ static int sdw_compute_bus_params(struct sdw_bus *bus)
582586
(bus->params.max_dr_freq >> clk_buf[i]) :
583587
clk_buf[i] * SDW_DOUBLE_RATE_FACTOR;
584588

589+
/* Use maximum freq to get maximum bandwidth if BPT stream is running */
590+
if (bus->bpt_stream_refcount)
591+
curr_dr_freq = bus->params.max_dr_freq;
592+
585593
if (curr_dr_freq * (mstr_prop->default_col - 1) >=
586594
bus->params.bandwidth * mstr_prop->default_col)
587595
break;

0 commit comments

Comments
 (0)