File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -498,7 +498,8 @@ static void dcpaud_report_hotplug(struct dcp_audio *dcpaud, bool connected)
498498
499499 if (!connected ) {
500500 snd_pcm_stream_lock (substream );
501- snd_pcm_stop (substream , SNDRV_PCM_STATE_DISCONNECTED );
501+ if (substream -> runtime )
502+ snd_pcm_stop (substream , SNDRV_PCM_STATE_DISCONNECTED );
502503 snd_pcm_stream_unlock (substream );
503504 }
504505}
@@ -590,7 +591,6 @@ void dcpaud_disconnect(struct platform_device *pdev)
590591
591592 mutex_lock (& dcpaud -> data_lock );
592593
593- dcpaud -> dcp_connected = false;
594594 dcpaud_report_hotplug (dcpaud , false);
595595}
596596
Original file line number Diff line number Diff line change @@ -69,6 +69,20 @@ static void av_interface_init(struct apple_epic_service *service, const char *na
6969{
7070}
7171
72+ static void av_interface_teardown (struct apple_epic_service * service )
73+ {
74+ struct apple_dcp * dcp = service -> ep -> dcp ;
75+ struct audiosrv_data * asrv = dcp -> audiosrv ;
76+
77+ mutex_lock (& asrv -> plug_lock );
78+
79+ asrv -> plugged = false;
80+ if (asrv -> audio_dev )
81+ dcpaud_disconnect (asrv -> audio_dev );
82+
83+ mutex_unlock (& asrv -> plug_lock );
84+ }
85+
7286static void av_audiosrv_init (struct apple_epic_service * service , const char * name ,
7387 const char * class , s64 unit )
7488{
@@ -258,6 +272,7 @@ static const struct apple_epic_service_ops avep_ops[] = {
258272 {
259273 .name = "DCPAVSimpleVideoInterface" ,
260274 .init = av_interface_init ,
275+ .teardown = av_interface_teardown ,
261276 },
262277 {
263278 .name = "DCPAVAudioInterface" ,
You can’t perform that action at this time.
0 commit comments