dm: sound: Create a uclass for audio codecs
An audio codec provides a way to convert digital data to sound and vice
versa. Add a simple uclass which just supports setting the parameters for
the codec.
Signed-off-by: Simon Glass <sjg@chromium.org>
diff --git a/arch/sandbox/dts/test.dts b/arch/sandbox/dts/test.dts
index 6b1c269..9ced5be 100644
--- a/arch/sandbox/dts/test.dts
+++ b/arch/sandbox/dts/test.dts
@@ -42,7 +42,12 @@
osd0 = "/osd";
};
- cros_ec: cros-ec {
+ audio: audio-codec {
+ compatible = "sandbox,audio-codec";
+ #sound-dai-cells = <1>;
+ };
+
+ cros_ec: cros-ec {
reg = <0 0>;
compatible = "google,cros-ec-sandbox";
diff --git a/arch/sandbox/include/asm/test.h b/arch/sandbox/include/asm/test.h
index 5e81839..f70e0d8 100644
--- a/arch/sandbox/include/asm/test.h
+++ b/arch/sandbox/include/asm/test.h
@@ -121,4 +121,14 @@
*/
void sandbox_sf_set_block_protect(struct udevice *dev, int bp_mask);
+/**
+ * sandbox_get_codec_params() - Read back codec parameters
+ *
+ * This reads back the parameters set by audio_codec_set_params() for the
+ * sandbox audio driver. Arguments are as for that function.
+ */
+void sandbox_get_codec_params(struct udevice *dev, int *interfacep, int *ratep,
+ int *mclk_freqp, int *bits_per_samplep,
+ uint *channelsp);
+
#endif