From 8f002da463467a9af839293edea4dd65e1580699 Mon Sep 17 00:00:00 2001 From: lw Date: Tue, 31 Jul 2012 19:09:21 +0800 Subject: [PATCH] phonepad:modify pwm regulator struct definition --- arch/arm/mach-rk30/board-rk30-phonepad.c | 2 +- drivers/regulator/rk30-pwm-regulator.c | 4 ++-- include/linux/regulator/rk29-pwm-regulator.h | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/arch/arm/mach-rk30/board-rk30-phonepad.c b/arch/arm/mach-rk30/board-rk30-phonepad.c index 82a8f031d5ce..6870e47d2995 100755 --- a/arch/arm/mach-rk30/board-rk30-phonepad.c +++ b/arch/arm/mach-rk30/board-rk30-phonepad.c @@ -1552,7 +1552,7 @@ static struct pwm_platform_data pwm_regulator_info[1] = { .pwm_voltage = 1100000, .min_uV = 1000000, .max_uV = 1400000, - .duty_cycle = 455, //45.5% + .coefficient = 455, //45.5% .pwm_voltage_map = pwm_voltage_map, .init_data = &pwm_regulator_init_dcdc[0], }, diff --git a/drivers/regulator/rk30-pwm-regulator.c b/drivers/regulator/rk30-pwm-regulator.c index 07ab738f1792..46bf1b75982e 100755 --- a/drivers/regulator/rk30-pwm-regulator.c +++ b/drivers/regulator/rk30-pwm-regulator.c @@ -179,7 +179,7 @@ static int pwm_regulator_set_voltage(struct regulator_dev *dev, struct rk_pwm_dcdc *dcdc = rdev_get_drvdata(dev); const int *voltage_map = dcdc->pdata->pwm_voltage_map; int max = dcdc->pdata->max_uV; - int duty_cycle = dcdc->pdata->duty_cycle; + int coefficient = dcdc->pdata->coefficient; u32 size = dcdc->desc.n_voltages, i, vol,pwm_value; DBG("%s: min_uV = %d, max_uV = %d\n",__FUNCTION__, min_uV,max_uV); @@ -202,7 +202,7 @@ static int pwm_regulator_set_voltage(struct regulator_dev *dev, dcdc->pdata->pwm_voltage = vol; // VDD12 = 1.40 - 0.455*D , ÆäÖÐDΪPWMÕ¼¿Õ±È, - pwm_value = (max-vol)/duty_cycle/10; // pwm_value %, duty_cycle = D*1000 + pwm_value = (max-vol)/coefficient/10; // pwm_value %, coefficient *1000 if (pwm_set_rate(dcdc->pdata,1000*1000,pwm_value)!=0) { diff --git a/include/linux/regulator/rk29-pwm-regulator.h b/include/linux/regulator/rk29-pwm-regulator.h index a8c691727f47..70904dc447be 100755 --- a/include/linux/regulator/rk29-pwm-regulator.h +++ b/include/linux/regulator/rk29-pwm-regulator.h @@ -57,7 +57,7 @@ struct pwm_platform_data { unsigned int pwm_iomux_pwm; int pwm_iomux_gpio; int pwm_voltage; - int duty_cycle; + int coefficient; int min_uV; int max_uV; int *pwm_voltage_map; -- 2.34.1