{
return snd_soc_write(codec, RT3261_RESET, 0);
}
-
+#if 0
static unsigned int rt3261_read(struct snd_soc_codec *codec,
unsigned int reg)
{
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)
{
{
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
#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;
return 0;
}
-
+#if 0
static int voltab[2][16] =
{
//spk
//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);
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;