rk30 phone: add codec reset function, modify rk30_i2s.c, do not use SDO1 to SDO3...
author宋秀杰 <sxj@rock-chips.com>
Mon, 7 May 2012 04:43:50 +0000 (12:43 +0800)
committer宋秀杰 <sxj@rock-chips.com>
Mon, 7 May 2012 04:43:50 +0000 (12:43 +0800)
arch/arm/mach-rk30/board-rk30-phone-loquat.c
drivers/mfd/tlv320aic3262-core.c
sound/soc/codecs/tlv320aic326x.c
sound/soc/rk29/rk30_i2s.c

index 2dbb6f3742f19fd204d28eee81f829dd2a3d45cf..4c497cb09913191527dd34d661c00b4b96fae62b 100755 (executable)
@@ -44,6 +44,8 @@
 #if defined(CONFIG_HDMI_RK30)
        #include "../../../drivers/video/rockchip/hdmi/rk_hdmi.h"
 #endif
+#include <linux/mfd/tlv320aic3262-core.h>
+#include <linux/mfd/tlv320aic3262-registers.h>
 
 #if defined(CONFIG_SPIM_RK29)
 #include "../../../drivers/spi/rk29_spim.h"
@@ -1442,6 +1444,39 @@ static struct platform_device *devices[] __initdata = {
 #endif
 };
 
+static struct aic3262_gpio_setup aic3262_gpio[] = {
+       { // GPIO1
+               .used           = 0,
+               .in             = 0,
+               .value          = AIC3262_GPIO1_FUNC_INT1_OUTPUT ,
+               
+       },
+       {// GPIO2
+               .used           = 0,
+               .in             = 0,
+               .value          = AIC3262_GPIO2_FUNC_CLOCK_OUTPUT,
+       },
+       {// GPI1
+               .used           = 1,
+               .in             = 1,
+               .value          = 0,
+       },
+       {// GPI2
+               .used           = 1,
+               .in             = 1,
+               .value          = AIC3262_GPO1_FUNC_DISABLED,
+       },
+       {// GPO1
+               .used           = 0,
+               .in             = 0,
+               .value          = AIC3262_GPO1_FUNC_ADC_MOD_CLK_OUTPUT,
+       },
+};
+static struct aic3262_pdata aic3262_codec_pdata = {
+       .gpio           = aic3262_gpio,
+       .gpio_reset = RK30_PIN0_PB7,
+};
+
 // i2c
 #ifdef CONFIG_I2C0_RK30
 static struct i2c_board_info __initdata i2c0_info[] = {
@@ -1498,6 +1533,7 @@ static struct i2c_board_info __initdata i2c0_info[] = {
                .type                   = "tlv320aic3262",
                .addr           = 0x18,
                .flags                  = 0,
+               .platform_data = &aic3262_codec_pdata,
        },
 #endif
 
index 4e058aca1fd056470e2859e9df7ff2fb3c1bf293..ddf4bd6f32e1ca44eecc4c01881e8dceaf44e9af 100644 (file)
@@ -12,6 +12,9 @@
 
 #include <linux/mfd/tlv320aic3262-core.h>
 #include <linux/mfd/tlv320aic3262-registers.h>
+#include <mach/gpio.h>
+#include <mach/iomux.h>
+
 #define DEBUG 1
 struct aic3262_gpio
 {
@@ -317,7 +320,7 @@ static int aic3262_device_init(struct aic3262 *aic3262, int irq)
        u8 revID, pgID;
        unsigned int naudint = 0;
        u8 resetVal = 1;
-       printk("aic3262_device_init beginning\n");
+       //printk("aic3262_device_init beginning\n");
 
        mutex_init(&aic3262->io_lock);
        dev_set_drvdata(aic3262->dev, aic3262);
@@ -328,15 +331,14 @@ static int aic3262_device_init(struct aic3262 *aic3262, int irq)
                                dev_err(aic3262->dev,"not able to acquire gpio %d for reseting the AIC3262 \n", pdata->gpio_reset);
                                goto err_return;
                        }
+                       rk30_mux_api_set(GPIO0B7_I2S8CHSDO3_NAME, GPIO0B_GPIO0B7);  
                        gpio_direction_output(pdata->gpio_reset, 1);
                        msleep(5);
                        gpio_direction_output(pdata->gpio_reset, 0);
                        msleep(5);
                        gpio_direction_output(pdata->gpio_reset, 1);
 //                     gpio_set_value(pdata->gpio_reset, 0);
-                       msleep(5);
-                       
-                       
+                       msleep(5);      
                }       
        }
 
index 33d7cd8e45eefb055aec4d5b3de08bc411418ef2..bc2a16cd7e425028919f159268b1657d6b9a78c2 100644 (file)
@@ -2741,7 +2741,7 @@ static void test_playback(void)
        int ret;
        printk("test palyback start\n");
 
-       record_in1lr( );
+       AP_to_headphone( );
 
 }
 
index 348c3ce54d65dbd757f5c662413c32110dc0e45e..19ce1882057152677fc475e70393f0413f50cec2 100755 (executable)
@@ -491,9 +491,9 @@ static int rockchip_i2s_dai_probe(struct snd_soc_dai *dai)
                        rk30_mux_api_set(GPIO0B2_I2S8CHLRCKRX_NAME, GPIO0B_I2S_8CH_LRCK_RX);
                        rk30_mux_api_set(GPIO0B3_I2S8CHLRCKTX_NAME, GPIO0B_I2S_8CH_LRCK_TX);    
                        rk30_mux_api_set(GPIO0B4_I2S8CHSDO0_NAME, GPIO0B_I2S_8CH_SDO0);
-                       rk30_mux_api_set(GPIO0B5_I2S8CHSDO1_NAME, GPIO0B_I2S_8CH_SDO1);
-                       rk30_mux_api_set(GPIO0B6_I2S8CHSDO2_NAME, GPIO0B_I2S_8CH_SDO2);
-                       rk30_mux_api_set(GPIO0B7_I2S8CHSDO3_NAME, GPIO0B_I2S_8CH_SDO3);        
+                       //rk30_mux_api_set(GPIO0B5_I2S8CHSDO1_NAME, GPIO0B_I2S_8CH_SDO1);
+                       //rk30_mux_api_set(GPIO0B6_I2S8CHSDO2_NAME, GPIO0B_I2S_8CH_SDO2);
+                       //rk30_mux_api_set(GPIO0B7_I2S8CHSDO3_NAME, GPIO0B_I2S_8CH_SDO3);        
                        break;
         case 1:
                        rk30_mux_api_set(GPIO0C0_I2S12CHCLK_NAME, GPIO0C_I2S1_2CH_CLK);