summaryrefslogtreecommitdiff
path: root/arch/sandbox
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2018-12-10 10:37:33 -0700
committerSimon Glass <sjg@chromium.org>2018-12-13 16:32:49 -0700
commitce6d99a056ebc9ad329521ca3660f6cb298a7666 (patch)
treee297e74248dba6d54656e7899a4bd0e134c1dd9d /arch/sandbox
parent45863db5a97360b6843a0488621342819e9a6e62 (diff)
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>
Diffstat (limited to 'arch/sandbox')
-rw-r--r--arch/sandbox/dts/test.dts7
-rw-r--r--arch/sandbox/include/asm/test.h10
2 files changed, 16 insertions, 1 deletions
diff --git a/arch/sandbox/dts/test.dts b/arch/sandbox/dts/test.dts
index 6b1c2692ba..9ced5beee8 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 5e81839295..f70e0d8417 100644
--- a/arch/sandbox/include/asm/test.h
+++ b/arch/sandbox/include/asm/test.h
@@ -121,4 +121,14 @@ int sandbox_pwm_get_config(struct udevice *dev, uint channel, uint *period_nsp,
*/
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