| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * Regulators driver for Marvell 88PM800 |
|---|
| 3 | 4 | * |
|---|
| 4 | 5 | * Copyright (C) 2012 Marvell International Ltd. |
|---|
| 5 | 6 | * Joseph(Yossi) Hanin <yhanin@marvell.com> |
|---|
| 6 | 7 | * Yi Zhang <yizhang@marvell.com> |
|---|
| 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 version 2 as |
|---|
| 10 | | - * published by the Free Software Foundation. |
|---|
| 11 | 8 | */ |
|---|
| 12 | 9 | #include <linux/module.h> |
|---|
| 13 | 10 | #include <linux/moduleparam.h> |
|---|
| .. | .. |
|---|
| 77 | 74 | int max_ua; |
|---|
| 78 | 75 | }; |
|---|
| 79 | 76 | |
|---|
| 80 | | -struct pm800_regulators { |
|---|
| 81 | | - struct pm80x_chip *chip; |
|---|
| 82 | | - struct regmap *map; |
|---|
| 83 | | -}; |
|---|
| 84 | | - |
|---|
| 85 | 77 | /* |
|---|
| 86 | 78 | * vreg - the buck regs string. |
|---|
| 87 | 79 | * ereg - the string for the enable register. |
|---|
| .. | .. |
|---|
| 142 | 134 | } |
|---|
| 143 | 135 | |
|---|
| 144 | 136 | /* Ranges are sorted in ascending order. */ |
|---|
| 145 | | -static const struct regulator_linear_range buck1_volt_range[] = { |
|---|
| 137 | +static const struct linear_range buck1_volt_range[] = { |
|---|
| 146 | 138 | REGULATOR_LINEAR_RANGE(600000, 0, 0x4f, 12500), |
|---|
| 147 | 139 | REGULATOR_LINEAR_RANGE(1600000, 0x50, 0x54, 50000), |
|---|
| 148 | 140 | }; |
|---|
| 149 | 141 | |
|---|
| 150 | 142 | /* BUCK 2~5 have same ranges. */ |
|---|
| 151 | | -static const struct regulator_linear_range buck2_5_volt_range[] = { |
|---|
| 143 | +static const struct linear_range buck2_5_volt_range[] = { |
|---|
| 152 | 144 | REGULATOR_LINEAR_RANGE(600000, 0, 0x4f, 12500), |
|---|
| 153 | 145 | REGULATOR_LINEAR_RANGE(1600000, 0x50, 0x72, 50000), |
|---|
| 154 | 146 | }; |
|---|
| .. | .. |
|---|
| 235 | 227 | { |
|---|
| 236 | 228 | struct pm80x_chip *chip = dev_get_drvdata(pdev->dev.parent); |
|---|
| 237 | 229 | struct pm80x_platform_data *pdata = dev_get_platdata(pdev->dev.parent); |
|---|
| 238 | | - struct pm800_regulators *pm800_data; |
|---|
| 239 | 230 | struct regulator_config config = { }; |
|---|
| 240 | 231 | struct regulator_init_data *init_data; |
|---|
| 241 | 232 | int i, ret; |
|---|
| .. | .. |
|---|
| 252 | 243 | return -EINVAL; |
|---|
| 253 | 244 | } |
|---|
| 254 | 245 | |
|---|
| 255 | | - pm800_data = devm_kzalloc(&pdev->dev, sizeof(*pm800_data), |
|---|
| 256 | | - GFP_KERNEL); |
|---|
| 257 | | - if (!pm800_data) |
|---|
| 258 | | - return -ENOMEM; |
|---|
| 259 | | - |
|---|
| 260 | | - pm800_data->map = chip->subchip->regmap_power; |
|---|
| 261 | | - pm800_data->chip = chip; |
|---|
| 262 | | - |
|---|
| 263 | | - platform_set_drvdata(pdev, pm800_data); |
|---|
| 264 | | - |
|---|
| 265 | 246 | config.dev = chip->dev; |
|---|
| 266 | | - config.regmap = pm800_data->map; |
|---|
| 247 | + config.regmap = chip->subchip->regmap_power; |
|---|
| 267 | 248 | for (i = 0; i < PM800_ID_RG_MAX; i++) { |
|---|
| 268 | 249 | struct regulator_dev *regulator; |
|---|
| 269 | 250 | |
|---|