hc
2023-12-06 08f87f769b595151be1afeff53e144f543faa614
kernel/drivers/regulator/mt6311-regulator.c
....@@ -1,16 +1,7 @@
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>
145
156 #include <linux/err.h>
167 #include <linux/gpio.h>
....@@ -38,13 +29,9 @@
3829 #define MT6311_MAX_UV 1393750
3930 #define MT6311_STEP_UV 6250
4031
41
-static const struct regulator_linear_range buck_volt_range[] = {
42
- REGULATOR_LINEAR_RANGE(MT6311_MIN_UV, 0, 0x7f, MT6311_STEP_UV),
43
-};
44
-
4532 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,
4835 .set_voltage_sel = regulator_set_voltage_sel_regmap,
4936 .get_voltage_sel = regulator_get_voltage_sel_regmap,
5037 .set_voltage_time_sel = regulator_set_voltage_time_sel,
....@@ -71,8 +58,6 @@
7158 .min_uV = MT6311_MIN_UV,\
7259 .uV_step = MT6311_STEP_UV,\
7360 .owner = THIS_MODULE,\
74
- .linear_ranges = buck_volt_range, \
75
- .n_linear_ranges = ARRAY_SIZE(buck_volt_range), \
7661 .enable_reg = MT6311_VDVFS11_CON9,\
7762 .enable_mask = MT6311_PMIC_VDVFS11_EN_MASK,\
7863 .vsel_reg = MT6311_VDVFS11_CON12,\
....@@ -100,8 +85,7 @@
10085 /*
10186 * I2C driver interface functions
10287 */
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)
10589 {
10690 struct regulator_config config = { };
10791 struct regulator_dev *rdev;
....@@ -169,7 +153,7 @@
169153 .name = "mt6311",
170154 .of_match_table = of_match_ptr(mt6311_dt_ids),
171155 },
172
- .probe = mt6311_i2c_probe,
156
+ .probe_new = mt6311_i2c_probe,
173157 .id_table = mt6311_i2c_id,
174158 };
175159