Skip to content

Commit

Permalink
drm/dp: Move DP declarations into separate header file
Browse files Browse the repository at this point in the history
Split the DP declarations from other helpers before moving the
DP functions into a separate module.

v2:
	* forward-declare struct drm_dp_aux (Jani)
	* add include guards in drm_dp_helper_internal.h

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Acked-by: Daniel Vetter <daniel@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/20220114114535.29157-3-tzimmermann@suse.de
  • Loading branch information
Thomas Zimmermann committed Jan 17, 2022
1 parent dfacce5 commit 3681eb2
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 30 deletions.
27 changes: 0 additions & 27 deletions drivers/gpu/drm/drm_crtc_helper_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,36 +28,9 @@

#include <drm/drm_connector.h>
#include <drm/drm_crtc.h>
#include <drm/drm_dp_helper.h>
#include <drm/drm_encoder.h>
#include <drm/drm_modes.h>

/* drm_dp_aux_dev.c */
#ifdef CONFIG_DRM_DP_AUX_CHARDEV
int drm_dp_aux_dev_init(void);
void drm_dp_aux_dev_exit(void);
int drm_dp_aux_register_devnode(struct drm_dp_aux *aux);
void drm_dp_aux_unregister_devnode(struct drm_dp_aux *aux);
#else
static inline int drm_dp_aux_dev_init(void)
{
return 0;
}

static inline void drm_dp_aux_dev_exit(void)
{
}

static inline int drm_dp_aux_register_devnode(struct drm_dp_aux *aux)
{
return 0;
}

static inline void drm_dp_aux_unregister_devnode(struct drm_dp_aux *aux)
{
}
#endif

/* drm_probe_helper.c */
enum drm_mode_status drm_crtc_mode_valid(struct drm_crtc *crtc,
const struct drm_display_mode *mode);
Expand Down
2 changes: 1 addition & 1 deletion drivers/gpu/drm/drm_dp_aux_dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
#include <drm/drm_dp_mst_helper.h>
#include <drm/drm_print.h>

#include "drm_crtc_helper_internal.h"
#include "drm_dp_helper_internal.h"

struct drm_dp_aux_dev {
unsigned index;
Expand Down
2 changes: 1 addition & 1 deletion drivers/gpu/drm/drm_dp_helper.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
#include <drm/drm_dp_mst_helper.h>
#include <drm/drm_panel.h>

#include "drm_crtc_helper_internal.h"
#include "drm_dp_helper_internal.h"

struct dp_aux_backlight {
struct backlight_device *base;
Expand Down
33 changes: 33 additions & 0 deletions drivers/gpu/drm/drm_dp_helper_internal.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/* SPDX-License-Identifier: MIT */

#ifndef DRM_DP_HELPER_INTERNAL_H
#define DRM_DP_HELPER_INTERNAL_H

struct drm_dp_aux;

#ifdef CONFIG_DRM_DP_AUX_CHARDEV
int drm_dp_aux_dev_init(void);
void drm_dp_aux_dev_exit(void);
int drm_dp_aux_register_devnode(struct drm_dp_aux *aux);
void drm_dp_aux_unregister_devnode(struct drm_dp_aux *aux);
#else
static inline int drm_dp_aux_dev_init(void)
{
return 0;
}

static inline void drm_dp_aux_dev_exit(void)
{
}

static inline int drm_dp_aux_register_devnode(struct drm_dp_aux *aux)
{
return 0;
}

static inline void drm_dp_aux_unregister_devnode(struct drm_dp_aux *aux)
{
}
#endif

#endif
2 changes: 1 addition & 1 deletion drivers/gpu/drm/drm_dp_mst_topology.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
#include <drm/drm_print.h>
#include <drm/drm_probe_helper.h>

#include "drm_crtc_helper_internal.h"
#include "drm_dp_helper_internal.h"
#include "drm_dp_mst_topology_internal.h"

/**
Expand Down
1 change: 1 addition & 0 deletions drivers/gpu/drm/drm_kms_helper_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@

#include <drm/drm_print.h>

#include "drm_dp_helper_internal.h"
#include "drm_crtc_helper_internal.h"

MODULE_AUTHOR("David Airlie, Jesse Barnes");
Expand Down

0 comments on commit 3681eb2

Please sign in to comment.