Simon Glass | ce6d99a | 2018-12-10 10:37:33 -0700 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0+ |
| 2 | /* |
| 3 | * Copyright 2018 Google LLC |
| 4 | * Written by Simon Glass <sjg@chromium.org> |
| 5 | */ |
| 6 | |
Patrick Delaunay | b953ec2 | 2021-04-27 11:02:19 +0200 | [diff] [blame] | 7 | #define LOG_CATEGORY UCLASS_AUDIO_CODEC |
| 8 | |
Simon Glass | ce6d99a | 2018-12-10 10:37:33 -0700 | [diff] [blame] | 9 | #include <common.h> |
| 10 | #include <dm.h> |
| 11 | #include <audio_codec.h> |
| 12 | |
| 13 | int 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 | |
| 25 | UCLASS_DRIVER(audio_codec) = { |
| 26 | .id = UCLASS_AUDIO_CODEC, |
| 27 | .name = "audio-codec", |
| 28 | }; |