mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-06-17 20:25:19 +00:00
components: multiple components for a device
Component framework is extended to support multiple components for a struct device. These will be matched with different masters based on its sub component value. We are introducing this, as I915 needs two different components with different subcomponent value, which will be matched to two different component masters(Audio and HDCP) based on the subcomponent values. v2: Add documenation. v3: Rebase on top of updated documenation. v4: Review from Rafael: - Remove redundant "This" from kerneldoc (also in the previous patch) - Streamline the logic in find_component() a bit. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> (v1 code) Signed-off-by: Ramalingam C <ramalingam.c@intel.com> (v1 commit message) Cc: Ramalingam C <ramalingam.c@intel.com> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: Russell King <rmk+kernel@arm.linux.org.uk> Cc: Rafael J. Wysocki <rafael@kernel.org> Cc: Jaroslav Kysela <perex@perex.cz> Cc: Takashi Iwai <tiwai@suse.com> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com> Cc: Jani Nikula <jani.nikula@linux.intel.com> Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Reviewed-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: https://patchwork.freedesktop.org/patch/msgid/20190207232759.14553-2-daniel.vetter@ffwll.ch
This commit is contained in:
parent
4d69c80e0d
commit
3521ee994b
2 changed files with 129 additions and 39 deletions
|
@ -34,6 +34,8 @@ struct component_ops {
|
|||
};
|
||||
|
||||
int component_add(struct device *, const struct component_ops *);
|
||||
int component_add_typed(struct device *dev, const struct component_ops *ops,
|
||||
int subcomponent);
|
||||
void component_del(struct device *, const struct component_ops *);
|
||||
|
||||
int component_bind_all(struct device *master, void *master_data);
|
||||
|
@ -91,6 +93,9 @@ void component_match_add_release(struct device *master,
|
|||
struct component_match **matchptr,
|
||||
void (*release)(struct device *, void *),
|
||||
int (*compare)(struct device *, void *), void *compare_data);
|
||||
void component_match_add_typed(struct device *master,
|
||||
struct component_match **matchptr,
|
||||
int (*compare_typed)(struct device *, int, void *), void *compare_data);
|
||||
|
||||
/**
|
||||
* component_match_add - add a compent match
|
||||
|
@ -101,12 +106,13 @@ void component_match_add_release(struct device *master,
|
|||
*
|
||||
* Adds a new component match to the list stored in @matchptr, which the @master
|
||||
* aggregate driver needs to function. The list of component matches pointed to
|
||||
* by @matchptr must be initialized to NULL before adding the first match.
|
||||
* by @matchptr must be initialized to NULL before adding the first match. This
|
||||
* only matches against components added with component_add().
|
||||
*
|
||||
* The allocated match list in @matchptr is automatically released using devm
|
||||
* actions.
|
||||
*
|
||||
* See also component_match_add_release().
|
||||
* See also component_match_add_release() and component_match_add_typed().
|
||||
*/
|
||||
static inline void component_match_add(struct device *master,
|
||||
struct component_match **matchptr,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue