Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros
drm_sysfs.c File Reference
#include <linux/device.h>
#include <linux/kdev_t.h>
#include <linux/gfp.h>
#include <linux/err.h>
#include <linux/export.h>
#include <drm/drm_sysfs.h>
#include <drm/drm_core.h>
#include <drm/drmP.h>

Go to the source code of this file.

Macros

#define to_drm_minor(d)   container_of(d, struct drm_minor, kdev)
 
#define to_drm_connector(d)   container_of(d, struct drm_connector, kdev)
 

: pointer to a string for the name of this class.

drm_sysfs_create - create a struct drm_sysfs_class structure : pointer to the module that is to "own" this struct drm_sysfs_class

This is used to create DRM class pointer that can then be used in calls to drm_sysfs_device_add().

Note, the pointer created here is to be destroyed when finished by making a call to drm_sysfs_destroy().

struct classdrm_sysfs_create (struct module *owner, char *name)
 
void drm_sysfs_destroy (void)
 
int drm_sysfs_connector_add (struct drm_connector *connector)
 
 EXPORT_SYMBOL (drm_sysfs_connector_add)
 
void drm_sysfs_connector_remove (struct drm_connector *connector)
 
 EXPORT_SYMBOL (drm_sysfs_connector_remove)
 
void drm_sysfs_hotplug_event (struct drm_device *dev)
 
 EXPORT_SYMBOL (drm_sysfs_hotplug_event)
 
int drm_sysfs_device_add (struct drm_minor *minor)
 
void drm_sysfs_device_remove (struct drm_minor *minor)
 
int drm_class_device_register (struct device *dev)
 
 EXPORT_SYMBOL_GPL (drm_class_device_register)
 
void drm_class_device_unregister (struct device *dev)
 
 EXPORT_SYMBOL_GPL (drm_class_device_unregister)
 

Macro Definition Documentation

#define to_drm_connector (   d)    container_of(d, struct drm_connector, kdev)

Definition at line 26 of file drm_sysfs.c.

#define to_drm_minor (   d)    container_of(d, struct drm_minor, kdev)

Definition at line 25 of file drm_sysfs.c.

Function Documentation

int drm_class_device_register ( struct device dev)

drm_class_device_register - Register a struct device in the drm class.

: pointer to struct device to register.

should have all relevant members pre-filled with the exception of the class member. In particular, the device_type member must be set.

Definition at line 556 of file drm_sysfs.c.

void drm_class_device_unregister ( struct device dev)

Definition at line 566 of file drm_sysfs.c.

int drm_sysfs_connector_add ( struct drm_connector connector)

drm_sysfs_connector_add - add a connector to sysfs : connector to add

Create a connector device in sysfs, along with its associated connector properties (so far, connection status, dpms, mode list & edid) and generate a hotplug event so userspace knows there's a new connector available.

Note: This routine should only be called once for each registered connector. A second call for an already registered connector will trigger the BUG_ON below.

Definition at line 364 of file drm_sysfs.c.

void drm_sysfs_connector_remove ( struct drm_connector connector)

drm_sysfs_connector_remove - remove an connector device from sysfs : connector to remove

Remove and its associated attributes from sysfs. Note that the device model core will take care of sending the "remove" uevent at this time, so we don't need to do it.

Note: This routine should only be called if the connector was previously successfully registered. If hasn't been registered yet, you'll likely see a panic somewhere deep in sysfs code when called.

Definition at line 454 of file drm_sysfs.c.

struct class* drm_sysfs_create ( struct module owner,
char name 
)
read

Definition at line 98 of file drm_sysfs.c.

void drm_sysfs_destroy ( void  )

drm_sysfs_destroy - destroys DRM class

Destroy the DRM device class.

Definition at line 131 of file drm_sysfs.c.

int drm_sysfs_device_add ( struct drm_minor *  minor)

drm_sysfs_device_add - adds a class device to sysfs for a character driver : DRM device to be added : DRM head in question

Add a DRM device to the DRM's device model class. We use 's PCI device as the parent for the Linux device, and make sure it has a file containing the driver we're using (for userspace compatibility).

Definition at line 499 of file drm_sysfs.c.

void drm_sysfs_device_remove ( struct drm_minor *  minor)

drm_sysfs_device_remove - remove DRM device : DRM device to remove

This call unregisters and cleans up a class device that was created with a call to drm_sysfs_device_add()

Definition at line 538 of file drm_sysfs.c.

void drm_sysfs_hotplug_event ( struct drm_device dev)

drm_sysfs_hotplug_event - generate a DRM uevent : DRM device

Send a uevent for the DRM device specified by . Currently we only set HOTPLUG=1 in the uevent environment, but this could be expanded to deal with other types of events.

Definition at line 479 of file drm_sysfs.c.

EXPORT_SYMBOL ( drm_sysfs_connector_add  )
EXPORT_SYMBOL ( drm_sysfs_connector_remove  )
EXPORT_SYMBOL ( drm_sysfs_hotplug_event  )
EXPORT_SYMBOL_GPL ( drm_class_device_register  )
EXPORT_SYMBOL_GPL ( drm_class_device_unregister  )