ASoC/soundwire: revisit support for clock registers
Subsystems (4)
Bard Liao
maintainerv2 cover ASoC/soundwire: revisit support for clock registers
SoundWire clock base and scale registers are only supported for SDCA devices. That's fine, but that leaves SoundWire 1.2 with optional registers not supported. This is a corner case that needs to be supported.
The change is mainly on soundwire. But rt1318-sdw.c was applied to ASoC tree recently and not in SoundWire tree yet. @Vinod, Are you good if we go throutgh ASoC tree? Or @Mark can provide a tag and we can go through SoundWire tree?
changes:
v2:
- remove is_sdca flag from rt1318-sdw codec driver, too.
Pierre-Louis Bossart (2):
ASoC/soundwire: remove is_sdca boolean property
soundwire: enable optional clock registers for SoundWire 1.2 devices
drivers/soundwire/bus.c | 11 ++++++----- include/linux/soundwire/sdw.h | 6 ++++-- sound/soc/codecs/rt1316-sdw.c | 1 - sound/soc/codecs/rt1318-sdw.c | 1 - sound/soc/codecs/rt711-sdca-sdw.c | 1 - 5 files changed, 10 insertions(+), 10 deletions(-)
Signature · 1 line
2.25.1
Bard Liao
maintainerPATCH v2 1/2 ASoC/soundwire: remove is_sdca boolean property
From: Pierre-Louis Bossart <[email protected]>
The Device_ID registers already tell us if a device supports the SDCA specification or not, in hindsight we never needed a property when the information is reported by both hardware and ACPI.
--- drivers/soundwire/bus.c | 4 ++-- include/linux/soundwire/sdw.h | 2 -- sound/soc/codecs/rt1316-sdw.c | 1 - sound/soc/codecs/rt1318-sdw.c | 1 - sound/soc/codecs/rt711-sdca-sdw.c | 1 - 5 files changed, 2 insertions(+), 7 deletions(-)
drivers/soundwire/bus.c +2 -2
@@ -1587,7 +1587,7 @@ static int sdw_handle_slave_alerts(struct sdw_slave *slave) goto io_err; } -if (slave->prop.is_sdca) { +if (slave->id.class_id) { ret =sdw_read_no_pm (slave,SDW_DP0_INT );if (ret <0 ) { dev_err(&slave->dev,
@@ -1724,7 +1724,7 @@ static int sdw_handle_slave_alerts(struct sdw_slave *slave) goto io_err; } -if (slave->prop.is_sdca) { +if (slave->id.class_id) { ret =sdw_read_no_pm (slave,SDW_DP0_INT );if (ret <0 ) { dev_err(&slave->dev,
include/linux/soundwire/sdw.h +0 -2
@@ -365,7 +365,6 @@ struct sdw_dpn_prop {* @sink_dpn_prop: Sink Data Port N properties * @scp_int1_mask: SCP_INT1_MASK desired settings * @quirks: bitmask identifying deltas from the MIPI specification -* @is_sdca: the Slave supports the SDCA specification */ struct sdw_slave_prop {u32 mipi_revision;
@@ -389,7 +388,6 @@ struct sdw_slave_prop {struct sdw_dpn_prop *sink_dpn_prop;u8 scp_int1_mask;u32 quirks; -bool is_sdca; };#define SDW_SLAVE_QUIRKS_INVALID_INITIAL_PARITY BIT(0)
sound/soc/codecs/rt1316-sdw.c +0 -1
@@ -203,7 +203,6 @@ static int rt1316_read_prop(struct sdw_slave *slave) prop->scp_int1_mask =SDW_SCP_INT1_BUS_CLASH |SDW_SCP_INT1_PARITY ; prop->quirks =SDW_SLAVE_QUIRKS_INVALID_INITIAL_PARITY ; - prop->is_sdca = true; prop->paging_support = true;
sound/soc/codecs/rt1318-sdw.c +0 -1
@@ -353,7 +353,6 @@ static int rt1318_read_prop(struct sdw_slave *slave) prop->scp_int1_mask =SDW_SCP_INT1_BUS_CLASH |SDW_SCP_INT1_PARITY ; prop->quirks =SDW_SLAVE_QUIRKS_INVALID_INITIAL_PARITY ; - prop->is_sdca = true; prop->paging_support = true;
sound/soc/codecs/rt711-sdca-sdw.c +0 -1
@@ -186,7 +186,6 @@ static int rt711_sdca_read_prop(struct sdw_slave *slave) prop->scp_int1_mask =SDW_SCP_INT1_BUS_CLASH |SDW_SCP_INT1_PARITY ; prop->quirks =SDW_SLAVE_QUIRKS_INVALID_INITIAL_PARITY ; - prop->is_sdca = true; prop->paging_support = true;
Signature · 1 line
2.25.1
Re: [PATCH v2 1/2] ASoC/soundwire: remove is_sdca boolean property
Quoted 5 lines · Bard Liao
From: Pierre-Louis Bossart <[email protected]>
The
Device_IDregisters already tell us if a device supports the SDCA specification or not, in hindsight we never needed a property when the information is reported by both hardware and ACPI.
Vinod Koul
maintainerRe: [PATCH v2 1/2] ASoC/soundwire: remove is_sdca boolean property
Quoted 8 lines · Mark Brown
Quoted 5 lines · Bard Liao
From: Pierre-Louis Bossart <[email protected]>
The
Device_IDregisters already tell us if a device supports the SDCA specification or not, in hindsight we never needed a property when the information is reported by both hardware and ACPI.Acked-by Mark Brown <[email protected]>
Hey Mark,
sound/soc/codecs/rt1318-sdw.c does not exist for me in sdw/next. Can I get a tag for the changes merged into ASoC for this
Thanks
Signature · 1 line
~Vinod
Mark Brown
maintainerRe: [PATCH v2 1/2] ASoC/soundwire: remove is_sdca boolean property
Quoted 4 lines · Vinod Koul
Quoted 2 lines · Mark Brown
Quoted 1 line · Bard Liao
From: Pierre-Louis Bossart <[email protected]>
Quoted 8 lines
Quoted 5 lines
Quoted 3 lines
The
Device_IDregisters already tell us if a device supports the SDCA specification or not, in hindsight we never needed a property when the information is reported by both hardware and ACPI.Acked-by Mark Brown <[email protected]>
sound/soc/codecs/rt1318-sdw.cdoes not exist for me in sdw/next. Can I get a tag for the changes merged into ASoC for this
Not reasonably, that's basically the entire tree since Linus doesn't like branches.
Vinod Koul
maintainerRe: [PATCH v2 1/2] ASoC/soundwire: remove is_sdca boolean property
Quoted 9 lines · Mark Brown
Quoted 7 lines · Vinod Koul
Quoted 6 lines · Mark Brown
Quoted 5 lines · Bard Liao
From: Pierre-Louis Bossart <[email protected]>
The
Device_IDregisters already tell us if a device supports the SDCA specification or not, in hindsight we never needed a property when the information is reported by both hardware and ACPI.
Quoted 7 lines
Quoted 4 lines
Quoted 1 line
Acked-by Mark Brown <[email protected]>
sound/soc/codecs/rt1318-sdw.cdoes not exist for me in sdw/next. Can I get a tag for the changes merged into ASoC for thisNot reasonably, that's basically the entire tree since Linus doesn't like branches.
Okay.
Anyway we are close to merge window, lets postpone this after that
Thanks
Signature · 1 line
~Vinod
Re: [PATCH v2 1/2] ASoC/soundwire: remove is_sdca boolean property
In reply to Bard LiaoQuoted 11 lines · Bard Liao
From: Pierre-Louis Bossart <[email protected]>
The
Device_IDregisters already tell us if a device supports the SDCA specification or not, in hindsight we never needed a property when the information is reported by both hardware and ACPI.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]>---
Thanks,
Charles
Bard Liao
maintainerPATCH v2 2/2 soundwire: enable optional clock registers for SoundWire 1.2 devices
In reply to Bard LiaoFrom: Pierre-Louis Bossart <[email protected]>
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.
--- drivers/soundwire/bus.c | 7 ++++--- include/linux/soundwire/sdw.h | 4 ++++ 2 files changed, 8 insertions(+), 3 deletions(-)
drivers/soundwire/bus.c +4 -3
@@ -1233,10 +1233,11 @@ static int sdw_slave_set_frequency(struct sdw_slave *slave)/* * frequency base and scale registers are required for SDCA -* devices. They may also be used for 1.2+/non-SDCA devices, -* but we will need a DisCo property to cover this case +* devices. They may also be used for 1.2+/non-SDCA devices. +* Driver can set the property, we will need a DisCo property +* to discover this case from platform firmware. */ -if (!slave->id.class_id) +if (!slave->id.class_id && !slave->prop.clock_reg_supported)return 0 ;if (!mclk_freq) {
include/linux/soundwire/sdw.h +4 -0
@@ -365,6 +365,9 @@ struct sdw_dpn_prop {* @sink_dpn_prop: Sink Data Port N properties * @scp_int1_mask: SCP_INT1_MASK desired settings * @quirks: bitmask identifying deltas from the MIPI specification +* @clock_reg_supported: the Peripheral implements the clock base and scale +* registers introduced with the SoundWire 1.2 specification. SDCA devices +* do not need to set this boolean property as the registers are required. */ struct sdw_slave_prop {u32 mipi_revision;
@@ -388,6 +391,7 @@ struct sdw_slave_prop {struct sdw_dpn_prop *sink_dpn_prop;u8 scp_int1_mask;u32 quirks; +bool clock_reg_supported; };#define SDW_SLAVE_QUIRKS_INVALID_INITIAL_PARITY BIT(0)
Signature · 1 line
2.25.1
Re: [PATCH v2 2/2] soundwire: enable optional clock registers for SoundWire 1.2 devices
Quoted 11 lines · Bard Liao
From: Pierre-Louis Bossart <[email protected]>
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]>---
Thanks,
Charles
Quoted 8 lines · Bard Liao
SoundWire clock base and scale registers are only supported for SDCA devices. That's fine, but that leaves SoundWire 1.2 with optional registers not supported. This is a corner case that needs to be supported.
The change is mainly on soundwire. But
rt1318-sdw.cwas applied to ASoC tree recently and not in SoundWire tree yet. @Vinod, Are you good if we go throutgh ASoC tree? Or @Mark can provide a tag and we can go through SoundWire tree?
Applied, thanks
Signature · 1 line
~Vinod