iommu/rockchip: make compatible to iommu who use "hclk" in dts

Change-Id: If7c5c48e78cdbf189dd445980a61f4ffeb7082ce
Signed-off-by: Simon Xue <xxm@rock-chips.com>
This commit is contained in:
Simon Xue
2021-04-06 16:41:07 +08:00
committed by Tao Huang
parent 8b158ee7e1
commit 7fafd907ae

View File

@@ -1221,8 +1221,18 @@ static int rk_iommu_probe(struct platform_device *pdev)
if (!iommu->clocks)
return -ENOMEM;
for (i = 0; i < iommu->num_clocks; ++i)
iommu->clocks[i].id = rk_iommu_clocks[i];
for (i = 0; i < iommu->num_clocks; ++i) {
err = of_property_match_string(dev->of_node, "clock-names",
rk_iommu_clocks[i]);
if (err < 0) {
if (!strcmp(rk_iommu_clocks[i], "iface")) {
iommu->clocks[i].id = "hclk";
dev_warn(dev, "iommu hclk need to update to iface\n");
}
} else {
iommu->clocks[i].id = rk_iommu_clocks[i];
}
}
/*
* iommu clocks should be present for all new devices and devicetrees