blob: 1ec77acfc1ce553bacc3b7e0a2e55f8dd6d4f33e [file] [log] [blame]
Simon Glassce6d99a2018-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
7#include <common.h>
8#include <dm.h>
9#include <audio_codec.h>
10
11int 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
23UCLASS_DRIVER(audio_codec) = {
24 .id = UCLASS_AUDIO_CODEC,
25 .name = "audio-codec",
26};