From: 张晴 Date: Mon, 24 Mar 2014 10:11:41 +0000 (+0800) Subject: rk3288:pwm_regulator:slove set pwm voltage out of table X-Git-Tag: firefly_0821_release~5869 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=7b1976a84d6c5eb0da8d516f21ad7f8ea91da838;p=firefly-linux-kernel-4.4.55.git rk3288:pwm_regulator:slove set pwm voltage out of table --- diff --git a/drivers/regulator/rockchip-pwm-regulator.c b/drivers/regulator/rockchip-pwm-regulator.c index 15d3acfcfc95..ad72c3b7916c 100755 --- a/drivers/regulator/rockchip-pwm-regulator.c +++ b/drivers/regulator/rockchip-pwm-regulator.c @@ -35,7 +35,7 @@ #include -#if 0 +#if 1 #define DBG(x...) printk(KERN_INFO x) #else #define DBG(x...) @@ -107,9 +107,9 @@ static int pwm_regulator_set_voltage(struct regulator_dev *dev, u32 size = g_pdata->pwm_vol_map_count; u32 i, vol,pwm_value; - DBG("%s: min_uV = %d, max_uV = %d \n",__FUNCTION__, min_uV,max_uV); + DBG("%s: min_uV = %d, max_uV = %d\n",__FUNCTION__, min_uV,max_uV); - if (min_uV < voltage_map[0] ||max_uV > voltage_map[size]) + if (min_uV < voltage_map[0] ||max_uV > voltage_map[size-1]) { printk("%s: voltage_map voltage is out of table\n",__func__); return -EINVAL;