diff options
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"); |
