i2s : add config for i2s output Voltage(3.3v/1.8v)
author邱建斌 <qjb@rock-chips.com>
Wed, 5 Jun 2013 03:56:59 +0000 (11:56 +0800)
committer邱建斌 <qjb@rock-chips.com>
Wed, 5 Jun 2013 03:56:59 +0000 (11:56 +0800)
sound/soc/rk29/Kconfig
sound/soc/rk29/rk30_i2s.c

index 682fb18917b464306d58255a341fd0b9d0c553bb..6ce9b846f1047127549c00a8f66273da8de78cea 100755 (executable)
@@ -14,7 +14,7 @@ config SND_RK29_SOC_I2S_8CH
        default y
        depends on SND_RK29_SOC_I2S && !ARCH_RK3066B && !ARCH_RK3188
        help
-                This supports the use of the 8 Channel I2S interface on rk29 processors.
+       This supports the use of the 8 Channel I2S interface on rk29 processors.
                                
 if SND_RK29_SOC_I2S_8CH
 choice
@@ -33,7 +33,19 @@ config SND_RK29_SOC_I2S_2CH
        depends on SND_RK29_SOC_I2S && !ARCH_RK2928     
        default y if (ARCH_RK3066B || ARCH_RK3188)
        help
-                This supports the use of the 2 Channel I2S interface on rk29 processors.
+         This supports the use of the 2 Channel I2S interface on rk29 processors.
+                
+if (ARCH_RK3066B || ARCH_RK3188) && SND_RK29_SOC_I2S_2CH
+choice
+  bool "Set I2S GRF Output Voltage"
+  default SND_I2S_USE_33V
+       config SND_I2S_USE_33V
+               tristate  "I2S use 3.3V"
+
+       config SND_I2S_USE_18V
+               tristate  "I2S use 1.8V"
+endchoice
+endif
 
 config SND_RK_SOC_I2S2_2CH
        bool "Soc RK29 I2S 2 Channel support(I2S2)"
index ca8b55ce7971c9efcfd80ed35365558b34bc28d4..0e66efffff72a8a59448334f045c935d4d510668 100755 (executable)
@@ -557,9 +557,18 @@ static int __devinit rockchip_i2s_probe(struct platform_device *pdev)
        struct rk29_i2s_info *i2s;
        struct snd_soc_dai_driver *dai;
        int    ret;
+       int v;
+
+#if defined(CONFIG_SND_I2S_USE_18V)    
+       v = 0x2000200;//bit9: 1,1.8v;0,3.3v
+       writel_relaxed(v,RK30_GRF_BASE + GRF_IO_CON4);
+#elif defined(CONFIG_SND_I2S_USE_33V)
+       v = 0x2000000;
+       writel_relaxed(v,RK30_GRF_BASE + GRF_IO_CON4);
+#endif
 
        I2S_DBG("Enter %s, %d pdev->id = %d >>>>>>>>>>>\n", __func__, __LINE__, pdev->id);
-
+       
        if(pdev->id >= MAX_I2S) {
                dev_err(&pdev->dev, "id %d out of range\n", pdev->id);
                return -EINVAL;