thesofproject / linux

Linux kernel source tree
Other
91 stars 133 forks source link

soundwire: stream: set peripheral frequency before programing port params #5063

Closed bardliao closed 5 months ago

bardliao commented 5 months ago

Currently, we set only peripheral frequency when the peripheral is initialized. However, curr_dr_freq may change after a stream is prepared. set peripheral frequency before sdw_program_slave_port_params() to ensure peripheral frequency is correct when a stream starts.

bardliao commented 5 months ago

@plbossart The issue is that bus->params.curr_dr_freq will be assigned in sdw_compute_bus_params(). But we call sdw_slave_set_frequency() only when a peripheral is attached. And we set scale based on mclk and curr_dr_freq in sdw_slave_set_frequency(). The bus->params.curr_dr_freq is set to bus->params.max_dr_freq in sdw_bus_master_add(), and will be calculated in sdw_compute_bus_params() based on required bandwidth. It means peripherals may use a scale based on a wrong curr_dr_freq value.

bardliao commented 5 months ago

Close it as we will use single clock rate for now.