sound: soc: ac108: Remove unused function and fix fallthrough warning
authorJaehoon Chung <jh80.chung@samsung.com>
Thu, 6 Jul 2023 06:24:59 +0000 (15:24 +0900)
committerJaehoon Chung <jh80.chung@samsung.com>
Mon, 24 Jul 2023 23:25:20 +0000 (08:25 +0900)
Fix the unused-function and implicit-fallthrough warning.

Change-Id: I84b7203c3ca864ecb89c562058037dd0630e5c25
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
sound/soc/codecs/ac108.c

index 617db21..bd208f6 100644 (file)
@@ -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*/