1 // SPDX-License-Identifier: GPL-2.0+
2 /*
3 * Copyright 2018 Google LLC
4 * Written by Simon Glass <sjg@chromium.org>
5 */
6
7 #include <common.h>
8 #include <dm.h>
9 #include <audio_codec.h>
10
audio_codec_set_params(struct udevice * dev,int interface,int rate,int mclk_freq,int bits_per_sample,uint channels)11 int audio_codec_set_params(struct udevice *dev, int interface, int rate,
12 int mclk_freq, int bits_per_sample, uint channels)
13 {
14 struct audio_codec_ops *ops = audio_codec_get_ops(dev);
15
16 if (!ops->set_params)
17 return -ENOSYS;
18
19 return ops->set_params(dev, interface, rate, mclk_freq, bits_per_sample,
20 channels);
21 }
22
23 UCLASS_DRIVER(audio_codec) = {
24 .id = UCLASS_AUDIO_CODEC,
25 .name = "audio-codec",
26 };
27