From 6290d60656e9f4f5a0071bafa798370ab35978a0 Mon Sep 17 00:00:00 2001 From: Axel Lin Date: Fri, 30 Aug 2013 18:06:06 +0800 Subject: regulator: tps65217: Convert to use linear ranges Below is the equation in original code: tps65217_uv1_ranges: 0 ... 24: uV = vsel * 25000 + 900000; 25 ... 52: uV = (vsel - 24) * 50000 + 1500000; = (vsel - 25) * 50000 + 1550000; 53 ... 55: uV = (vsel - 52) * 100000 + 2900000; = (vsel - 53) * 100000 + 3000000; 56 ... 62: uV = 3300000; tps65217_uv2_ranges: 0 ... 8: uV = vsel * 50000 + 1500000; 9 ... 13: uV = (vsel - 8) * 100000 + 1900000; = (vsel - 9) * 100000 + 2000000; 14 ... 31: uV = (vsel - 13) * 50000 + 2400000; = (vsel - 14) * 50000 + 2450000; The voltage tables are composed of linear ranges. This patch converts this driver to use multiple linear ranges APIs. In original code, voltage range for DCDC1 is 900000 ~ 1800000 and voltage range for DCDC3 is 900000 ~ 1500000. This patch separates the range 25~52 in tps65217_uv1_ranges table to two linear ranges: 25~30 and 31~52. This change makes it possible to reuse the same linear_ranges table for DCDCx. Signed-off-by: Axel Lin Signed-off-by: Mark Brown --- include/linux/mfd/tps65217.h | 19 ------------------- 1 file changed, 19 deletions(-) (limited to 'include/linux/mfd/tps65217.h') diff --git a/include/linux/mfd/tps65217.h b/include/linux/mfd/tps65217.h index 29eab2bd3dfa..a5a7f0130e96 100644 --- a/include/linux/mfd/tps65217.h +++ b/include/linux/mfd/tps65217.h @@ -243,24 +243,6 @@ struct tps65217_board { struct tps65217_bl_pdata *bl_pdata; }; -/** - * struct tps_info - packages regulator constraints - * @name: Voltage regulator name - * @min_uV: minimum micro volts - * @max_uV: minimum micro volts - * @vsel_to_uv: Function pointer to get voltage from selector - * @uv_to_vsel: Function pointer to get selector from voltage - * - * This data is used to check the regualtor voltage limits while setting. - */ -struct tps_info { - const char *name; - int min_uV; - int max_uV; - int (*vsel_to_uv)(unsigned int vsel); - int (*uv_to_vsel)(int uV, unsigned int *vsel); -}; - /** * struct tps65217 - tps65217 sub-driver chip access routines * @@ -273,7 +255,6 @@ struct tps65217 { unsigned int id; struct regulator_desc desc[TPS65217_NUM_REGULATOR]; struct regulator_dev *rdev[TPS65217_NUM_REGULATOR]; - struct tps_info *info[TPS65217_NUM_REGULATOR]; struct regmap *regmap; }; -- cgit v1.2.3-59-g8ed1b