diff options
| author | Alexandre Courbot <acourbot@nvidia.com> | 2015-01-15 01:29:56 -0500 |
|---|---|---|
| committer | Ben Skeggs <bskeggs@redhat.com> | 2015-01-21 21:15:09 -0500 |
| commit | 055a65d5987a7f246c3fc2297158286882dbdbcf (patch) | |
| tree | e0659efc5e0857acca5682dc8212c62928dad546 /drivers/gpu | |
| parent | 4dc63933ea518501fe9cfe6a8f8797d21095e76f (diff) | |
drm/nouveau: merge nouveau_platform.ko into nouveau.ko
Having the two modules separated causes various unneeded complications,
including having to export symbols accessed between the modules. Make
things simpler by compiling platform device support into nouveau.ko.
Platform device support remains optional and is only compiled on Tegra.
Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
Reviewed-by: Vince Hsu <vinceh@nvidia.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers/gpu')
| -rw-r--r-- | drivers/gpu/drm/nouveau/Kconfig | 2 | ||||
| -rw-r--r-- | drivers/gpu/drm/nouveau/Makefile | 3 | ||||
| -rw-r--r-- | drivers/gpu/drm/nouveau/nouveau_drm.c | 11 | ||||
| -rw-r--r-- | drivers/gpu/drm/nouveau/nouveau_platform.c | 6 | ||||
| -rw-r--r-- | drivers/gpu/drm/nouveau/nouveau_platform.h | 3 |
5 files changed, 14 insertions, 11 deletions
diff --git a/drivers/gpu/drm/nouveau/Kconfig b/drivers/gpu/drm/nouveau/Kconfig index 40afc69a3778..5ab13e7939db 100644 --- a/drivers/gpu/drm/nouveau/Kconfig +++ b/drivers/gpu/drm/nouveau/Kconfig | |||
| @@ -26,7 +26,7 @@ config DRM_NOUVEAU | |||
| 26 | Choose this option for open-source NVIDIA support. | 26 | Choose this option for open-source NVIDIA support. |
| 27 | 27 | ||
| 28 | config NOUVEAU_PLATFORM_DRIVER | 28 | config NOUVEAU_PLATFORM_DRIVER |
| 29 | tristate "Nouveau (NVIDIA) SoC GPUs" | 29 | bool "Nouveau (NVIDIA) SoC GPUs" |
| 30 | depends on DRM_NOUVEAU && ARCH_TEGRA | 30 | depends on DRM_NOUVEAU && ARCH_TEGRA |
| 31 | default y | 31 | default y |
| 32 | help | 32 | help |
diff --git a/drivers/gpu/drm/nouveau/Makefile b/drivers/gpu/drm/nouveau/Makefile index ba6b660d3316..1febf6ec0b69 100644 --- a/drivers/gpu/drm/nouveau/Makefile +++ b/drivers/gpu/drm/nouveau/Makefile | |||
| @@ -394,8 +394,7 @@ nouveau-$(CONFIG_ACPI) += nouveau_acpi.o | |||
| 394 | endif | 394 | endif |
| 395 | nouveau-$(CONFIG_DRM_NOUVEAU_BACKLIGHT) += nouveau_backlight.o | 395 | nouveau-$(CONFIG_DRM_NOUVEAU_BACKLIGHT) += nouveau_backlight.o |
| 396 | nouveau-$(CONFIG_DEBUG_FS) += nouveau_debugfs.o | 396 | nouveau-$(CONFIG_DEBUG_FS) += nouveau_debugfs.o |
| 397 | nouveau-$(CONFIG_NOUVEAU_PLATFORM_DRIVER) += nouveau_platform.o | ||
| 397 | 398 | ||
| 398 | obj-$(CONFIG_DRM_NOUVEAU)+= nouveau.o | 399 | obj-$(CONFIG_DRM_NOUVEAU)+= nouveau.o |
| 399 | 400 | ||
| 400 | # platform driver | ||
| 401 | obj-$(CONFIG_NOUVEAU_PLATFORM_DRIVER) += nouveau_platform.o | ||
diff --git a/drivers/gpu/drm/nouveau/nouveau_drm.c b/drivers/gpu/drm/nouveau/nouveau_drm.c index 65910e3aed0c..1118efa56817 100644 --- a/drivers/gpu/drm/nouveau/nouveau_drm.c +++ b/drivers/gpu/drm/nouveau/nouveau_drm.c | |||
| @@ -52,6 +52,7 @@ | |||
| 52 | #include "nouveau_debugfs.h" | 52 | #include "nouveau_debugfs.h" |
| 53 | #include "nouveau_usif.h" | 53 | #include "nouveau_usif.h" |
| 54 | #include "nouveau_connector.h" | 54 | #include "nouveau_connector.h" |
| 55 | #include "nouveau_platform.h" | ||
| 55 | 56 | ||
| 56 | MODULE_PARM_DESC(config, "option string to pass to driver core"); | 57 | MODULE_PARM_DESC(config, "option string to pass to driver core"); |
| 57 | static char *nouveau_config; | 58 | static char *nouveau_config; |
| @@ -533,7 +534,6 @@ nouveau_drm_device_remove(struct drm_device *dev) | |||
| 533 | nouveau_object_ref(NULL, &device); | 534 | nouveau_object_ref(NULL, &device); |
| 534 | nouveau_object_debug(); | 535 | nouveau_object_debug(); |
| 535 | } | 536 | } |
| 536 | EXPORT_SYMBOL(nouveau_drm_device_remove); | ||
| 537 | 537 | ||
| 538 | static void | 538 | static void |
| 539 | nouveau_drm_remove(struct pci_dev *pdev) | 539 | nouveau_drm_remove(struct pci_dev *pdev) |
| @@ -1083,7 +1083,6 @@ err_free: | |||
| 1083 | 1083 | ||
| 1084 | return ERR_PTR(err); | 1084 | return ERR_PTR(err); |
| 1085 | } | 1085 | } |
| 1086 | EXPORT_SYMBOL(nouveau_platform_device_create_); | ||
| 1087 | 1086 | ||
| 1088 | static int __init | 1087 | static int __init |
| 1089 | nouveau_drm_init(void) | 1088 | nouveau_drm_init(void) |
| @@ -1105,6 +1104,10 @@ nouveau_drm_init(void) | |||
| 1105 | if (!nouveau_modeset) | 1104 | if (!nouveau_modeset) |
| 1106 | return 0; | 1105 | return 0; |
| 1107 | 1106 | ||
| 1107 | #ifdef CONFIG_NOUVEAU_PLATFORM_DRIVER | ||
| 1108 | platform_driver_register(&nouveau_platform_driver); | ||
| 1109 | #endif | ||
| 1110 | |||
| 1108 | nouveau_register_dsm_handler(); | 1111 | nouveau_register_dsm_handler(); |
| 1109 | return drm_pci_init(&driver_pci, &nouveau_drm_pci_driver); | 1112 | return drm_pci_init(&driver_pci, &nouveau_drm_pci_driver); |
| 1110 | } | 1113 | } |
| @@ -1117,6 +1120,10 @@ nouveau_drm_exit(void) | |||
| 1117 | 1120 | ||
| 1118 | drm_pci_exit(&driver_pci, &nouveau_drm_pci_driver); | 1121 | drm_pci_exit(&driver_pci, &nouveau_drm_pci_driver); |
| 1119 | nouveau_unregister_dsm_handler(); | 1122 | nouveau_unregister_dsm_handler(); |
| 1123 | |||
| 1124 | #ifdef CONFIG_NOUVEAU_PLATFORM_DRIVER | ||
| 1125 | platform_driver_unregister(&nouveau_platform_driver); | ||
| 1126 | #endif | ||
| 1120 | } | 1127 | } |
| 1121 | 1128 | ||
| 1122 | module_init(nouveau_drm_init); | 1129 | module_init(nouveau_drm_init); |
diff --git a/drivers/gpu/drm/nouveau/nouveau_platform.c b/drivers/gpu/drm/nouveau/nouveau_platform.c index b307bbedd4c4..34d78b288f97 100644 --- a/drivers/gpu/drm/nouveau/nouveau_platform.c +++ b/drivers/gpu/drm/nouveau/nouveau_platform.c | |||
| @@ -177,9 +177,3 @@ struct platform_driver nouveau_platform_driver = { | |||
| 177 | .probe = nouveau_platform_probe, | 177 | .probe = nouveau_platform_probe, |
| 178 | .remove = nouveau_platform_remove, | 178 | .remove = nouveau_platform_remove, |
| 179 | }; | 179 | }; |
| 180 | |||
| 181 | module_platform_driver(nouveau_platform_driver); | ||
| 182 | |||
| 183 | MODULE_AUTHOR(DRIVER_AUTHOR); | ||
| 184 | MODULE_DESCRIPTION(DRIVER_DESC); | ||
| 185 | MODULE_LICENSE("GPL and additional rights"); | ||
diff --git a/drivers/gpu/drm/nouveau/nouveau_platform.h b/drivers/gpu/drm/nouveau/nouveau_platform.h index 58c28b5653d5..ca22c525329a 100644 --- a/drivers/gpu/drm/nouveau/nouveau_platform.h +++ b/drivers/gpu/drm/nouveau/nouveau_platform.h | |||
| @@ -28,6 +28,7 @@ | |||
| 28 | struct reset_control; | 28 | struct reset_control; |
| 29 | struct clk; | 29 | struct clk; |
| 30 | struct regulator; | 30 | struct regulator; |
| 31 | struct platform_driver; | ||
| 31 | 32 | ||
| 32 | struct nouveau_platform_gpu { | 33 | struct nouveau_platform_gpu { |
| 33 | struct reset_control *rst; | 34 | struct reset_control *rst; |
| @@ -48,4 +49,6 @@ struct nouveau_platform_device { | |||
| 48 | #define nv_device_to_platform(d) \ | 49 | #define nv_device_to_platform(d) \ |
| 49 | container_of(d, struct nouveau_platform_device, device) | 50 | container_of(d, struct nouveau_platform_device, device) |
| 50 | 51 | ||
| 52 | extern struct platform_driver nouveau_platform_driver; | ||
| 53 | |||
| 51 | #endif | 54 | #endif |
