Skip to content

Commit 5432e77

Browse files
MarielTinaconunojsa
authored andcommitted
hwmon: (pmbus/ltc2978) add support for ltc7841
Add support for LTC7841. The LTC7841 is a high performance PolyPhase® single output synchronous boost converter controller. Multiphase operation reduces input and output capacitor requirements and allows the use of smaller inductors than the single-phase equivalent. The relevant registers in the LTC7841 are similar to the LTC7880, only reduced by some amount. So it's just a matter of adding the chip id. The device also doesn't support polling, on top of the reduced register set, so a separate case for setting the chip info is added. Signed-off-by: Mariel Tinaco <Mariel.Tinaco@analog.com> Message-ID: <20241029013734.293024-4-Mariel.Tinaco@analog.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
1 parent 658a068 commit 5432e77

File tree

2 files changed

+23
-5
lines changed

2 files changed

+23
-5
lines changed

drivers/hwmon/pmbus/Kconfig

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -215,9 +215,9 @@ config SENSORS_LTC2978_REGULATOR
215215
depends on SENSORS_LTC2978 && REGULATOR
216216
help
217217
If you say yes here you get regulator support for Linear Technology
218-
LTC3880, LTC3883, LTC3884, LTC3886, LTC3887, LTC3889, LTC7880,
219-
LTM4644, LTM4675, LTM4676, LTM4677, LTM4678, LTM4680, LTM4686,
220-
and LTM4700.
218+
LTC3880, LTC3883, LTC3884, LTC3886, LTC3887, LTC3889, LTC7841,
219+
LTC7880, LTM4644, LTM4675, LTM4676, LTM4677, LTM4678, LTM4680,
220+
LTM4686, and LTM4700.
221221

222222
config SENSORS_LTC3815
223223
tristate "Linear Technologies LTC3815"

drivers/hwmon/pmbus/ltc2978.c

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ enum chips {
2323
/* Managers */
2424
ltc2972, ltc2974, ltc2975, ltc2977, ltc2978, ltc2979, ltc2980,
2525
/* Controllers */
26-
ltc3880, ltc3882, ltc3883, ltc3884, ltc3886, ltc3887, ltc3889, ltc7880,
26+
ltc3880, ltc3882, ltc3883, ltc3884, ltc3886, ltc3887, ltc3889, ltc7841,
27+
ltc7880,
2728
/* Modules */
2829
ltm2987, ltm4664, ltm4675, ltm4676, ltm4677, ltm4678, ltm4680, ltm4686,
2930
ltm4700,
@@ -50,7 +51,7 @@ enum chips {
5051
#define LTC3880_MFR_CLEAR_PEAKS 0xe3
5152
#define LTC3880_MFR_TEMPERATURE2_PEAK 0xf4
5253

53-
/* LTC3883, LTC3884, LTC3886, LTC3889 and LTC7880 only */
54+
/* LTC3883, LTC3884, LTC3886, LTC3889, LTC7841 and LTC7880 only */
5455
#define LTC3883_MFR_IIN_PEAK 0xe1
5556

5657

@@ -79,6 +80,9 @@ enum chips {
7980
#define LTC3884_ID 0x4C00
8081
#define LTC3886_ID 0x4600
8182
#define LTC3887_ID 0x4700
83+
#define LTC3889_ID 0x4900
84+
#define LTC7841_ID 0x40D0
85+
#define LTC7880_ID 0x49E0
8286
#define LTM2987_ID_A 0x8010 /* A/B for two die IDs */
8387
#define LTM2987_ID_B 0x8020
8488
#define LTC3889_ID 0x4900
@@ -547,6 +551,7 @@ static const struct i2c_device_id ltc2978_id[] = {
547551
{"ltc3886", ltc3886},
548552
{"ltc3887", ltc3887},
549553
{"ltc3889", ltc3889},
554+
{"ltc7841", ltc7841},
550555
{"ltc7880", ltc7880},
551556
{"ltm2987", ltm2987},
552557
{"ltm4664", ltm4664},
@@ -651,6 +656,8 @@ static int ltc2978_get_id(struct i2c_client *client)
651656
return ltc3887;
652657
else if (chip_id == LTC3889_ID)
653658
return ltc3889;
659+
else if (chip_id == LTC7841_ID)
660+
return ltc7841;
654661
else if (chip_id == LTC7880_ID)
655662
return ltc7880;
656663
else if (chip_id == LTM2987_ID_A || chip_id == LTM2987_ID_B)
@@ -850,6 +857,16 @@ static int ltc2978_probe(struct i2c_client *client)
850857
| PMBUS_HAVE_POUT
851858
| PMBUS_HAVE_TEMP | PMBUS_HAVE_STATUS_TEMP;
852859
break;
860+
case ltc7841:
861+
data->features |= FEAT_CLEAR_PEAKS;
862+
info->read_word_data = ltc3883_read_word_data;
863+
info->pages = LTC3883_NUM_PAGES;
864+
info->func[0] = PMBUS_HAVE_VIN | PMBUS_HAVE_IIN
865+
| PMBUS_HAVE_STATUS_INPUT
866+
| PMBUS_HAVE_VOUT | PMBUS_HAVE_STATUS_VOUT
867+
| PMBUS_HAVE_IOUT
868+
| PMBUS_HAVE_TEMP | PMBUS_HAVE_STATUS_TEMP;
869+
break;
853870
default:
854871
return -ENODEV;
855872
}
@@ -902,6 +919,7 @@ static const struct of_device_id ltc2978_of_match[] = {
902919
{ .compatible = "lltc,ltc3886" },
903920
{ .compatible = "lltc,ltc3887" },
904921
{ .compatible = "lltc,ltc3889" },
922+
{ .compatible = "lltc,ltc7841" },
905923
{ .compatible = "lltc,ltc7880" },
906924
{ .compatible = "lltc,ltm2987" },
907925
{ .compatible = "lltc,ltm4664" },

0 commit comments

Comments
 (0)