| .. | .. |
|---|
| 3 | 3 | * |
|---|
| 4 | 4 | * Regulator driver for TPS65217 PMIC |
|---|
| 5 | 5 | * |
|---|
| 6 | | - * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ |
|---|
| 6 | + * Copyright (C) 2011 Texas Instruments Incorporated - https://www.ti.com/ |
|---|
| 7 | 7 | * |
|---|
| 8 | 8 | * This program is free software; you can redistribute it and/or |
|---|
| 9 | 9 | * modify it under the terms of the GNU General Public License as |
|---|
| .. | .. |
|---|
| 56 | 56 | 2800000, 3000000, 3100000, 3300000, |
|---|
| 57 | 57 | }; |
|---|
| 58 | 58 | |
|---|
| 59 | | -static const struct regulator_linear_range tps65217_uv1_ranges[] = { |
|---|
| 59 | +static const struct linear_range tps65217_uv1_ranges[] = { |
|---|
| 60 | 60 | REGULATOR_LINEAR_RANGE(900000, 0, 24, 25000), |
|---|
| 61 | | - REGULATOR_LINEAR_RANGE(1550000, 25, 30, 50000), |
|---|
| 62 | | - REGULATOR_LINEAR_RANGE(1850000, 31, 52, 50000), |
|---|
| 61 | + REGULATOR_LINEAR_RANGE(1550000, 25, 52, 50000), |
|---|
| 63 | 62 | REGULATOR_LINEAR_RANGE(3000000, 53, 55, 100000), |
|---|
| 64 | | - REGULATOR_LINEAR_RANGE(3300000, 56, 62, 0), |
|---|
| 63 | + REGULATOR_LINEAR_RANGE(3300000, 56, 63, 0), |
|---|
| 65 | 64 | }; |
|---|
| 66 | 65 | |
|---|
| 67 | | -static const struct regulator_linear_range tps65217_uv2_ranges[] = { |
|---|
| 66 | +static const struct linear_range tps65217_uv2_ranges[] = { |
|---|
| 68 | 67 | REGULATOR_LINEAR_RANGE(1500000, 0, 8, 50000), |
|---|
| 69 | 68 | REGULATOR_LINEAR_RANGE(2000000, 9, 13, 100000), |
|---|
| 70 | 69 | REGULATOR_LINEAR_RANGE(2450000, 14, 31, 50000), |
|---|
| .. | .. |
|---|
| 125 | 124 | struct tps65217 *tps = rdev_get_drvdata(dev); |
|---|
| 126 | 125 | unsigned int rid = rdev_get_id(dev); |
|---|
| 127 | 126 | |
|---|
| 128 | | - if (rid < TPS65217_DCDC_1 || rid > TPS65217_LDO_4) |
|---|
| 127 | + if (rid > TPS65217_LDO_4) |
|---|
| 129 | 128 | return -EINVAL; |
|---|
| 130 | 129 | |
|---|
| 131 | 130 | return tps65217_clear_bits(tps, dev->desc->bypass_reg, |
|---|
| .. | .. |
|---|
| 138 | 137 | struct tps65217 *tps = rdev_get_drvdata(dev); |
|---|
| 139 | 138 | unsigned int rid = rdev_get_id(dev); |
|---|
| 140 | 139 | |
|---|
| 141 | | - if (rid < TPS65217_DCDC_1 || rid > TPS65217_LDO_4) |
|---|
| 140 | + if (rid > TPS65217_LDO_4) |
|---|
| 142 | 141 | return -EINVAL; |
|---|
| 143 | 142 | |
|---|
| 144 | 143 | if (!tps->strobes[rid]) |
|---|
| .. | .. |
|---|
| 150 | 149 | } |
|---|
| 151 | 150 | |
|---|
| 152 | 151 | /* Operations permitted on DCDCx, LDO2, LDO3 and LDO4 */ |
|---|
| 153 | | -static struct regulator_ops tps65217_pmic_ops = { |
|---|
| 152 | +static const struct regulator_ops tps65217_pmic_ops = { |
|---|
| 154 | 153 | .is_enabled = regulator_is_enabled_regmap, |
|---|
| 155 | 154 | .enable = tps65217_pmic_enable, |
|---|
| 156 | 155 | .disable = tps65217_pmic_disable, |
|---|
| .. | .. |
|---|
| 163 | 162 | }; |
|---|
| 164 | 163 | |
|---|
| 165 | 164 | /* Operations permitted on LDO1 */ |
|---|
| 166 | | -static struct regulator_ops tps65217_pmic_ldo1_ops = { |
|---|
| 165 | +static const struct regulator_ops tps65217_pmic_ldo1_ops = { |
|---|
| 167 | 166 | .is_enabled = regulator_is_enabled_regmap, |
|---|
| 168 | 167 | .enable = tps65217_pmic_enable, |
|---|
| 169 | 168 | .disable = tps65217_pmic_disable, |
|---|
| .. | .. |
|---|
| 255 | 254 | |
|---|
| 256 | 255 | /* Store default strobe info */ |
|---|
| 257 | 256 | ret = tps65217_reg_read(tps, regulators[i].bypass_reg, &val); |
|---|
| 257 | + if (ret) |
|---|
| 258 | + return ret; |
|---|
| 259 | + |
|---|
| 258 | 260 | tps->strobes[i] = val & regulators[i].bypass_mask; |
|---|
| 259 | 261 | } |
|---|
| 260 | 262 | |
|---|