diff options
author | Thomas Hellstrom <thellstrom@vmware.com> | 2009-08-17 10:28:37 -0400 |
---|---|---|
committer | Dave Airlie <airlied@linux.ie> | 2009-08-19 02:08:51 -0400 |
commit | 327c225bd548bf7871f116a0baa5ebdac884e452 (patch) | |
tree | a97343597d446324d37874d148e1e29c3ec7e17c /drivers/gpu/drm/drm_sysfs.c | |
parent | a0724fcf829e5afb66159ef68cb16a805ea11b42 (diff) |
drm: Enable drm drivers to add drm sysfs devices.
Export utility functions for drivers to add specialized devices in the
sysfs drm class subdirectory.
Initially this will be needed form TTM to add a virtual device that
handles power management.
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Signed-off-by: Dave Airlie <airlied@linux.ie>
Diffstat (limited to 'drivers/gpu/drm/drm_sysfs.c')
-rw-r--r-- | drivers/gpu/drm/drm_sysfs.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/drivers/gpu/drm/drm_sysfs.c b/drivers/gpu/drm/drm_sysfs.c index adc179459c25..de154556c405 100644 --- a/drivers/gpu/drm/drm_sysfs.c +++ b/drivers/gpu/drm/drm_sysfs.c | |||
@@ -16,6 +16,7 @@ | |||
16 | #include <linux/kdev_t.h> | 16 | #include <linux/kdev_t.h> |
17 | #include <linux/err.h> | 17 | #include <linux/err.h> |
18 | 18 | ||
19 | #include "drm_sysfs.h" | ||
19 | #include "drm_core.h" | 20 | #include "drm_core.h" |
20 | #include "drmP.h" | 21 | #include "drmP.h" |
21 | 22 | ||
@@ -515,3 +516,27 @@ void drm_sysfs_device_remove(struct drm_minor *minor) | |||
515 | { | 516 | { |
516 | device_unregister(&minor->kdev); | 517 | device_unregister(&minor->kdev); |
517 | } | 518 | } |
519 | |||
520 | |||
521 | /** | ||
522 | * drm_class_device_register - Register a struct device in the drm class. | ||
523 | * | ||
524 | * @dev: pointer to struct device to register. | ||
525 | * | ||
526 | * @dev should have all relevant members pre-filled with the exception | ||
527 | * of the class member. In particular, the device_type member must | ||
528 | * be set. | ||
529 | */ | ||
530 | |||
531 | int drm_class_device_register(struct device *dev) | ||
532 | { | ||
533 | dev->class = drm_class; | ||
534 | return device_register(dev); | ||
535 | } | ||
536 | EXPORT_SYMBOL_GPL(drm_class_device_register); | ||
537 | |||
538 | void drm_class_device_unregister(struct device *dev) | ||
539 | { | ||
540 | return device_unregister(dev); | ||
541 | } | ||
542 | EXPORT_SYMBOL_GPL(drm_class_device_unregister); | ||