Skip to content

Commit ffa1726

Browse files
plbossartvinodkoul
authored andcommitted
soundwire: enable optional clock registers for SoundWire 1.2 devices
The bus supports the mandatory clock registers for SDCA devices, these registers can also be optionally supported by SoundWire 1.2 devices that don't follow the SDCA class specification. Signed-off-by: Pierre-Louis Bossart <[email protected]> Reviewed-by: Rander Wang <[email protected]> Reviewed-by: Péter Ujfalusi <[email protected]> Signed-off-by: Bard Liao <[email protected]> Reviewed-by: Charles Keepax <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Vinod Koul <[email protected]>
1 parent be505ba commit ffa1726

File tree

2 files changed

+8
-3
lines changed
  • drivers/soundwire
  • include/linux/soundwire

2 files changed

+8
-3
lines changed

drivers/soundwire/bus.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1233,10 +1233,11 @@ static int sdw_slave_set_frequency(struct sdw_slave *slave)
12331233

12341234
/*
12351235
* frequency base and scale registers are required for SDCA
1236-
* devices. They may also be used for 1.2+/non-SDCA devices,
1237-
* but we will need a DisCo property to cover this case
1236+
* devices. They may also be used for 1.2+/non-SDCA devices.
1237+
* Driver can set the property, we will need a DisCo property
1238+
* to discover this case from platform firmware.
12381239
*/
1239-
if (!slave->id.class_id)
1240+
if (!slave->id.class_id && !slave->prop.clock_reg_supported)
12401241
return 0;
12411242

12421243
if (!mclk_freq) {

include/linux/soundwire/sdw.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -365,6 +365,9 @@ struct sdw_dpn_prop {
365365
* @sink_dpn_prop: Sink Data Port N properties
366366
* @scp_int1_mask: SCP_INT1_MASK desired settings
367367
* @quirks: bitmask identifying deltas from the MIPI specification
368+
* @clock_reg_supported: the Peripheral implements the clock base and scale
369+
* registers introduced with the SoundWire 1.2 specification. SDCA devices
370+
* do not need to set this boolean property as the registers are required.
368371
*/
369372
struct sdw_slave_prop {
370373
u32 mipi_revision;
@@ -388,6 +391,7 @@ struct sdw_slave_prop {
388391
struct sdw_dpn_prop *sink_dpn_prop;
389392
u8 scp_int1_mask;
390393
u32 quirks;
394+
bool clock_reg_supported;
391395
};
392396

393397
#define SDW_SLAVE_QUIRKS_INVALID_INITIAL_PARITY BIT(0)

0 commit comments

Comments
 (0)