sound: Add uclass operations for beeping

Some audio codecs such as Intel HDA do not need to use digital data to
play sounds, but instead have a way to emit beeps. Add this interface as
an option. If the beep interface is not supported, then the sound uclass
falls back to the I2S interface.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
This commit is contained in:
Simon Glass
2019-02-16 20:24:54 -07:00
committed by Bin Meng
parent e65f9ef9f2
commit 2850266965
5 changed files with 157 additions and 4 deletions

View File

@@ -161,6 +161,22 @@ int sandbox_get_setup_called(struct udevice *dev);
*/
int sandbox_get_sound_sum(struct udevice *dev);
/**
* sandbox_set_allow_beep() - Set whether the 'beep' interface is supported
*
* @dev: Device to update
* @allow: true to allow the start_beep() method, false to disallow it
*/
void sandbox_set_allow_beep(struct udevice *dev, bool allow);
/**
* sandbox_get_beep_frequency() - Get the frequency of the current beep
*
* @dev: Device to check
* @return frequency of beep, if there is an active beep, else 0
*/
int sandbox_get_beep_frequency(struct udevice *dev);
/**
* sandbox_get_pch_spi_protect() - Get the PCI SPI protection status
*