]> rtime.felk.cvut.cz Git - sojka/nv-tegra/linux-3.10.git/commitdiff
video: tegra: host: make get_aperture() public API
authorDeepak Nibade <dnibade@nvidia.com>
Wed, 6 May 2015 15:25:35 +0000 (20:55 +0530)
committerArto Merilainen <amerilainen@nvidia.com>
Mon, 18 May 2015 08:24:22 +0000 (01:24 -0700)
Make get_aperture() as public API by declaring it in bus_client.h

Also, add one more parameter to it which specifies index of
the aperture to be returned

Bug 1611482

Change-Id: I88877fc9a7c5660202d68981beaa5d680ddc0bba
Signed-off-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-on: http://git-master/r/741242
Reviewed-by: Arto Merilainen <amerilainen@nvidia.com>
Tested-by: Arto Merilainen <amerilainen@nvidia.com>
drivers/video/tegra/host/bus_client.c
drivers/video/tegra/host/bus_client.h

index 4a85243278e7c92d9f6d118bf5295686e0396b62..9f4df9a2c0df5e0aed9ff757fe7bf333dbc16d95 100644 (file)
@@ -85,19 +85,19 @@ static int validate_reg(struct platform_device *ndev, u32 offset, int count)
        return err;
 }
 
-static __iomem void *get_aperture(struct platform_device *pdev)
+void __iomem *get_aperture(struct platform_device *pdev, int index)
 {
        struct nvhost_device_data *pdata = platform_get_drvdata(pdev);
 
        if (pdata->master)
                pdata = platform_get_drvdata(pdata->master);
 
-       return pdata->aperture[0];
+       return pdata->aperture[index];
 }
 
 void host1x_writel(struct platform_device *pdev, u32 r, u32 v)
 {
-       void __iomem *addr = get_aperture(pdev) + r;
+       void __iomem *addr = get_aperture(pdev, 0) + r;
        nvhost_dbg(dbg_reg, " d=%s r=0x%x v=0x%x", pdev->name, r, v);
        writel(v, addr);
 }
@@ -105,7 +105,7 @@ EXPORT_SYMBOL_GPL(host1x_writel);
 
 u32 host1x_readl(struct platform_device *pdev, u32 r)
 {
-       void __iomem *addr = get_aperture(pdev) + r;
+       void __iomem *addr = get_aperture(pdev, 0) + r;
        u32 v;
 
        nvhost_dbg(dbg_reg, " d=%s r=0x%x", pdev->name, r);
index bf1d3680a74a001dc4b48d62eea24a6768210187..5ab81e396eaf2d2769a4f4090fd4d1f311cd8bb3 100644 (file)
@@ -34,6 +34,8 @@ int nvhost_write_module_regs(struct platform_device *ndev,
 
 int nvhost_client_user_init(struct platform_device *dev);
 
+void __iomem *get_aperture(struct platform_device *pdev, int index);
+
 int nvhost_device_get_resources(struct platform_device *dev);
 
 #endif