[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20241003070650.62787-11-yung-chuan.liao@linux.intel.com>
Date: Thu, 3 Oct 2024 15:06:46 +0800
From: Bard Liao <yung-chuan.liao@...ux.intel.com>
To: linux-sound@...r.kernel.org,
vkoul@...nel.org
Cc: vinod.koul@...aro.org,
linux-kernel@...r.kernel.org,
pierre-louis.bossart@...ux.dev,
bard.liao@...el.com
Subject: [PATCH v2 RESEND 10/14] soundwire: mipi_disco: add support for clock-scales property
From: Pierre-Louis Bossart <pierre-louis.bossart@...ux.intel.com>
The DisCo for SoundWire 2.0 spec adds support for the
'mipi-sdw-supported-clock-scales' property, which is just a
rename. Add in a backwards-compatible manner.
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@...ux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@...ux.intel.com>
---
drivers/soundwire/mipi_disco.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/drivers/soundwire/mipi_disco.c b/drivers/soundwire/mipi_disco.c
index 99253f4c9a38..5f42d23bbc85 100644
--- a/drivers/soundwire/mipi_disco.c
+++ b/drivers/soundwire/mipi_disco.c
@@ -51,6 +51,7 @@ int sdw_master_read_prop(struct sdw_bus *bus)
{
struct sdw_master_prop *prop = &bus->prop;
struct fwnode_handle *link;
+ const char *scales_prop;
char name[32];
int nval;
int ret;
@@ -112,7 +113,12 @@ int sdw_master_read_prop(struct sdw_bus *bus)
}
}
- nval = fwnode_property_count_u32(link, "mipi-sdw-supported-clock-gears");
+ scales_prop = "mipi-sdw-supported-clock-scales";
+ nval = fwnode_property_count_u32(link, scales_prop);
+ if (nval == 0) {
+ scales_prop = "mipi-sdw-supported-clock-gears";
+ nval = fwnode_property_count_u32(link, scales_prop);
+ }
if (nval > 0) {
prop->num_clk_gears = nval;
prop->clk_gears = devm_kcalloc(bus->dev, prop->num_clk_gears,
@@ -124,7 +130,7 @@ int sdw_master_read_prop(struct sdw_bus *bus)
}
ret = fwnode_property_read_u32_array(link,
- "mipi-sdw-supported-clock-gears",
+ scales_prop,
prop->clk_gears,
prop->num_clk_gears);
if (ret < 0)
--
2.43.0
Powered by blists - more mailing lists