From 43531eff8cd70924d6f03635f0ebf0916258da74 Mon Sep 17 00:00:00 2001 From: cym Date: Sat, 9 Oct 2010 14:17:19 +0800 Subject: [PATCH] move lp8725 DVS pin control function to board_raho.c --- arch/arm/mach-rk2818/board-raho.c | 11 +++++++++++ drivers/regulator/rk2818_lp8725.c | 5 +---- include/linux/regulator/rk2818_lp8725.h | 2 +- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/arch/arm/mach-rk2818/board-raho.c b/arch/arm/mach-rk2818/board-raho.c index 950a3355b889..e624460d8eb6 100755 --- a/arch/arm/mach-rk2818/board-raho.c +++ b/arch/arm/mach-rk2818/board-raho.c @@ -370,6 +370,17 @@ struct pca9554_platform_data rk2818_pca9554_data={ *author: cym *****************************************************************************************/ #if defined (CONFIG_RK2818_REGULATOR_LP8725) + +/*DVS pin control, make sure it is high level at start.*/ +int rk2818_lp8725_pm_control(void) +{ + rk2818_mux_api_set(GPIOC_LCDC24BIT_SEL_NAME, IOMUXB_GPIO0_C2_7); + gpio_request(RK2818_PIN_PC2,NULL); + gpio_direction_output(RK2818_PIN_PC2,1); + gpio_set_value(RK2818_PIN_PC2,1); + return 0; +} + /*ldo1 2V8OUT USB2.5V LCD_VCC*/ static struct regulator_consumer_supply ldo1_consumers[] = { { diff --git a/drivers/regulator/rk2818_lp8725.c b/drivers/regulator/rk2818_lp8725.c index e17408210efd..3a99ff1a527a 100755 --- a/drivers/regulator/rk2818_lp8725.c +++ b/drivers/regulator/rk2818_lp8725.c @@ -922,10 +922,7 @@ static int __devinit lp8725_i2c_probe(struct i2c_client *i2c, const struct i2c_d //DVS pin control, make sure it is high level at start. #ifdef PM_CONTROL - rk2818_mux_api_set(GPIOC_LCDC24BIT_SEL_NAME, IOMUXB_GPIO0_C2_7); - ret=gpio_request(RK2818_PIN_PC2,NULL); - gpio_direction_output(RK2818_PIN_PC2,1); - gpio_set_value(RK2818_PIN_PC2,1); + rk2818_lp8725_pm_control(); #endif lp8725_set_init(); diff --git a/include/linux/regulator/rk2818_lp8725.h b/include/linux/regulator/rk2818_lp8725.h index 4cb2415c5d0c..f99602e0238c 100644 --- a/include/linux/regulator/rk2818_lp8725.h +++ b/include/linux/regulator/rk2818_lp8725.h @@ -42,5 +42,5 @@ struct lp8725_platform_data { int num_regulators; struct lp8725_regulator_subdev *regulators; }; - +extern int rk2818_lp8725_pm_control(void); #endif -- 2.34.1