diff options
| -rw-r--r-- | drivers/mfd/88pm860x-core.c | 36 | ||||
| -rw-r--r-- | drivers/regulator/88pm8607.c | 533 | ||||
| -rw-r--r-- | drivers/regulator/ab3100.c | 10 | ||||
| -rw-r--r-- | drivers/regulator/bq24022.c | 1 | ||||
| -rw-r--r-- | drivers/regulator/core.c | 83 | ||||
| -rw-r--r-- | drivers/regulator/mc13783-regulator.c | 6 | ||||
| -rw-r--r-- | drivers/regulator/twl-regulator.c | 138 | ||||
| -rw-r--r-- | include/linux/mfd/88pm860x.h | 3 | ||||
| -rw-r--r-- | include/linux/regulator/machine.h | 9 |
9 files changed, 414 insertions, 405 deletions
diff --git a/drivers/mfd/88pm860x-core.c b/drivers/mfd/88pm860x-core.c index 6a14d2b1ccf..405d2d5183c 100644 --- a/drivers/mfd/88pm860x-core.c +++ b/drivers/mfd/88pm860x-core.c | |||
| @@ -173,33 +173,35 @@ static struct resource regulator_resources[] = { | |||
| 173 | PM8607_REG_RESOURCE(LDO9, LDO9), | 173 | PM8607_REG_RESOURCE(LDO9, LDO9), |
| 174 | PM8607_REG_RESOURCE(LDO10, LDO10), | 174 | PM8607_REG_RESOURCE(LDO10, LDO10), |
| 175 | PM8607_REG_RESOURCE(LDO12, LDO12), | 175 | PM8607_REG_RESOURCE(LDO12, LDO12), |
| 176 | PM8607_REG_RESOURCE(VIBRATOR_SET, VIBRATOR_SET), | ||
| 176 | PM8607_REG_RESOURCE(LDO14, LDO14), | 177 | PM8607_REG_RESOURCE(LDO14, LDO14), |
| 177 | }; | 178 | }; |
| 178 | 179 | ||
| 179 | #define PM8607_REG_DEVS(_name, _id) \ | 180 | #define PM8607_REG_DEVS(_id) \ |
| 180 | { \ | 181 | { \ |
| 181 | .name = "88pm8607-" #_name, \ | 182 | .name = "88pm860x-regulator", \ |
| 182 | .num_resources = 1, \ | 183 | .num_resources = 1, \ |
| 183 | .resources = ®ulator_resources[PM8607_ID_##_id], \ | 184 | .resources = ®ulator_resources[PM8607_ID_##_id], \ |
| 184 | .id = PM8607_ID_##_id, \ | 185 | .id = PM8607_ID_##_id, \ |
| 185 | } | 186 | } |
| 186 | 187 | ||
| 187 | static struct mfd_cell regulator_devs[] = { | 188 | static struct mfd_cell regulator_devs[] = { |
| 188 | PM8607_REG_DEVS(buck1, BUCK1), | 189 | PM8607_REG_DEVS(BUCK1), |
| 189 | PM8607_REG_DEVS(buck2, BUCK2), | 190 | PM8607_REG_DEVS(BUCK2), |
| 190 | PM8607_REG_DEVS(buck3, BUCK3), | 191 | PM8607_REG_DEVS(BUCK3), |
| 191 | PM8607_REG_DEVS(ldo1, LDO1), | 192 | PM8607_REG_DEVS(LDO1), |
| 192 | PM8607_REG_DEVS(ldo2, LDO2), | 193 | PM8607_REG_DEVS(LDO2), |
| 193 | PM8607_REG_DEVS(ldo3, LDO3), | 194 | PM8607_REG_DEVS(LDO3), |
| 194 | PM8607_REG_DEVS(ldo4, LDO4), | 195 | PM8607_REG_DEVS(LDO4), |
| 195 | PM8607_REG_DEVS(ldo5, LDO5), | 196 | PM8607_REG_DEVS(LDO5), |
| 196 | PM8607_REG_DEVS(ldo6, LDO6), | 197 | PM8607_REG_DEVS(LDO6), |
| 197 | PM8607_REG_DEVS(ldo7, LDO7), | 198 | PM8607_REG_DEVS(LDO7), |
| 198 | PM8607_REG_DEVS(ldo8, LDO8), | 199 | PM8607_REG_DEVS(LDO8), |
| 199 | PM8607_REG_DEVS(ldo9, LDO9), | 200 | PM8607_REG_DEVS(LDO9), |
| 200 | PM8607_REG_DEVS(ldo10, LDO10), | 201 | PM8607_REG_DEVS(LDO10), |
| 201 | PM8607_REG_DEVS(ldo12, LDO12), | 202 | PM8607_REG_DEVS(LDO12), |
| 202 | PM8607_REG_DEVS(ldo14, LDO14), | 203 | PM8607_REG_DEVS(LDO13), |
| 204 | PM8607_REG_DEVS(LDO14), | ||
| 203 | }; | 205 | }; |
| 204 | 206 | ||
| 205 | struct pm860x_irq_data { | 207 | struct pm860x_irq_data { |
diff --git a/drivers/regulator/88pm8607.c b/drivers/regulator/88pm8607.c index 5fb83e2ced2..7d149a8d8d9 100644 --- a/drivers/regulator/88pm8607.c +++ b/drivers/regulator/88pm8607.c | |||
| @@ -23,9 +23,9 @@ struct pm8607_regulator_info { | |||
| 23 | struct regulator_dev *regulator; | 23 | struct regulator_dev *regulator; |
| 24 | struct i2c_client *i2c; | 24 | struct i2c_client *i2c; |
| 25 | 25 | ||
| 26 | int min_uV; | 26 | unsigned int *vol_table; |
| 27 | int max_uV; | 27 | unsigned int *vol_suspend; |
| 28 | int step_uV; | 28 | |
| 29 | int vol_reg; | 29 | int vol_reg; |
| 30 | int vol_shift; | 30 | int vol_shift; |
| 31 | int vol_nbits; | 31 | int vol_nbits; |
| @@ -36,83 +36,189 @@ struct pm8607_regulator_info { | |||
| 36 | int slope_double; | 36 | int slope_double; |
| 37 | }; | 37 | }; |
| 38 | 38 | ||
| 39 | static inline int check_range(struct pm8607_regulator_info *info, | 39 | static const unsigned int BUCK1_table[] = { |
| 40 | int min_uV, int max_uV) | 40 | 725000, 750000, 775000, 800000, 825000, 850000, 875000, 900000, |
| 41 | { | 41 | 925000, 950000, 975000, 1000000, 1025000, 1050000, 1075000, 1100000, |
| 42 | if (max_uV < info->min_uV || min_uV > info->max_uV || min_uV > max_uV) | 42 | 1125000, 1150000, 1175000, 1200000, 1225000, 1250000, 1275000, 1300000, |
| 43 | return -EINVAL; | 43 | 1325000, 1350000, 1375000, 1400000, 1425000, 1450000, 1475000, 1500000, |
| 44 | 0, 25000, 50000, 75000, 100000, 125000, 150000, 175000, | ||
| 45 | 200000, 225000, 250000, 275000, 300000, 325000, 350000, 375000, | ||
| 46 | 400000, 425000, 450000, 475000, 500000, 525000, 550000, 575000, | ||
| 47 | 600000, 625000, 650000, 675000, 700000, 725000, 750000, 775000, | ||
| 48 | }; | ||
| 44 | 49 | ||
| 45 | return 0; | 50 | static const unsigned int BUCK1_suspend_table[] = { |
| 46 | } | 51 | 0, 25000, 50000, 75000, 100000, 125000, 150000, 175000, |
| 52 | 200000, 225000, 250000, 275000, 300000, 325000, 350000, 375000, | ||
| 53 | 400000, 425000, 450000, 475000, 500000, 525000, 550000, 575000, | ||
| 54 | 600000, 625000, 650000, 675000, 700000, 725000, 750000, 775000, | ||
| 55 | 800000, 825000, 850000, 875000, 900000, 925000, 950000, 975000, | ||
| 56 | 1000000, 1025000, 1050000, 1075000, 1100000, 1125000, 1150000, 1175000, | ||
| 57 | 1200000, 1225000, 1250000, 1275000, 1300000, 1325000, 1350000, 1375000, | ||
| 58 | 1400000, 1425000, 1450000, 1475000, 1500000, 1500000, 1500000, 1500000, | ||
| 59 | }; | ||
| 60 | |||
| 61 | static const unsigned int BUCK2_table[] = { | ||
| 62 | 0, 50000, 100000, 150000, 200000, 250000, 300000, 350000, | ||
| 63 | 400000, 450000, 500000, 550000, 600000, 650000, 700000, 750000, | ||
| 64 | 800000, 850000, 900000, 950000, 1000000, 1050000, 1100000, 1150000, | ||
| 65 | 1200000, 1250000, 1300000, 1350000, 1400000, 1450000, 1500000, 1550000, | ||
| 66 | 1600000, 1650000, 1700000, 1750000, 1800000, 1850000, 1900000, 1950000, | ||
| 67 | 2000000, 2050000, 2100000, 2150000, 2200000, 2250000, 2300000, 2350000, | ||
| 68 | 2400000, 2450000, 2500000, 2550000, 2600000, 2650000, 2700000, 2750000, | ||
| 69 | 2800000, 2850000, 2900000, 2950000, 3000000, 3000000, 3000000, 3000000, | ||
| 70 | }; | ||
| 71 | |||
| 72 | static const unsigned int BUCK2_suspend_table[] = { | ||
| 73 | 0, 50000, 100000, 150000, 200000, 250000, 300000, 350000, | ||
| 74 | 400000, 450000, 500000, 550000, 600000, 650000, 700000, 750000, | ||
| 75 | 800000, 850000, 900000, 950000, 1000000, 1050000, 1100000, 1150000, | ||
| 76 | 1200000, 1250000, 1300000, 1350000, 1400000, 1450000, 1500000, 1550000, | ||
| 77 | 1600000, 1650000, 1700000, 1750000, 1800000, 1850000, 1900000, 1950000, | ||
| 78 | 2000000, 2050000, 2100000, 2150000, 2200000, 2250000, 2300000, 2350000, | ||
| 79 | 2400000, 2450000, 2500000, 2550000, 2600000, 2650000, 2700000, 2750000, | ||
| 80 | 2800000, 2850000, 2900000, 2950000, 3000000, 3000000, 3000000, 3000000, | ||
| 81 | }; | ||
| 82 | |||
| 83 | static const unsigned int BUCK3_table[] = { | ||
| 84 | 0, 25000, 50000, 75000, 100000, 125000, 150000, 175000, | ||
| 85 | 200000, 225000, 250000, 275000, 300000, 325000, 350000, 375000, | ||
| 86 | 400000, 425000, 450000, 475000, 500000, 525000, 550000, 575000, | ||
| 87 | 600000, 625000, 650000, 675000, 700000, 725000, 750000, 775000, | ||
| 88 | 800000, 825000, 850000, 875000, 900000, 925000, 950000, 975000, | ||
| 89 | 1000000, 1025000, 1050000, 1075000, 1100000, 1125000, 1150000, 1175000, | ||
| 90 | 1200000, 1225000, 1250000, 1275000, 1300000, 1325000, 1350000, 1375000, | ||
| 91 | 1400000, 1425000, 1450000, 1475000, 1500000, 1500000, 1500000, 1500000, | ||
| 92 | }; | ||
| 93 | |||
| 94 | static const unsigned int BUCK3_suspend_table[] = { | ||
| 95 | 0, 25000, 50000, 75000, 100000, 125000, 150000, 175000, | ||
| 96 | 200000, 225000, 250000, 275000, 300000, 325000, 350000, 375000, | ||
| 97 | 400000, 425000, 450000, 475000, 500000, 525000, 550000, 575000, | ||
| 98 | 600000, 625000, 650000, 675000, 700000, 725000, 750000, 775000, | ||
| 99 | 800000, 825000, 850000, 875000, 900000, 925000, 950000, 975000, | ||
| 100 | 1000000, 1025000, 1050000, 1075000, 1100000, 1125000, 1150000, 1175000, | ||
| 101 | 1200000, 1225000, 1250000, 1275000, 1300000, 1325000, 1350000, 1375000, | ||
| 102 | 1400000, 1425000, 1450000, 1475000, 1500000, 1500000, 1500000, 1500000, | ||
| 103 | }; | ||
| 104 | |||
| 105 | static const unsigned int LDO1_table[] = { | ||
| 106 | 1800000, 1200000, 2800000, 0, | ||
| 107 | }; | ||
| 108 | |||
| 109 | static const unsigned int LDO1_suspend_table[] = { | ||
| 110 | 1800000, 1200000, 0, 0, | ||
| 111 | }; | ||
| 112 | |||
| 113 | static const unsigned int LDO2_table[] = { | ||
| 114 | 1800000, 1850000, 1900000, 2700000, 2750000, 2800000, 2850000, 3300000, | ||
| 115 | }; | ||
| 116 | |||
| 117 | static const unsigned int LDO2_suspend_table[] = { | ||
| 118 | 1800000, 1850000, 1900000, 2700000, 2750000, 2800000, 2850000, 2900000, | ||
| 119 | }; | ||
| 120 | |||
| 121 | static const unsigned int LDO3_table[] = { | ||
| 122 | 1800000, 1850000, 1900000, 2700000, 2750000, 2800000, 2850000, 3300000, | ||
| 123 | }; | ||
| 124 | |||
| 125 | static const unsigned int LDO3_suspend_table[] = { | ||
| 126 | 1800000, 1850000, 1900000, 2700000, 2750000, 2800000, 2850000, 2900000, | ||
| 127 | }; | ||
| 128 | |||
| 129 | static const unsigned int LDO4_table[] = { | ||
| 130 | 1800000, 1850000, 1900000, 2700000, 2750000, 2800000, 2900000, 3300000, | ||
| 131 | }; | ||
| 132 | |||
| 133 | static const unsigned int LDO4_suspend_table[] = { | ||
| 134 | 1800000, 1850000, 1900000, 2700000, 2750000, 2800000, 2900000, 2900000, | ||
| 135 | }; | ||
| 136 | |||
| 137 | static const unsigned int LDO5_table[] = { | ||
| 138 | 2900000, 3000000, 3100000, 3300000, | ||
| 139 | }; | ||
| 140 | |||
| 141 | static const unsigned int LDO5_suspend_table[] = { | ||
| 142 | 2900000, 0, 0, 0, | ||
| 143 | }; | ||
| 144 | |||
| 145 | static const unsigned int LDO6_table[] = { | ||
