Wenyou Yang | 33036f4 | 2013-12-24 10:34:28 +0800 | [diff] [blame] | 1 | /* |
Beniamino Galvani | 50a03e3 | 2014-07-05 15:20:54 +0200 | [diff] [blame] | 2 | * act8865-regulator.c - Voltage regulation for active-semi ACT88xx PMUs |
| 3 | * |
| 4 | * http://www.active-semi.com/products/power-management-units/act88xx/ |
Wenyou Yang | 33036f4 | 2013-12-24 10:34:28 +0800 | [diff] [blame] | 5 | * |
| 6 | * Copyright (C) 2013 Atmel Corporation |
| 7 | * |
| 8 | * This program is free software; you can redistribute it and/or modify |
| 9 | * it under the terms of the GNU General Public License as published by |
| 10 | * the Free Software Foundation; either version 2 of the License, or |
| 11 | * (at your option) any later version. |
| 12 | * |
| 13 | * This program is distributed in the hope that it will be useful, |
| 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 16 | * GNU General Public License for more details. |
| 17 | */ |
| 18 | |
| 19 | #include <linux/module.h> |
| 20 | #include <linux/init.h> |
| 21 | #include <linux/i2c.h> |
| 22 | #include <linux/err.h> |
| 23 | #include <linux/platform_device.h> |
| 24 | #include <linux/regulator/driver.h> |
| 25 | #include <linux/regulator/act8865.h> |
| 26 | #include <linux/of.h> |
| 27 | #include <linux/of_device.h> |
| 28 | #include <linux/regulator/of_regulator.h> |
| 29 | #include <linux/regmap.h> |
| 30 | |
| 31 | /* |
Zubair Lutfullah Kakakhel | df3a950 | 2015-02-27 17:04:04 +0000 | [diff] [blame] | 32 | * ACT8600 Global Register Map. |
| 33 | */ |
| 34 | #define ACT8600_SYS_MODE 0x00 |
| 35 | #define ACT8600_SYS_CTRL 0x01 |
| 36 | #define ACT8600_DCDC1_VSET 0x10 |
| 37 | #define ACT8600_DCDC1_CTRL 0x12 |
| 38 | #define ACT8600_DCDC2_VSET 0x20 |
| 39 | #define ACT8600_DCDC2_CTRL 0x22 |
| 40 | #define ACT8600_DCDC3_VSET 0x30 |
| 41 | #define ACT8600_DCDC3_CTRL 0x32 |
| 42 | #define ACT8600_SUDCDC4_VSET 0x40 |
| 43 | #define ACT8600_SUDCDC4_CTRL 0x41 |
| 44 | #define ACT8600_LDO5_VSET 0x50 |
| 45 | #define ACT8600_LDO5_CTRL 0x51 |
| 46 | #define ACT8600_LDO6_VSET 0x60 |
| 47 | #define ACT8600_LDO6_CTRL 0x61 |
| 48 | #define ACT8600_LDO7_VSET 0x70 |
| 49 | #define ACT8600_LDO7_CTRL 0x71 |
| 50 | #define ACT8600_LDO8_VSET 0x80 |
| 51 | #define ACT8600_LDO8_CTRL 0x81 |
| 52 | #define ACT8600_LDO910_CTRL 0x91 |
| 53 | #define ACT8600_APCH0 0xA1 |
| 54 | #define ACT8600_APCH1 0xA8 |
| 55 | #define ACT8600_APCH2 0xA9 |
| 56 | #define ACT8600_APCH_STAT 0xAA |
| 57 | #define ACT8600_OTG0 0xB0 |
| 58 | #define ACT8600_OTG1 0xB2 |
| 59 | |
| 60 | /* |
Beniamino Galvani | ac0c0ea | 2014-07-05 15:20:55 +0200 | [diff] [blame] | 61 | * ACT8846 Global Register Map. |
| 62 | */ |
| 63 | #define ACT8846_SYS0 0x00 |
| 64 | #define ACT8846_SYS1 0x01 |
| 65 | #define ACT8846_REG1_VSET 0x10 |
| 66 | #define ACT8846_REG1_CTRL 0x12 |
| 67 | #define ACT8846_REG2_VSET0 0x20 |
| 68 | #define ACT8846_REG2_VSET1 0x21 |
| 69 | #define ACT8846_REG2_CTRL 0x22 |
| 70 | #define ACT8846_REG3_VSET0 0x30 |
| 71 | #define ACT8846_REG3_VSET1 0x31 |
| 72 | #define ACT8846_REG3_CTRL 0x32 |
| 73 | #define ACT8846_REG4_VSET0 0x40 |
| 74 | #define ACT8846_REG4_VSET1 0x41 |
| 75 | #define ACT8846_REG4_CTRL 0x42 |
| 76 | #define ACT8846_REG5_VSET 0x50 |
| 77 | #define ACT8846_REG5_CTRL 0x51 |
| 78 | #define ACT8846_REG6_VSET 0x58 |
| 79 | #define ACT8846_REG6_CTRL 0x59 |
| 80 | #define ACT8846_REG7_VSET 0x60 |
| 81 | #define ACT8846_REG7_CTRL 0x61 |
| 82 | #define ACT8846_REG8_VSET 0x68 |
| 83 | #define ACT8846_REG8_CTRL 0x69 |
| 84 | #define ACT8846_REG9_VSET 0x70 |
| 85 | #define ACT8846_REG9_CTRL 0x71 |
| 86 | #define ACT8846_REG10_VSET 0x80 |
| 87 | #define ACT8846_REG10_CTRL 0x81 |
| 88 | #define ACT8846_REG11_VSET 0x90 |
| 89 | #define ACT8846_REG11_CTRL 0x91 |
| 90 | #define ACT8846_REG12_VSET 0xa0 |
| 91 | #define ACT8846_REG12_CTRL 0xa1 |
| 92 | #define ACT8846_REG13_CTRL 0xb1 |
Romain Perier | 2b17fa2 | 2014-10-14 06:31:10 +0000 | [diff] [blame] | 93 | #define ACT8846_GLB_OFF_CTRL 0xc3 |
| 94 | #define ACT8846_OFF_SYSMASK 0x18 |
Beniamino Galvani | ac0c0ea | 2014-07-05 15:20:55 +0200 | [diff] [blame] | 95 | |
| 96 | /* |
Wenyou Yang | 33036f4 | 2013-12-24 10:34:28 +0800 | [diff] [blame] | 97 | * ACT8865 Global Register Map. |
| 98 | */ |
| 99 | #define ACT8865_SYS_MODE 0x00 |
| 100 | #define ACT8865_SYS_CTRL 0x01 |
| 101 | #define ACT8865_DCDC1_VSET1 0x20 |
| 102 | #define ACT8865_DCDC1_VSET2 0x21 |
| 103 | #define ACT8865_DCDC1_CTRL 0x22 |
| 104 | #define ACT8865_DCDC2_VSET1 0x30 |
| 105 | #define ACT8865_DCDC2_VSET2 0x31 |
| 106 | #define ACT8865_DCDC2_CTRL 0x32 |
| 107 | #define ACT8865_DCDC3_VSET1 0x40 |
| 108 | #define ACT8865_DCDC3_VSET2 0x41 |
| 109 | #define ACT8865_DCDC3_CTRL 0x42 |
| 110 | #define ACT8865_LDO1_VSET 0x50 |
| 111 | #define ACT8865_LDO1_CTRL 0x51 |
| 112 | #define ACT8865_LDO2_VSET 0x54 |
| 113 | #define ACT8865_LDO2_CTRL 0x55 |
| 114 | #define ACT8865_LDO3_VSET 0x60 |
| 115 | #define ACT8865_LDO3_CTRL 0x61 |
| 116 | #define ACT8865_LDO4_VSET 0x64 |
| 117 | #define ACT8865_LDO4_CTRL 0x65 |
Romain Perier | 2b17fa2 | 2014-10-14 06:31:10 +0000 | [diff] [blame] | 118 | #define ACT8865_MSTROFF 0x20 |
Wenyou Yang | 33036f4 | 2013-12-24 10:34:28 +0800 | [diff] [blame] | 119 | |
| 120 | /* |
| 121 | * Field Definitions. |
| 122 | */ |
| 123 | #define ACT8865_ENA 0x80 /* ON - [7] */ |
| 124 | #define ACT8865_VSEL_MASK 0x3F /* VSET - [5:0] */ |
| 125 | |
Zubair Lutfullah Kakakhel | df3a950 | 2015-02-27 17:04:04 +0000 | [diff] [blame] | 126 | |
| 127 | #define ACT8600_LDO10_ENA 0x40 /* ON - [6] */ |
| 128 | #define ACT8600_SUDCDC_VSEL_MASK 0xFF /* SUDCDC VSET - [7:0] */ |
| 129 | |
Wenyou Yang | 33036f4 | 2013-12-24 10:34:28 +0800 | [diff] [blame] | 130 | /* |
| 131 | * ACT8865 voltage number |
| 132 | */ |
| 133 | #define ACT8865_VOLTAGE_NUM 64 |
Zubair Lutfullah Kakakhel | df3a950 | 2015-02-27 17:04:04 +0000 | [diff] [blame] | 134 | #define ACT8600_SUDCDC_VOLTAGE_NUM 255 |
Wenyou Yang | 33036f4 | 2013-12-24 10:34:28 +0800 | [diff] [blame] | 135 | |
| 136 | struct act8865 { |
Wenyou Yang | 33036f4 | 2013-12-24 10:34:28 +0800 | [diff] [blame] | 137 | struct regmap *regmap; |
Romain Perier | 2b17fa2 | 2014-10-14 06:31:10 +0000 | [diff] [blame] | 138 | int off_reg; |
| 139 | int off_mask; |
Wenyou Yang | 33036f4 | 2013-12-24 10:34:28 +0800 | [diff] [blame] | 140 | }; |
| 141 | |
Maarten ter Huurne | c5c9c2d | 2016-03-17 15:05:08 +0100 | [diff] [blame^] | 142 | static const struct regmap_range act8600_reg_ranges[] = { |
| 143 | regmap_reg_range(0x00, 0x01), |
| 144 | regmap_reg_range(0x10, 0x10), |
| 145 | regmap_reg_range(0x12, 0x12), |
| 146 | regmap_reg_range(0x20, 0x20), |
| 147 | regmap_reg_range(0x22, 0x22), |
| 148 | regmap_reg_range(0x30, 0x30), |
| 149 | regmap_reg_range(0x32, 0x32), |
| 150 | regmap_reg_range(0x40, 0x41), |
| 151 | regmap_reg_range(0x50, 0x51), |
| 152 | regmap_reg_range(0x60, 0x61), |
| 153 | regmap_reg_range(0x70, 0x71), |
| 154 | regmap_reg_range(0x80, 0x81), |
| 155 | regmap_reg_range(0x91, 0x91), |
| 156 | regmap_reg_range(0xA1, 0xA1), |
| 157 | regmap_reg_range(0xA8, 0xAA), |
| 158 | regmap_reg_range(0xB0, 0xB0), |
| 159 | regmap_reg_range(0xB2, 0xB2), |
| 160 | regmap_reg_range(0xC1, 0xC1), |
| 161 | }; |
| 162 | |
| 163 | static const struct regmap_range act8600_reg_ro_ranges[] = { |
| 164 | regmap_reg_range(0xAA, 0xAA), |
| 165 | regmap_reg_range(0xC1, 0xC1), |
| 166 | }; |
| 167 | |
| 168 | static const struct regmap_range act8600_reg_volatile_ranges[] = { |
| 169 | regmap_reg_range(0x00, 0x01), |
| 170 | regmap_reg_range(0x12, 0x12), |
| 171 | regmap_reg_range(0x22, 0x22), |
| 172 | regmap_reg_range(0x32, 0x32), |
| 173 | regmap_reg_range(0x41, 0x41), |
| 174 | regmap_reg_range(0x51, 0x51), |
| 175 | regmap_reg_range(0x61, 0x61), |
| 176 | regmap_reg_range(0x71, 0x71), |
| 177 | regmap_reg_range(0x81, 0x81), |
| 178 | regmap_reg_range(0xA8, 0xA8), |
| 179 | regmap_reg_range(0xAA, 0xAA), |
| 180 | regmap_reg_range(0xB0, 0xB0), |
| 181 | regmap_reg_range(0xC1, 0xC1), |
| 182 | }; |
| 183 | |
| 184 | static const struct regmap_access_table act8600_write_ranges_table = { |
| 185 | .yes_ranges = act8600_reg_ranges, |
| 186 | .n_yes_ranges = ARRAY_SIZE(act8600_reg_ranges), |
| 187 | .no_ranges = act8600_reg_ro_ranges, |
| 188 | .n_no_ranges = ARRAY_SIZE(act8600_reg_ro_ranges), |
| 189 | }; |
| 190 | |
| 191 | static const struct regmap_access_table act8600_read_ranges_table = { |
| 192 | .yes_ranges = act8600_reg_ranges, |
| 193 | .n_yes_ranges = ARRAY_SIZE(act8600_reg_ranges), |
| 194 | }; |
| 195 | |
| 196 | static const struct regmap_access_table act8600_volatile_ranges_table = { |
| 197 | .yes_ranges = act8600_reg_volatile_ranges, |
| 198 | .n_yes_ranges = ARRAY_SIZE(act8600_reg_volatile_ranges), |
| 199 | }; |
| 200 | |
| 201 | static const struct regmap_config act8600_regmap_config = { |
| 202 | .reg_bits = 8, |
| 203 | .val_bits = 8, |
| 204 | .max_register = 0xFF, |
| 205 | .wr_table = &act8600_write_ranges_table, |
| 206 | .rd_table = &act8600_read_ranges_table, |
| 207 | .volatile_table = &act8600_volatile_ranges_table, |
| 208 | }; |
| 209 | |
Wenyou Yang | 33036f4 | 2013-12-24 10:34:28 +0800 | [diff] [blame] | 210 | static const struct regmap_config act8865_regmap_config = { |
| 211 | .reg_bits = 8, |
| 212 | .val_bits = 8, |
| 213 | }; |
| 214 | |
Beniamino Galvani | 50a03e3 | 2014-07-05 15:20:54 +0200 | [diff] [blame] | 215 | static const struct regulator_linear_range act8865_voltage_ranges[] = { |
Wenyou Yang | 33036f4 | 2013-12-24 10:34:28 +0800 | [diff] [blame] | 216 | REGULATOR_LINEAR_RANGE(600000, 0, 23, 25000), |
| 217 | REGULATOR_LINEAR_RANGE(1200000, 24, 47, 50000), |
| 218 | REGULATOR_LINEAR_RANGE(2400000, 48, 63, 100000), |
| 219 | }; |
| 220 | |
Zubair Lutfullah Kakakhel | df3a950 | 2015-02-27 17:04:04 +0000 | [diff] [blame] | 221 | static const struct regulator_linear_range act8600_sudcdc_voltage_ranges[] = { |
| 222 | REGULATOR_LINEAR_RANGE(3000000, 0, 63, 0), |
| 223 | REGULATOR_LINEAR_RANGE(3000000, 64, 159, 100000), |
| 224 | REGULATOR_LINEAR_RANGE(12600000, 160, 191, 200000), |
| 225 | REGULATOR_LINEAR_RANGE(19000000, 191, 255, 400000), |
| 226 | }; |
| 227 | |
Wenyou Yang | 33036f4 | 2013-12-24 10:34:28 +0800 | [diff] [blame] | 228 | static struct regulator_ops act8865_ops = { |
| 229 | .list_voltage = regulator_list_voltage_linear_range, |
| 230 | .map_voltage = regulator_map_voltage_linear_range, |
| 231 | .get_voltage_sel = regulator_get_voltage_sel_regmap, |
| 232 | .set_voltage_sel = regulator_set_voltage_sel_regmap, |
| 233 | .enable = regulator_enable_regmap, |
| 234 | .disable = regulator_disable_regmap, |
| 235 | .is_enabled = regulator_is_enabled_regmap, |
Wenyou Yang | 33036f4 | 2013-12-24 10:34:28 +0800 | [diff] [blame] | 236 | }; |
| 237 | |
Zubair Lutfullah Kakakhel | df3a950 | 2015-02-27 17:04:04 +0000 | [diff] [blame] | 238 | static struct regulator_ops act8865_ldo_ops = { |
| 239 | .enable = regulator_enable_regmap, |
| 240 | .disable = regulator_disable_regmap, |
| 241 | .is_enabled = regulator_is_enabled_regmap, |
| 242 | }; |
| 243 | |
Heiko Stuebner | c8b263c | 2015-03-07 16:33:53 +0100 | [diff] [blame] | 244 | #define ACT88xx_REG(_name, _family, _id, _vsel_reg, _supply) \ |
Beniamino Galvani | 50a03e3 | 2014-07-05 15:20:54 +0200 | [diff] [blame] | 245 | [_family##_ID_##_id] = { \ |
| 246 | .name = _name, \ |
Heiko Stuebner | c8b263c | 2015-03-07 16:33:53 +0100 | [diff] [blame] | 247 | .supply_name = _supply, \ |
Beniamino Galvani | 50a03e3 | 2014-07-05 15:20:54 +0200 | [diff] [blame] | 248 | .id = _family##_ID_##_id, \ |
| 249 | .type = REGULATOR_VOLTAGE, \ |
| 250 | .ops = &act8865_ops, \ |
| 251 | .n_voltages = ACT8865_VOLTAGE_NUM, \ |
| 252 | .linear_ranges = act8865_voltage_ranges, \ |
| 253 | .n_linear_ranges = ARRAY_SIZE(act8865_voltage_ranges), \ |
| 254 | .vsel_reg = _family##_##_id##_##_vsel_reg, \ |
| 255 | .vsel_mask = ACT8865_VSEL_MASK, \ |
| 256 | .enable_reg = _family##_##_id##_CTRL, \ |
| 257 | .enable_mask = ACT8865_ENA, \ |
| 258 | .owner = THIS_MODULE, \ |
| 259 | } |
| 260 | |
Zubair Lutfullah Kakakhel | df3a950 | 2015-02-27 17:04:04 +0000 | [diff] [blame] | 261 | static const struct regulator_desc act8600_regulators[] = { |
Heiko Stuebner | c8b263c | 2015-03-07 16:33:53 +0100 | [diff] [blame] | 262 | ACT88xx_REG("DCDC1", ACT8600, DCDC1, VSET, "vp1"), |
| 263 | ACT88xx_REG("DCDC2", ACT8600, DCDC2, VSET, "vp2"), |
| 264 | ACT88xx_REG("DCDC3", ACT8600, DCDC3, VSET, "vp3"), |
Zubair Lutfullah Kakakhel | df3a950 | 2015-02-27 17:04:04 +0000 | [diff] [blame] | 265 | { |
| 266 | .name = "SUDCDC_REG4", |
| 267 | .id = ACT8600_ID_SUDCDC4, |
| 268 | .ops = &act8865_ops, |
| 269 | .type = REGULATOR_VOLTAGE, |
| 270 | .n_voltages = ACT8600_SUDCDC_VOLTAGE_NUM, |
| 271 | .linear_ranges = act8600_sudcdc_voltage_ranges, |
| 272 | .n_linear_ranges = ARRAY_SIZE(act8600_sudcdc_voltage_ranges), |
| 273 | .vsel_reg = ACT8600_SUDCDC4_VSET, |
| 274 | .vsel_mask = ACT8600_SUDCDC_VSEL_MASK, |
| 275 | .enable_reg = ACT8600_SUDCDC4_CTRL, |
| 276 | .enable_mask = ACT8865_ENA, |
| 277 | .owner = THIS_MODULE, |
| 278 | }, |
Heiko Stuebner | c8b263c | 2015-03-07 16:33:53 +0100 | [diff] [blame] | 279 | ACT88xx_REG("LDO5", ACT8600, LDO5, VSET, "inl"), |
| 280 | ACT88xx_REG("LDO6", ACT8600, LDO6, VSET, "inl"), |
| 281 | ACT88xx_REG("LDO7", ACT8600, LDO7, VSET, "inl"), |
| 282 | ACT88xx_REG("LDO8", ACT8600, LDO8, VSET, "inl"), |
Zubair Lutfullah Kakakhel | df3a950 | 2015-02-27 17:04:04 +0000 | [diff] [blame] | 283 | { |
| 284 | .name = "LDO_REG9", |
| 285 | .id = ACT8600_ID_LDO9, |
| 286 | .ops = &act8865_ldo_ops, |
| 287 | .type = REGULATOR_VOLTAGE, |
| 288 | .n_voltages = 1, |
Maarten ter Huurne | 79b5d02 | 2016-02-28 16:53:28 +0100 | [diff] [blame] | 289 | .fixed_uV = 3300000, |
Zubair Lutfullah Kakakhel | df3a950 | 2015-02-27 17:04:04 +0000 | [diff] [blame] | 290 | .enable_reg = ACT8600_LDO910_CTRL, |
| 291 | .enable_mask = ACT8865_ENA, |
| 292 | .owner = THIS_MODULE, |
| 293 | }, |
| 294 | { |
| 295 | .name = "LDO_REG10", |
| 296 | .id = ACT8600_ID_LDO10, |
| 297 | .ops = &act8865_ldo_ops, |
| 298 | .type = REGULATOR_VOLTAGE, |
| 299 | .n_voltages = 1, |
| 300 | .fixed_uV = 1200000, |
| 301 | .enable_reg = ACT8600_LDO910_CTRL, |
| 302 | .enable_mask = ACT8600_LDO10_ENA, |
| 303 | .owner = THIS_MODULE, |
| 304 | }, |
| 305 | }; |
| 306 | |
Beniamino Galvani | ac0c0ea | 2014-07-05 15:20:55 +0200 | [diff] [blame] | 307 | static const struct regulator_desc act8846_regulators[] = { |
Heiko Stuebner | c8b263c | 2015-03-07 16:33:53 +0100 | [diff] [blame] | 308 | ACT88xx_REG("REG1", ACT8846, REG1, VSET, "vp1"), |
| 309 | ACT88xx_REG("REG2", ACT8846, REG2, VSET0, "vp2"), |
| 310 | ACT88xx_REG("REG3", ACT8846, REG3, VSET0, "vp3"), |
| 311 | ACT88xx_REG("REG4", ACT8846, REG4, VSET0, "vp4"), |
| 312 | ACT88xx_REG("REG5", ACT8846, REG5, VSET, "inl1"), |
| 313 | ACT88xx_REG("REG6", ACT8846, REG6, VSET, "inl1"), |
| 314 | ACT88xx_REG("REG7", ACT8846, REG7, VSET, "inl1"), |
| 315 | ACT88xx_REG("REG8", ACT8846, REG8, VSET, "inl2"), |
| 316 | ACT88xx_REG("REG9", ACT8846, REG9, VSET, "inl2"), |
| 317 | ACT88xx_REG("REG10", ACT8846, REG10, VSET, "inl3"), |
| 318 | ACT88xx_REG("REG11", ACT8846, REG11, VSET, "inl3"), |
| 319 | ACT88xx_REG("REG12", ACT8846, REG12, VSET, "inl3"), |
Beniamino Galvani | ac0c0ea | 2014-07-05 15:20:55 +0200 | [diff] [blame] | 320 | }; |
| 321 | |
Beniamino Galvani | 50a03e3 | 2014-07-05 15:20:54 +0200 | [diff] [blame] | 322 | static const struct regulator_desc act8865_regulators[] = { |
Heiko Stuebner | c8b263c | 2015-03-07 16:33:53 +0100 | [diff] [blame] | 323 | ACT88xx_REG("DCDC_REG1", ACT8865, DCDC1, VSET1, "vp1"), |
| 324 | ACT88xx_REG("DCDC_REG2", ACT8865, DCDC2, VSET1, "vp2"), |
| 325 | ACT88xx_REG("DCDC_REG3", ACT8865, DCDC3, VSET1, "vp3"), |
| 326 | ACT88xx_REG("LDO_REG1", ACT8865, LDO1, VSET, "inl45"), |
| 327 | ACT88xx_REG("LDO_REG2", ACT8865, LDO2, VSET, "inl45"), |
| 328 | ACT88xx_REG("LDO_REG3", ACT8865, LDO3, VSET, "inl67"), |
| 329 | ACT88xx_REG("LDO_REG4", ACT8865, LDO4, VSET, "inl67"), |
Wenyou Yang | 33036f4 | 2013-12-24 10:34:28 +0800 | [diff] [blame] | 330 | }; |
| 331 | |
Wenyou Yang | c86dc03 | 2015-09-30 15:25:49 +0800 | [diff] [blame] | 332 | static const struct regulator_desc act8865_alt_regulators[] = { |
| 333 | ACT88xx_REG("DCDC_REG1", ACT8865, DCDC1, VSET2, "vp1"), |
| 334 | ACT88xx_REG("DCDC_REG2", ACT8865, DCDC2, VSET2, "vp2"), |
| 335 | ACT88xx_REG("DCDC_REG3", ACT8865, DCDC3, VSET2, "vp3"), |
| 336 | ACT88xx_REG("LDO_REG1", ACT8865, LDO1, VSET, "inl45"), |
| 337 | ACT88xx_REG("LDO_REG2", ACT8865, LDO2, VSET, "inl45"), |
| 338 | ACT88xx_REG("LDO_REG3", ACT8865, LDO3, VSET, "inl67"), |
| 339 | ACT88xx_REG("LDO_REG4", ACT8865, LDO4, VSET, "inl67"), |
| 340 | }; |
| 341 | |
Wenyou Yang | 33036f4 | 2013-12-24 10:34:28 +0800 | [diff] [blame] | 342 | #ifdef CONFIG_OF |
| 343 | static const struct of_device_id act8865_dt_ids[] = { |
Zubair Lutfullah Kakakhel | df3a950 | 2015-02-27 17:04:04 +0000 | [diff] [blame] | 344 | { .compatible = "active-semi,act8600", .data = (void *)ACT8600 }, |
Beniamino Galvani | ac0c0ea | 2014-07-05 15:20:55 +0200 | [diff] [blame] | 345 | { .compatible = "active-semi,act8846", .data = (void *)ACT8846 }, |
Beniamino Galvani | 50a03e3 | 2014-07-05 15:20:54 +0200 | [diff] [blame] | 346 | { .compatible = "active-semi,act8865", .data = (void *)ACT8865 }, |
Wenyou Yang | 33036f4 | 2013-12-24 10:34:28 +0800 | [diff] [blame] | 347 | { } |
| 348 | }; |
| 349 | MODULE_DEVICE_TABLE(of, act8865_dt_ids); |
| 350 | |
Beniamino Galvani | ac0c0ea | 2014-07-05 15:20:55 +0200 | [diff] [blame] | 351 | static struct of_regulator_match act8846_matches[] = { |
| 352 | [ACT8846_ID_REG1] = { .name = "REG1" }, |
| 353 | [ACT8846_ID_REG2] = { .name = "REG2" }, |
| 354 | [ACT8846_ID_REG3] = { .name = "REG3" }, |
| 355 | [ACT8846_ID_REG4] = { .name = "REG4" }, |
| 356 | [ACT8846_ID_REG5] = { .name = "REG5" }, |
| 357 | [ACT8846_ID_REG6] = { .name = "REG6" }, |
| 358 | [ACT8846_ID_REG7] = { .name = "REG7" }, |
| 359 | [ACT8846_ID_REG8] = { .name = "REG8" }, |
| 360 | [ACT8846_ID_REG9] = { .name = "REG9" }, |
| 361 | [ACT8846_ID_REG10] = { .name = "REG10" }, |
| 362 | [ACT8846_ID_REG11] = { .name = "REG11" }, |
| 363 | [ACT8846_ID_REG12] = { .name = "REG12" }, |
| 364 | }; |
| 365 | |
Wenyou Yang | 33036f4 | 2013-12-24 10:34:28 +0800 | [diff] [blame] | 366 | static struct of_regulator_match act8865_matches[] = { |
| 367 | [ACT8865_ID_DCDC1] = { .name = "DCDC_REG1"}, |
| 368 | [ACT8865_ID_DCDC2] = { .name = "DCDC_REG2"}, |
| 369 | [ACT8865_ID_DCDC3] = { .name = "DCDC_REG3"}, |
| 370 | [ACT8865_ID_LDO1] = { .name = "LDO_REG1"}, |
| 371 | [ACT8865_ID_LDO2] = { .name = "LDO_REG2"}, |
| 372 | [ACT8865_ID_LDO3] = { .name = "LDO_REG3"}, |
| 373 | [ACT8865_ID_LDO4] = { .name = "LDO_REG4"}, |
| 374 | }; |
| 375 | |
Zubair Lutfullah Kakakhel | df3a950 | 2015-02-27 17:04:04 +0000 | [diff] [blame] | 376 | static struct of_regulator_match act8600_matches[] = { |
| 377 | [ACT8600_ID_DCDC1] = { .name = "DCDC_REG1"}, |
| 378 | [ACT8600_ID_DCDC2] = { .name = "DCDC_REG2"}, |
| 379 | [ACT8600_ID_DCDC3] = { .name = "DCDC_REG3"}, |
| 380 | [ACT8600_ID_SUDCDC4] = { .name = "SUDCDC_REG4"}, |
| 381 | [ACT8600_ID_LDO5] = { .name = "LDO_REG5"}, |
| 382 | [ACT8600_ID_LDO6] = { .name = "LDO_REG6"}, |
| 383 | [ACT8600_ID_LDO7] = { .name = "LDO_REG7"}, |
| 384 | [ACT8600_ID_LDO8] = { .name = "LDO_REG8"}, |
| 385 | [ACT8600_ID_LDO9] = { .name = "LDO_REG9"}, |
| 386 | [ACT8600_ID_LDO10] = { .name = "LDO_REG10"}, |
| 387 | }; |
| 388 | |
Wenyou Yang | 33036f4 | 2013-12-24 10:34:28 +0800 | [diff] [blame] | 389 | static int act8865_pdata_from_dt(struct device *dev, |
Beniamino Galvani | 50a03e3 | 2014-07-05 15:20:54 +0200 | [diff] [blame] | 390 | struct act8865_platform_data *pdata, |
Beniamino Galvani | 34e0247 | 2014-07-07 23:40:47 +0200 | [diff] [blame] | 391 | unsigned long type) |
Wenyou Yang | 33036f4 | 2013-12-24 10:34:28 +0800 | [diff] [blame] | 392 | { |
Beniamino Galvani | 34e0247 | 2014-07-07 23:40:47 +0200 | [diff] [blame] | 393 | int matched, i, num_matches; |
Wenyou Yang | 33036f4 | 2013-12-24 10:34:28 +0800 | [diff] [blame] | 394 | struct device_node *np; |
| 395 | struct act8865_regulator_data *regulator; |
Beniamino Galvani | 34e0247 | 2014-07-07 23:40:47 +0200 | [diff] [blame] | 396 | struct of_regulator_match *matches; |
Wenyou Yang | 33036f4 | 2013-12-24 10:34:28 +0800 | [diff] [blame] | 397 | |
Sachin Kamat | 6ea970a | 2014-02-14 17:19:54 +0530 | [diff] [blame] | 398 | np = of_get_child_by_name(dev->of_node, "regulators"); |
Wenyou Yang | 33036f4 | 2013-12-24 10:34:28 +0800 | [diff] [blame] | 399 | if (!np) { |
| 400 | dev_err(dev, "missing 'regulators' subnode in DT\n"); |
| 401 | return -EINVAL; |
| 402 | } |
| 403 | |
Beniamino Galvani | 34e0247 | 2014-07-07 23:40:47 +0200 | [diff] [blame] | 404 | switch (type) { |
Zubair Lutfullah Kakakhel | df3a950 | 2015-02-27 17:04:04 +0000 | [diff] [blame] | 405 | case ACT8600: |
| 406 | matches = act8600_matches; |
| 407 | num_matches = ARRAY_SIZE(act8600_matches); |
| 408 | break; |
Beniamino Galvani | 34e0247 | 2014-07-07 23:40:47 +0200 | [diff] [blame] | 409 | case ACT8846: |
| 410 | matches = act8846_matches; |
| 411 | num_matches = ARRAY_SIZE(act8846_matches); |
| 412 | break; |
| 413 | case ACT8865: |
| 414 | matches = act8865_matches; |
| 415 | num_matches = ARRAY_SIZE(act8865_matches); |
| 416 | break; |
| 417 | default: |
| 418 | dev_err(dev, "invalid device id %lu\n", type); |
| 419 | return -EINVAL; |
| 420 | } |
| 421 | |
Beniamino Galvani | 50a03e3 | 2014-07-05 15:20:54 +0200 | [diff] [blame] | 422 | matched = of_regulator_match(dev, np, matches, num_matches); |
Sachin Kamat | 0079eb5 | 2014-02-17 14:33:29 +0530 | [diff] [blame] | 423 | of_node_put(np); |
Wenyou Yang | 33036f4 | 2013-12-24 10:34:28 +0800 | [diff] [blame] | 424 | if (matched <= 0) |
| 425 | return matched; |
| 426 | |
| 427 | pdata->regulators = devm_kzalloc(dev, |
Beniamino Galvani | 50a03e3 | 2014-07-05 15:20:54 +0200 | [diff] [blame] | 428 | sizeof(struct act8865_regulator_data) * |
| 429 | num_matches, GFP_KERNEL); |
Sachin Kamat | 5ee77ef | 2014-02-18 16:11:08 +0530 | [diff] [blame] | 430 | if (!pdata->regulators) |
Wenyou Yang | 33036f4 | 2013-12-24 10:34:28 +0800 | [diff] [blame] | 431 | return -ENOMEM; |
Wenyou Yang | 33036f4 | 2013-12-24 10:34:28 +0800 | [diff] [blame] | 432 | |
Beniamino Galvani | 50a03e3 | 2014-07-05 15:20:54 +0200 | [diff] [blame] | 433 | pdata->num_regulators = num_matches; |
Wenyou Yang | 33036f4 | 2013-12-24 10:34:28 +0800 | [diff] [blame] | 434 | regulator = pdata->regulators; |
| 435 | |
Beniamino Galvani | 50a03e3 | 2014-07-05 15:20:54 +0200 | [diff] [blame] | 436 | for (i = 0; i < num_matches; i++) { |
Wenyou Yang | 33036f4 | 2013-12-24 10:34:28 +0800 | [diff] [blame] | 437 | regulator->id = i; |
Beniamino Galvani | 50a03e3 | 2014-07-05 15:20:54 +0200 | [diff] [blame] | 438 | regulator->name = matches[i].name; |
Maarten ter Huurne | 30f065b | 2016-02-28 16:53:26 +0100 | [diff] [blame] | 439 | regulator->init_data = matches[i].init_data; |
Maarten ter Huurne | 005e4685 | 2016-03-17 15:05:07 +0100 | [diff] [blame] | 440 | regulator->of_node = matches[i].of_node; |
Wenyou Yang | 33036f4 | 2013-12-24 10:34:28 +0800 | [diff] [blame] | 441 | regulator++; |
| 442 | } |
| 443 | |
| 444 | return 0; |
| 445 | } |
| 446 | #else |
| 447 | static inline int act8865_pdata_from_dt(struct device *dev, |
Beniamino Galvani | 34e0247 | 2014-07-07 23:40:47 +0200 | [diff] [blame] | 448 | struct act8865_platform_data *pdata, |
| 449 | unsigned long type) |
Wenyou Yang | 33036f4 | 2013-12-24 10:34:28 +0800 | [diff] [blame] | 450 | { |
| 451 | return 0; |
| 452 | } |
| 453 | #endif |
| 454 | |
Maarten ter Huurne | 005e4685 | 2016-03-17 15:05:07 +0100 | [diff] [blame] | 455 | static struct act8865_regulator_data *act8865_get_regulator_data( |
| 456 | int id, struct act8865_platform_data *pdata) |
Beniamino Galvani | 48a1e1b | 2014-06-22 17:31:41 +0200 | [diff] [blame] | 457 | { |
| 458 | int i; |
| 459 | |
| 460 | if (!pdata) |
| 461 | return NULL; |
| 462 | |
| 463 | for (i = 0; i < pdata->num_regulators; i++) { |
| 464 | if (pdata->regulators[i].id == id) |
Maarten ter Huurne | 005e4685 | 2016-03-17 15:05:07 +0100 | [diff] [blame] | 465 | return &pdata->regulators[i]; |
Beniamino Galvani | 48a1e1b | 2014-06-22 17:31:41 +0200 | [diff] [blame] | 466 | } |
| 467 | |
| 468 | return NULL; |
| 469 | } |
| 470 | |
Romain Perier | 2b17fa2 | 2014-10-14 06:31:10 +0000 | [diff] [blame] | 471 | static struct i2c_client *act8865_i2c_client; |
| 472 | static void act8865_power_off(void) |
| 473 | { |
| 474 | struct act8865 *act8865; |
| 475 | |
| 476 | act8865 = i2c_get_clientdata(act8865_i2c_client); |
| 477 | regmap_write(act8865->regmap, act8865->off_reg, act8865->off_mask); |
| 478 | while (1); |
| 479 | } |
| 480 | |
Wenyou Yang | 33036f4 | 2013-12-24 10:34:28 +0800 | [diff] [blame] | 481 | static int act8865_pmic_probe(struct i2c_client *client, |
Beniamino Galvani | 50a03e3 | 2014-07-05 15:20:54 +0200 | [diff] [blame] | 482 | const struct i2c_device_id *i2c_id) |
Wenyou Yang | 33036f4 | 2013-12-24 10:34:28 +0800 | [diff] [blame] | 483 | { |
Maarten ter Huurne | abea1bb | 2016-02-28 16:53:25 +0100 | [diff] [blame] | 484 | const struct regulator_desc *regulators; |
Beniamino Galvani | 50a03e3 | 2014-07-05 15:20:54 +0200 | [diff] [blame] | 485 | struct act8865_platform_data pdata_of, *pdata; |
Wenyou Yang | 33036f4 | 2013-12-24 10:34:28 +0800 | [diff] [blame] | 486 | struct device *dev = &client->dev; |
Beniamino Galvani | 50a03e3 | 2014-07-05 15:20:54 +0200 | [diff] [blame] | 487 | int i, ret, num_regulators; |
Wenyou Yang | 33036f4 | 2013-12-24 10:34:28 +0800 | [diff] [blame] | 488 | struct act8865 *act8865; |
Maarten ter Huurne | c5c9c2d | 2016-03-17 15:05:08 +0100 | [diff] [blame^] | 489 | const struct regmap_config *regmap_config; |
Beniamino Galvani | 50a03e3 | 2014-07-05 15:20:54 +0200 | [diff] [blame] | 490 | unsigned long type; |
Romain Perier | 2b17fa2 | 2014-10-14 06:31:10 +0000 | [diff] [blame] | 491 | int off_reg, off_mask; |
Wenyou Yang | c86dc03 | 2015-09-30 15:25:49 +0800 | [diff] [blame] | 492 | int voltage_select = 0; |
Beniamino Galvani | 50a03e3 | 2014-07-05 15:20:54 +0200 | [diff] [blame] | 493 | |
| 494 | pdata = dev_get_platdata(dev); |
Wenyou Yang | 33036f4 | 2013-12-24 10:34:28 +0800 | [diff] [blame] | 495 | |
| 496 | if (dev->of_node && !pdata) { |
| 497 | const struct of_device_id *id; |
Wenyou Yang | 33036f4 | 2013-12-24 10:34:28 +0800 | [diff] [blame] | 498 | |
| 499 | id = of_match_device(of_match_ptr(act8865_dt_ids), dev); |
| 500 | if (!id) |
| 501 | return -ENODEV; |
| 502 | |
Beniamino Galvani | 50a03e3 | 2014-07-05 15:20:54 +0200 | [diff] [blame] | 503 | type = (unsigned long) id->data; |
Wenyou Yang | c86dc03 | 2015-09-30 15:25:49 +0800 | [diff] [blame] | 504 | |
| 505 | voltage_select = !!of_get_property(dev->of_node, |
| 506 | "active-semi,vsel-high", |
| 507 | NULL); |
Beniamino Galvani | 50a03e3 | 2014-07-05 15:20:54 +0200 | [diff] [blame] | 508 | } else { |
| 509 | type = i2c_id->driver_data; |
| 510 | } |
| 511 | |
| 512 | switch (type) { |
Zubair Lutfullah Kakakhel | df3a950 | 2015-02-27 17:04:04 +0000 | [diff] [blame] | 513 | case ACT8600: |
| 514 | regulators = act8600_regulators; |
| 515 | num_regulators = ARRAY_SIZE(act8600_regulators); |
Maarten ter Huurne | c5c9c2d | 2016-03-17 15:05:08 +0100 | [diff] [blame^] | 516 | regmap_config = &act8600_regmap_config; |
Zubair Lutfullah Kakakhel | df3a950 | 2015-02-27 17:04:04 +0000 | [diff] [blame] | 517 | off_reg = -1; |
| 518 | off_mask = -1; |
| 519 | break; |
Beniamino Galvani | ac0c0ea | 2014-07-05 15:20:55 +0200 | [diff] [blame] | 520 | case ACT8846: |
Beniamino Galvani | ac0c0ea | 2014-07-05 15:20:55 +0200 | [diff] [blame] | 521 | regulators = act8846_regulators; |
| 522 | num_regulators = ARRAY_SIZE(act8846_regulators); |
Maarten ter Huurne | c5c9c2d | 2016-03-17 15:05:08 +0100 | [diff] [blame^] | 523 | regmap_config = &act8865_regmap_config; |
Romain Perier | 2b17fa2 | 2014-10-14 06:31:10 +0000 | [diff] [blame] | 524 | off_reg = ACT8846_GLB_OFF_CTRL; |
| 525 | off_mask = ACT8846_OFF_SYSMASK; |
Beniamino Galvani | ac0c0ea | 2014-07-05 15:20:55 +0200 | [diff] [blame] | 526 | break; |
Beniamino Galvani | 50a03e3 | 2014-07-05 15:20:54 +0200 | [diff] [blame] | 527 | case ACT8865: |
Wenyou Yang | c86dc03 | 2015-09-30 15:25:49 +0800 | [diff] [blame] | 528 | if (voltage_select) { |
| 529 | regulators = act8865_alt_regulators; |
| 530 | num_regulators = ARRAY_SIZE(act8865_alt_regulators); |
| 531 | } else { |
| 532 | regulators = act8865_regulators; |
| 533 | num_regulators = ARRAY_SIZE(act8865_regulators); |
| 534 | } |
Maarten ter Huurne | c5c9c2d | 2016-03-17 15:05:08 +0100 | [diff] [blame^] | 535 | regmap_config = &act8865_regmap_config; |
Romain Perier | 2b17fa2 | 2014-10-14 06:31:10 +0000 | [diff] [blame] | 536 | off_reg = ACT8865_SYS_CTRL; |
| 537 | off_mask = ACT8865_MSTROFF; |
Beniamino Galvani | 50a03e3 | 2014-07-05 15:20:54 +0200 | [diff] [blame] | 538 | break; |
| 539 | default: |
| 540 | dev_err(dev, "invalid device id %lu\n", type); |
| 541 | return -EINVAL; |
| 542 | } |
| 543 | |
Beniamino Galvani | 50a03e3 | 2014-07-05 15:20:54 +0200 | [diff] [blame] | 544 | if (dev->of_node && !pdata) { |
Maarten ter Huurne | 005e4685 | 2016-03-17 15:05:07 +0100 | [diff] [blame] | 545 | ret = act8865_pdata_from_dt(dev, &pdata_of, type); |
Wenyou Yang | 33036f4 | 2013-12-24 10:34:28 +0800 | [diff] [blame] | 546 | if (ret < 0) |
| 547 | return ret; |
| 548 | |
| 549 | pdata = &pdata_of; |
| 550 | } |
| 551 | |
Wenyou Yang | f1de2c2 | 2013-12-26 14:52:43 +0800 | [diff] [blame] | 552 | act8865 = devm_kzalloc(dev, sizeof(struct act8865), GFP_KERNEL); |
Wenyou Yang | 33036f4 | 2013-12-24 10:34:28 +0800 | [diff] [blame] | 553 | if (!act8865) |
| 554 | return -ENOMEM; |
| 555 | |
Maarten ter Huurne | c5c9c2d | 2016-03-17 15:05:08 +0100 | [diff] [blame^] | 556 | act8865->regmap = devm_regmap_init_i2c(client, regmap_config); |
Wenyou Yang | 33036f4 | 2013-12-24 10:34:28 +0800 | [diff] [blame] | 557 | if (IS_ERR(act8865->regmap)) { |
Axel Lin | 40d3bc1 | 2014-06-30 15:32:09 +0800 | [diff] [blame] | 558 | ret = PTR_ERR(act8865->regmap); |
Maarten ter Huurne | de14ba6 | 2016-03-17 15:05:05 +0100 | [diff] [blame] | 559 | dev_err(dev, "Failed to allocate register map: %d\n", ret); |
Axel Lin | 40d3bc1 | 2014-06-30 15:32:09 +0800 | [diff] [blame] | 560 | return ret; |
Wenyou Yang | 33036f4 | 2013-12-24 10:34:28 +0800 | [diff] [blame] | 561 | } |
| 562 | |
Romain Perier | 8f73110 | 2014-11-25 12:28:25 +0000 | [diff] [blame] | 563 | if (of_device_is_system_power_controller(dev->of_node)) { |
Zubair Lutfullah Kakakhel | df3a950 | 2015-02-27 17:04:04 +0000 | [diff] [blame] | 564 | if (!pm_power_off && (off_reg > 0)) { |
Romain Perier | 2b17fa2 | 2014-10-14 06:31:10 +0000 | [diff] [blame] | 565 | act8865_i2c_client = client; |
| 566 | act8865->off_reg = off_reg; |
| 567 | act8865->off_mask = off_mask; |
| 568 | pm_power_off = act8865_power_off; |
| 569 | } else { |
| 570 | dev_err(dev, "Failed to set poweroff capability, already defined\n"); |
| 571 | } |
| 572 | } |
| 573 | |
Wenyou Yang | 33036f4 | 2013-12-24 10:34:28 +0800 | [diff] [blame] | 574 | /* Finally register devices */ |
Beniamino Galvani | 50a03e3 | 2014-07-05 15:20:54 +0200 | [diff] [blame] | 575 | for (i = 0; i < num_regulators; i++) { |
| 576 | const struct regulator_desc *desc = ®ulators[i]; |
| 577 | struct regulator_config config = { }; |
Maarten ter Huurne | 005e4685 | 2016-03-17 15:05:07 +0100 | [diff] [blame] | 578 | struct act8865_regulator_data *rdata; |
Beniamino Galvani | 50a03e3 | 2014-07-05 15:20:54 +0200 | [diff] [blame] | 579 | struct regulator_dev *rdev; |
Wenyou Yang | 33036f4 | 2013-12-24 10:34:28 +0800 | [diff] [blame] | 580 | |
| 581 | config.dev = dev; |
Wenyou Yang | 33036f4 | 2013-12-24 10:34:28 +0800 | [diff] [blame] | 582 | config.driver_data = act8865; |
| 583 | config.regmap = act8865->regmap; |
| 584 | |
Maarten ter Huurne | 005e4685 | 2016-03-17 15:05:07 +0100 | [diff] [blame] | 585 | rdata = act8865_get_regulator_data(desc->id, pdata); |
| 586 | if (rdata) { |
| 587 | config.init_data = rdata->init_data; |
| 588 | config.of_node = rdata->of_node; |
| 589 | } |
| 590 | |
Maarten ter Huurne | de14ba6 | 2016-03-17 15:05:05 +0100 | [diff] [blame] | 591 | rdev = devm_regulator_register(dev, desc, &config); |
Axel Lin | fb8eb45 | 2014-03-08 21:19:07 +0800 | [diff] [blame] | 592 | if (IS_ERR(rdev)) { |
Beniamino Galvani | 48a1e1b | 2014-06-22 17:31:41 +0200 | [diff] [blame] | 593 | dev_err(dev, "failed to register %s\n", desc->name); |
Axel Lin | fb8eb45 | 2014-03-08 21:19:07 +0800 | [diff] [blame] | 594 | return PTR_ERR(rdev); |
Wenyou Yang | 33036f4 | 2013-12-24 10:34:28 +0800 | [diff] [blame] | 595 | } |
| 596 | } |
| 597 | |
| 598 | i2c_set_clientdata(client, act8865); |
| 599 | |
| 600 | return 0; |
| 601 | } |
| 602 | |
Wenyou Yang | 33036f4 | 2013-12-24 10:34:28 +0800 | [diff] [blame] | 603 | static const struct i2c_device_id act8865_ids[] = { |
Zubair Lutfullah Kakakhel | df3a950 | 2015-02-27 17:04:04 +0000 | [diff] [blame] | 604 | { .name = "act8600", .driver_data = ACT8600 }, |
Beniamino Galvani | ac0c0ea | 2014-07-05 15:20:55 +0200 | [diff] [blame] | 605 | { .name = "act8846", .driver_data = ACT8846 }, |
Beniamino Galvani | 50a03e3 | 2014-07-05 15:20:54 +0200 | [diff] [blame] | 606 | { .name = "act8865", .driver_data = ACT8865 }, |
Wenyou Yang | 33036f4 | 2013-12-24 10:34:28 +0800 | [diff] [blame] | 607 | { }, |
| 608 | }; |
| 609 | MODULE_DEVICE_TABLE(i2c, act8865_ids); |
| 610 | |
| 611 | static struct i2c_driver act8865_pmic_driver = { |
| 612 | .driver = { |
| 613 | .name = "act8865", |
Wenyou Yang | 33036f4 | 2013-12-24 10:34:28 +0800 | [diff] [blame] | 614 | }, |
| 615 | .probe = act8865_pmic_probe, |
Wenyou Yang | 33036f4 | 2013-12-24 10:34:28 +0800 | [diff] [blame] | 616 | .id_table = act8865_ids, |
| 617 | }; |
| 618 | |
| 619 | module_i2c_driver(act8865_pmic_driver); |
| 620 | |
Beniamino Galvani | 50a03e3 | 2014-07-05 15:20:54 +0200 | [diff] [blame] | 621 | MODULE_DESCRIPTION("active-semi act88xx voltage regulator driver"); |
Wenyou Yang | 33036f4 | 2013-12-24 10:34:28 +0800 | [diff] [blame] | 622 | MODULE_AUTHOR("Wenyou Yang <wenyou.yang@atmel.com>"); |
| 623 | MODULE_LICENSE("GPL v2"); |