return 0;\r
}\r
\r
-static int voltab[2][16] = \r
-{\r
- //spk\r
- {0x27, 0x1b, 0x18, 0x15, 0x13, 0x11, 0x0f, 0x0e, 0x0d, 0x0c, 0x0b, 0x0a, 0x09, 0x08, 0x07, 0x06},\r
- //hp\r
- {0x1f, 0x1c, 0x1a, 0x18, 0x16, 0x14, 0x12, 0x10, 0x0e, 0x0c, 0x0a, 0x08, 0x06, 0x04, 0x02, 0x01},\r
-};\r
static int gvolume = 0;\r
-#if 1\r
\r
+#if 1\r
static int get_vol(int max, int min, int stage_num, int stage)\r
{\r
int ret, step=((max-min)<<8)/(stage_num-1);\r
\r
#else\r
\r
+static int voltab[2][16] =\r
+{\r
+ //spk\r
+ {0x27, 0x1b, 0x18, 0x15, 0x13, 0x11, 0x0f, 0x0e, 0x0d, 0x0c, 0x0b, 0x0a, 0x09, 0x08, 0x07, 0x06},\r
+ //hp\r
+ {0x1f, 0x1c, 0x1a, 0x18, 0x16, 0x14, 0x12, 0x10, 0x0e, 0x0c, 0x0a, 0x08, 0x06, 0x04, 0x02, 0x01},\r
+};\r
+\r
static void rt5631_set_volume(int vollevel)\r
{\r
struct snd_soc_codec *codec = rt5631_codec;\r
return ret;\r
}\r
\r
+#if defined(CONFIG_ADJUST_VOL_BY_CODEC)\r
static int rt5631_trigger(struct snd_pcm_substream *substream, int status, struct snd_soc_dai *dai)\r
{\r
//DBG("rt5631_trigger\n");\r
\r
return 0;\r
}\r
+#endif\r
\r
static ssize_t rt5631_index_reg_show(struct device *dev,\r
struct device_attribute *attr, char *buf)\r
\r
if(on){\r
DBG("snd_soc_dapm_enable_pin\n");\r
- snd_soc_dapm_enable_pin(codec, "Headphone Jack");\r
- snd_soc_dapm_enable_pin(codec, "Ext Spk");\r
+ snd_soc_dapm_enable_pin(&codec->dapm, "Headphone Jack");\r
+ snd_soc_dapm_enable_pin(&codec->dapm, "Ext Spk");\r
}\r
else{\r
\r
DBG("snd_soc_dapm_disable_pin\n");\r
- snd_soc_dapm_disable_pin(codec, "Headphone Jack");\r
- snd_soc_dapm_disable_pin(codec, "Ext Spk");\r
+ snd_soc_dapm_disable_pin(&codec->dapm, "Headphone Jack");\r
+ snd_soc_dapm_disable_pin(&codec->dapm, "Ext Spk");\r
}\r
\r
- snd_soc_dapm_sync(codec);\r
+ snd_soc_dapm_sync(&codec->dapm);\r
\r
return;\r
}\r