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