Skip to content

Commit c326356

Browse files
plbossartvinodkoul
authored andcommitted
soundwire: intel_auxdevice: start the bus at default frequency
When platform firmware exposes multiple supported bus frequencies, the existing SoundWire support selects the maximum frequency. This is not aligned with the SoundWire 1.2 directions: the MIPI recommendation is to start at a 'safe' speed, compatible with the default frame rate and shape, and only increase the clock when vendor and codec PHY parameters are updated. However, clock changes are not supported for now by the SoundWire core, so in practice this patch has the effect of discarding frequencies different to the implicit default. Dynamic clock changes will be required at some point, and this limitation will be removed after the core is updated, specifically to perform synchronous clock scale changes on manager and peripheral sides with a bank switch. On Intel LunarLake platforms with a 'standard' DSDT, this forces the use of 4.8MHz. On older platforms this patch has no effect. Signed-off-by: Pierre-Louis Bossart <[email protected]> Signed-off-by: Bard Liao <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Vinod Koul <[email protected]>
1 parent fe600c8 commit c326356

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

drivers/soundwire/intel_auxdevice.c

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,9 +210,30 @@ static int sdw_master_read_intel_prop(struct sdw_bus *bus)
210210

211211
static int intel_prop_read(struct sdw_bus *bus)
212212
{
213+
struct sdw_master_prop *prop;
214+
213215
/* Initialize with default handler to read all DisCo properties */
214216
sdw_master_read_prop(bus);
215217

218+
/*
219+
* Only one bus frequency is supported so far, filter
220+
* frequencies reported in the DSDT
221+
*/
222+
prop = &bus->prop;
223+
if (prop->clk_freq && prop->num_clk_freq > 1) {
224+
unsigned int default_bus_frequency;
225+
226+
default_bus_frequency =
227+
prop->default_frame_rate *
228+
prop->default_row *
229+
prop->default_col /
230+
SDW_DOUBLE_RATE_FACTOR;
231+
232+
prop->num_clk_freq = 1;
233+
prop->clk_freq[0] = default_bus_frequency;
234+
prop->max_clk_freq = default_bus_frequency;
235+
}
236+
216237
/* read Intel-specific properties */
217238
sdw_master_read_intel_prop(bus);
218239

0 commit comments

Comments
 (0)