@@ -327,6 +327,19 @@ static int sdw_select_row_col(struct sdw_bus *bus, int clk_freq)
327
327
return - EINVAL ;
328
328
}
329
329
330
+ static bool is_clock_scaling_supported (struct sdw_bus * bus )
331
+ {
332
+ struct sdw_master_runtime * m_rt ;
333
+ struct sdw_slave_runtime * s_rt ;
334
+
335
+ list_for_each_entry (m_rt , & bus -> m_rt_list , bus_node )
336
+ list_for_each_entry (s_rt , & m_rt -> slave_rt_list , m_rt_node )
337
+ if (!is_clock_scaling_supported_by_slave (s_rt -> slave ))
338
+ return false;
339
+
340
+ return true;
341
+ }
342
+
330
343
/**
331
344
* sdw_compute_bus_params: Compute bus parameters
332
345
*
@@ -352,6 +365,10 @@ static int sdw_compute_bus_params(struct sdw_bus *bus)
352
365
clk_buf = NULL ;
353
366
}
354
367
368
+ /* If dynamic scaling is not supported, don't try higher freq */
369
+ if (!is_clock_scaling_supported (bus ))
370
+ clk_values = 1 ;
371
+
355
372
for (i = 0 ; i < clk_values ; i ++ ) {
356
373
if (!clk_buf )
357
374
curr_dr_freq = bus -> params .max_dr_freq ;
@@ -378,6 +395,12 @@ static int sdw_compute_bus_params(struct sdw_bus *bus)
378
395
return - EINVAL ;
379
396
}
380
397
398
+ if (!mstr_prop -> default_frame_rate || !mstr_prop -> default_row )
399
+ return - EINVAL ;
400
+
401
+ mstr_prop -> default_col = curr_dr_freq / mstr_prop -> default_frame_rate /
402
+ mstr_prop -> default_row ;
403
+
381
404
ret = sdw_select_row_col (bus , curr_dr_freq );
382
405
if (ret < 0 ) {
383
406
dev_err (bus -> dev , "%s: could not find frame configuration for bus dr_freq %d\n" ,
0 commit comments