summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJaehoon Chung <jh80.chung@samsung.com>2023-07-06 15:24:59 +0900
committerJaehoon Chung <jh80.chung@samsung.com>2023-07-25 08:25:20 +0900
commitb8123062c03907702d5d969e34a4d9bebfd8cedd (patch)
treec9ec1ddfd2c9d662ebe43ffc85454fe0b4d5c172
parent957688087a2afa1833e1a7f2534220707ecafa91 (diff)
downloadlinux-starfive-b8123062c03907702d5d969e34a4d9bebfd8cedd.tar.gz
linux-starfive-b8123062c03907702d5d969e34a4d9bebfd8cedd.tar.bz2
linux-starfive-b8123062c03907702d5d969e34a4d9bebfd8cedd.zip
sound: soc: ac108: Remove unused function and fix fallthrough warning
Fix the unused-function and implicit-fallthrough warning. Change-Id: I84b7203c3ca864ecb89c562058037dd0630e5c25 Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
-rw-r--r--sound/soc/codecs/ac108.c63
1 files changed, 5 insertions, 58 deletions
diff --git a/sound/soc/codecs/ac108.c b/sound/soc/codecs/ac108.c
index 617db2199395..bd208f6b8c80 100644
--- a/sound/soc/codecs/ac108.c
+++ b/sound/soc/codecs/ac108.c
@@ -871,10 +871,12 @@ static int ac108_set_fmt(struct snd_soc_dai *dai, unsigned int fmt) {
/* multi_chips: only one chip set as Master, and the others also need to set as Slave */
ac10x_update_bits(I2S_CTRL, 0x3 << LRCK_IOEN, 0x01 << BCLK_IOEN, ac10x->i2cmap[_MASTER_INDEX]);
break;
- } else {
- /* TODO: Both cpu_dai and codec_dai(AC108) be set as slave in DTS */
- dev_dbg(dai->dev, "used as slave when AC101 is master\n");
}
+
+ /* TODO: Both cpu_dai and codec_dai(AC108) be set as slave in DTS */
+ dev_dbg(dai->dev, "used as slave when AC101 is master\n");
+
+ fallthrough;
case SND_SOC_DAIFMT_CBS_CFS: /*AC108 Slave*/
dev_dbg(dai->dev, "AC108 set to work as Slave\n");
/**
@@ -1068,60 +1070,6 @@ static int ac108_prepare(struct snd_pcm_substream *substream,
return 0;
}
-static int ac108_trigger(struct snd_pcm_substream *substream, int cmd,
- struct snd_soc_dai *dai)
-{
- struct snd_soc_codec *codec = dai->codec;
- struct ac10x_priv *ac10x = snd_soc_codec_get_drvdata(codec);
- unsigned long flags;
- int ret = 0;
- u8 r;
-
- dev_dbg(dai->dev, "%s() stream=%s cmd=%d\n",
- __FUNCTION__,
- snd_pcm_stream_str(substream),
- cmd);
-
- spin_lock_irqsave(&ac10x->lock, flags);
-
- if (ac10x->i2c101 && _MASTER_MULTI_CODEC == _MASTER_AC101) {
- ac101_trigger(substream, cmd, dai);
- if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
- goto __ret;
- }
- }
-
- switch (cmd) {
- case SNDRV_PCM_TRIGGER_START:
- case SNDRV_PCM_TRIGGER_RESUME:
- case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
- /* disable global clock if lrck disabled */
- ac10x_read(I2S_CTRL, &r, ac10x->i2cmap[_MASTER_INDEX]);
- if ((r & (0x01 << BCLK_IOEN)) && (r & (0x01 << LRCK_IOEN)) == 0) {
- /* disable global clock */
- ac108_multi_update_bits(I2S_CTRL, 0x1 << TXEN | 0x1 << GEN, 0x0 << TXEN | 0x0 << GEN, ac10x);
- }
-
- /* delayed clock starting, move to machine trigger() */
- //msleep(10);
- ac108_set_clock(1);
- break;
- case SNDRV_PCM_TRIGGER_STOP:
- case SNDRV_PCM_TRIGGER_SUSPEND:
- case SNDRV_PCM_TRIGGER_PAUSE_PUSH:
- //msleep(10);
- ac108_set_clock(0);
- break;
- default:
- ret = -EINVAL;
- }
-
-__ret:
- spin_unlock_irqrestore(&ac10x->lock, flags);
-
- return ret;
-}
-
int ac108_audio_startup(struct snd_pcm_substream *substream,
struct snd_soc_dai *dai
) {
@@ -1174,7 +1122,6 @@ static const struct snd_soc_dai_ops ac108_dai_ops = {
/*ALSA PCM audio operations*/
.hw_params = ac108_hw_params,
.prepare = ac108_prepare,
- /*.trigger = ac108_trigger, */
.mute_stream = ac108_aif_mute,
/*DAI format configuration*/