diff options
-rw-r--r-- | drivers/video/tegra/host/bus.c | 3 | ||||
-rw-r--r-- | drivers/video/tegra/host/gr3d/gr3d.c | 12 | ||||
-rw-r--r-- | drivers/video/tegra/host/mpe/mpe.c | 12 | ||||
-rw-r--r-- | drivers/video/tegra/host/t20/t20.c | 6 | ||||
-rw-r--r-- | drivers/video/tegra/host/t30/t30.c | 6 | ||||
-rw-r--r-- | include/linux/nvhost.h | 9 |
6 files changed, 21 insertions, 27 deletions
diff --git a/drivers/video/tegra/host/bus.c b/drivers/video/tegra/host/bus.c index 3b769f41170d..758a5ca4ad94 100644 --- a/drivers/video/tegra/host/bus.c +++ b/drivers/video/tegra/host/bus.c @@ -79,7 +79,8 @@ static struct nvhost_device_id *nvhost_bus_match_id(struct nvhost_device *dev, struct nvhost_device_id *id_table) { while (id_table->name[0]) { - if (strcmp(dev->name, id_table->name) == 0) + if (strcmp(dev->name, id_table->name) == 0 + && dev->version == id_table->version) return id_table; id_table++; } diff --git a/drivers/video/tegra/host/gr3d/gr3d.c b/drivers/video/tegra/host/gr3d/gr3d.c index 1ea4414c2cfb..5338ce9edb7a 100644 --- a/drivers/video/tegra/host/gr3d/gr3d.c +++ b/drivers/video/tegra/host/gr3d/gr3d.c @@ -157,7 +157,7 @@ int nvhost_gr3d_prepare_power_off(struct nvhost_device *dev) } enum gr3d_ip_ver { - gr3d_01, + gr3d_01 = 1, gr3d_02, }; @@ -197,8 +197,8 @@ static const struct gr3d_desc gr3d[] = { }; static struct nvhost_device_id gr3d_id[] = { - { "gr3d01", gr3d_01 }, - { "gr3d02", gr3d_02 }, + { "gr3d", gr3d_01 }, + { "gr3d", gr3d_02 }, { }, }; @@ -210,7 +210,7 @@ static int __devinit gr3d_probe(struct nvhost_device *dev, int index = 0; struct nvhost_driver *drv = to_nvhost_driver(dev->dev.driver); - index = id_table->driver_data; + index = id_table->version; drv->finalize_poweron = gr3d[index].finalize_poweron; drv->busy = gr3d[index].busy; @@ -221,10 +221,6 @@ static int __devinit gr3d_probe(struct nvhost_device *dev, drv->prepare_poweroff = gr3d[index].prepare_poweroff; drv->alloc_hwctx_handler = gr3d[index].alloc_hwctx_handler; - /* reset device name so that consistent device name can be - * found in clock tree */ - dev->name = "gr3d"; - nvhost_set_register_sets(tegra_gpu_register_sets()); return nvhost_client_device_init(dev); } diff --git a/drivers/video/tegra/host/mpe/mpe.c b/drivers/video/tegra/host/mpe/mpe.c index 57770ce617d7..9f9055311b35 100644 --- a/drivers/video/tegra/host/mpe/mpe.c +++ b/drivers/video/tegra/host/mpe/mpe.c @@ -593,7 +593,7 @@ int nvhost_mpe_prepare_power_off(struct nvhost_device *dev) } enum mpe_ip_ver { - mpe_01, + mpe_01 = 1, mpe_02, }; @@ -615,8 +615,8 @@ static const struct mpe_desc mpe[] = { }; static struct nvhost_device_id mpe_id[] = { - { "mpe01", mpe_01 }, - { "mpe02", mpe_02 }, + { "mpe", mpe_01 }, + { "mpe", mpe_02 }, { }, }; @@ -629,15 +629,11 @@ static int __devinit mpe_probe(struct nvhost_device *dev, int index = 0; struct nvhost_driver *drv = to_nvhost_driver(dev->dev.driver); - index = id_table->driver_data; + index = id_table->version; drv->prepare_poweroff = mpe[index].prepare_poweroff; drv->alloc_hwctx_handler = mpe[index].alloc_hwctx_handler; - /* reset device name so that consistent device name can be - * found in clock tree */ - dev->name = "mpe"; - err = nvhost_client_device_get_resources(dev); if (err) return err; diff --git a/drivers/video/tegra/host/t20/t20.c b/drivers/video/tegra/host/t20/t20.c index 9b27c74ffd48..93e73e501ce0 100644 --- a/drivers/video/tegra/host/t20/t20.c +++ b/drivers/video/tegra/host/t20/t20.c @@ -118,7 +118,8 @@ static struct nvhost_device tegra_display01_device = { }; static struct nvhost_device tegra_gr3d01_device = { - .name = "gr3d01", + .name = "gr3d", + .version = 1, .id = -1, .index = 1, .syncpts = BIT(NVSYNCPT_3D), @@ -204,7 +205,8 @@ static struct resource tegra_mpe01_resources[] = { }; static struct nvhost_device tegra_mpe01_device = { - .name = "mpe01", + .name = "mpe", + .version = 1, .id = -1, .resource = tegra_mpe01_resources, .num_resources = ARRAY_SIZE(tegra_mpe01_resources), diff --git a/drivers/video/tegra/host/t30/t30.c b/drivers/video/tegra/host/t30/t30.c index 9f43036c8523..b74c561c05aa 100644 --- a/drivers/video/tegra/host/t30/t30.c +++ b/drivers/video/tegra/host/t30/t30.c @@ -118,7 +118,8 @@ static struct nvhost_device tegra_display01_device = { }; static struct nvhost_device tegra_gr3d02_device = { - .name = "gr3d02", + .name = "gr3d", + .version = 2, .id = -1, .index = 1, .syncpts = BIT(NVSYNCPT_3D), @@ -210,7 +211,8 @@ static struct resource tegra_mpe01_resources[] = { }; static struct nvhost_device tegra_mpe02_device = { - .name = "mpe02", + .name = "mpe", + .version = 2, .id = -1, .resource = tegra_mpe01_resources, .num_resources = ARRAY_SIZE(tegra_mpe01_resources), diff --git a/include/linux/nvhost.h b/include/linux/nvhost.h index 1293cec7cd75..382a54f2370c 100644 --- a/include/linux/nvhost.h +++ b/include/linux/nvhost.h @@ -36,7 +36,7 @@ struct nvhost_master; struct nvhost_device_id { char name[NVHOST_NAME_SIZE]; - unsigned long driver_data; + unsigned long version; }; struct nvhost_clock { @@ -52,11 +52,8 @@ enum nvhost_device_powerstate_t { }; struct nvhost_device { - /* device name: its format is of type - - * <name><ip-version>.<instance> - * e.g.: gr3d01 = gr3d ip version 01 used in tegra2 - * no instance number means hardware supports single instance */ - const char *name; + const char *name; /* device name */ + int version; /* ip version number of device */ struct device dev; /* Linux device struct */ int id; /* Separates clients of same hw */ int index; /* Hardware channel number */ |