Lines Matching +full:comp +full:- +full:int
1 // SPDX-License-Identifier: GPL-2.0-or-later
21 struct hda_component *comp; in hda_component_acpi_device_notify() local
22 int i; in hda_component_acpi_device_notify()
24 mutex_lock(&parent->mutex); in hda_component_acpi_device_notify()
25 for (i = 0; i < ARRAY_SIZE(parent->comps); i++) { in hda_component_acpi_device_notify()
26 comp = hda_component_from_index(parent, i); in hda_component_acpi_device_notify()
27 if (comp->dev && comp->acpi_notify) in hda_component_acpi_device_notify()
28 comp->acpi_notify(acpi_device_handle(comp->adev), event, comp->dev); in hda_component_acpi_device_notify()
30 mutex_unlock(&parent->mutex); in hda_component_acpi_device_notify()
34 int hda_component_manager_bind_acpi_notifications(struct hda_codec *cdc, in hda_component_manager_bind_acpi_notifications()
40 struct hda_component *comp; in hda_component_manager_bind_acpi_notifications() local
41 int ret; in hda_component_manager_bind_acpi_notifications()
42 int i; in hda_component_manager_bind_acpi_notifications()
44 adev = parent->comps[0].adev; in hda_component_manager_bind_acpi_notifications()
48 for (i = 0; i < ARRAY_SIZE(parent->comps); i++) { in hda_component_manager_bind_acpi_notifications()
49 comp = hda_component_from_index(parent, i); in hda_component_manager_bind_acpi_notifications()
51 comp->acpi_notifications_supported; in hda_component_manager_bind_acpi_notifications()
55 ret = acpi_install_notify_handler(adev->handle, ACPI_DEVICE_NOTIFY, in hda_component_manager_bind_acpi_notifications()
74 int ret; in hda_component_manager_unbind_acpi_notifications()
76 adev = parent->comps[0].adev; in hda_component_manager_unbind_acpi_notifications()
80 ret = acpi_remove_notify_handler(adev->handle, ACPI_DEVICE_NOTIFY, handler); in hda_component_manager_unbind_acpi_notifications()
87 void hda_component_manager_playback_hook(struct hda_component_parent *parent, int action) in hda_component_manager_playback_hook()
89 struct hda_component *comp; in hda_component_manager_playback_hook() local
90 int i; in hda_component_manager_playback_hook()
92 mutex_lock(&parent->mutex); in hda_component_manager_playback_hook()
93 for (i = 0; i < ARRAY_SIZE(parent->comps); i++) { in hda_component_manager_playback_hook()
94 comp = hda_component_from_index(parent, i); in hda_component_manager_playback_hook()
95 if (comp->dev && comp->pre_playback_hook) in hda_component_manager_playback_hook()
96 comp->pre_playback_hook(comp->dev, action); in hda_component_manager_playback_hook()
98 for (i = 0; i < ARRAY_SIZE(parent->comps); i++) { in hda_component_manager_playback_hook()
99 comp = hda_component_from_index(parent, i); in hda_component_manager_playback_hook()
100 if (comp->dev && comp->playback_hook) in hda_component_manager_playback_hook()
101 comp->playback_hook(comp->dev, action); in hda_component_manager_playback_hook()
103 for (i = 0; i < ARRAY_SIZE(parent->comps); i++) { in hda_component_manager_playback_hook()
104 comp = hda_component_from_index(parent, i); in hda_component_manager_playback_hook()
105 if (comp->dev && comp->post_playback_hook) in hda_component_manager_playback_hook()
106 comp->post_playback_hook(comp->dev, action); in hda_component_manager_playback_hook()
108 mutex_unlock(&parent->mutex); in hda_component_manager_playback_hook()
116 int index;
120 static int hda_comp_match_dev_name(struct device *dev, void *data) in hda_comp_match_dev_name()
124 int n = strlen(p->bus); in hda_comp_match_dev_name()
128 if (strncmp(d, p->bus, n)) in hda_comp_match_dev_name()
134 snprintf(tmp, sizeof(tmp), p->match_str, p->hid, p->index); in hda_comp_match_dev_name()
138 int hda_component_manager_bind(struct hda_codec *cdc, in hda_component_manager_bind()
141 int ret; in hda_component_manager_bind()
144 memset(parent->comps, 0, sizeof(parent->comps)); in hda_component_manager_bind()
146 mutex_lock(&parent->mutex); in hda_component_manager_bind()
148 mutex_unlock(&parent->mutex); in hda_component_manager_bind()
154 int hda_component_manager_init(struct hda_codec *cdc, in hda_component_manager_init()
155 struct hda_component_parent *parent, int count, in hda_component_manager_init()
163 int ret, i; in hda_component_manager_init()
165 if (parent->codec) { in hda_component_manager_init()
167 cdc->core.subsystem_id); in hda_component_manager_init()
168 return -EINVAL; in hda_component_manager_init()
170 parent->codec = cdc; in hda_component_manager_init()
172 mutex_init(&parent->mutex); in hda_component_manager_init()
177 return -ENOMEM; in hda_component_manager_init()
179 sm->bus = bus; in hda_component_manager_init()
180 sm->hid = hid; in hda_component_manager_init()
181 sm->match_str = match_str; in hda_component_manager_init()
182 sm->index = i; in hda_component_manager_init()
199 if (!parent->codec) in hda_component_manager_free()
202 dev = hda_codec_dev(parent->codec); in hda_component_manager_free()
206 parent->codec = NULL; in hda_component_manager_free()