From: yxj Date: Wed, 3 Apr 2013 10:10:42 +0000 (+0800) Subject: rk3188 tb board:add mfd rk616 X-Git-Tag: firefly_0821_release~7296 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=113f008a3c966c8bcdac39b8ec4b4be7477196d8;p=firefly-linux-kernel-4.4.55.git rk3188 tb board:add mfd rk616 --- diff --git a/arch/arm/mach-rk30/board-rk3168-tb.c b/arch/arm/mach-rk30/board-rk3168-tb.c index 0b9d9b314b53..f207a4b93cf0 100755 --- a/arch/arm/mach-rk30/board-rk3168-tb.c +++ b/arch/arm/mach-rk30/board-rk3168-tb.c @@ -56,6 +56,11 @@ #include #endif +#if defined(CONFIG_MFD_RK616) +#include +#endif + + #if defined(CONFIG_RK_HDMI) #include "../../../drivers/video/rockchip/hdmi/rk_hdmi.h" #endif @@ -689,6 +694,55 @@ static struct rk610_ctl_platform_data rk610_ctl_pdata = { }; #endif +#if defined(CONFIG_MFD_RK616) +#define RK616_RST_PIN RK30_PIN3_PB2 +#define RK616_PWREN_PIN RK30_PIN0_PA3 +#define RK616_SCL_RATE (100*1000) //i2c scl rate +static int rk616_power_on_init(void) +{ + int ret; + + if(RK616_PWREN_PIN != INVALID_GPIO) + { + ret = gpio_request(RK616_PWREN_PIN, "rk616 pwren"); + if (ret) + { + printk(KERN_ERR "rk616 pwren gpio request fail\n"); + } + else + { + gpio_direction_output(RK616_PWREN_PIN,GPIO_HIGH); + } + } + + if(RK616_RST_PIN != INVALID_GPIO) + { + ret = gpio_request(RK616_RST_PIN, "rk616 reset"); + if (ret) + { + printk(KERN_ERR "rk616 reset gpio request fail\n"); + } + else + { + gpio_direction_output(RK616_RST_PIN, GPIO_HIGH); + msleep(100); + gpio_direction_output(RK616_RST_PIN, GPIO_LOW); + msleep(100); + gpio_set_value(RK616_RST_PIN, GPIO_HIGH); + } + } + + return 0; + +} + + +static struct rk616_platform_data rk616_pdata = { + .power_init = rk616_power_on_init, + .scl_rate = RK616_SCL_RATE, +}; +#endif + #ifdef CONFIG_SND_SOC_RK610 static int rk610_codec_io_init(void) { @@ -2052,6 +2106,15 @@ static struct i2c_board_info __initdata i2c3_info[] = { #ifdef CONFIG_I2C4_RK30 static struct i2c_board_info __initdata i2c4_info[] = { +#if defined (CONFIG_MFD_RK616) + { + .type = "rk616", + .addr = 0x50, + .flags = 0, + .platform_data = &rk616_pdata, + }, +#endif + }; #endif