mirror of
git://nv-tegra.nvidia.com/linux-nv-oot.git
synced 2025-12-22 09:11:26 +03:00
gpu: nvhost-host1x: Move nvhost_get_* APIs to header file
deprecate definition of below APIs from host1x-nvhost.ko - nvhost_get_default_device nvhost_get_host1x_device nvhost_get_host1x Bug 5176225 Change-Id: I72c3aae62fbc8c297a3871a9337562fe3998621b Signed-off-by: Mainak Sen <msen@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3342019 Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com> GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
This commit is contained in:
@@ -91,77 +91,6 @@ void host1x_writel(struct platform_device *pdev, u32 r, u32 v)
|
||||
}
|
||||
EXPORT_SYMBOL(host1x_writel);
|
||||
|
||||
static const struct of_device_id host1x_match[] = {
|
||||
{ .compatible = "nvidia,tegra234-host1x", },
|
||||
{ .compatible = "nvidia,tegra264-host1x", },
|
||||
{},
|
||||
};
|
||||
|
||||
struct platform_device *nvhost_get_default_device(void)
|
||||
{
|
||||
struct platform_device *host1x_pdev;
|
||||
struct device_node *np;
|
||||
|
||||
np = of_find_matching_node(NULL, host1x_match);
|
||||
if (!np)
|
||||
return NULL;
|
||||
|
||||
host1x_pdev = of_find_device_by_node(np);
|
||||
if (!host1x_pdev)
|
||||
return NULL;
|
||||
|
||||
return host1x_pdev;
|
||||
}
|
||||
EXPORT_SYMBOL(nvhost_get_default_device);
|
||||
|
||||
struct platform_device *nvhost_get_host1x_device(int instance)
|
||||
{
|
||||
struct platform_device *host1x_pdev;
|
||||
struct device_node *np;
|
||||
int numa_node;
|
||||
|
||||
for_each_matching_node(np, host1x_match) {
|
||||
host1x_pdev = of_find_device_by_node(np);
|
||||
if (host1x_pdev) {
|
||||
numa_node = dev_to_node(&host1x_pdev->dev);
|
||||
if (numa_node == NUMA_NO_NODE || numa_node == instance)
|
||||
return host1x_pdev;
|
||||
}
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
EXPORT_SYMBOL(nvhost_get_host1x_device);
|
||||
|
||||
struct host1x *nvhost_get_host1x(struct platform_device *client_pdev)
|
||||
{
|
||||
struct platform_device *host1x_pdev;
|
||||
struct host1x *host1x;
|
||||
int numa_node = NUMA_NO_NODE;
|
||||
|
||||
if (client_pdev)
|
||||
numa_node = dev_to_node(&client_pdev->dev);
|
||||
|
||||
if (numa_node == NUMA_NO_NODE)
|
||||
host1x_pdev = nvhost_get_default_device();
|
||||
else
|
||||
host1x_pdev = nvhost_get_host1x_device(numa_node);
|
||||
|
||||
if (!host1x_pdev) {
|
||||
dev_dbg(&client_pdev->dev, "host1x device not available\n");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
host1x = platform_get_drvdata(host1x_pdev);
|
||||
if (!host1x) {
|
||||
dev_warn(&client_pdev->dev, "No platform data for host1x!\n");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return host1x;
|
||||
}
|
||||
EXPORT_SYMBOL(nvhost_get_host1x);
|
||||
|
||||
static struct device *nvhost_client_device_create(struct platform_device *pdev,
|
||||
struct cdev *cdev,
|
||||
const char *cdev_name,
|
||||
@@ -869,7 +798,5 @@ static struct platform_driver nvhost_driver = {
|
||||
},
|
||||
};
|
||||
|
||||
MODULE_DEVICE_TABLE(of, host1x_match);
|
||||
|
||||
module_platform_driver(nvhost_driver);
|
||||
MODULE_LICENSE("GPL v2");
|
||||
|
||||
Reference in New Issue
Block a user