From 00fa01dd8a3dcf493b572ca2341bfed6286da5b2 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=E9=82=B1=E5=BB=BA=E6=96=8C?= Date: Wed, 5 Jun 2013 11:56:59 +0800 Subject: [PATCH] i2s : add config for i2s output Voltage(3.3v/1.8v) --- sound/soc/rk29/Kconfig | 16 ++++++++++++++-- sound/soc/rk29/rk30_i2s.c | 11 ++++++++++- 2 files changed, 24 insertions(+), 3 deletions(-) diff --git a/sound/soc/rk29/Kconfig b/sound/soc/rk29/Kconfig index 682fb18917b4..6ce9b846f104 100755 --- a/sound/soc/rk29/Kconfig +++ b/sound/soc/rk29/Kconfig @@ -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)" diff --git a/sound/soc/rk29/rk30_i2s.c b/sound/soc/rk29/rk30_i2s.c index ca8b55ce7971..0e66efffff72 100755 --- a/sound/soc/rk29/rk30_i2s.c +++ b/sound/soc/rk29/rk30_i2s.c @@ -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; -- 2.34.1