Update I2S and WM8900 Codec
authorfang <fang@fang-desktop.(none)>
Tue, 7 Dec 2010 11:12:18 +0000 (19:12 +0800)
committerfang <fang@fang-desktop.(none)>
Tue, 7 Dec 2010 11:12:18 +0000 (19:12 +0800)
arch/arm/mach-rk29/devices.c
sound/soc/codecs/wm8900.c
sound/soc/rk29/Kconfig
sound/soc/rk29/rk29_i2s.c
sound/soc/rk29/rk29_wm8900.c

index 6fe13e75d3a338ee245448faaf072aad90230df9..da3e8f3a793c38e61461091be516d0430cc5de7b 100644 (file)
@@ -504,7 +504,7 @@ static struct resource rk29_iis_2ch_resource[] = {
 
 struct platform_device rk29_device_iis_2ch = {
         .name           = "rk29_i2s",
-        .id             = 0,
+        .id             = 1,
         .num_resources  = ARRAY_SIZE(rk29_iis_2ch_resource),
         .resource       = rk29_iis_2ch_resource,
 };
@@ -534,7 +534,7 @@ static struct resource rk29_iis_8ch_resource[] = {
 
 struct platform_device rk29_device_iis_8ch = {
         .name           = "rk29_i2s",
-        .id             = 1,
+        .id             = 0,
         .num_resources  = ARRAY_SIZE(rk29_iis_8ch_resource),
         .resource       = rk29_iis_8ch_resource,
 };
index 5e9c855c0036eb72e79741ff4b90d13b3b7ae3c3..14688945d6165f4fe997fa22b97c36ec440146fe 100644 (file)
 
 #include "wm8900.h"
 
+
+#if 0
+#define        WM8900_DBG(x...)        printk(KERN_INFO x)
+#else
+#define        WM8900_DBG(x...)
+#endif
+
 /* WM8900 register space */
 #define WM8900_REG_RESET       0x0
 #define WM8900_REG_ID          0x0
@@ -196,6 +203,7 @@ static int wm8900_volatile_register(unsigned int reg)
 
 static void wm8900_reset(struct snd_soc_codec *codec)
 {
+        WM8900_DBG("Enter:%s, %d, codec=0x%8X \n", __FUNCTION__, __LINE__,codec);
        snd_soc_write(codec, WM8900_REG_RESET, 0);
 
        memcpy(codec->reg_cache, wm8900_reg_defaults,
@@ -207,6 +215,8 @@ static int wm8900_hp_event(struct snd_soc_dapm_widget *w,
 {
        struct snd_soc_codec *codec = w->codec;
        u16 hpctl1 = snd_soc_read(codec, WM8900_REG_HPCTL1);
+       
+        WM8900_DBG("Enter:%s, %d \n", __FUNCTION__, __LINE__);
 
        switch (event) {
        case SND_SOC_DAPM_PRE_PMU:
@@ -214,6 +224,7 @@ static int wm8900_hp_event(struct snd_soc_dapm_widget *w,
                hpctl1 = WM8900_REG_HPCTL1_HP_CLAMP_IP |
                        WM8900_REG_HPCTL1_HP_CLAMP_OP;
                snd_soc_write(codec, WM8900_REG_HPCTL1, hpctl1);
+               WM8900_DBG("Enter:%s, %d, HPCTL=0x%04X \n", __FUNCTION__, __LINE__, hpctl1);
                break;
 
        case SND_SOC_DAPM_POST_PMU:
@@ -236,6 +247,7 @@ static int wm8900_hp_event(struct snd_soc_dapm_widget *w,
                snd_soc_write(codec, WM8900_REG_HPCTL1, hpctl1);
                hpctl1 &= ~WM8900_REG_HPCTL1_HP_SHORT;
                snd_soc_write(codec, WM8900_REG_HPCTL1, hpctl1);
+               WM8900_DBG("Enter:%s, %d, HPCTL=0x%04X \n", __FUNCTION__, __LINE__, hpctl1);
                break;
 
        case SND_SOC_DAPM_PRE_PMD:
@@ -252,11 +264,13 @@ static int wm8900_hp_event(struct snd_soc_dapm_widget *w,
                        WM8900_REG_HPCTL1_HP_CLAMP_OP;
                hpctl1 &= ~WM8900_REG_HPCTL1_HP_IPSTAGE_ENA;
                snd_soc_write(codec, WM8900_REG_HPCTL1, hpctl1);
+               WM8900_DBG("Enter:%s, %d, HPCTL=0x%04X \n", __FUNCTION__, __LINE__, hpctl1);
                break;
 
        case SND_SOC_DAPM_POST_PMD:
                /* Disable everything */
                snd_soc_write(codec, WM8900_REG_HPCTL1, 0);
+               WM8900_DBG("Enter:%s, %d, HPCTL=0x%04X \n", __FUNCTION__, __LINE__, hpctl1);
                break;
 
        default:
@@ -613,11 +627,13 @@ static const struct snd_soc_dapm_route audio_map[] = {
 
 static int wm8900_add_widgets(struct snd_soc_codec *codec)
 {
+        WM8900_DBG("Enter:%s, %d \n", __FUNCTION__, __LINE__);
+        
        snd_soc_dapm_new_controls(codec, wm8900_dapm_widgets,
                                  ARRAY_SIZE(wm8900_dapm_widgets));
-
+        WM8900_DBG("Enter:%s, %d \n", __FUNCTION__, __LINE__);
        snd_soc_dapm_add_routes(codec, audio_map, ARRAY_SIZE(audio_map));
-
+        WM8900_DBG("Enter:%s, %d \n", __FUNCTION__, __LINE__);
        snd_soc_dapm_new_widgets(codec);
 
        return 0;
@@ -632,6 +648,8 @@ static int wm8900_hw_params(struct snd_pcm_substream *substream,
        struct snd_soc_codec *codec = socdev->card->codec;
        u16 reg;
 
+        WM8900_DBG("Enter:%s, %d \n", __FUNCTION__, __LINE__);
+
        reg = snd_soc_read(codec, WM8900_REG_AUDIO1) & ~0x60;
 
        switch (params_format(params)) {
@@ -661,6 +679,14 @@ static int wm8900_hw_params(struct snd_pcm_substream *substream,
                        reg &= ~WM8900_REG_DACCTRL_DAC_SB_FILT;
 
                snd_soc_write(codec, WM8900_REG_DACCTRL, reg);
+               
+               snd_soc_write(codec, WM8900_REG_POWER3, 0xEF);
+               
+               snd_soc_write(codec, WM8900_REG_LOUTMIXCTL1, 0x150);
+               snd_soc_write(codec, WM8900_REG_ROUTMIXCTL1, 0x150);
+               snd_soc_write(codec, WM8900_REG_LOUT2CTL, 0x126);
+               snd_soc_write(codec, WM8900_REG_ROUT2CTL, 0x126);
+               snd_soc_write(codec, WM8900_REG_HPCTL1, 0xC0);          
        }
 
        return 0;
@@ -687,7 +713,9 @@ static int fll_factors(struct _fll_div *fll_div, unsigned int Fref,
        unsigned int div;
 
        BUG_ON(!Fout);
-
+       
+        WM8900_DBG("Enter:%s, %d \n", __FUNCTION__, __LINE__);
+        
        /* The FLL must run at 90-100MHz which is then scaled down to
         * the output value by FLLCLK_DIV. */
        target = Fout;
@@ -750,6 +778,8 @@ static int wm8900_set_fll(struct snd_soc_codec *codec,
        struct _fll_div fll_div;
        unsigned int reg;
 
+        WM8900_DBG("Enter:%s, %d \n", __FUNCTION__, __LINE__);
+
        if (wm8900->fll_in == freq_in && wm8900->fll_out == freq_out)
                return 0;
 
@@ -817,6 +847,7 @@ reenable:
 static int wm8900_set_dai_pll(struct snd_soc_dai *codec_dai,
                int pll_id, unsigned int freq_in, unsigned int freq_out)
 {
+        WM8900_DBG("Enter:%s, %d \n", __FUNCTION__, __LINE__);
        return wm8900_set_fll(codec_dai->codec, pll_id, freq_in, freq_out);
 }
 
@@ -825,6 +856,7 @@ static int wm8900_set_dai_clkdiv(struct snd_soc_dai *codec_dai,
 {
        struct snd_soc_codec *codec = codec_dai->codec;
        unsigned int reg;
+        WM8900_DBG("Enter:%s, %d, div_id=%d, div=%d \n", __FUNCTION__, __LINE__, div_id, div);
 
        switch (div_id) {
        case WM8900_BCLK_DIV:
@@ -876,6 +908,8 @@ static int wm8900_set_dai_fmt(struct snd_soc_dai *codec_dai,
        struct snd_soc_codec *codec = codec_dai->codec;
        unsigned int clocking1, aif1, aif3, aif4;
 
+        WM8900_DBG("Enter:%s, %d, fmt=0x%08X \n", __FUNCTION__, __LINE__, fmt);
+
        clocking1 = snd_soc_read(codec, WM8900_REG_CLOCKING1);
        aif1 = snd_soc_read(codec, WM8900_REG_AUDIO1);
        aif3 = snd_soc_read(codec, WM8900_REG_AUDIO3);
@@ -987,6 +1021,7 @@ static int wm8900_digital_mute(struct snd_soc_dai *codec_dai, int mute)
 {
        struct snd_soc_codec *codec = codec_dai->codec;
        u16 reg;
+        WM8900_DBG("Enter:%s, %d \n", __FUNCTION__, __LINE__);
 
        reg = snd_soc_read(codec, WM8900_REG_DACCTRL);
 
@@ -1041,6 +1076,8 @@ static int wm8900_set_bias_level(struct snd_soc_codec *codec,
 {
        u16 reg;
 
+        WM8900_DBG("Enter:%s, %d, level=0x%08X \n", __FUNCTION__, __LINE__, level);
+
        switch (level) {
        case SND_SOC_BIAS_ON:
                /* Enable thermal shutdown */
@@ -1125,6 +1162,8 @@ static int wm8900_set_bias_level(struct snd_soc_codec *codec,
                             WM8900_REG_POWER2_SYSCLK_ENA);
                break;
        }
+
+       
        codec->bias_level = level;
        return 0;
 }
@@ -1134,6 +1173,9 @@ static int wm8900_suspend(struct platform_device *pdev, pm_message_t state)
        struct snd_soc_device *socdev = platform_get_drvdata(pdev);
        struct snd_soc_codec *codec = socdev->card->codec;
        struct wm8900_priv *wm8900 = codec->private_data;
+
+        WM8900_DBG("Enter:%s, %d \n", __FUNCTION__, __LINE__);
+       
        int fll_out = wm8900->fll_out;
        int fll_in  = wm8900->fll_in;
        int ret;
@@ -1202,6 +1244,8 @@ static __devinit int wm8900_i2c_probe(struct i2c_client *i2c,
        unsigned int reg;
        int ret;
 
+        WM8900_DBG("Enter:%s, %d \n", __FUNCTION__, __LINE__);
+        
        wm8900 = kzalloc(sizeof(struct wm8900_priv), GFP_KERNEL);
        if (wm8900 == NULL)
                return -ENOMEM;
@@ -1269,6 +1313,13 @@ static __devinit int wm8900_i2c_probe(struct i2c_client *i2c,
        snd_soc_write(codec, WM8900_REG_RADC_DV,
                      snd_soc_read(codec, WM8900_REG_RADC_DV) | 0x100);
 
+        /* For Fzf Test */
+        #if 1
+       snd_soc_write(codec, WM8900_REG_LDAC_DV,
+                     (snd_soc_read(codec, WM8900_REG_LDAC_DV)&0xFF00) | 0xB0);
+       snd_soc_write(codec, WM8900_REG_RDAC_DV,
+                     (snd_soc_read(codec, WM8900_REG_RDAC_DV)&0xFF00) | 0xB0);
+        #endif
        /* Set the DAC and mixer output bias */
        snd_soc_write(codec, WM8900_REG_OUTBIASCTL, 0x81);
 
@@ -1300,6 +1351,8 @@ err:
 
 static __devexit int wm8900_i2c_remove(struct i2c_client *client)
 {
+        WM8900_DBG("Enter:%s, %d \n", __FUNCTION__, __LINE__);
+        
        snd_soc_unregister_dai(&wm8900_dai);
        snd_soc_unregister_codec(wm8900_codec);
 
@@ -1315,6 +1368,7 @@ static __devexit int wm8900_i2c_remove(struct i2c_client *client)
 #ifdef CONFIG_PM
 static int wm8900_i2c_suspend(struct i2c_client *client, pm_message_t msg)
 {
+        WM8900_DBG("Enter:%s, %d \n", __FUNCTION__, __LINE__);
        return snd_soc_suspend_device(&client->dev);
 }
 
@@ -1351,6 +1405,8 @@ static int wm8900_probe(struct platform_device *pdev)
        struct snd_soc_codec *codec;
        int ret = 0;
 
+        WM8900_DBG("Enter:%s, %d \n", __FUNCTION__, __LINE__);
+        
        if (!wm8900_codec) {
                dev_err(&pdev->dev, "I2C client not yet instantiated\n");
                return -ENODEV;
index 5b4042d99f68b6d7375025d246619257f3947eea..d2d5b0d4adee61710a0eeb8abbbd1b234f0ebdea 100755 (executable)
@@ -18,7 +18,7 @@ config SND_RK29_SOC_I2S_2CH
 
 config SND_RK29_SOC_I2S_8CH
         bool "Soc RK29 I2S 8 Channel support"
-        default y
+        default n
        depends on SND_RK29_SOC_I2S
        help
                 This supports the use of the 8 Channel I2S interface on rk29 processors.
index 510fd7094b1770c77001d90304e1c9e5405171a5..0dd90ba6cc3cd177bdde16a66c47e22caa701007 100755 (executable)
@@ -30,7 +30,7 @@
 #include <mach/board.h>
 #include <mach/rk29_iomap.h>
 #include <mach/rk29-dma-pl330.h>
-
+#include <mach/iomux.h>
 
 #include "rk29_pcm.h"
 #include "rk29_i2s.h"
@@ -257,13 +257,22 @@ static int rockchip_i2s_hw_params(struct snd_pcm_substream *substream,
        iismod = readl(&(pheadi2s->I2S_TXCR));
         //iismod &= (~((1<<5)-1));
        switch (params_format(params)) {
-         case SNDRV_PCM_FORMAT_S8:
-               iismod |= SAMPLE_DATA_8bit;
-               break;
-         case SNDRV_PCM_FORMAT_S16_LE:
-               iismod |= I2S_DATA_WIDTH(15);
-               break;
-        } 
+        case SNDRV_PCM_FORMAT_S8:
+               iismod |= SAMPLE_DATA_8bit;
+               break;
+        case SNDRV_PCM_FORMAT_S16_LE:
+               iismod |= I2S_DATA_WIDTH(15);
+               break;
+        case SNDRV_PCM_FORMAT_S20_3LE:
+                iismod |= I2S_DATA_WIDTH(19);
+                break;
+        case SNDRV_PCM_FORMAT_S24_LE:
+                iismod |= I2S_DATA_WIDTH(23);
+                break;
+        case SNDRV_PCM_FORMAT_S32_LE:
+                iismod |= I2S_DATA_WIDTH(31);
+                break;
+        }
 
         iismod |= I2S_SLAVE_MODE;
 
@@ -411,7 +420,33 @@ static struct snd_soc_dai_ops rockchip_i2s_dai_ops = {
 static int rockchip_i2s_dai_probe(struct platform_device *pdev, struct snd_soc_dai *dai)
 {      
        I2S_DBG("Enter %s, %d >>>>>>>>>>>\n", __func__, __LINE__);
-    
+
+        switch(dai->id) {
+        case 0:
+                rk29_mux_api_set(GPIO2D0_I2S0CLK_MIIRXCLKIN_NAME, GPIO2H_I2S0_CLK);                
+                rk29_mux_api_set(GPIO2D1_I2S0SCLK_MIICRS_NAME, GPIO2H_I2S0_SCLK);
+                rk29_mux_api_set(GPIO2D2_I2S0LRCKRX_MIITXERR_NAME, GPIO2H_I2S0_LRCK_RX);
+                rk29_mux_api_set(GPIO2D3_I2S0SDI_MIICOL_NAME, GPIO2H_I2S0_SDI);
+                rk29_mux_api_set(GPIO2D4_I2S0SDO0_MIIRXD2_NAME, GPIO2H_I2S0_SDO0);
+                rk29_mux_api_set(GPIO2D5_I2S0SDO1_MIIRXD3_NAME, GPIO2H_I2S0_SDO1);
+                rk29_mux_api_set(GPIO2D6_I2S0SDO2_MIITXD2_NAME, GPIO2H_I2S0_SDO2);
+                rk29_mux_api_set(GPIO2D7_I2S0SDO3_MIITXD3_NAME, GPIO2H_I2S0_SDO3);
+                
+                rk29_mux_api_set(GPIO4D6_I2S0LRCKTX0_NAME, GPIO4H_I2S0_LRCK_TX0);
+                rk29_mux_api_set(GPIO4D7_I2S0LRCKTX1_NAME, GPIO4H_I2S0_LRCK_TX1);
+                break;
+        case 1:
+                rk29_mux_api_set(GPIO3A0_I2S1CLK_NAME, GPIO3L_I2S1_CLK);
+                rk29_mux_api_set(GPIO3A1_I2S1SCLK_NAME, GPIO3L_I2S1_SCLK);
+                rk29_mux_api_set(GPIO3A2_I2S1LRCKRX_NAME, GPIO3L_I2S1_LRCK_RX);
+                rk29_mux_api_set(GPIO3A3_I2S1SDI_NAME, GPIO3L_I2S1_SDI);
+                rk29_mux_api_set(GPIO3A4_I2S1SDO_NAME, GPIO3L_I2S1_SDO);
+                rk29_mux_api_set(GPIO3A5_I2S1LRCKTX_NAME, GPIO3L_I2S1_LRCK_TX);
+                break;
+        default:
+                I2S_DBG("Enter:%s, %d, Error For DevId!!!", __FUNCTION__, __LINE__);
+                return -EINVAL;
+        }
         return 0;
 }
 
@@ -546,6 +581,7 @@ static int __devinit rockchip_i2s_probe(struct platform_device *pdev)
        i2s->dma_playback->dma_size = 4;
 
        i2s->iis_clk = clk_get(&pdev->dev, "i2s");
+       I2S_DBG("Enter:%s, %d, iis_clk=%d\n", __FUNCTION__, __LINE__, i2s->iis_clk);
        if (IS_ERR(i2s->iis_clk)) {
                dev_err(&pdev->dev, "failed to get i2s clk\n");
                ret = PTR_ERR(i2s->iis_clk);
@@ -553,7 +589,7 @@ static int __devinit rockchip_i2s_probe(struct platform_device *pdev)
        }
 
        clk_enable(i2s->iis_clk);
-
+        clk_set_rate(i2s->iis_clk, 12000000);
        ret = rk29_i2s_probe(pdev, dai, i2s, 0);
        if (ret)
                goto err_clk;
index 5a45f5cd899fc693cecbb35763ff9614a2f043ee..07a67ea16b08ef4ed244b6faaffca2024699a22a 100644 (file)
 static int rk29_hw_params(struct snd_pcm_substream *substream,
        struct snd_pcm_hw_params *params)
 {
-    struct snd_soc_pcm_runtime *rtd = substream->private_data;
-       struct snd_soc_dai *codec_dai = rtd->dai->codec_dai;
-       struct snd_soc_dai *cpu_dai = rtd->dai->cpu_dai;
-       int ret;
-         
-    DBG("Enter::%s----%d\n",__FUNCTION__,__LINE__);    
-       /*by Vincent Hsiung for EQ Vol Change*/
-       #define HW_PARAMS_FLAG_EQVOL_ON 0x21
-       #define HW_PARAMS_FLAG_EQVOL_OFF 0x22
-    if ((params->flags == HW_PARAMS_FLAG_EQVOL_ON)||(params->flags == HW_PARAMS_FLAG_EQVOL_OFF))
-    {
-       ret = codec_dai->ops->hw_params(substream, params, codec_dai); //by Vincent
-       DBG("Enter::%s----%d\n",__FUNCTION__,__LINE__);
-    }
-    else
-    {
-           /* set codec DAI configuration */
-           #if defined (CONFIG_SND_CODEC_SOC_SLAVE) 
-           ret = codec_dai->ops->set_fmt(codec_dai, SND_SOC_DAIFMT_I2S |
-               SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBS_CFS); 
-           #endif      
-           #if defined (CONFIG_SND_CODEC_SOC_MASTER) 
-           ret = codec_dai->ops->set_fmt(codec_dai, SND_SOC_DAIFMT_I2S |
-               SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBM_CFM ); 
-           #endif
-           if (ret < 0)
-                 return ret; 
-           /* set cpu DAI configuration */
-           #if defined (CONFIG_SND_CODEC_SOC_SLAVE) 
-           ret = cpu_dai->ops->set_fmt(cpu_dai, SND_SOC_DAIFMT_I2S |
-               SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBM_CFM);
-           #endif      
-           #if defined (CONFIG_SND_CODEC_SOC_MASTER) 
-           ret = cpu_dai->ops->set_fmt(cpu_dai, SND_SOC_DAIFMT_I2S |
-               SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBS_CFS); 
-           #endif              
-           if (ret < 0)
-                 return ret;
-         }
-    
-         return 0;
+        struct snd_soc_pcm_runtime *rtd = substream->private_data;
+        struct snd_soc_dai *codec_dai = rtd->dai->codec_dai;
+        struct snd_soc_dai *cpu_dai = rtd->dai->cpu_dai;
+        int ret;
+          
+        DBG("Enter::%s----%d\n",__FUNCTION__,__LINE__);    
+        /*by Vincent Hsiung for EQ Vol Change*/
+        #define HW_PARAMS_FLAG_EQVOL_ON 0x21
+        #define HW_PARAMS_FLAG_EQVOL_OFF 0x22
+        if ((params->flags == HW_PARAMS_FLAG_EQVOL_ON)||(params->flags == HW_PARAMS_FLAG_EQVOL_OFF))
+        {
+               ret = codec_dai->ops->hw_params(substream, params, codec_dai); //by Vincent
+               DBG("Enter::%s----%d\n",__FUNCTION__,__LINE__);
+        }
+        else
+        {
+                
+                /* set codec DAI configuration */
+                #if defined (CONFIG_SND_RK29_CODEC_SOC_SLAVE) 
+                ret = snd_soc_dai_set_fmt(codec_dai, SND_SOC_DAIFMT_I2S |
+                                SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBS_CFS);
+                #endif 
+                #if defined (CONFIG_SND_RK29_CODEC_SOC_MASTER) 
+                ret = snd_soc_dai_set_fmt(codec_dai, SND_SOC_DAIFMT_I2S |
+                                SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBM_CFM ); 
+                #endif
+                if (ret < 0)
+                  return ret; 
+                #if 0
+                /* set cpu DAI configuration */
+                #if defined (CONFIG_SND_RK29_CODEC_SOC_SLAVE) 
+                ret = snd_soc_dai_set_fmt(cpu_dai, SND_SOC_DAIFMT_I2S |
+                                SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBM_CFM);
+                #endif 
+                #if defined (CONFIG_SND_RK29_CODEC_SOC_MASTER) 
+                ret = snd_soc_dai_set_fmt(cpu_dai, SND_SOC_DAIFMT_I2S |
+                                SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBS_CFS);        
+                #endif         
+                if (ret < 0)
+                  return ret;
+                #endif
+        }
+
+        snd_soc_dai_set_clkdiv(codec_dai, WM8900_BCLK_DIV, WM8900_BCLK_DIV_4);
+        snd_soc_dai_set_clkdiv(codec_dai, WM8900_LRCLK_MODE, 0x400);
+        snd_soc_dai_set_clkdiv(codec_dai, WM8900_DAC_LRCLK,0x40);
+
+        return 0;
 }
 
 static const struct snd_soc_dapm_widget wm8900_dapm_widgets[] = {
@@ -85,8 +92,8 @@ static const struct snd_soc_dapm_widget wm8900_dapm_widgets[] = {
 
 static const struct snd_soc_dapm_route audio_map[]= {
        
-       {"Audio Out", NULL, "LOUT1"},
-       {"Audio Out", NULL, "ROUT1"},
+       {"Audio Out", NULL, "HP_L"},
+       {"Audio Out", NULL, "HP_R"},
        {"Line in", NULL, "RINPUT1"},
        {"Line in", NULL, "LINPUT1"},
        {"Micn", NULL, "RINPUT2"},
@@ -101,27 +108,22 @@ static int rk29_wm8900_init(struct snd_soc_codec *codec)
        struct snd_soc_dai *codec_dai = &codec->dai[0];
        int ret;
          
-    DBG("Enter::%s----%d\n",__FUNCTION__,__LINE__);
-    
-    ret = snd_soc_dai_set_sysclk(codec_dai, 0,
-               12000000, SND_SOC_CLOCK_IN);
-       if (ret < 0) {
-               printk(KERN_ERR "Failed to set WM8900 SYSCLK: %d\n", ret);
-               return ret;
-       }
-       
-    /* Add specific widgets */
+        DBG("Enter::%s----%d\n",__FUNCTION__,__LINE__);
+
+        /* Add specific widgets */
        snd_soc_dapm_new_controls(codec, wm8900_dapm_widgets,
                                  ARRAY_SIZE(wm8900_dapm_widgets));
-       snd_soc_dapm_nc_pin(codec, "LOUT1");
-       snd_soc_dapm_nc_pin(codec, "ROUT1");
-       
-    /* Set up specific audio path audio_mapnects */
-    snd_soc_dapm_add_routes(codec, audio_map, ARRAY_SIZE(audio_map));
-       
-    snd_soc_dapm_sync(codec);
-    return 0;
+       DBG("Enter::%s----%d\n",__FUNCTION__,__LINE__);
+        /* Set up specific audio path audio_mapnects */
+        snd_soc_dapm_add_routes(codec, audio_map, ARRAY_SIZE(audio_map));
+        DBG("Enter::%s----%d\n",__FUNCTION__,__LINE__);
+        snd_soc_dapm_nc_pin(codec, "HP_L");
+        DBG("Enter::%s----%d\n",__FUNCTION__,__LINE__);
+       snd_soc_dapm_nc_pin(codec, "HP_R");
+       DBG("Enter::%s----%d\n",__FUNCTION__,__LINE__);
+        snd_soc_dapm_sync(codec);
+        DBG("Enter::%s----%d\n",__FUNCTION__,__LINE__);
+        return 0;
 }
 
 static struct snd_soc_ops rk29_ops = {
@@ -131,7 +133,7 @@ static struct snd_soc_ops rk29_ops = {
 static struct snd_soc_dai_link rk29_dai = {
          .name = "WM8900",
          .stream_name = "WM8900 PCM",
-         .cpu_dai = &rk29_i2s_dai,
+         .cpu_dai = &rk29_i2s_dai[1],
          .codec_dai = &wm8900_dai,
          .init = rk29_wm8900_init,
          .ops = &rk29_ops,
@@ -155,7 +157,7 @@ static struct platform_device *rk29_snd_device;
 static int __init audio_card_init(void)
 {
        int ret =0;     
-    DBG("Enter::%s----%d\n",__FUNCTION__,__LINE__);
+        DBG("Enter::%s----%d\n",__FUNCTION__,__LINE__);
        rk29_snd_device = platform_device_alloc("soc-audio", -1);
        if (!rk29_snd_device) {
                  DBG("platform device allocation failed\n");
@@ -166,8 +168,8 @@ static int __init audio_card_init(void)
        rk29_snd_devdata.dev = &rk29_snd_device->dev;
        ret = platform_device_add(rk29_snd_device);
        if (ret) {
-           DBG("platform device add failed\n");
-           platform_device_put(rk29_snd_device);
+               DBG("platform device add failed\n");
+               platform_device_put(rk29_snd_device);
        }
        return ret;
 }