forked from torvalds/linux
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
drm: Introduce generic probe function for component based masters.
A lot of component based DRM drivers use a variant of the same code as the probe function. They bind the crtc ports in the first iteration and then scan through the child nodes and bind the encoders attached to the remote endpoints. Factor the common code into a separate function called drm_of_component_probe() in order to increase code reuse. Cc: David Airlie <airlied@linux.ie> Signed-off-by: Liviu Dudau <Liviu.Dudau@arm.com> Acked-by: Russell King <rmk+kernel@arm.linux.org.uk> Link: http://patchwork.freedesktop.org/patch/msgid/1445332995-11212-2-git-send-email-Liviu.Dudau@arm.com Acked-by: Eric Anholt <eric@anholt.net> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
- Loading branch information
Showing
2 changed files
with
101 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,31 @@ | ||
#ifndef __DRM_OF_H__ | ||
#define __DRM_OF_H__ | ||
|
||
struct component_master_ops; | ||
struct device; | ||
struct drm_device; | ||
struct device_node; | ||
|
||
#ifdef CONFIG_OF | ||
extern uint32_t drm_of_find_possible_crtcs(struct drm_device *dev, | ||
struct device_node *port); | ||
extern int drm_of_component_probe(struct device *dev, | ||
int (*compare_of)(struct device *, void *), | ||
const struct component_master_ops *m_ops); | ||
#else | ||
static inline uint32_t drm_of_find_possible_crtcs(struct drm_device *dev, | ||
struct device_node *port) | ||
{ | ||
return 0; | ||
} | ||
|
||
static inline int | ||
drm_of_component_probe(struct device *dev, | ||
int (*compare_of)(struct device *, void *), | ||
const struct component_master_ops *m_ops) | ||
{ | ||
return -EINVAL; | ||
} | ||
#endif | ||
|
||
#endif /* __DRM_OF_H__ */ |