aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/drm_kms_helper_common.c
diff options
context:
space:
mode:
authorRafael Antognolli <rafael.antognolli@intel.com>2016-01-21 15:10:19 -0800
committerDaniel Vetter <daniel.vetter@ffwll.ch>2016-02-12 14:22:40 +0100
commite94cb37b34eb8a88fe847438dba55c3f18bf024a (patch)
tree1aaa38c44181b51b36c201373d43ed9f3006d635 /drivers/gpu/drm/drm_kms_helper_common.c
parentdrm/kms_helper: Add a common place to call init and exit functions. (diff)
downloadlinux-dev-e94cb37b34eb8a88fe847438dba55c3f18bf024a.tar.xz
linux-dev-e94cb37b34eb8a88fe847438dba55c3f18bf024a.zip
drm/dp: Add a drm_aux-dev module for reading/writing dpcd registers.
This module is heavily based on i2c-dev. Once loaded, it provides one dev node per DP AUX channel, named drm_dp_auxN, where N is an integer. It's possible to know which connector owns this aux channel by looking at the respective sysfs /sys/class/drm_aux_dev/drm_dp_auxN/connector, if the connector device pointer was correctly set in the aux helper struct. Two main operations are provided on the registers read and write. The address of the register to be read or written is given using lseek. The seek position is updated upon read or write. v2: - lseek is used to select the register to read/write - read/write are used instead of ioctl - no blocking_notifier is used, just a direct callback v3: - use drm_dp_aux_dev prefix for public functions - chardev is named drm_dp_auxN - read/write don't allocate a buffer anymore, and transfer up to 16 bytes a time - remove notifier list from the implementation - option on menuconfig is now a boolean - add inline stub functions to avoid breakage when this option is disabled v4: - fix build system changes - actually disable this module when not selected. v5: - Use kref to avoid device closing while still in use - Don't use list, use an idr for storing aux_dev - Remove "connector" attribute - set aux.dev to the connector drm_connector device, instead of drm_device v6: - Use atomic_t for usage count - Use a mutex instead of spinlock for idr lock - Destroy chardev immediately on unregister - other minor suggestions from Ville v7: - style fixes - error handling fixes v8: - more error handling fixes v9: - remove module_init and module_exit, and add drm_dp_aux_dev_init/exit to drm_kms_helper_init/exit. Signed-off-by: Rafael Antognolli <rafael.antognolli@intel.com> Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: http://patchwork.freedesktop.org/patch/msgid/1453417821-2811-3-git-send-email-rafael.antognolli@intel.com
Diffstat (limited to 'drivers/gpu/drm/drm_kms_helper_common.c')
-rw-r--r--drivers/gpu/drm/drm_kms_helper_common.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/drivers/gpu/drm/drm_kms_helper_common.c b/drivers/gpu/drm/drm_kms_helper_common.c
index d3610058de3c..3187c4bb01cb 100644
--- a/drivers/gpu/drm/drm_kms_helper_common.c
+++ b/drivers/gpu/drm/drm_kms_helper_common.c
@@ -27,6 +27,7 @@
#include <drm/drmP.h>
#include <drm/drm_fb_helper.h>
+#include <drm/drm_dp_aux_dev.h>
MODULE_AUTHOR("David Airlie, Jesse Barnes");
MODULE_DESCRIPTION("DRM KMS helper");
@@ -34,13 +35,25 @@ MODULE_LICENSE("GPL and additional rights");
static int __init drm_kms_helper_init(void)
{
+ int ret;
+
/* Call init functions from specific kms helpers here */
- return drm_fb_helper_modinit();
+ ret = drm_fb_helper_modinit();
+ if (ret < 0)
+ goto out;
+
+ ret = drm_dp_aux_dev_init();
+ if (ret < 0)
+ goto out;
+
+out:
+ return ret;
}
static void __exit drm_kms_helper_exit(void)
{
/* Call exit functions from specific kms helpers here */
+ drm_dp_aux_dev_exit();
}
module_init(drm_kms_helper_init);