aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu
diff options
context:
space:
mode:
authorAlexandre Courbot <acourbot@nvidia.com>2015-01-15 01:29:56 -0500
committerBen Skeggs <bskeggs@redhat.com>2015-01-21 21:15:09 -0500
commit055a65d5987a7f246c3fc2297158286882dbdbcf (patch)
treee0659efc5e0857acca5682dc8212c62928dad546 /drivers/gpu
parent4dc63933ea518501fe9cfe6a8f8797d21095e76f (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/Kconfig2
-rw-r--r--drivers/gpu/drm/nouveau/Makefile3
-rw-r--r--drivers/gpu/drm/nouveau/nouveau_drm.c11
-rw-r--r--drivers/gpu/drm/nouveau/nouveau_platform.c6
-rw-r--r--drivers/gpu/drm/nouveau/nouveau_platform.h3
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
28config NOUVEAU_PLATFORM_DRIVER 28config 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
394endif 394endif
395nouveau-$(CONFIG_DRM_NOUVEAU_BACKLIGHT) += nouveau_backlight.o 395nouveau-$(CONFIG_DRM_NOUVEAU_BACKLIGHT) += nouveau_backlight.o
396nouveau-$(CONFIG_DEBUG_FS) += nouveau_debugfs.o 396nouveau-$(CONFIG_DEBUG_FS) += nouveau_debugfs.o
397nouveau-$(CONFIG_NOUVEAU_PLATFORM_DRIVER) += nouveau_platform.o
397 398
398obj-$(CONFIG_DRM_NOUVEAU)+= nouveau.o 399obj-$(CONFIG_DRM_NOUVEAU)+= nouveau.o
399 400
400# platform driver
401obj-$(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
56MODULE_PARM_DESC(config, "option string to pass to driver core"); 57MODULE_PARM_DESC(config, "option string to pass to driver core");
57static char *nouveau_config; 58static 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}
536EXPORT_SYMBOL(nouveau_drm_device_remove);
537 537
538static void 538static void
539nouveau_drm_remove(struct pci_dev *pdev) 539nouveau_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}
1086EXPORT_SYMBOL(nouveau_platform_device_create_);
1087 1086
1088static int __init 1087static int __init
1089nouveau_drm_init(void) 1088nouveau_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
1122module_init(nouveau_drm_init); 1129module_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
181module_platform_driver(nouveau_platform_driver);
182
183MODULE_AUTHOR(DRIVER_AUTHOR);
184MODULE_DESCRIPTION(DRIVER_DESC);
185MODULE_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 @@
28struct reset_control; 28struct reset_control;
29struct clk; 29struct clk;
30struct regulator; 30struct regulator;
31struct platform_driver;
31 32
32struct nouveau_platform_gpu { 33struct 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
52extern struct platform_driver nouveau_platform_driver;
53
51#endif 54#endif