mirror of
git://nv-tegra.nvidia.com/linux-nv-oot.git
synced 2025-12-24 10:11:26 +03:00
platform: tegra: cvnas: Simplify DT support
The compatible string for CVNAS devices has been updated from "nvidia,tegra-cvnas" to "nvidia,tegra194-cvnas" to conform with the upstream policy of stating the actual device it is supported on. The 'nvidia,tegra-cvnas-hv' has been left as-is because this is a special case for virtualisation. The CVNAS driver is only support for Tegra194 devices and so it is not necessary to check the actual device variant, just the device SKU. Finally, instead of populating platform data in the device-tree table we can simply use the compatible string itself to detect if the device support virtualisation. Bug 3459526 Change-Id: I9755e8277892445b3e6772b8fa0b1960a34d90f4 Signed-off-by: Jon Hunter <jonathanh@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2657909 Reviewed-by: Puneet Saxena <puneets@nvidia.com> Reviewed-by: Sachin Nikam <snikam@nvidia.com>
This commit is contained in:
committed by
Laxman Dewangan
parent
344d952e46
commit
2f44df7fa3
@@ -526,8 +526,8 @@ static ssize_t clk_cap_show(struct device *dev,
|
||||
}
|
||||
|
||||
static const struct of_device_id nvcvnas_of_ids[] = {
|
||||
{ .compatible = "nvidia,tegra-cvnas", .data = (void *)false, },
|
||||
{ .compatible = "nvidia,tegra-cvnas-hv", .data = (void *)true, },
|
||||
{ .compatible = "nvidia,tegra194-cvnas", },
|
||||
{ .compatible = "nvidia,tegra-cvnas-hv", },
|
||||
{ }
|
||||
};
|
||||
MODULE_DEVICE_TABLE(of, nvcvnas_of_ids);
|
||||
@@ -538,10 +538,8 @@ static int nvcvnas_probe(struct platform_device *pdev)
|
||||
int ret;
|
||||
u32 cvsram_slice_data[2];
|
||||
u32 cvsram_reg_data[4];
|
||||
const struct of_device_id *match;
|
||||
|
||||
if (of_machine_is_compatible("nvidia,tegra194") &&
|
||||
tegra_get_sku_id() == 0x9E) {
|
||||
if (tegra_get_sku_id() == 0x9E) {
|
||||
dev_err(&pdev->dev, "CVNAS IP is disabled in SKU.\n");
|
||||
return -ENODEV;
|
||||
}
|
||||
@@ -572,9 +570,8 @@ static int nvcvnas_probe(struct platform_device *pdev)
|
||||
goto err_device_create_file;
|
||||
}
|
||||
|
||||
match = of_match_device(nvcvnas_of_ids, &pdev->dev);
|
||||
if (match)
|
||||
cvnas_dev->virt = (bool)match->data;
|
||||
if (of_device_is_compatible(pdev->dev.of_node, "nvidia,tegra-cvnas-hv"))
|
||||
cvnas_dev->virt = true;
|
||||
|
||||
cvnas_dev->cvreg_iobase = of_iomap(pdev->dev.of_node, 0);
|
||||
if (!cvnas_dev->cvreg_iobase) {
|
||||
|
||||
Reference in New Issue
Block a user