dm: sound: Create a uclass for i2s
The i2s bus is commonly used with audio codecs. It provides a way to stream digital data sychronously in both directions. U-Boot only supports audio output, so this uclass is very simple, with a single tx_data() method. Add a uclass and a test for i2s. Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
@@ -47,7 +47,7 @@
|
||||
#sound-dai-cells = <1>;
|
||||
};
|
||||
|
||||
cros_ec: cros-ec {
|
||||
cros_ec: cros-ec {
|
||||
reg = <0 0>;
|
||||
compatible = "google,cros-ec-sandbox";
|
||||
|
||||
@@ -378,6 +378,11 @@
|
||||
u-boot,dm-pre-reloc;
|
||||
};
|
||||
|
||||
i2s: i2s {
|
||||
compatible = "sandbox,i2s";
|
||||
#sound-dai-cells = <1>;
|
||||
};
|
||||
|
||||
misc-test {
|
||||
compatible = "sandbox,misc_sandbox";
|
||||
};
|
||||
|
||||
@@ -131,4 +131,14 @@ void sandbox_get_codec_params(struct udevice *dev, int *interfacep, int *ratep,
|
||||
int *mclk_freqp, int *bits_per_samplep,
|
||||
uint *channelsp);
|
||||
|
||||
/**
|
||||
* sandbox_get_i2s_sum() - Read back the sum of the audio data so far
|
||||
*
|
||||
* This data is provided to the sandbox driver by the I2S tx_data() method.
|
||||
*
|
||||
* @dev: Device to check
|
||||
* @return sum of audio data
|
||||
*/
|
||||
int sandbox_get_i2s_sum(struct udevice *dev);
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user