summaryrefslogtreecommitdiff
path: root/chip/npcx/audio_codec_i2s_rx.c
diff options
context:
space:
mode:
authorJack Rosenthal <jrosenth@chromium.org>2021-11-04 12:11:58 -0600
committerCommit Bot <commit-bot@chromium.org>2021-11-05 04:22:34 +0000
commit252457d4b21f46889eebad61d4c0a65331919cec (patch)
tree01856c4d31d710b20e85a74c8d7b5836e35c3b98 /chip/npcx/audio_codec_i2s_rx.c
parent08f5a1e6fc2c9467230444ac9b582dcf4d9f0068 (diff)
downloadchrome-ec-stabilize-14526.57.B-ish.tar.gz
In the interest of making long-term branch maintenance incur as little technical debt on us as possible, we should not maintain any files on the branch we are not actually using. This has the added effect of making it extremely clear when merging CLs from the main branch when changes have the possibility to affect us. The follow-on CL adds a convenience script to actually pull updates from the main branch and generate a CL for the update. BUG=b:204206272 BRANCH=ish TEST=make BOARD=arcada_ish && make BOARD=drallion_ish Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Change-Id: I17e4694c38219b5a0823e0a3e55a28d1348f4b18 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3262038 Reviewed-by: Jett Rink <jettrink@chromium.org> Reviewed-by: Tom Hughes <tomhughes@chromium.org>
Diffstat (limited to 'chip/npcx/audio_codec_i2s_rx.c')
-rw-r--r--chip/npcx/audio_codec_i2s_rx.c80
1 files changed, 0 insertions, 80 deletions
diff --git a/chip/npcx/audio_codec_i2s_rx.c b/chip/npcx/audio_codec_i2s_rx.c
deleted file mode 100644
index 12c4173048..0000000000
--- a/chip/npcx/audio_codec_i2s_rx.c
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- * Copyright 2020 The Chromium OS Authors. All rights reserved.
- * Use of this source code is governed by a BSD-style license that can be
- * found in the LICENSE file.
- */
-
-#include "audio_codec.h"
-#include "ec_commands.h"
-#include "wov_chip.h"
-
-#define CPRINTS(format, args...) cprints(CC_AUDIO_CODEC, format, ## args)
-
-int audio_codec_i2s_rx_enable(void)
-{
- /*
- * The mic source and sample rate don't need to be set each time
- * an i2s stream is started, but the audio codec does not
- * contain a method to select these as they must be the values
- * set below for proper i2s operation. Since the default values
- * set in wov.c are different than what's required, they are set
- * each time an i2s stream is started.
- */
- wov_set_mic_source(WOV_SRC_STEREO);
-
- /* Mode must be WOV_MODE_OFF to change sample rate */
- wov_set_mode(WOV_MODE_OFF);
- wov_set_sample_rate(48000);
-
- return wov_set_mode(WOV_MODE_I2S);
-}
-
-int audio_codec_i2s_rx_disable(void)
-{
- return wov_set_mode(WOV_MODE_OFF);
-}
-
-int audio_codec_i2s_rx_set_sample_depth(uint8_t depth)
-{
- int bits_num;
-
- if (depth == EC_CODEC_I2S_RX_SAMPLE_DEPTH_24)
- bits_num = 24;
- else
- bits_num = 16;
-
- /* Sample depth can only be changed when mode is WOV_MODE_OFF */
- wov_set_mode(WOV_MODE_OFF);
- return wov_set_sample_depth(bits_num);
-}
-
-int audio_codec_i2s_rx_set_daifmt(uint8_t daifmt)
-{
- enum wov_dai_format fmt = WOV_DAI_FMT_I2S;
-
- switch (daifmt) {
- case EC_CODEC_I2S_RX_DAIFMT_I2S:
- fmt = WOV_DAI_FMT_I2S;
- break;
- case EC_CODEC_I2S_RX_DAIFMT_RIGHT_J:
- fmt = WOV_DAI_FMT_RIGHT_J;
- break;
- case EC_CODEC_I2S_RX_DAIFMT_LEFT_J:
- fmt = WOV_DAI_FMT_LEFT_J;
- break;
- }
-
- /* To change mode setting it must be set to WOV_MODE_OFF */
- wov_set_mode(WOV_MODE_OFF);
- wov_set_i2s_fmt(fmt);
-
- return EC_SUCCESS;
-}
-
-int audio_codec_i2s_rx_set_bclk(uint32_t bclk)
-{
- /* To change bclk setting it must be set to WOV_MODE_OFF */
- wov_set_mode(WOV_MODE_OFF);
- wov_set_i2s_bclk(bclk);
- return EC_SUCCESS;
-}