Skip to content

Commit ed2f4c7

Browse files
nsolanki22broonie
authored andcommitted
regulator: max5970: Rename driver and remove wildcard
The previous version of this driver included wildcards in file names and descriptions. This patch renames the driver to only support MAX5970 and MAX5978, which are the only chips that the driver actually supports. Signed-off-by: Naresh Solanki <Naresh.Solanki@9elements.com> Link: https://lore.kernel.org/r/20230801102453.1798292-1-Naresh.Solanki@9elements.com Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent 9308372 commit ed2f4c7

3 files changed

Lines changed: 18 additions & 18 deletions

File tree

drivers/regulator/Kconfig

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -546,11 +546,11 @@ config REGULATOR_MAX1586
546546
regulator via I2C bus. The provided regulator is suitable
547547
for PXA27x chips to control VCC_CORE and VCC_USIM voltages.
548548

549-
config REGULATOR_MAX597X
550-
tristate "Maxim 597x power switch and monitor"
549+
config REGULATOR_MAX5970
550+
tristate "Maxim 5970/5978 power switch and monitor"
551551
depends on I2C
552552
depends on OF
553-
depends on MFD_MAX597X
553+
depends on MFD_MAX5970
554554
help
555555
This driver controls a Maxim 5970/5978 switch via I2C bus.
556556
The MAX5970/5978 is a smart switch with no output regulation, but

drivers/regulator/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ obj-$(CONFIG_REGULATOR_LTC3589) += ltc3589.o
6767
obj-$(CONFIG_REGULATOR_LTC3676) += ltc3676.o
6868
obj-$(CONFIG_REGULATOR_MAX14577) += max14577-regulator.o
6969
obj-$(CONFIG_REGULATOR_MAX1586) += max1586.o
70-
obj-$(CONFIG_REGULATOR_MAX597X) += max597x-regulator.o
70+
obj-$(CONFIG_REGULATOR_MAX5970) += max5970-regulator.o
7171
obj-$(CONFIG_REGULATOR_MAX77541) += max77541-regulator.o
7272
obj-$(CONFIG_REGULATOR_MAX77620) += max77620-regulator.o
7373
obj-$(CONFIG_REGULATOR_MAX77650) += max77650-regulator.o
Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@
2020
#include <linux/regulator/of_regulator.h>
2121
#include <linux/platform_device.h>
2222

23-
#include <linux/mfd/max597x.h>
23+
#include <linux/mfd/max5970.h>
2424

25-
struct max597x_regulator {
25+
struct max5970_regulator {
2626
int num_switches, mon_rng, irng, shunt_micro_ohms, lim_uA;
2727
struct regmap *regmap;
2828
};
@@ -58,7 +58,7 @@ static int max597x_set_vp(struct regulator_dev *rdev, int lim_uV, int severity,
5858
bool enable, bool overvoltage)
5959
{
6060
int off_h, off_l, reg, ret;
61-
struct max597x_regulator *data = rdev_get_drvdata(rdev);
61+
struct max5970_regulator *data = rdev_get_drvdata(rdev);
6262
int channel = rdev_get_id(rdev);
6363

6464
if (overvoltage) {
@@ -140,7 +140,7 @@ static int max597x_set_ocp(struct regulator_dev *rdev, int lim_uA,
140140
int val, reg;
141141
unsigned int vthst, vthfst;
142142

143-
struct max597x_regulator *data = rdev_get_drvdata(rdev);
143+
struct max5970_regulator *data = rdev_get_drvdata(rdev);
144144
int rdev_id = rdev_get_id(rdev);
145145
/*
146146
* MAX5970 doesn't has enable control for ocp.
@@ -222,7 +222,7 @@ static int max597x_dt_parse(struct device_node *np,
222222
const struct regulator_desc *desc,
223223
struct regulator_config *cfg)
224224
{
225-
struct max597x_regulator *data = cfg->driver_data;
225+
struct max5970_regulator *data = cfg->driver_data;
226226
int ret = 0;
227227

228228
ret =
@@ -274,7 +274,7 @@ static int max597x_irq_handler(int irq, struct regulator_irq_data *rid,
274274
unsigned long *dev_mask)
275275
{
276276
struct regulator_err_state *stat;
277-
struct max597x_regulator *d = (struct max597x_regulator *)rid->data;
277+
struct max5970_regulator *d = (struct max5970_regulator *)rid->data;
278278
int val, ret, i;
279279

280280
ret = max597x_regmap_read_clear(d->regmap, MAX5970_REG_FAULT0, &val);
@@ -394,7 +394,7 @@ static int max597x_adc_range(struct regmap *regmap, const int ch,
394394
static int max597x_setup_irq(struct device *dev,
395395
int irq,
396396
struct regulator_dev *rdevs[MAX5970_NUM_SWITCHES],
397-
int num_switches, struct max597x_regulator *data)
397+
int num_switches, struct max5970_regulator *data)
398398
{
399399
struct regulator_irq_desc max597x_notif = {
400400
.name = "max597x-irq",
@@ -425,9 +425,9 @@ static int max597x_setup_irq(struct device *dev,
425425

426426
static int max597x_regulator_probe(struct platform_device *pdev)
427427
{
428-
struct max597x_data *max597x;
428+
struct max5970_data *max597x;
429429
struct regmap *regmap = dev_get_regmap(pdev->dev.parent, NULL);
430-
struct max597x_regulator *data;
430+
struct max5970_regulator *data;
431431
struct i2c_client *i2c = to_i2c_client(pdev->dev.parent);
432432
struct regulator_config config = { };
433433
struct regulator_dev *rdev;
@@ -438,16 +438,16 @@ static int max597x_regulator_probe(struct platform_device *pdev)
438438
if (!regmap)
439439
return -EPROBE_DEFER;
440440

441-
max597x = devm_kzalloc(&i2c->dev, sizeof(struct max597x_data), GFP_KERNEL);
441+
max597x = devm_kzalloc(&i2c->dev, sizeof(struct max5970_data), GFP_KERNEL);
442442
if (!max597x)
443443
return -ENOMEM;
444444

445445
i2c_set_clientdata(i2c, max597x);
446446

447447
if (of_device_is_compatible(i2c->dev.of_node, "maxim,max5978"))
448-
max597x->num_switches = MAX597x_TYPE_MAX5978;
448+
max597x->num_switches = MAX5978_NUM_SWITCHES;
449449
else if (of_device_is_compatible(i2c->dev.of_node, "maxim,max5970"))
450-
max597x->num_switches = MAX597x_TYPE_MAX5970;
450+
max597x->num_switches = MAX5970_NUM_SWITCHES;
451451
else
452452
return -ENODEV;
453453

@@ -456,7 +456,7 @@ static int max597x_regulator_probe(struct platform_device *pdev)
456456

457457
for (i = 0; i < num_switches; i++) {
458458
data =
459-
devm_kzalloc(&i2c->dev, sizeof(struct max597x_regulator),
459+
devm_kzalloc(&i2c->dev, sizeof(struct max5970_regulator),
460460
GFP_KERNEL);
461461
if (!data)
462462
return -ENOMEM;
@@ -500,7 +500,7 @@ static int max597x_regulator_probe(struct platform_device *pdev)
500500

501501
static struct platform_driver max597x_regulator_driver = {
502502
.driver = {
503-
.name = "max597x-regulator",
503+
.name = "max5970-regulator",
504504
.probe_type = PROBE_PREFER_ASYNCHRONOUS,
505505
},
506506
.probe = max597x_regulator_probe,

0 commit comments

Comments
 (0)