diff options
Diffstat (limited to 'drivers/regulator/mt6380-regulator.c')
| -rw-r--r-- | drivers/regulator/mt6380-regulator.c | 40 |
1 files changed, 15 insertions, 25 deletions
diff --git a/drivers/regulator/mt6380-regulator.c b/drivers/regulator/mt6380-regulator.c index 127dd720cbcc..83e50df7f7c3 100644 --- a/drivers/regulator/mt6380-regulator.c +++ b/drivers/regulator/mt6380-regulator.c @@ -1,16 +1,7 @@ -/* - * Copyright (c) 2017 MediaTek Inc. - * Author: Chenglin Xu <chenglin.xu@mediatek.com> - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - */ +// SPDX-License-Identifier: GPL-2.0 +// +// Copyright (c) 2017 MediaTek Inc. +// Author: Chenglin Xu <chenglin.xu@mediatek.com> #include <linux/module.h> #include <linux/of.h> @@ -161,38 +152,38 @@ struct mt6380_regulator_info { .modeset_mask = _modeset_mask, \ } -static const struct regulator_linear_range buck_volt_range1[] = { +static const struct linear_range buck_volt_range1[] = { REGULATOR_LINEAR_RANGE(600000, 0, 0xfe, 6250), }; -static const struct regulator_linear_range buck_volt_range2[] = { +static const struct linear_range buck_volt_range2[] = { REGULATOR_LINEAR_RANGE(600000, 0, 0xfe, 6250), }; -static const struct regulator_linear_range buck_volt_range3[] = { +static const struct linear_range buck_volt_range3[] = { REGULATOR_LINEAR_RANGE(1200000, 0, 0x3c, 25000), }; -static const u32 ldo_volt_table1[] = { +static const unsigned int ldo_volt_table1[] = { 1400000, 1350000, 1300000, 1250000, 1200000, 1150000, 1100000, 1050000, }; -static const u32 ldo_volt_table2[] = { +static const unsigned int ldo_volt_table2[] = { 2200000, 3300000, }; -static const u32 ldo_volt_table3[] = { +static const unsigned int ldo_volt_table3[] = { 1240000, 1390000, 1540000, 1840000, }; -static const u32 ldo_volt_table4[] = { +static const unsigned int ldo_volt_table4[] = { 2200000, 3300000, }; static int mt6380_regulator_set_mode(struct regulator_dev *rdev, unsigned int mode) { - int ret, val = 0; + int val = 0; struct mt6380_regulator_info *info = rdev_get_drvdata(rdev); switch (mode) { @@ -208,10 +199,8 @@ static int mt6380_regulator_set_mode(struct regulator_dev *rdev, val <<= ffs(info->modeset_mask) - 1; - ret = regmap_update_bits(rdev->regmap, info->modeset_reg, + return regmap_update_bits(rdev->regmap, info->modeset_reg, info->modeset_mask, val); - - return ret; } static unsigned int mt6380_regulator_get_mode(struct regulator_dev *rdev) @@ -330,7 +319,7 @@ static const struct platform_device_id mt6380_platform_ids[] = { }; MODULE_DEVICE_TABLE(platform, mt6380_platform_ids); -static const struct of_device_id mt6380_of_match[] = { +static const struct of_device_id __maybe_unused mt6380_of_match[] = { { .compatible = "mediatek,mt6380-regulator", }, { /* sentinel */ }, }; @@ -339,6 +328,7 @@ MODULE_DEVICE_TABLE(of, mt6380_of_match); static struct platform_driver mt6380_regulator_driver = { .driver = { .name = "mt6380-regulator", + .probe_type = PROBE_PREFER_ASYNCHRONOUS, .of_match_table = of_match_ptr(mt6380_of_match), }, .probe = mt6380_regulator_probe, |
