diff options
author | Jorge Zapata <turran@openmoko.com> | 2009-02-17 17:48:14 +0100 |
---|---|---|
committer | Thomas White <taw@bitwiz.org.uk> | 2009-03-26 21:34:09 +0000 |
commit | d78d95efdfec5a39e470e8e866b864c8fc096c7a (patch) | |
tree | 4bc96b4ecfc1031d49df588ae477bd4e414aa939 /drivers/gpu/drm/drm_drv.c | |
parent | bd3253cdafb13969a3a52e38ec591d8c7df4b5dc (diff) |
Platform's DRM driver loading, unloading and sysfs interface support.
Diffstat (limited to 'drivers/gpu/drm/drm_drv.c')
-rw-r--r-- | drivers/gpu/drm/drm_drv.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/drivers/gpu/drm/drm_drv.c b/drivers/gpu/drm/drm_drv.c index 14c7a23dc15..30546a72d75 100644 --- a/drivers/gpu/drm/drm_drv.c +++ b/drivers/gpu/drm/drm_drv.c @@ -251,6 +251,7 @@ int drm_lastclose(struct drm_device * dev) */ int drm_init(struct drm_driver *driver) { +#ifdef CONFIG_PCI struct pci_dev *pdev = NULL; struct pci_device_id *pid; int i; @@ -280,12 +281,40 @@ int drm_init(struct drm_driver *driver) drm_get_dev(pdev, pid, driver); } } +#endif return 0; } EXPORT_SYMBOL(drm_init); /** + * + * Call this to associate a drm_driver with a platform_device. + * + * \return zero on success or a negative number on failure. + * + * This is a replacement for drm_init(), but for platform drivers. + * In this case, the caller must provide the matching platform_device + * + * since there is no physical bus to scan through. + * + * \sa drm_init + * + */ + +int drm_platform_init(struct drm_driver *driver, struct platform_device *pdev) +{ + DRM_DEBUG("\n"); + + INIT_LIST_HEAD(&driver->device_list); + + return drm_get_platform_dev(pdev, driver); +} + +EXPORT_SYMBOL(drm_platform_init); + + +/** * Called via cleanup_module() at module unload time. * * Cleans up all DRM device, calling drm_lastclose(). |