From 511f054f86eef84b5f8c42acc58c06be168ee529 Mon Sep 17 00:00:00 2001 From: qjb Date: Thu, 12 Jun 2014 09:33:24 +0800 Subject: [PATCH] audio codec : remove compiler warnings --- sound/soc/codecs/rt3261.c | 11 +++++++---- sound/soc/codecs/rt5631.c | 12 ++++++------ 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/sound/soc/codecs/rt3261.c b/sound/soc/codecs/rt3261.c index b70408e456f3..ab66254305a8 100755 --- a/sound/soc/codecs/rt3261.c +++ b/sound/soc/codecs/rt3261.c @@ -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; diff --git a/sound/soc/codecs/rt5631.c b/sound/soc/codecs/rt5631.c index b8626cb0db83..d6b5a05a2e74 100755 --- a/sound/soc/codecs/rt5631.c +++ b/sound/soc/codecs/rt5631.c @@ -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; -- 2.34.1