File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -500,7 +500,8 @@ static void dcpaud_report_hotplug(struct dcp_audio *dcpaud, bool connected)
500500
501501 if (!connected ) {
502502 snd_pcm_stream_lock (substream );
503- snd_pcm_stop (substream , SNDRV_PCM_STATE_DISCONNECTED );
503+ if (substream -> runtime )
504+ snd_pcm_stop (substream , SNDRV_PCM_STATE_DISCONNECTED );
504505 snd_pcm_stream_unlock (substream );
505506 }
506507}
@@ -592,7 +593,6 @@ void dcpaud_disconnect(struct platform_device *pdev)
592593
593594 mutex_lock (& dcpaud -> data_lock );
594595
595- dcpaud -> dcp_connected = false;
596596 dcpaud_report_hotplug (dcpaud , false);
597597}
598598
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