Commit 085f4ace authored by Pierre-Louis Bossart's avatar Pierre-Louis Bossart Committed by Vinod Koul

soundwire: intel: read mclk_freq property from firmware

The BIOS provides an Intel-specific property, let's use it to avoid
hard-coded clock dividers.
Signed-off-by: default avatarPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20190806005522.22642-12-pierre-louis.bossart@linux.intel.comSigned-off-by: default avatarVinod Koul <vkoul@kernel.org>
parent 82fc8d06
...@@ -808,11 +808,37 @@ static int intel_register_dai(struct sdw_intel *sdw) ...@@ -808,11 +808,37 @@ static int intel_register_dai(struct sdw_intel *sdw)
dais, num_dai); dais, num_dai);
} }
static int sdw_master_read_intel_prop(struct sdw_bus *bus)
{
struct sdw_master_prop *prop = &bus->prop;
struct fwnode_handle *link;
char name[32];
int nval, i;
/* Find master handle */
snprintf(name, sizeof(name),
"mipi-sdw-link-%d-subproperties", bus->link_id);
link = device_get_named_child_node(bus->dev, name);
if (!link) {
dev_err(bus->dev, "Master node %s not found\n", name);
return -EIO;
}
fwnode_property_read_u32(link,
"intel-sdw-ip-clock",
&prop->mclk_freq);
return 0;
}
static int intel_prop_read(struct sdw_bus *bus) static int intel_prop_read(struct sdw_bus *bus)
{ {
/* Initialize with default handler to read all DisCo properties */ /* Initialize with default handler to read all DisCo properties */
sdw_master_read_prop(bus); sdw_master_read_prop(bus);
/* read Intel-specific properties */
sdw_master_read_intel_prop(bus);
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment