| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * Driver for Regulator part of Palmas PMIC Chips |
|---|
| 3 | 4 | * |
|---|
| .. | .. |
|---|
| 5 | 6 | * |
|---|
| 6 | 7 | * Author: Graeme Gregory <gg@slimlogic.co.uk> |
|---|
| 7 | 8 | * Author: Ian Lartey <ian@slimlogic.co.uk> |
|---|
| 8 | | - * |
|---|
| 9 | | - * This program is free software; you can redistribute it and/or modify it |
|---|
| 10 | | - * under the terms of the GNU General Public License as published by the |
|---|
| 11 | | - * Free Software Foundation; either version 2 of the License, or (at your |
|---|
| 12 | | - * option) any later version. |
|---|
| 13 | | - * |
|---|
| 14 | 9 | */ |
|---|
| 15 | 10 | |
|---|
| 16 | 11 | #include <linux/kernel.h> |
|---|
| .. | .. |
|---|
| 27 | 22 | #include <linux/of_platform.h> |
|---|
| 28 | 23 | #include <linux/regulator/of_regulator.h> |
|---|
| 29 | 24 | |
|---|
| 30 | | -static const struct regulator_linear_range smps_low_ranges[] = { |
|---|
| 25 | +static const struct linear_range smps_low_ranges[] = { |
|---|
| 31 | 26 | REGULATOR_LINEAR_RANGE(0, 0x0, 0x0, 0), |
|---|
| 32 | 27 | REGULATOR_LINEAR_RANGE(500000, 0x1, 0x6, 0), |
|---|
| 33 | 28 | REGULATOR_LINEAR_RANGE(510000, 0x7, 0x79, 10000), |
|---|
| 34 | 29 | REGULATOR_LINEAR_RANGE(1650000, 0x7A, 0x7f, 0), |
|---|
| 35 | 30 | }; |
|---|
| 36 | 31 | |
|---|
| 37 | | -static const struct regulator_linear_range smps_high_ranges[] = { |
|---|
| 32 | +static const struct linear_range smps_high_ranges[] = { |
|---|
| 38 | 33 | REGULATOR_LINEAR_RANGE(0, 0x0, 0x0, 0), |
|---|
| 39 | 34 | REGULATOR_LINEAR_RANGE(1000000, 0x1, 0x6, 0), |
|---|
| 40 | 35 | REGULATOR_LINEAR_RANGE(1020000, 0x7, 0x79, 20000), |
|---|
| .. | .. |
|---|
| 382 | 377 | EXTERNAL_REQUESTOR_TPS65917(LDO5, 2, 4), |
|---|
| 383 | 378 | }; |
|---|
| 384 | 379 | |
|---|
| 385 | | -static unsigned int palmas_smps_ramp_delay[4] = {0, 10000, 5000, 2500}; |
|---|
| 380 | +static const unsigned int palmas_smps_ramp_delay[4] = {0, 10000, 5000, 2500}; |
|---|
| 386 | 381 | |
|---|
| 387 | 382 | #define SMPS_CTRL_MODE_OFF 0x00 |
|---|
| 388 | 383 | #define SMPS_CTRL_MODE_ON 0x01 |
|---|
| .. | .. |
|---|
| 991 | 986 | return PTR_ERR(rdev); |
|---|
| 992 | 987 | } |
|---|
| 993 | 988 | |
|---|
| 994 | | - /* Save regulator for cleanup */ |
|---|
| 995 | | - pmic->rdev[id] = rdev; |
|---|
| 996 | | - |
|---|
| 997 | 989 | /* Initialise sleep/init values from platform data */ |
|---|
| 998 | 990 | if (pdata) { |
|---|
| 999 | 991 | reg_init = pdata->reg_init[id]; |
|---|
| .. | .. |
|---|
| 1100 | 1092 | pdev_name); |
|---|
| 1101 | 1093 | return PTR_ERR(rdev); |
|---|
| 1102 | 1094 | } |
|---|
| 1103 | | - |
|---|
| 1104 | | - /* Save regulator for cleanup */ |
|---|
| 1105 | | - pmic->rdev[id] = rdev; |
|---|
| 1106 | 1095 | |
|---|
| 1107 | 1096 | /* Initialise sleep/init values from platform data */ |
|---|
| 1108 | 1097 | if (pdata) { |
|---|
| .. | .. |
|---|
| 1288 | 1277 | pdev_name); |
|---|
| 1289 | 1278 | return PTR_ERR(rdev); |
|---|
| 1290 | 1279 | } |
|---|
| 1291 | | - |
|---|
| 1292 | | - /* Save regulator for cleanup */ |
|---|
| 1293 | | - pmic->rdev[id] = rdev; |
|---|
| 1294 | 1280 | } |
|---|
| 1295 | 1281 | |
|---|
| 1296 | 1282 | return 0; |
|---|
| .. | .. |
|---|
| 1395 | 1381 | pdev_name); |
|---|
| 1396 | 1382 | return PTR_ERR(rdev); |
|---|
| 1397 | 1383 | } |
|---|
| 1398 | | - |
|---|
| 1399 | | - /* Save regulator for cleanup */ |
|---|
| 1400 | | - pmic->rdev[id] = rdev; |
|---|
| 1401 | 1384 | } |
|---|
| 1402 | 1385 | |
|---|
| 1403 | 1386 | return 0; |
|---|