Skip to content

Commit cf44ae3

Browse files
bardliaovinodkoul
authored andcommitted
soundwire: generic_bandwidth_allocation: correct clk_freq check in sdw_select_row_col
The bits in Column 0 of Rows 0 to 47 are for control word and cannot be used for audio. In practice, entire Column 0 is skipped. 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-10-yung-chuan.liao@linux.intel.com Signed-off-by: Vinod Koul <vkoul@kernel.org>
1 parent 3ddd303 commit cf44ae3

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

drivers/soundwire/generic_bandwidth_allocation.c

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,6 @@ static int sdw_compute_port_params(struct sdw_bus *bus)
302302
static int sdw_select_row_col(struct sdw_bus *bus, int clk_freq)
303303
{
304304
struct sdw_master_prop *prop = &bus->prop;
305-
int frame_int, frame_freq;
306305
int r, c;
307306

308307
for (c = 0; c < SDW_FRAME_COLS; c++) {
@@ -311,11 +310,8 @@ static int sdw_select_row_col(struct sdw_bus *bus, int clk_freq)
311310
sdw_cols[c] != prop->default_col)
312311
continue;
313312

314-
frame_int = sdw_rows[r] * sdw_cols[c];
315-
frame_freq = clk_freq / frame_int;
316-
317-
if ((clk_freq - (frame_freq * SDW_FRAME_CTRL_BITS)) <
318-
bus->params.bandwidth)
313+
if (clk_freq * (sdw_cols[c] - 1) <
314+
bus->params.bandwidth * sdw_cols[c])
319315
continue;
320316

321317
bus->params.row = sdw_rows[r];

0 commit comments

Comments
 (0)