Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

regulator: sm5703: Remove because it is unused and fails to build

This file does not compile because <linux/mfd/sm5703.h> is missing.
In KConfig, it depends on MFD_SM5703.

Both MFD_SM5703 and the missing include rely on another patch that never
got merged. The last iteration related to this patch is [1].

So remove this dead-code and undo commit e8858ba89ca3 ("regulator:
sm5703-regulator: Add regulators support for SM5703 MFD")

[1]: https://lore.kernel.org/lkml/20220423085319.483524-5-markuss.broks@gmail.com/

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Link: https://patch.msgid.link/0f5da91a05e7343d290c88e3c583b674cf6219ac.1725910247.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Christophe JAILLET and committed by
Mark Brown
4591a227 2a1de567

-178
-7
drivers/regulator/Kconfig
··· 1373 1373 The SLG51000 is seven compact and customizable low dropout 1374 1374 regulators. 1375 1375 1376 - config REGULATOR_SM5703 1377 - tristate "Silicon Mitus SM5703 regulators" 1378 - depends on MFD_SM5703 1379 - help 1380 - This driver provides support for voltage regulators of SM5703 1381 - multi-function device. 1382 - 1383 1376 config REGULATOR_STM32_BOOSTER 1384 1377 tristate "STMicroelectronics STM32 BOOSTER" 1385 1378 depends on ARCH_STM32 || COMPILE_TEST
-1
drivers/regulator/Makefile
··· 160 160 obj-$(CONFIG_REGULATOR_SC2731) += sc2731-regulator.o 161 161 obj-$(CONFIG_REGULATOR_SKY81452) += sky81452-regulator.o 162 162 obj-$(CONFIG_REGULATOR_SLG51000) += slg51000-regulator.o 163 - obj-$(CONFIG_REGULATOR_SM5703) += sm5703-regulator.o 164 163 obj-$(CONFIG_REGULATOR_STM32_BOOSTER) += stm32-booster.o 165 164 obj-$(CONFIG_REGULATOR_STM32_VREFBUF) += stm32-vrefbuf.o 166 165 obj-$(CONFIG_REGULATOR_STM32_PWR) += stm32-pwr.o
-170
drivers/regulator/sm5703-regulator.c
··· 1 - // SPDX-License-Identifier: GPL-2.0-only 2 - 3 - #include <linux/mfd/sm5703.h> 4 - #include <linux/module.h> 5 - #include <linux/mod_devicetable.h> 6 - #include <linux/platform_device.h> 7 - #include <linux/regmap.h> 8 - #include <linux/regulator/driver.h> 9 - #include <linux/regulator/of_regulator.h> 10 - 11 - enum sm5703_regulators { 12 - SM5703_BUCK, 13 - SM5703_LDO1, 14 - SM5703_LDO2, 15 - SM5703_LDO3, 16 - SM5703_USBLDO1, 17 - SM5703_USBLDO2, 18 - SM5703_VBUS, 19 - SM5703_MAX_REGULATORS, 20 - }; 21 - 22 - static const int sm5703_ldo_voltagemap[] = { 23 - 1500000, 1800000, 2600000, 2800000, 3000000, 3300000, 24 - }; 25 - 26 - static const int sm5703_buck_voltagemap[] = { 27 - 1000000, 1000000, 1000000, 1000000, 28 - 1000000, 1000000, 1000000, 1000000, 29 - 1000000, 1000000, 1000000, 1100000, 30 - 1200000, 1300000, 1400000, 1500000, 31 - 1600000, 1700000, 1800000, 1900000, 32 - 2000000, 2100000, 2200000, 2300000, 33 - 2400000, 2500000, 2600000, 2700000, 34 - 2800000, 2900000, 3000000, 3000000, 35 - }; 36 - 37 - #define SM5703USBLDO(_name, _id) \ 38 - [SM5703_USBLDO ## _id] = { \ 39 - .name = _name, \ 40 - .of_match = _name, \ 41 - .regulators_node = "regulators", \ 42 - .type = REGULATOR_VOLTAGE, \ 43 - .id = SM5703_USBLDO ## _id, \ 44 - .ops = &sm5703_regulator_ops_fixed, \ 45 - .n_voltages = 1, \ 46 - .fixed_uV = SM5703_USBLDO_MICROVOLT, \ 47 - .enable_reg = SM5703_REG_USBLDO12, \ 48 - .enable_mask = SM5703_REG_EN_USBLDO ##_id, \ 49 - .owner = THIS_MODULE, \ 50 - } 51 - 52 - #define SM5703VBUS(_name) \ 53 - [SM5703_VBUS] = { \ 54 - .name = _name, \ 55 - .of_match = _name, \ 56 - .regulators_node = "regulators", \ 57 - .type = REGULATOR_VOLTAGE, \ 58 - .id = SM5703_VBUS, \ 59 - .ops = &sm5703_regulator_ops_fixed, \ 60 - .n_voltages = 1, \ 61 - .fixed_uV = SM5703_VBUS_MICROVOLT, \ 62 - .enable_reg = SM5703_REG_CNTL, \ 63 - .enable_mask = SM5703_OPERATION_MODE_MASK, \ 64 - .enable_val = SM5703_OPERATION_MODE_USB_OTG_MODE, \ 65 - .disable_val = SM5703_OPERATION_MODE_CHARGING_ON, \ 66 - .owner = THIS_MODULE, \ 67 - } 68 - 69 - #define SM5703BUCK(_name) \ 70 - [SM5703_BUCK] = { \ 71 - .name = _name, \ 72 - .of_match = _name, \ 73 - .regulators_node = "regulators", \ 74 - .type = REGULATOR_VOLTAGE, \ 75 - .id = SM5703_BUCK, \ 76 - .ops = &sm5703_regulator_ops, \ 77 - .n_voltages = ARRAY_SIZE(sm5703_buck_voltagemap), \ 78 - .volt_table = sm5703_buck_voltagemap, \ 79 - .vsel_reg = SM5703_REG_BUCK, \ 80 - .vsel_mask = SM5703_BUCK_VOLT_MASK, \ 81 - .enable_reg = SM5703_REG_BUCK, \ 82 - .enable_mask = SM5703_REG_EN_BUCK, \ 83 - .owner = THIS_MODULE, \ 84 - } 85 - 86 - #define SM5703LDO(_name, _id) \ 87 - [SM5703_LDO ## _id] = { \ 88 - .name = _name, \ 89 - .of_match = _name, \ 90 - .regulators_node = "regulators", \ 91 - .type = REGULATOR_VOLTAGE, \ 92 - .id = SM5703_LDO ## _id, \ 93 - .ops = &sm5703_regulator_ops, \ 94 - .n_voltages = ARRAY_SIZE(sm5703_ldo_voltagemap), \ 95 - .volt_table = sm5703_ldo_voltagemap, \ 96 - .vsel_reg = SM5703_REG_LDO ##_id, \ 97 - .vsel_mask = SM5703_LDO_VOLT_MASK, \ 98 - .enable_reg = SM5703_REG_LDO ##_id, \ 99 - .enable_mask = SM5703_LDO_EN, \ 100 - .owner = THIS_MODULE, \ 101 - } 102 - 103 - static const struct regulator_ops sm5703_regulator_ops = { 104 - .enable = regulator_enable_regmap, 105 - .disable = regulator_disable_regmap, 106 - .is_enabled = regulator_is_enabled_regmap, 107 - .list_voltage = regulator_list_voltage_table, 108 - .get_voltage_sel = regulator_get_voltage_sel_regmap, 109 - .set_voltage_sel = regulator_set_voltage_sel_regmap, 110 - }; 111 - 112 - static const struct regulator_ops sm5703_regulator_ops_fixed = { 113 - .enable = regulator_enable_regmap, 114 - .disable = regulator_disable_regmap, 115 - .is_enabled = regulator_is_enabled_regmap, 116 - }; 117 - 118 - static struct regulator_desc sm5703_regulators_desc[SM5703_MAX_REGULATORS] = { 119 - SM5703BUCK("buck"), 120 - SM5703LDO("ldo1", 1), 121 - SM5703LDO("ldo2", 2), 122 - SM5703LDO("ldo3", 3), 123 - SM5703USBLDO("usbldo1", 1), 124 - SM5703USBLDO("usbldo2", 2), 125 - SM5703VBUS("vbus"), 126 - }; 127 - 128 - static int sm5703_regulator_probe(struct platform_device *pdev) 129 - { 130 - struct device *dev = &pdev->dev; 131 - struct regulator_config config = { NULL, }; 132 - struct regulator_dev *rdev; 133 - struct sm5703_dev *sm5703 = dev_get_drvdata(pdev->dev.parent); 134 - int i; 135 - 136 - config.dev = dev->parent; 137 - config.regmap = sm5703->regmap; 138 - 139 - for (i = 0; i < SM5703_MAX_REGULATORS; i++) { 140 - rdev = devm_regulator_register(dev, 141 - &sm5703_regulators_desc[i], 142 - &config); 143 - if (IS_ERR(rdev)) 144 - return dev_err_probe(dev, PTR_ERR(rdev), 145 - "Failed to register a regulator\n"); 146 - } 147 - 148 - return 0; 149 - } 150 - 151 - static const struct platform_device_id sm5703_regulator_id[] = { 152 - { "sm5703-regulator", 0 }, 153 - {} 154 - }; 155 - MODULE_DEVICE_TABLE(platform, sm5703_regulator_id); 156 - 157 - static struct platform_driver sm5703_regulator_driver = { 158 - .driver = { 159 - .name = "sm5703-regulator", 160 - .probe_type = PROBE_PREFER_ASYNCHRONOUS, 161 - }, 162 - .probe = sm5703_regulator_probe, 163 - .id_table = sm5703_regulator_id, 164 - }; 165 - 166 - module_platform_driver(sm5703_regulator_driver); 167 - 168 - MODULE_DESCRIPTION("Silicon Mitus SM5703 LDO/Buck/USB regulator driver"); 169 - MODULE_AUTHOR("Markuss Broks <markuss.broks@gmail.com>"); 170 - MODULE_LICENSE("GPL");