From 3062cd17af35b691582230c382dd125625d3b7ca Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Mon, 3 Feb 2020 07:36:06 -0700 Subject: sound: Add a new stop_play() method At present there is no positive indication that U-Boot has finished sending sound data. This means that it is not possible to power down an audio codec, for example. Add a new method that is called once all sound data has been sent. Add a new method for this, called when the sound_play() call is done. Signed-off-by: Simon Glass --- include/sound.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'include') diff --git a/include/sound.h b/include/sound.h index 47de9fa3ed3..71bd850652e 100644 --- a/include/sound.h +++ b/include/sound.h @@ -68,6 +68,18 @@ struct sound_ops { */ int (*play)(struct udevice *dev, void *data, uint data_size); + /** + * stop_play() - Indicate that there is no more data coming + * + * This is called once play() has finished sending all the data to the + * output device. This may be used to tell the hardware to turn off the + * codec, for example. + * + * @dev: Sound device + * @return 0 if OK, -ve on error + */ + int (*stop_play)(struct udevice *dev); + /** * start_beep() - Start beeping (optional) * -- cgit v1.3.1