Lines Matching refs:mctl

37 	struct media_ctl *mctl;  in snd_media_stream_init()  local
52 mctl = kzalloc(sizeof(*mctl), GFP_KERNEL); in snd_media_stream_init()
53 if (!mctl) in snd_media_stream_init()
56 mctl->media_dev = mdev; in snd_media_stream_init()
59 mctl->media_entity.function = MEDIA_ENT_F_AUDIO_PLAYBACK; in snd_media_stream_init()
60 mctl->media_pad.flags = MEDIA_PAD_FL_SOURCE; in snd_media_stream_init()
64 mctl->media_entity.function = MEDIA_ENT_F_AUDIO_CAPTURE; in snd_media_stream_init()
65 mctl->media_pad.flags = MEDIA_PAD_FL_SINK; in snd_media_stream_init()
68 mctl->media_entity.name = pcm->name; in snd_media_stream_init()
69 media_entity_pads_init(&mctl->media_entity, 1, &mctl->media_pad); in snd_media_stream_init()
70 ret = media_device_register_entity(mctl->media_dev, in snd_media_stream_init()
71 &mctl->media_entity); in snd_media_stream_init()
75 mctl->intf_devnode = media_devnode_create(mdev, intf_type, 0, in snd_media_stream_init()
78 if (!mctl->intf_devnode) { in snd_media_stream_init()
82 mctl->intf_link = media_create_intf_link(&mctl->media_entity, in snd_media_stream_init()
83 &mctl->intf_devnode->intf, in snd_media_stream_init()
85 if (!mctl->intf_link) { in snd_media_stream_init()
95 &mctl->media_entity, 0, in snd_media_stream_init()
103 subs->media_ctl = mctl; in snd_media_stream_init()
107 media_remove_intf_link(mctl->intf_link); in snd_media_stream_init()
109 media_devnode_remove(mctl->intf_devnode); in snd_media_stream_init()
111 media_device_unregister_entity(&mctl->media_entity); in snd_media_stream_init()
113 kfree(mctl); in snd_media_stream_init()
119 struct media_ctl *mctl = subs->media_ctl; in snd_media_stream_delete() local
121 if (mctl) { in snd_media_stream_delete()
124 mdev = mctl->media_dev; in snd_media_stream_delete()
126 media_devnode_remove(mctl->intf_devnode); in snd_media_stream_delete()
127 media_device_unregister_entity(&mctl->media_entity); in snd_media_stream_delete()
128 media_entity_cleanup(&mctl->media_entity); in snd_media_stream_delete()
130 kfree(mctl); in snd_media_stream_delete()
137 struct media_ctl *mctl = subs->media_ctl; in snd_media_start_pipeline() local
140 if (!mctl) in snd_media_start_pipeline()
143 mutex_lock(&mctl->media_dev->graph_mutex); in snd_media_start_pipeline()
144 if (mctl->media_dev->enable_source) in snd_media_start_pipeline()
145 ret = mctl->media_dev->enable_source(&mctl->media_entity, in snd_media_start_pipeline()
146 &mctl->media_pipe); in snd_media_start_pipeline()
147 mutex_unlock(&mctl->media_dev->graph_mutex); in snd_media_start_pipeline()
153 struct media_ctl *mctl = subs->media_ctl; in snd_media_stop_pipeline() local
155 if (!mctl) in snd_media_stop_pipeline()
158 mutex_lock(&mctl->media_dev->graph_mutex); in snd_media_stop_pipeline()
159 if (mctl->media_dev->disable_source) in snd_media_stop_pipeline()
160 mctl->media_dev->disable_source(&mctl->media_entity); in snd_media_stop_pipeline()
161 mutex_unlock(&mctl->media_dev->graph_mutex); in snd_media_stop_pipeline()
170 struct media_mixer_ctl *mctl; in snd_media_mixer_init() local
193 mctl = kzalloc(sizeof(*mctl), GFP_KERNEL); in snd_media_mixer_init()
194 if (!mctl) in snd_media_mixer_init()
197 mctl->media_dev = mdev; in snd_media_mixer_init()
198 mctl->media_entity.function = MEDIA_ENT_F_AUDIO_MIXER; in snd_media_mixer_init()
199 mctl->media_entity.name = chip->card->mixername; in snd_media_mixer_init()
200 mctl->media_pad[0].flags = MEDIA_PAD_FL_SINK; in snd_media_mixer_init()
201 mctl->media_pad[1].flags = MEDIA_PAD_FL_SOURCE; in snd_media_mixer_init()
202 mctl->media_pad[2].flags = MEDIA_PAD_FL_SOURCE; in snd_media_mixer_init()
203 media_entity_pads_init(&mctl->media_entity, MEDIA_MIXER_PAD_MAX, in snd_media_mixer_init()
204 mctl->media_pad); in snd_media_mixer_init()
205 ret = media_device_register_entity(mctl->media_dev, in snd_media_mixer_init()
206 &mctl->media_entity); in snd_media_mixer_init()
208 kfree(mctl); in snd_media_mixer_init()
212 mctl->intf_link = media_create_intf_link(&mctl->media_entity, in snd_media_mixer_init()
215 if (!mctl->intf_link) { in snd_media_mixer_init()
216 media_device_unregister_entity(&mctl->media_entity); in snd_media_mixer_init()
217 media_entity_cleanup(&mctl->media_entity); in snd_media_mixer_init()
218 kfree(mctl); in snd_media_mixer_init()
221 mctl->intf_devnode = ctl_intf; in snd_media_mixer_init()
222 mixer->media_mixer_ctl = mctl; in snd_media_mixer_init()
236 struct media_mixer_ctl *mctl; in snd_media_mixer_delete() local
238 mctl = mixer->media_mixer_ctl; in snd_media_mixer_delete()
243 media_device_unregister_entity(&mctl->media_entity); in snd_media_mixer_delete()
244 media_entity_cleanup(&mctl->media_entity); in snd_media_mixer_delete()
246 kfree(mctl); in snd_media_mixer_delete()