@@ -190,8 +190,6 @@ struct snd_compr_ops {
190190 * @lock: device lock
191191 * @device: device id
192192 * @use_pause_in_draining: allow pause in draining, true when set
193- * @keep_running_state_after_drain: after successful drain, keep the RUNNING state instead of
194- * moving to SETUP
195193 */
196194struct snd_compr {
197195 const char * name ;
@@ -203,7 +201,6 @@ struct snd_compr {
203201 struct mutex lock ;
204202 int device ;
205203 bool use_pause_in_draining ;
206- bool keep_running_state_after_drain ;
207204#ifdef CONFIG_SND_VERBOSE_PROCFS
208205 /* private: */
209206 char id [64 ];
@@ -228,23 +225,6 @@ static inline void snd_compr_use_pause_in_draining(struct snd_compr_stream *subs
228225 substream -> device -> use_pause_in_draining = true;
229226}
230227
231- /**
232- * snd_compr_keep_running_state_after_drain - Keep RUNNING state after drain
233- * @substream: compress substream to set
234- *
235- * Keep the device in RUNNING state after the drain completed instead of transitioning
236- * to SETUP state.
237- * For generic drivers the SETUP state is not equal to RUNNING state and a transition
238- * between them without a trigger is not possible.
239- * For example in complex systems with Soundwire after the drain the stream can be
240- * closed, but the stream has not been stopped, which will result errors in codec and
241- * subsystem level.
242- */
243- static inline void snd_compr_keep_running_state_after_drain (struct snd_compr_stream * substream )
244- {
245- substream -> device -> keep_running_state_after_drain = true;
246- }
247-
248228/* dsp driver callback apis
249229 * For playback: driver should call snd_compress_fragment_elapsed() to let the
250230 * framework know that a fragment has been consumed from the ring buffer
@@ -263,11 +243,8 @@ static inline void snd_compr_drain_notify(struct snd_compr_stream *stream)
263243 if (snd_BUG_ON (!stream ))
264244 return ;
265245
266- /*
267- * For partial_drain case or if keep_running_state_after_drain is set we
268- * are back to running state on success
269- */
270- if (stream -> partial_drain || stream -> device -> keep_running_state_after_drain ) {
246+ /* for partial_drain case we are back to running state on success */
247+ if (stream -> partial_drain ) {
271248 stream -> runtime -> state = SNDRV_PCM_STATE_RUNNING ;
272249 stream -> partial_drain = false; /* clear this flag as well */
273250 } else {
0 commit comments