From b8506ff13803eed97631472257d27e398abf3c4f Mon Sep 17 00:00:00 2001 From: wuhao Date: Thu, 28 Mar 2013 16:38:49 +0800 Subject: [PATCH] rk3188 sdk: config cat66121 --- arch/arm/configs/rk3188_sdk_defconfig | 7 ++++- arch/arm/mach-rk3188/board-rk3188-sdk.c | 36 +++++++++++++++++++++++++ sound/soc/codecs/rt5616.c | 26 ++++++++++++++++++ 3 files changed, 68 insertions(+), 1 deletion(-) diff --git a/arch/arm/configs/rk3188_sdk_defconfig b/arch/arm/configs/rk3188_sdk_defconfig index 81a240d1bf56..68692f9af9a4 100644 --- a/arch/arm/configs/rk3188_sdk_defconfig +++ b/arch/arm/configs/rk3188_sdk_defconfig @@ -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 diff --git a/arch/arm/mach-rk3188/board-rk3188-sdk.c b/arch/arm/mach-rk3188/board-rk3188-sdk.c index b5a4ea374dfe..f9b5da6b8128 100644 --- a/arch/arm/mach-rk3188/board-rk3188-sdk.c +++ b/arch/arm/mach-rk3188/board-rk3188-sdk.c @@ -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 diff --git a/sound/soc/codecs/rt5616.c b/sound/soc/codecs/rt5616.c index 64e019b817d4..b773870ba80d 100755 --- a/sound/soc/codecs/rt5616.c +++ b/sound/soc/codecs/rt5616.c @@ -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, -- 2.34.1