diff options
author | Terje Bergstrom <tbergstrom@nvidia.com> | 2013-03-22 10:34:07 -0400 |
---|---|---|
committer | Thierry Reding <thierry.reding@avionic-design.de> | 2013-04-22 06:39:59 -0400 |
commit | 692e6d7be8099225f04b2d97299bc03479a5fcdb (patch) | |
tree | 13e5a72eeaca72c0b73a668f5f683df6e01619d0 /drivers/gpu/host1x/dev.c | |
parent | c89c0ea63fcd045bdc17076fd078676e1da0c41a (diff) |
gpu: host1x: Remove second host1x driver
Remove second host1x driver, and bind tegra-drm to the new host1x
driver. The logic to parse device tree and track clients is moved
to drm.c.
Signed-off-by: Arto Merilainen <amerilainen@nvidia.com>
Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-by: Thierry Reding <thierry.reding@avionic-design.de>
Tested-by: Thierry Reding <thierry.reding@avionic-design.de>
Tested-by: Erik Faye-Lund <kusmabite@gmail.com>
Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de>
Diffstat (limited to 'drivers/gpu/host1x/dev.c')
-rw-r--r-- | drivers/gpu/host1x/dev.c | 58 |
1 files changed, 56 insertions, 2 deletions
diff --git a/drivers/gpu/host1x/dev.c b/drivers/gpu/host1x/dev.c index 96897242fcc2..8ce9889cefd5 100644 --- a/drivers/gpu/host1x/dev.c +++ b/drivers/gpu/host1x/dev.c | |||
@@ -32,6 +32,19 @@ | |||
32 | #include "channel.h" | 32 | #include "channel.h" |
33 | #include "debug.h" | 33 | #include "debug.h" |
34 | #include "hw/host1x01.h" | 34 | #include "hw/host1x01.h" |
35 | #include "host1x_client.h" | ||
36 | |||
37 | void host1x_set_drm_data(struct device *dev, void *data) | ||
38 | { | ||
39 | struct host1x *host1x = dev_get_drvdata(dev); | ||
40 | host1x->drm_data = data; | ||
41 | } | ||
42 | |||
43 | void *host1x_get_drm_data(struct device *dev) | ||
44 | { | ||
45 | struct host1x *host1x = dev_get_drvdata(dev); | ||
46 | return host1x->drm_data; | ||
47 | } | ||
35 | 48 | ||
36 | void host1x_sync_writel(struct host1x *host1x, u32 v, u32 r) | 49 | void host1x_sync_writel(struct host1x *host1x, u32 v, u32 r) |
37 | { | 50 | { |
@@ -150,6 +163,8 @@ static int host1x_probe(struct platform_device *pdev) | |||
150 | 163 | ||
151 | host1x_debug_init(host); | 164 | host1x_debug_init(host); |
152 | 165 | ||
166 | host1x_drm_alloc(pdev); | ||
167 | |||
153 | return 0; | 168 | return 0; |
154 | 169 | ||
155 | fail_deinit_syncpt: | 170 | fail_deinit_syncpt: |
@@ -168,7 +183,7 @@ static int __exit host1x_remove(struct platform_device *pdev) | |||
168 | return 0; | 183 | return 0; |
169 | } | 184 | } |
170 | 185 | ||
171 | static struct platform_driver platform_driver = { | 186 | static struct platform_driver tegra_host1x_driver = { |
172 | .probe = host1x_probe, | 187 | .probe = host1x_probe, |
173 | .remove = __exit_p(host1x_remove), | 188 | .remove = __exit_p(host1x_remove), |
174 | .driver = { | 189 | .driver = { |
@@ -178,8 +193,47 @@ static struct platform_driver platform_driver = { | |||
178 | }, | 193 | }, |
179 | }; | 194 | }; |
180 | 195 | ||
181 | module_platform_driver(platform_driver); | 196 | static int __init tegra_host1x_init(void) |
197 | { | ||
198 | int err; | ||
199 | |||
200 | err = platform_driver_register(&tegra_host1x_driver); | ||
201 | if (err < 0) | ||
202 | return err; | ||
203 | |||
204 | #ifdef CONFIG_DRM_TEGRA | ||
205 | err = platform_driver_register(&tegra_dc_driver); | ||
206 | if (err < 0) | ||
207 | goto unregister_host1x; | ||
208 | |||
209 | err = platform_driver_register(&tegra_hdmi_driver); | ||
210 | if (err < 0) | ||
211 | goto unregister_dc; | ||
212 | #endif | ||
213 | |||
214 | return 0; | ||
215 | |||
216 | #ifdef CONFIG_DRM_TEGRA | ||
217 | unregister_dc: | ||
218 | platform_driver_unregister(&tegra_dc_driver); | ||
219 | unregister_host1x: | ||
220 | platform_driver_unregister(&tegra_host1x_driver); | ||
221 | return err; | ||
222 | #endif | ||
223 | } | ||
224 | module_init(tegra_host1x_init); | ||
225 | |||
226 | static void __exit tegra_host1x_exit(void) | ||
227 | { | ||
228 | #ifdef CONFIG_DRM_TEGRA | ||
229 | platform_driver_unregister(&tegra_hdmi_driver); | ||
230 | platform_driver_unregister(&tegra_dc_driver); | ||
231 | #endif | ||
232 | platform_driver_unregister(&tegra_host1x_driver); | ||
233 | } | ||
234 | module_exit(tegra_host1x_exit); | ||
182 | 235 | ||
236 | MODULE_AUTHOR("Thierry Reding <thierry.reding@avionic-design.de>"); | ||
183 | MODULE_AUTHOR("Terje Bergstrom <tbergstrom@nvidia.com>"); | 237 | MODULE_AUTHOR("Terje Bergstrom <tbergstrom@nvidia.com>"); |
184 | MODULE_DESCRIPTION("Host1x driver for Tegra products"); | 238 | MODULE_DESCRIPTION("Host1x driver for Tegra products"); |
185 | MODULE_LICENSE("GPL"); | 239 | MODULE_LICENSE("GPL"); |