blob: 2cb233bd3060b6430afe3daa5711fb826602c07f [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 <common.h>
10#include <dm.h>
11#include <audio_codec.h>
12
13int audio_codec_set_params(struct udevice *dev, int interface, int rate,
14 int mclk_freq, int bits_per_sample, uint channels)
15{
16 struct audio_codec_ops *ops = audio_codec_get_ops(dev);
17
18 if (!ops->set_params)
19 return -ENOSYS;
20
21 return ops->set_params(dev, interface, rate, mclk_freq, bits_per_sample,
22 channels);
23}
24
25UCLASS_DRIVER(audio_codec) = {
26 .id = UCLASS_AUDIO_CODEC,
27 .name = "audio-codec",
28};