Tom Rini | 10e4779 | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0+ |
Keerthy | ffed0ea | 2016-09-30 09:20:44 +0530 | [diff] [blame] | 2 | /* |
| 3 | * (C) Copyright 2016 |
| 4 | * Texas Instruments Incorporated, <www.ti.com> |
| 5 | * |
| 6 | * Keerthy <j-keerthy@ti.com> |
Keerthy | ffed0ea | 2016-09-30 09:20:44 +0530 | [diff] [blame] | 7 | */ |
| 8 | |
| 9 | #include <common.h> |
| 10 | #include <fdtdec.h> |
| 11 | #include <errno.h> |
| 12 | #include <dm.h> |
Keerthy | ffed0ea | 2016-09-30 09:20:44 +0530 | [diff] [blame] | 13 | #include <power/pmic.h> |
| 14 | #include <power/regulator.h> |
| 15 | #include <power/palmas.h> |
| 16 | |
Keerthy | ffed0ea | 2016-09-30 09:20:44 +0530 | [diff] [blame] | 17 | #define REGULATOR_ON 0x1 |
| 18 | #define REGULATOR_OFF 0x0 |
| 19 | |
| 20 | #define SMPS_MODE_MASK 0x3 |
| 21 | #define SMPS_MODE_SHIFT 0x0 |
| 22 | #define LDO_MODE_MASK 0x1 |
| 23 | #define LDO_MODE_SHIFT 0x0 |
| 24 | |
| 25 | static const char palmas_smps_ctrl[][PALMAS_SMPS_NUM] = { |
| 26 | {0x20, 0x24, 0x28, 0x2c, 0x30, 0x34, 0x38, 0x3c}, |
| 27 | {0x20, 0x24, 0x28, 0x2c, 0x30, 0x34, 0x38}, |
| 28 | {0x20, 0x24, 0x2c, 0x30, 0x38}, |
| 29 | }; |
| 30 | |
| 31 | static const char palmas_smps_volt[][PALMAS_SMPS_NUM] = { |
| 32 | {0x23, 0x27, 0x2b, 0x2f, 0x33, 0x37, 0x3b, 0x3c}, |
| 33 | {0x23, 0x27, 0x2b, 0x2f, 0x33, 0x37, 0x3b}, |
| 34 | {0x23, 0x27, 0x2f, 0x33, 0x3B} |
| 35 | }; |
| 36 | |
| 37 | static const char palmas_ldo_ctrl[][PALMAS_LDO_NUM] = { |
| 38 | {0x50, 0x52, 0x54, 0x56, 0x58, 0x5a, 0x5c, 0x5e, 0x60, 0x62, 0x64}, |
| 39 | {0x50, 0x52, 0x54, 0x56, 0x58, 0x5a, 0x5c, 0x5e, 0x60, 0x62, 0x64}, |
| 40 | {0x50, 0x52, 0x54, 0x5e, 0x62} |
| 41 | }; |
| 42 | |
| 43 | static const char palmas_ldo_volt[][PALMAS_LDO_NUM] = { |
| 44 | {0x51, 0x53, 0x55, 0x57, 0x59, 0x5b, 0x5d, 0x5f, 0x61, 0x63, 0x65}, |
| 45 | {0x51, 0x53, 0x55, 0x57, 0x59, 0x5b, 0x5d, 0x5f, 0x61, 0x63, 0x65}, |
| 46 | {0x51, 0x53, 0x55, 0x5f, 0x63} |
| 47 | }; |
| 48 | |
| 49 | static int palmas_smps_enable(struct udevice *dev, int op, bool *enable) |
| 50 | { |
| 51 | int ret; |
| 52 | unsigned int adr; |
Simon Glass | 71fa5b4 | 2020-12-03 16:55:18 -0700 | [diff] [blame] | 53 | struct dm_regulator_uclass_plat *uc_pdata; |
Keerthy | ffed0ea | 2016-09-30 09:20:44 +0530 | [diff] [blame] | 54 | |
Simon Glass | 71fa5b4 | 2020-12-03 16:55:18 -0700 | [diff] [blame] | 55 | uc_pdata = dev_get_uclass_plat(dev); |
Keerthy | ffed0ea | 2016-09-30 09:20:44 +0530 | [diff] [blame] | 56 | adr = uc_pdata->ctrl_reg; |
| 57 | |
| 58 | ret = pmic_reg_read(dev->parent, adr); |
| 59 | if (ret < 0) |
| 60 | return ret; |
| 61 | |
| 62 | if (op == PMIC_OP_GET) { |
| 63 | ret &= PALMAS_SMPS_STATUS_MASK; |
| 64 | |
| 65 | if (ret) |
| 66 | *enable = true; |
| 67 | else |
| 68 | *enable = false; |
| 69 | |
| 70 | return 0; |
| 71 | } else if (op == PMIC_OP_SET) { |
| 72 | if (*enable) |
| 73 | ret |= PALMAS_SMPS_MODE_MASK; |
| 74 | else |
| 75 | ret &= ~(PALMAS_SMPS_MODE_MASK); |
| 76 | |
| 77 | ret = pmic_reg_write(dev->parent, adr, ret); |
| 78 | if (ret) |
| 79 | return ret; |
| 80 | } |
| 81 | |
| 82 | return 0; |
| 83 | } |
| 84 | |
| 85 | static int palmas_smps_volt2hex(int uV) |
| 86 | { |
| 87 | if (uV > PALMAS_LDO_VOLT_MAX) |
| 88 | return -EINVAL; |
| 89 | |
| 90 | if (uV > 1650000) |
| 91 | return (uV - 1000000) / 20000 + 0x6; |
| 92 | |
| 93 | if (uV == 500000) |
| 94 | return 0x6; |
| 95 | else |
| 96 | return 0x6 + ((uV - 500000) / 10000); |
| 97 | } |
| 98 | |
| 99 | static int palmas_smps_hex2volt(int hex, bool range) |
| 100 | { |
| 101 | unsigned int uV = 0; |
| 102 | |
| 103 | if (hex > PALMAS_SMPS_VOLT_MAX_HEX) |
| 104 | return -EINVAL; |
| 105 | |
| 106 | if (hex < 0x7) |
| 107 | uV = 500000; |
| 108 | else |
| 109 | uV = 500000 + (hex - 0x6) * 10000; |
| 110 | |
| 111 | if (range) |
| 112 | uV *= 2; |
| 113 | |
| 114 | return uV; |
| 115 | } |
| 116 | |
| 117 | static int palmas_smps_val(struct udevice *dev, int op, int *uV) |
| 118 | { |
| 119 | unsigned int hex, adr; |
| 120 | int ret; |
| 121 | bool range; |
Simon Glass | 71fa5b4 | 2020-12-03 16:55:18 -0700 | [diff] [blame] | 122 | struct dm_regulator_uclass_plat *uc_pdata; |
Keerthy | ffed0ea | 2016-09-30 09:20:44 +0530 | [diff] [blame] | 123 | |
Simon Glass | 71fa5b4 | 2020-12-03 16:55:18 -0700 | [diff] [blame] | 124 | uc_pdata = dev_get_uclass_plat(dev); |
Keerthy | ffed0ea | 2016-09-30 09:20:44 +0530 | [diff] [blame] | 125 | |
| 126 | if (op == PMIC_OP_GET) |
| 127 | *uV = 0; |
| 128 | |
| 129 | adr = uc_pdata->volt_reg; |
| 130 | |
| 131 | ret = pmic_reg_read(dev->parent, adr); |
| 132 | if (ret < 0) |
| 133 | return ret; |
| 134 | |
| 135 | if (op == PMIC_OP_GET) { |
| 136 | if (ret & PALMAS_SMPS_RANGE_MASK) |
| 137 | range = true; |
| 138 | else |
| 139 | range = false; |
| 140 | |
| 141 | ret &= PALMAS_SMPS_VOLT_MASK; |
| 142 | ret = palmas_smps_hex2volt(ret, range); |
| 143 | if (ret < 0) |
| 144 | return ret; |
| 145 | *uV = ret; |
| 146 | |
| 147 | return 0; |
| 148 | } |
| 149 | |
| 150 | hex = palmas_smps_volt2hex(*uV); |
| 151 | if (hex < 0) |
| 152 | return hex; |
| 153 | |
| 154 | ret &= ~PALMAS_SMPS_VOLT_MASK; |
| 155 | ret |= hex; |
| 156 | if (*uV > 1650000) |
| 157 | ret |= PALMAS_SMPS_RANGE_MASK; |
| 158 | |
| 159 | return pmic_reg_write(dev->parent, adr, ret); |
| 160 | } |
| 161 | |
Jean-Jacques Hiblot | 9182741 | 2017-07-12 11:42:47 +0200 | [diff] [blame] | 162 | static int palmas_ldo_bypass_enable(struct udevice *dev, bool enabled) |
| 163 | { |
| 164 | int type = dev_get_driver_data(dev_get_parent(dev)); |
Simon Glass | 71fa5b4 | 2020-12-03 16:55:18 -0700 | [diff] [blame] | 165 | struct dm_regulator_uclass_plat *p; |
Jean-Jacques Hiblot | 9182741 | 2017-07-12 11:42:47 +0200 | [diff] [blame] | 166 | unsigned int adr; |
| 167 | int reg; |
| 168 | |
| 169 | if (type == TPS65917) { |
| 170 | /* bypass available only on LDO1 and LDO2 */ |
| 171 | if (dev->driver_data > 2) |
| 172 | return -ENOTSUPP; |
| 173 | } else if (type == TPS659038) { |
| 174 | /* bypass available only on LDO9 */ |
| 175 | if (dev->driver_data != 9) |
| 176 | return -ENOTSUPP; |
| 177 | } |
| 178 | |
Simon Glass | 71fa5b4 | 2020-12-03 16:55:18 -0700 | [diff] [blame] | 179 | p = dev_get_uclass_plat(dev); |
Jean-Jacques Hiblot | 9182741 | 2017-07-12 11:42:47 +0200 | [diff] [blame] | 180 | adr = p->ctrl_reg; |
| 181 | |
| 182 | reg = pmic_reg_read(dev->parent, adr); |
| 183 | if (reg < 0) |
| 184 | return reg; |
| 185 | |
| 186 | if (enabled) |
| 187 | reg |= PALMAS_LDO_BYPASS_EN; |
| 188 | else |
| 189 | reg &= ~PALMAS_LDO_BYPASS_EN; |
| 190 | |
| 191 | return pmic_reg_write(dev->parent, adr, reg); |
| 192 | } |
| 193 | |
Keerthy | ffed0ea | 2016-09-30 09:20:44 +0530 | [diff] [blame] | 194 | static int palmas_ldo_enable(struct udevice *dev, int op, bool *enable) |
| 195 | { |
| 196 | int ret; |
| 197 | unsigned int adr; |
Simon Glass | 71fa5b4 | 2020-12-03 16:55:18 -0700 | [diff] [blame] | 198 | struct dm_regulator_uclass_plat *uc_pdata; |
Keerthy | ffed0ea | 2016-09-30 09:20:44 +0530 | [diff] [blame] | 199 | |
Simon Glass | 71fa5b4 | 2020-12-03 16:55:18 -0700 | [diff] [blame] | 200 | uc_pdata = dev_get_uclass_plat(dev); |
Keerthy | ffed0ea | 2016-09-30 09:20:44 +0530 | [diff] [blame] | 201 | adr = uc_pdata->ctrl_reg; |
| 202 | |
| 203 | ret = pmic_reg_read(dev->parent, adr); |
| 204 | if (ret < 0) |
| 205 | return ret; |
| 206 | |
| 207 | if (op == PMIC_OP_GET) { |
| 208 | ret &= PALMAS_LDO_STATUS_MASK; |
| 209 | |
| 210 | if (ret) |
| 211 | *enable = true; |
| 212 | else |
| 213 | *enable = false; |
| 214 | |
| 215 | return 0; |
| 216 | } else if (op == PMIC_OP_SET) { |
| 217 | if (*enable) |
| 218 | ret |= PALMAS_LDO_MODE_MASK; |
| 219 | else |
| 220 | ret &= ~(PALMAS_LDO_MODE_MASK); |
| 221 | |
| 222 | ret = pmic_reg_write(dev->parent, adr, ret); |
| 223 | if (ret) |
| 224 | return ret; |
Jean-Jacques Hiblot | 9182741 | 2017-07-12 11:42:47 +0200 | [diff] [blame] | 225 | |
| 226 | ret = palmas_ldo_bypass_enable(dev, false); |
| 227 | if (ret && (ret != -ENOTSUPP)) |
| 228 | return ret; |
Keerthy | ffed0ea | 2016-09-30 09:20:44 +0530 | [diff] [blame] | 229 | } |
| 230 | |
| 231 | return 0; |
| 232 | } |
| 233 | |
| 234 | static int palmas_ldo_volt2hex(int uV) |
| 235 | { |
| 236 | if (uV > PALMAS_LDO_VOLT_MAX) |
| 237 | return -EINVAL; |
| 238 | |
| 239 | return (uV - 850000) / 50000; |
| 240 | } |
| 241 | |
| 242 | static int palmas_ldo_hex2volt(int hex) |
| 243 | { |
| 244 | if (hex > PALMAS_LDO_VOLT_MAX_HEX) |
| 245 | return -EINVAL; |
| 246 | |
| 247 | if (!hex) |
| 248 | return 0; |
| 249 | |
| 250 | return (hex * 50000) + 850000; |
| 251 | } |
| 252 | |
| 253 | static int palmas_ldo_val(struct udevice *dev, int op, int *uV) |
| 254 | { |
| 255 | unsigned int hex, adr; |
| 256 | int ret; |
| 257 | |
Simon Glass | 71fa5b4 | 2020-12-03 16:55:18 -0700 | [diff] [blame] | 258 | struct dm_regulator_uclass_plat *uc_pdata; |
Keerthy | ffed0ea | 2016-09-30 09:20:44 +0530 | [diff] [blame] | 259 | |
| 260 | if (op == PMIC_OP_GET) |
| 261 | *uV = 0; |
| 262 | |
Simon Glass | 71fa5b4 | 2020-12-03 16:55:18 -0700 | [diff] [blame] | 263 | uc_pdata = dev_get_uclass_plat(dev); |
Keerthy | ffed0ea | 2016-09-30 09:20:44 +0530 | [diff] [blame] | 264 | |
| 265 | adr = uc_pdata->volt_reg; |
| 266 | |
| 267 | ret = pmic_reg_read(dev->parent, adr); |
| 268 | if (ret < 0) |
| 269 | return ret; |
| 270 | |
| 271 | if (op == PMIC_OP_GET) { |
| 272 | ret &= PALMAS_LDO_VOLT_MASK; |
| 273 | ret = palmas_ldo_hex2volt(ret); |
| 274 | if (ret < 0) |
| 275 | return ret; |
| 276 | *uV = ret; |
| 277 | return 0; |
| 278 | } |
| 279 | |
| 280 | hex = palmas_ldo_volt2hex(*uV); |
| 281 | if (hex < 0) |
| 282 | return hex; |
| 283 | |
| 284 | ret &= ~PALMAS_LDO_VOLT_MASK; |
| 285 | ret |= hex; |
| 286 | if (*uV > 1650000) |
| 287 | ret |= 0x80; |
| 288 | |
| 289 | return pmic_reg_write(dev->parent, adr, ret); |
| 290 | } |
| 291 | |
| 292 | static int palmas_ldo_probe(struct udevice *dev) |
| 293 | { |
Simon Glass | 71fa5b4 | 2020-12-03 16:55:18 -0700 | [diff] [blame] | 294 | struct dm_regulator_uclass_plat *uc_pdata; |
Keerthy | ffed0ea | 2016-09-30 09:20:44 +0530 | [diff] [blame] | 295 | struct udevice *parent; |
| 296 | |
Simon Glass | 71fa5b4 | 2020-12-03 16:55:18 -0700 | [diff] [blame] | 297 | uc_pdata = dev_get_uclass_plat(dev); |
Keerthy | ffed0ea | 2016-09-30 09:20:44 +0530 | [diff] [blame] | 298 | |
| 299 | parent = dev_get_parent(dev); |
| 300 | int type = dev_get_driver_data(parent); |
| 301 | |
| 302 | uc_pdata->type = REGULATOR_TYPE_LDO; |
| 303 | |
Svyatoslav Ryhel | 4e0d293 | 2023-10-27 11:26:09 +0300 | [diff] [blame] | 304 | /* check for ldoln and ldousb cases */ |
| 305 | if (!strcmp("ldoln", dev->name)) { |
| 306 | uc_pdata->ctrl_reg = palmas_ldo_ctrl[type][9]; |
| 307 | uc_pdata->volt_reg = palmas_ldo_volt[type][9]; |
| 308 | return 0; |
| 309 | } |
| 310 | |
| 311 | if (!strcmp("ldousb", dev->name)) { |
| 312 | uc_pdata->ctrl_reg = palmas_ldo_ctrl[type][10]; |
| 313 | uc_pdata->volt_reg = palmas_ldo_volt[type][10]; |
| 314 | return 0; |
| 315 | } |
| 316 | |
| 317 | if (dev->driver_data > 0) { |
Keerthy | ffed0ea | 2016-09-30 09:20:44 +0530 | [diff] [blame] | 318 | u8 idx = dev->driver_data - 1; |
| 319 | uc_pdata->ctrl_reg = palmas_ldo_ctrl[type][idx]; |
| 320 | uc_pdata->volt_reg = palmas_ldo_volt[type][idx]; |
Keerthy | ffed0ea | 2016-09-30 09:20:44 +0530 | [diff] [blame] | 321 | } |
| 322 | |
| 323 | return 0; |
| 324 | } |
| 325 | |
| 326 | static int ldo_get_value(struct udevice *dev) |
| 327 | { |
| 328 | int uV; |
| 329 | int ret; |
| 330 | |
| 331 | ret = palmas_ldo_val(dev, PMIC_OP_GET, &uV); |
| 332 | if (ret) |
| 333 | return ret; |
| 334 | |
| 335 | return uV; |
| 336 | } |
| 337 | |
| 338 | static int ldo_set_value(struct udevice *dev, int uV) |
| 339 | { |
| 340 | return palmas_ldo_val(dev, PMIC_OP_SET, &uV); |
| 341 | } |
| 342 | |
Keerthy | e8de891 | 2017-06-13 09:53:49 +0530 | [diff] [blame] | 343 | static int ldo_get_enable(struct udevice *dev) |
Keerthy | ffed0ea | 2016-09-30 09:20:44 +0530 | [diff] [blame] | 344 | { |
| 345 | bool enable = false; |
| 346 | int ret; |
| 347 | |
| 348 | ret = palmas_ldo_enable(dev, PMIC_OP_GET, &enable); |
| 349 | if (ret) |
| 350 | return ret; |
| 351 | |
| 352 | return enable; |
| 353 | } |
| 354 | |
| 355 | static int ldo_set_enable(struct udevice *dev, bool enable) |
| 356 | { |
| 357 | return palmas_ldo_enable(dev, PMIC_OP_SET, &enable); |
| 358 | } |
| 359 | |
| 360 | static int palmas_smps_probe(struct udevice *dev) |
| 361 | { |
Simon Glass | 71fa5b4 | 2020-12-03 16:55:18 -0700 | [diff] [blame] | 362 | struct dm_regulator_uclass_plat *uc_pdata; |
Keerthy | ffed0ea | 2016-09-30 09:20:44 +0530 | [diff] [blame] | 363 | struct udevice *parent; |
| 364 | int idx; |
| 365 | |
Simon Glass | 71fa5b4 | 2020-12-03 16:55:18 -0700 | [diff] [blame] | 366 | uc_pdata = dev_get_uclass_plat(dev); |
Keerthy | ffed0ea | 2016-09-30 09:20:44 +0530 | [diff] [blame] | 367 | |
| 368 | parent = dev_get_parent(dev); |
| 369 | int type = dev_get_driver_data(parent); |
| 370 | |
| 371 | uc_pdata->type = REGULATOR_TYPE_BUCK; |
| 372 | |
| 373 | switch (type) { |
| 374 | case PALMAS: |
| 375 | case TPS659038: |
| 376 | switch (dev->driver_data) { |
| 377 | case 123: |
| 378 | case 12: |
| 379 | uc_pdata->ctrl_reg = palmas_smps_ctrl[type][0]; |
| 380 | uc_pdata->volt_reg = palmas_smps_volt[type][0]; |
| 381 | break; |
| 382 | case 3: |
| 383 | uc_pdata->ctrl_reg = palmas_smps_ctrl[type][1]; |
| 384 | uc_pdata->volt_reg = palmas_smps_volt[type][1]; |
| 385 | break; |
| 386 | case 45: |
| 387 | uc_pdata->ctrl_reg = palmas_smps_ctrl[type][2]; |
| 388 | uc_pdata->volt_reg = palmas_smps_volt[type][2]; |
| 389 | break; |
| 390 | case 6: |
| 391 | case 7: |
| 392 | case 8: |
| 393 | case 9: |
| 394 | case 10: |
Keerthy | c89f7ce | 2017-02-03 17:04:08 +0530 | [diff] [blame] | 395 | idx = dev->driver_data - 3; |
Keerthy | ffed0ea | 2016-09-30 09:20:44 +0530 | [diff] [blame] | 396 | uc_pdata->ctrl_reg = palmas_smps_ctrl[type][idx]; |
| 397 | uc_pdata->volt_reg = palmas_smps_volt[type][idx]; |
| 398 | break; |
| 399 | |
| 400 | default: |
| 401 | printf("Wrong ID for regulator\n"); |
| 402 | } |
| 403 | break; |
| 404 | |
| 405 | case TPS65917: |
| 406 | switch (dev->driver_data) { |
| 407 | case 1: |
| 408 | case 2: |
| 409 | case 3: |
| 410 | case 4: |
| 411 | case 5: |
| 412 | idx = dev->driver_data - 1; |
| 413 | uc_pdata->ctrl_reg = palmas_smps_ctrl[type][idx]; |
| 414 | uc_pdata->volt_reg = palmas_smps_volt[type][idx]; |
| 415 | break; |
Keerthy | 879cbd0 | 2017-06-02 10:51:51 +0530 | [diff] [blame] | 416 | case 12: |
| 417 | idx = 0; |
| 418 | uc_pdata->ctrl_reg = palmas_smps_ctrl[type][idx]; |
| 419 | uc_pdata->volt_reg = palmas_smps_volt[type][idx]; |
| 420 | break; |
Keerthy | ffed0ea | 2016-09-30 09:20:44 +0530 | [diff] [blame] | 421 | default: |
| 422 | printf("Wrong ID for regulator\n"); |
| 423 | } |
| 424 | break; |
| 425 | |
| 426 | default: |
| 427 | printf("Invalid PMIC ID\n"); |
| 428 | } |
| 429 | |
| 430 | return 0; |
| 431 | } |
| 432 | |
| 433 | static int smps_get_value(struct udevice *dev) |
| 434 | { |
| 435 | int uV; |
| 436 | int ret; |
| 437 | |
| 438 | ret = palmas_smps_val(dev, PMIC_OP_GET, &uV); |
| 439 | if (ret) |
| 440 | return ret; |
| 441 | |
| 442 | return uV; |
| 443 | } |
| 444 | |
| 445 | static int smps_set_value(struct udevice *dev, int uV) |
| 446 | { |
| 447 | return palmas_smps_val(dev, PMIC_OP_SET, &uV); |
| 448 | } |
| 449 | |
Keerthy | e8de891 | 2017-06-13 09:53:49 +0530 | [diff] [blame] | 450 | static int smps_get_enable(struct udevice *dev) |
Keerthy | ffed0ea | 2016-09-30 09:20:44 +0530 | [diff] [blame] | 451 | { |
| 452 | bool enable = false; |
| 453 | int ret; |
| 454 | |
| 455 | ret = palmas_smps_enable(dev, PMIC_OP_GET, &enable); |
| 456 | if (ret) |
| 457 | return ret; |
| 458 | |
| 459 | return enable; |
| 460 | } |
| 461 | |
| 462 | static int smps_set_enable(struct udevice *dev, bool enable) |
| 463 | { |
| 464 | return palmas_smps_enable(dev, PMIC_OP_SET, &enable); |
| 465 | } |
| 466 | |
| 467 | static const struct dm_regulator_ops palmas_ldo_ops = { |
| 468 | .get_value = ldo_get_value, |
| 469 | .set_value = ldo_set_value, |
| 470 | .get_enable = ldo_get_enable, |
| 471 | .set_enable = ldo_set_enable, |
| 472 | }; |
| 473 | |
| 474 | U_BOOT_DRIVER(palmas_ldo) = { |
| 475 | .name = PALMAS_LDO_DRIVER, |
| 476 | .id = UCLASS_REGULATOR, |
| 477 | .ops = &palmas_ldo_ops, |
| 478 | .probe = palmas_ldo_probe, |
| 479 | }; |
| 480 | |
| 481 | static const struct dm_regulator_ops palmas_smps_ops = { |
| 482 | .get_value = smps_get_value, |
| 483 | .set_value = smps_set_value, |
| 484 | .get_enable = smps_get_enable, |
| 485 | .set_enable = smps_set_enable, |
| 486 | }; |
| 487 | |
| 488 | U_BOOT_DRIVER(palmas_smps) = { |
| 489 | .name = PALMAS_SMPS_DRIVER, |
| 490 | .id = UCLASS_REGULATOR, |
| 491 | .ops = &palmas_smps_ops, |
| 492 | .probe = palmas_smps_probe, |
| 493 | }; |