rk3288:pwm_regulator:slove set pwm voltage out of table
author张晴 <zhangqing@rock-chips.com>
Mon, 24 Mar 2014 10:11:41 +0000 (18:11 +0800)
committer张晴 <zhangqing@rock-chips.com>
Mon, 24 Mar 2014 10:11:41 +0000 (18:11 +0800)
drivers/regulator/rockchip-pwm-regulator.c

index 15d3acfcfc95e6933ac799cbb652504f276c62d3..ad72c3b7916c7e25d55fbb6a246b99c564329ecb 100755 (executable)
@@ -35,7 +35,7 @@
 #include <linux/regulator/machine.h>\r
 \r
 \r
-#if 0\r
+#if 1\r
 #define DBG(x...)      printk(KERN_INFO x)\r
 #else\r
 #define DBG(x...)\r
@@ -107,9 +107,9 @@ static int pwm_regulator_set_voltage(struct regulator_dev *dev,
        u32 size = g_pdata->pwm_vol_map_count;\r
        u32 i, vol,pwm_value;\r
 \r
-       DBG("%s:  min_uV = %d, max_uV = %d \n",__FUNCTION__, min_uV,max_uV);\r
+       DBG("%s:  min_uV = %d, max_uV = %d\n",__FUNCTION__, min_uV,max_uV);\r
 \r
-       if (min_uV < voltage_map[0] ||max_uV > voltage_map[size])\r
+       if (min_uV < voltage_map[0] ||max_uV > voltage_map[size-1])\r
        {\r
                printk("%s: voltage_map voltage is out of table\n",__func__);\r
                return -EINVAL;\r