rk3188 sdk: config cat66121
authorwuhao <wuhao@wuhao@rock-chips.com>
Thu, 28 Mar 2013 08:38:49 +0000 (16:38 +0800)
committerwuhao <wuhao@wuhao@rock-chips.com>
Thu, 28 Mar 2013 08:38:49 +0000 (16:38 +0800)
arch/arm/configs/rk3188_sdk_defconfig
arch/arm/mach-rk3188/board-rk3188-sdk.c
sound/soc/codecs/rt5616.c

index 81a240d1bf564aa4f2c05fa5f10a330e49f8f365..68692f9af9a4c7bf60a2f3a1df2b635f10d5af9c 100644 (file)
@@ -305,9 +305,14 @@ CONFIG_BACKLIGHT_CLASS_DEVICE=y
 CONFIG_DISPLAY_SUPPORT=y
 CONFIG_LCD_B101EW05=y
 CONFIG_FB_ROCKCHIP=y
-CONFIG_ONE_LCDC_DUAL_OUTPUT_INF=y
+CONFIG_DUAL_LCDC_DUAL_DISP_IN_KERNEL=y
 CONFIG_LCDC_RK3188=y
 CONFIG_LCDC0_RK3188=y
+CONFIG_LCDC1_RK3188=y
+CONFIG_RK_HDMI=y
+CONFIG_HDMI_CAT66121=y
+CONFIG_HDMI_SOURCE_LCDC1=y
+CONFIG_RK_HDMI_CTL_CODEC=y
 CONFIG_RGA_RK30=y
 CONFIG_LOGO=y
 # CONFIG_LOGO_LINUX_MONO is not set
index b5a4ea374dfea3d664b6dafc3ed173170ca865f9..f9b5da6b8128bc391bcd1625ee4639c120f45db7 100644 (file)
@@ -468,6 +468,32 @@ static struct sensor_platform_data cm3217_info = {
 
 #endif
 
+#ifdef CONFIG_RK_HDMI
+#define RK_HDMI_RST_PIN                        RK30_PIN3_PB2
+static int rk_hdmi_power_init(void)
+{
+       int ret;
+
+       if(RK_HDMI_RST_PIN != INVALID_GPIO)
+       {
+               if (gpio_request(RK_HDMI_RST_PIN, NULL)) {
+                       printk("func %s, line %d: request gpio fail\n", __FUNCTION__, __LINE__);
+                       return -1;
+               }
+               gpio_direction_output(RK_HDMI_RST_PIN, GPIO_LOW);
+               gpio_set_value(RK_HDMI_RST_PIN, GPIO_LOW);
+               msleep(100);
+               gpio_set_value(RK_HDMI_RST_PIN, GPIO_HIGH);
+               msleep(50);
+       }
+       return 0;
+}
+static struct rk_hdmi_platform_data rk_hdmi_pdata = {
+       .io_init = rk_hdmi_power_init,
+};
+#endif
+
+
 #ifdef CONFIG_FB_ROCKCHIP
 
 #define LCD_CS_PIN         INVALID_GPIO
@@ -2042,6 +2068,16 @@ static struct i2c_board_info __initdata i2c2_info[] = {
                .platform_data = &cm3217_info,
        },
 #endif
+#if defined(CONFIG_HDMI_CAT66121)
+       {
+               .type           = "cat66121_hdmi",
+               .addr           = 0x4c,
+               .flags          = 0,
+               .irq            = RK30_PIN2_PD6,
+               .platform_data  = &rk_hdmi_pdata,
+       },
+#endif
+
 };
 #endif
 
index 64e019b817d4624411cb5f19b06e8a8931041d40..b773870ba80deea07ef390992f363df9f4ddaf9b 100755 (executable)
@@ -62,6 +62,8 @@ static struct rt5616_init_reg init_list[] = {
 };
 #define RT5616_INIT_REG_LEN ARRAY_SIZE(init_list)
 
+static struct snd_soc_codec *rt5616_codec;
+
 static int rt5616_reg_init(struct snd_soc_codec *codec)
 {
        int i;
@@ -1478,6 +1480,28 @@ static int rt5616_set_bias_level(struct snd_soc_codec *codec,
        return 0;
 }
 
+void codec_set_spk(bool on)
+{
+
+       struct snd_soc_codec *codec = rt5616_codec;
+       printk("%s: %d\n", __func__, on);
+
+       if(!codec)
+               return;
+
+       mutex_lock(&codec->mutex);
+       if(on){
+               printk(">>>> snd_soc_dapm_enable_pin\n");
+               snd_soc_dapm_enable_pin(&codec->dapm, "Headphone Jack");
+               snd_soc_dapm_enable_pin(&codec->dapm, "Ext Spk");
+       }else{
+               printk(">>>> snd_soc_dapm_disable_pin\n");
+               snd_soc_dapm_disable_pin(&codec->dapm, "Headphone Jack");
+               snd_soc_dapm_disable_pin(&codec->dapm, "Ext Spk");
+       }
+       snd_soc_dapm_sync(&codec->dapm);
+       mutex_unlock(&codec->mutex);
+}
 static int rt5616_probe(struct snd_soc_codec *codec)
 {
        struct rt5616_priv *rt5616 = snd_soc_codec_get_drvdata(codec);
@@ -1507,6 +1531,8 @@ static int rt5616_probe(struct snd_soc_codec *codec)
        codec->dapm.bias_level = SND_SOC_BIAS_STANDBY;
        rt5616->codec = codec;
 
+      rt5616_codec = codec;
+      
        snd_soc_add_controls(codec, rt5616_snd_controls,
                        ARRAY_SIZE(rt5616_snd_controls));
        snd_soc_dapm_new_controls(&codec->dapm, rt5616_dapm_widgets,