Skip to content

Commit cbcb7ed

Browse files
plbossartvinodkoul
authored andcommitted
soundwire: intel_auxdevice: add kernel parameter for mclk divider
Add a kernel parameter to work-around discrepancies between hardware and platform firmware, it's not unusual to see e.g. 38.4MHz listed in _DSD properties as the SoundWire clock source, but the hardware may be based on a 19.2 MHz mclk source. Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com> Link: https://lore.kernel.org/r/20241004021850.9758-1-yung-chuan.liao@linux.intel.com Signed-off-by: Vinod Koul <vkoul@kernel.org>
1 parent 71b405b commit cbcb7ed

File tree

3 files changed

+15
-2
lines changed

3 files changed

+15
-2
lines changed

Documentation/admin-guide/kernel-parameters.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,7 @@ is applicable::
159159
SCSI Appropriate SCSI support is enabled.
160160
A lot of drivers have their options described inside
161161
the Documentation/scsi/ sub-directory.
162+
SDW SoundWire support is enabled.
162163
SECURITY Different security models are enabled.
163164
SELINUX SELinux support is enabled.
164165
SERIAL Serial support is enabled.

Documentation/admin-guide/kernel-parameters.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6060,6 +6060,10 @@
60606060
non-zero "wait" parameter. See weight_single
60616061
and weight_many.
60626062

6063+
sdw_mclk_divider=[SDW]
6064+
Specify the MCLK divider for Intel SoundWire buses in
6065+
case the BIOS does not provide the clock rate properly.
6066+
60636067
skew_tick= [KNL,EARLY] Offset the periodic timer tick per cpu to mitigate
60646068
xtime_lock contention on larger systems, and/or RCU lock
60656069
contention on all systems with CONFIG_MAXSMP set.

drivers/soundwire/intel_auxdevice.c

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,10 @@ static int md_flags;
4141
module_param_named(sdw_md_flags, md_flags, int, 0444);
4242
MODULE_PARM_DESC(sdw_md_flags, "SoundWire Intel Master device flags (0x0 all off)");
4343

44+
static int mclk_divider;
45+
module_param_named(sdw_mclk_divider, mclk_divider, int, 0444);
46+
MODULE_PARM_DESC(sdw_mclk_divider, "SoundWire Intel mclk divider");
47+
4448
struct wake_capable_part {
4549
const u16 mfg_id;
4650
const u16 part_id;
@@ -142,8 +146,12 @@ static int sdw_master_read_intel_prop(struct sdw_bus *bus)
142146
"intel-sdw-ip-clock",
143147
&prop->mclk_freq);
144148

145-
/* the values reported by BIOS are the 2x clock, not the bus clock */
146-
prop->mclk_freq /= 2;
149+
if (mclk_divider)
150+
/* use kernel parameter for BIOS or board work-arounds */
151+
prop->mclk_freq /= mclk_divider;
152+
else
153+
/* the values reported by BIOS are the 2x clock, not the bus clock */
154+
prop->mclk_freq /= 2;
147155

148156
fwnode_property_read_u32(link,
149157
"intel-quirk-mask",

0 commit comments

Comments
 (0)