Skip to content

Commit fe0eba1

Browse files
ssekar15groeck
authored andcommitted
hwmon: (pmbus/mpq7932) Add a support for mpq2286 Power Management IC
The MPQ2286 is a programmable, high frequency synchronous buck regulator designed to power a variety of Automotive system peripherals. Single buck converters with hardware monitoring capability is configurable over PMBus interface. Signed-off-by: Saravanan Sekar <[email protected]> Link: https://lore.kernel.org/r/[email protected] [groeck: Updated subject (mpq2286 -> mpq7932)] Signed-off-by: Guenter Roeck <[email protected]>
1 parent 88b5970 commit fe0eba1

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

drivers/hwmon/pmbus/mpq7932.c

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
#define MPQ7932_N_VOLTAGES 256
2222
#define MPQ7932_VOUT_MAX 0xFF
2323
#define MPQ7932_NUM_PAGES 6
24+
#define MPQ2286_NUM_PAGES 1
2425

2526
#define MPQ7932_TON_DELAY 0x60
2627
#define MPQ7932_VOUT_STARTUP_SLEW 0xA3
@@ -48,6 +49,11 @@ static struct regulator_desc mpq7932_regulators_desc[] = {
4849
PMBUS_REGULATOR_STEP("buck", 5, MPQ7932_N_VOLTAGES,
4950
MPQ7932_UV_STEP, MPQ7932_BUCK_UV_MIN),
5051
};
52+
53+
static const struct regulator_desc mpq7932_regulators_desc_one[] = {
54+
PMBUS_REGULATOR_STEP_ONE("buck", MPQ7932_N_VOLTAGES,
55+
MPQ7932_UV_STEP, MPQ7932_BUCK_UV_MIN),
56+
};
5157
#endif
5258

5359
static int mpq7932_write_word_data(struct i2c_client *client, int page, int reg,
@@ -116,7 +122,10 @@ static int mpq7932_probe(struct i2c_client *client)
116122

117123
#if IS_ENABLED(CONFIG_SENSORS_MPQ7932_REGULATOR)
118124
info->num_regulators = info->pages;
119-
info->reg_desc = mpq7932_regulators_desc;
125+
if (info->num_regulators == 1)
126+
info->reg_desc = mpq7932_regulators_desc_one;
127+
else
128+
info->reg_desc = mpq7932_regulators_desc;
120129
#endif
121130

122131
info->read_word_data = mpq7932_read_word_data;
@@ -129,12 +138,14 @@ static int mpq7932_probe(struct i2c_client *client)
129138
}
130139

131140
static const struct of_device_id mpq7932_of_match[] = {
141+
{ .compatible = "mps,mpq2286", .data = (void *)MPQ2286_NUM_PAGES },
132142
{ .compatible = "mps,mpq7932", .data = (void *)MPQ7932_NUM_PAGES },
133143
{},
134144
};
135145
MODULE_DEVICE_TABLE(of, mpq7932_of_match);
136146

137147
static const struct i2c_device_id mpq7932_id[] = {
148+
{ "mpq2286", },
138149
{ "mpq7932", },
139150
{ },
140151
};

0 commit comments

Comments
 (0)