]> nv-tegra.nvidia Code Review - linux-2.6.git/blobdiff - drivers/video/tegra/host/vi/vi.c
video: tegra: host: move resources to devices
[linux-2.6.git] / drivers / video / tegra / host / vi / vi.c
index 3ea7f007c13cf4bc971d634214037d893b6af9b8..f4e1cdcc2a75b4618507c99981dd2869d7a7bbcd 100644 (file)
  */
 
 #include <linux/export.h>
+#include <linux/resource.h>
+
+#include <mach/iomap.h>
 
 #include "dev.h"
 #include "bus_client.h"
 
 static int __devinit vi_probe(struct nvhost_device *dev)
 {
+       int err = 0;
+
+       err = nvhost_client_device_get_resources(dev);
+       if (err)
+               return err;
+
        return nvhost_client_device_init(dev);
 }
 
@@ -45,6 +54,13 @@ static int vi_resume(struct nvhost_device *dev)
        return 0;
 }
 
+static struct resource vi_resources = {
+       .name = "regs",
+       .start = TEGRA_VI_BASE,
+       .end = TEGRA_VI_BASE + TEGRA_VI_SIZE - 1,
+       .flags = IORESOURCE_MEM,
+};
+
 struct nvhost_device *vi_device;
 
 static struct nvhost_driver vi_driver = {
@@ -68,6 +84,8 @@ static int __init vi_init(void)
        if (!vi_device)
                return -ENXIO;
 
+       vi_device->resource = &vi_resources;
+       vi_device->num_resources = 1;
        err = nvhost_device_register(vi_device);
        if (err)
                return err;