Skip to content

Commit

Permalink
hwmon: (pmbus/ltc2978) add support for ltc7841
Browse files Browse the repository at this point in the history
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 identical to the
LTC7880. So it's just a matter of adding the chip id.

Signed-off-by: Mariel Tinaco <[email protected]>
  • Loading branch information
MarielTinaco committed Oct 25, 2024
1 parent a34d196 commit 2b8adc2
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 5 deletions.
6 changes: 3 additions & 3 deletions drivers/hwmon/pmbus/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -215,9 +215,9 @@ config SENSORS_LTC2978_REGULATOR
depends on SENSORS_LTC2978 && REGULATOR
help
If you say yes here you get regulator support for Linear Technology
LTC3880, LTC3883, LTC3884, LTC3886, LTC3887, LTC3889, LTC7880,
LTM4644, LTM4675, LTM4676, LTM4677, LTM4678, LTM4680, LTM4686,
and LTM4700.
LTC3880, LTC3883, LTC3884, LTC3886, LTC3887, LTC3889, LTC7841,
LTC7880, LTM4644, LTM4675, LTM4676, LTM4677, LTM4678, LTM4680,
LTM4686, and LTM4700.

config SENSORS_LTC3815
tristate "Linear Technologies LTC3815"
Expand Down
20 changes: 18 additions & 2 deletions drivers/hwmon/pmbus/ltc2978.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ enum chips {
/* Managers */
ltc2972, ltc2974, ltc2975, ltc2977, ltc2978, ltc2979, ltc2980,
/* Controllers */
ltc3880, ltc3882, ltc3883, ltc3884, ltc3886, ltc3887, ltc3889, ltc7880,
ltc3880, ltc3882, ltc3883, ltc3884, ltc3886, ltc3887, ltc3889, ltc7841,
ltc7880,
/* Modules */
ltm2987, ltm4664, ltm4675, ltm4676, ltm4677, ltm4678, ltm4680, ltm4686,
ltm4700,
Expand All @@ -50,7 +51,7 @@ enum chips {
#define LTC3880_MFR_CLEAR_PEAKS 0xe3
#define LTC3880_MFR_TEMPERATURE2_PEAK 0xf4

/* LTC3883, LTC3884, LTC3886, LTC3889 and LTC7880 only */
/* LTC3883, LTC3884, LTC3886, LTC3889, LTC7841 and LTC7880 only */
#define LTC3883_MFR_IIN_PEAK 0xe1


Expand Down Expand Up @@ -82,6 +83,7 @@ enum chips {
#define LTM2987_ID_A 0x8010 /* A/B for two die IDs */
#define LTM2987_ID_B 0x8020
#define LTC3889_ID 0x4900
#define LTC7841_ID 0x40D0
#define LTC7880_ID 0x49E0
#define LTM4664_ID 0x4120
#define LTM4675_ID 0x47a0
Expand Down Expand Up @@ -547,6 +549,7 @@ static const struct i2c_device_id ltc2978_id[] = {
{"ltc3886", ltc3886},
{"ltc3887", ltc3887},
{"ltc3889", ltc3889},
{"ltc7841", ltc7841},
{"ltc7880", ltc7880},
{"ltm2987", ltm2987},
{"ltm4664", ltm4664},
Expand Down Expand Up @@ -651,6 +654,8 @@ static int ltc2978_get_id(struct i2c_client *client)
return ltc3887;
else if (chip_id == LTC3889_ID)
return ltc3889;
else if (chip_id == LTC7841_ID)
return ltc7841;
else if (chip_id == LTC7880_ID)
return ltc7880;
else if (chip_id == LTM2987_ID_A || chip_id == LTM2987_ID_B)
Expand Down Expand Up @@ -850,6 +855,16 @@ static int ltc2978_probe(struct i2c_client *client)
| PMBUS_HAVE_POUT
| PMBUS_HAVE_TEMP | PMBUS_HAVE_STATUS_TEMP;
break;
case ltc7841:
data->features |= FEAT_CLEAR_PEAKS;
info->read_word_data = ltc3883_read_word_data;
info->pages = LTC3883_NUM_PAGES;
info->func[0] = PMBUS_HAVE_VIN | PMBUS_HAVE_IIN
| PMBUS_HAVE_STATUS_INPUT
| PMBUS_HAVE_VOUT | PMBUS_HAVE_STATUS_VOUT
| PMBUS_HAVE_IOUT
| PMBUS_HAVE_TEMP | PMBUS_HAVE_STATUS_TEMP;
break;
default:
return -ENODEV;
}
Expand Down Expand Up @@ -902,6 +917,7 @@ static const struct of_device_id ltc2978_of_match[] = {
{ .compatible = "lltc,ltc3886" },
{ .compatible = "lltc,ltc3887" },
{ .compatible = "lltc,ltc3889" },
{ .compatible = "lltc,ltc7841" },
{ .compatible = "lltc,ltc7880" },
{ .compatible = "lltc,ltm2987" },
{ .compatible = "lltc,ltm4664" },
Expand Down

0 comments on commit 2b8adc2

Please sign in to comment.