summaryrefslogtreecommitdiffstats
path: root/include/linux/component.h
diff options
context:
space:
mode:
authorDaniel Vetter2019-02-08 00:27:57 +0100
committerDaniel Vetter2019-02-08 16:58:03 +0100
commit3521ee994bca90c57b539e106ff7e12a839aa8ea (patch)
tree0153e5c92433680a59b3207b4a0c2f786bfce3e2 /include/linux/component.h
parentcomponent: Add documentation (diff)
downloadkernel-qcow2-linux-3521ee994bca90c57b539e106ff7e12a839aa8ea.tar.gz
kernel-qcow2-linux-3521ee994bca90c57b539e106ff7e12a839aa8ea.tar.xz
kernel-qcow2-linux-3521ee994bca90c57b539e106ff7e12a839aa8ea.zip
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
Diffstat (limited to 'include/linux/component.h')
-rw-r--r--include/linux/component.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/include/linux/component.h b/include/linux/component.h
index 83da25bdf59c..30bcc7e590eb 100644
--- a/include/linux/component.h
+++ b/include/linux/component.h
@@ -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,