audio codec : remove compiler warnings
authorqjb <qjb@rock-chips.com>
Thu, 12 Jun 2014 01:33:24 +0000 (09:33 +0800)
committerqjb <qjb@rock-chips.com>
Thu, 12 Jun 2014 01:33:24 +0000 (09:33 +0800)
sound/soc/codecs/rt3261.c
sound/soc/codecs/rt5631.c

index b70408e456f32ca809475c31907d39b650b2a341..ab66254305a8d246ee6172cca142104190cc60fc 100755 (executable)
@@ -278,7 +278,7 @@ static int rt3261_reset(struct snd_soc_codec *codec)
 {
        return snd_soc_write(codec, RT3261_RESET, 0);
 }
-
+#if 0
 static unsigned int rt3261_read(struct snd_soc_codec *codec,
                unsigned int reg)
 {
@@ -287,7 +287,7 @@ static unsigned int rt3261_read(struct snd_soc_codec *codec,
        val = codec->hw_read(codec, reg);
        return val;
 }
-
+#endif
 static int do_hw_write(struct snd_soc_codec *codec, unsigned int reg,
                unsigned int value, const void *data, int len)
 {
@@ -3351,7 +3351,11 @@ static int rt3261_probe(struct snd_soc_codec *codec)
 {
        struct rt3261_priv *rt3261 = snd_soc_codec_get_drvdata(codec);
        int ret;
-
+#ifdef RTK_IOCTL
+#if defined(CONFIG_SND_HWDEP) || defined(CONFIG_SND_HWDEP_MODULE)
+       struct rt_codec_ops *ioctl_ops = rt_codec_get_ioctl_ops();
+#endif
+#endif
        #if defined (CONFIG_SND_SOC_RT3224)
        pr_info("Codec driver version %s, in fact you choose rt3224, no dsp!\n", VERSION);
        #else
@@ -3445,7 +3449,6 @@ static int rt3261_probe(struct snd_soc_codec *codec)
 
 #ifdef RTK_IOCTL
 #if defined(CONFIG_SND_HWDEP) || defined(CONFIG_SND_HWDEP_MODULE)
-       struct rt_codec_ops *ioctl_ops = rt_codec_get_ioctl_ops();
        ioctl_ops->index_write = rt3261_index_write;
        ioctl_ops->index_read = rt3261_index_read;
        ioctl_ops->index_update_bits = rt3261_index_update_bits;
index b8626cb0db83882655e24f83388b585b91f25285..d6b5a05a2e74ecc093d7874332cbf358cdbd0dc0 100755 (executable)
@@ -1379,7 +1379,7 @@ static int rt5631_add_widgets(struct snd_soc_codec *codec)
 
        return 0;
 }
-
+#if 0
 static int voltab[2][16] = 
 {
     //spk
@@ -1387,9 +1387,10 @@ static int voltab[2][16] =
     //hp
     {0x1f, 0x1c, 0x1a, 0x18, 0x16, 0x14, 0x12, 0x10, 0x0e, 0x0c, 0x0a, 0x08, 0x06, 0x04, 0x02, 0x01},
 };
-static int gvolume = 0;
+#endif
 
-#if 1
+#if defined(CONFIG_ADJUST_VOL_BY_CODEC)
+static int gvolume = 0;
 static int get_vol(int max, int min, int stage_num, int stage)
 {
        int ret, step=((max-min)<<8)/(stage_num-1);
@@ -1458,9 +1459,8 @@ static void rt5631_set_eq(int on)
        DBG("------- rt5631_set_eq: write Reg0C = 0x%04x\n", Reg0C);
        rt5631_write(codec, RT5631_STEREO_DAC_VOL_1, Reg0C);
 }
-
-#else
-
+#endif
+#if 0
 static void rt5631_set_volume(int vollevel)
 {
        struct snd_soc_codec *codec = rt5631_codec;