| .. | .. |
|---|
| 1 | | -/* |
|---|
| 2 | | - * Copyright (c) 2015 MediaTek Inc. |
|---|
| 3 | | - * Author: Henry Chen <henryc.chen@mediatek.com> |
|---|
| 4 | | - * |
|---|
| 5 | | - * This program is free software; you can redistribute it and/or modify |
|---|
| 6 | | - * it under the terms of the GNU General Public License version 2 as |
|---|
| 7 | | - * published by the Free Software Foundation. |
|---|
| 8 | | - * |
|---|
| 9 | | - * This program is distributed in the hope that it will be useful, |
|---|
| 10 | | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|---|
| 11 | | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|---|
| 12 | | - * GNU General Public License for more details. |
|---|
| 13 | | - */ |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0 |
|---|
| 2 | +// |
|---|
| 3 | +// Copyright (c) 2015 MediaTek Inc. |
|---|
| 4 | +// Author: Henry Chen <henryc.chen@mediatek.com> |
|---|
| 14 | 5 | |
|---|
| 15 | 6 | #include <linux/err.h> |
|---|
| 16 | 7 | #include <linux/gpio.h> |
|---|
| .. | .. |
|---|
| 38 | 29 | #define MT6311_MAX_UV 1393750 |
|---|
| 39 | 30 | #define MT6311_STEP_UV 6250 |
|---|
| 40 | 31 | |
|---|
| 41 | | -static const struct regulator_linear_range buck_volt_range[] = { |
|---|
| 42 | | - REGULATOR_LINEAR_RANGE(MT6311_MIN_UV, 0, 0x7f, MT6311_STEP_UV), |
|---|
| 43 | | -}; |
|---|
| 44 | | - |
|---|
| 45 | 32 | static const struct regulator_ops mt6311_buck_ops = { |
|---|
| 46 | | - .list_voltage = regulator_list_voltage_linear_range, |
|---|
| 47 | | - .map_voltage = regulator_map_voltage_linear_range, |
|---|
| 33 | + .list_voltage = regulator_list_voltage_linear, |
|---|
| 34 | + .map_voltage = regulator_map_voltage_linear, |
|---|
| 48 | 35 | .set_voltage_sel = regulator_set_voltage_sel_regmap, |
|---|
| 49 | 36 | .get_voltage_sel = regulator_get_voltage_sel_regmap, |
|---|
| 50 | 37 | .set_voltage_time_sel = regulator_set_voltage_time_sel, |
|---|
| .. | .. |
|---|
| 71 | 58 | .min_uV = MT6311_MIN_UV,\ |
|---|
| 72 | 59 | .uV_step = MT6311_STEP_UV,\ |
|---|
| 73 | 60 | .owner = THIS_MODULE,\ |
|---|
| 74 | | - .linear_ranges = buck_volt_range, \ |
|---|
| 75 | | - .n_linear_ranges = ARRAY_SIZE(buck_volt_range), \ |
|---|
| 76 | 61 | .enable_reg = MT6311_VDVFS11_CON9,\ |
|---|
| 77 | 62 | .enable_mask = MT6311_PMIC_VDVFS11_EN_MASK,\ |
|---|
| 78 | 63 | .vsel_reg = MT6311_VDVFS11_CON12,\ |
|---|
| .. | .. |
|---|
| 100 | 85 | /* |
|---|
| 101 | 86 | * I2C driver interface functions |
|---|
| 102 | 87 | */ |
|---|
| 103 | | -static int mt6311_i2c_probe(struct i2c_client *i2c, |
|---|
| 104 | | - const struct i2c_device_id *id) |
|---|
| 88 | +static int mt6311_i2c_probe(struct i2c_client *i2c) |
|---|
| 105 | 89 | { |
|---|
| 106 | 90 | struct regulator_config config = { }; |
|---|
| 107 | 91 | struct regulator_dev *rdev; |
|---|
| .. | .. |
|---|
| 169 | 153 | .name = "mt6311", |
|---|
| 170 | 154 | .of_match_table = of_match_ptr(mt6311_dt_ids), |
|---|
| 171 | 155 | }, |
|---|
| 172 | | - .probe = mt6311_i2c_probe, |
|---|
| 156 | + .probe_new = mt6311_i2c_probe, |
|---|
| 173 | 157 | .id_table = mt6311_i2c_id, |
|---|
| 174 | 158 | }; |
|---|
| 175 | 159 | |
|---|