Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for LTM4673 #2660

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Documentation/devicetree/bindings/hwmon/ltc2978.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ Required properties:
* "lltc,ltc7880"
* "lltc,ltm2987"
* "lltc,ltm4664"
* "lltc,ltm4673"
* "lltc,ltm4675"
* "lltc,ltm4676"
* "lltc,ltm4677"
Expand All @@ -45,6 +46,7 @@ Valid names of regulators depend on number of supplies supported per device:
* ltc3883 : vout0
* ltc7841 : vout0
* ltm4664 : vout0 - vout1
* ltm4673 : vout0 - vout3
* ltm4675, ltm4676, ltm4677, ltm4678 : vout0 - vout1
* ltm4680, ltm4686 : vout0 - vout1
* ltm4700 : vout0 - vout1
Expand Down
9 changes: 9 additions & 0 deletions Documentation/hwmon/ltc2978.rst
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,14 @@ Supported chips:

Datasheet: https://www.analog.com/en/products/ltm4644

* Linear Technology LTM4673

Prefix: 'ltm4673'

Addresses scanned: -

Datasheet: https://www.analog.com/en/products/ltm4673

* Linear Technology LTM4675

Prefix: 'ltm4675'
Expand Down Expand Up @@ -227,6 +235,7 @@ Description
- LTM2987 is a 16-channel Power System Manager with two LTC2977 plus
- additional components on a single die. The chip is instantiated and reported
- as two separate chips on two different I2C bus addresses.
- LTM4673 is a dual 12A and dual 5A μModule regulator.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not likely a problem but I think you squash this change with the patch adding the driver.

- LTM4675 is a dual 9A or single 18A μModule regulator
- LTM4676 is a dual 13A or single 26A uModule regulator.
- LTM4686 is a dual 10A or single 20A uModule regulator.
Expand Down
4 changes: 2 additions & 2 deletions drivers/hwmon/pmbus/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -216,8 +216,8 @@ config SENSORS_LTC2978_REGULATOR
help
If you say yes here you get regulator support for Linear Technology
LTC3880, LTC3883, LTC3884, LTC3886, LTC3887, LTC3889, LTC7841,
LTC7880, LTM4644, LTM4675, LTM4676, LTM4677, LTM4678, LTM4680,
LTM4686, and LTM4700.
LTC7880, LTM4644, LTM4673, LTM4675, LTM4676, LTM4677, LTM4678,
LTM4680, LTM4686, and LTM4700.

config SENSORS_LTC3815
tristate "Linear Technologies LTC3815"
Expand Down
25 changes: 23 additions & 2 deletions drivers/hwmon/pmbus/ltc2978.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ enum chips {
ltc3880, ltc3882, ltc3883, ltc3884, ltc3886, ltc3887, ltc3889, ltc7841,
ltc7880,
/* Modules */
ltm2987, ltm4664, ltm4675, ltm4676, ltm4677, ltm4678, ltm4680, ltm4686,
ltm4700,
ltm2987, ltm4664, ltm4673, ltm4675, ltm4676, ltm4677, ltm4678, ltm4680,
ltm4686, ltm4700,
};

/* Common for all chips */
Expand Down Expand Up @@ -88,6 +88,8 @@ enum chips {
#define LTC3889_ID 0x4900
#define LTC7880_ID 0x49E0
#define LTM4664_ID 0x4120
#define LTM4673_ID_REV1 0x0230
#define LTM4673_ID 0x4480
#define LTM4675_ID 0x47a0
#define LTM4676_ID_REV1 0x4400
#define LTM4676_ID_REV2 0x4480
Expand Down Expand Up @@ -555,6 +557,7 @@ static const struct i2c_device_id ltc2978_id[] = {
{"ltc7880", ltc7880},
{"ltm2987", ltm2987},
{"ltm4664", ltm4664},
{"ltm4673", ltm4673},
{"ltm4675", ltm4675},
{"ltm4676", ltm4676},
{"ltm4677", ltm4677},
Expand Down Expand Up @@ -664,6 +667,8 @@ static int ltc2978_get_id(struct i2c_client *client)
return ltm2987;
else if (chip_id == LTM4664_ID)
return ltm4664;
else if (chip_id == LTM4673_ID || chip_id == LTM4673_ID_REV1)
return ltm4673;
else if (chip_id == LTM4675_ID)
return ltm4675;
else if (chip_id == LTM4676_ID_REV1 || chip_id == LTM4676_ID_REV2 ||
Expand Down Expand Up @@ -867,6 +872,21 @@ static int ltc2978_probe(struct i2c_client *client)
| PMBUS_HAVE_IOUT
| PMBUS_HAVE_TEMP | PMBUS_HAVE_STATUS_TEMP;
break;
case ltm4673:
data->features |= FEAT_NEEDS_POLLING;
info->read_word_data = ltc2975_read_word_data;
info->pages = LTC2974_NUM_PAGES;
info->func[0] = PMBUS_HAVE_VIN | PMBUS_HAVE_STATUS_INPUT
| PMBUS_HAVE_TEMP2;
for (i = 0; i < info->pages; i++) {
info->func[i] |= PMBUS_HAVE_IIN
| PMBUS_HAVE_VOUT | PMBUS_HAVE_STATUS_VOUT
| PMBUS_HAVE_IOUT | PMBUS_HAVE_STATUS_IOUT
| PMBUS_HAVE_PIN
| PMBUS_HAVE_POUT
| PMBUS_HAVE_TEMP | PMBUS_HAVE_STATUS_TEMP;
}
break;
default:
return -ENODEV;
}
Expand Down Expand Up @@ -923,6 +943,7 @@ static const struct of_device_id ltc2978_of_match[] = {
{ .compatible = "lltc,ltc7880" },
{ .compatible = "lltc,ltm2987" },
{ .compatible = "lltc,ltm4664" },
{ .compatible = "lltc,ltm4673" },
{ .compatible = "lltc,ltm4675" },
{ .compatible = "lltc,ltm4676" },
{ .compatible = "lltc,ltm4677" },
Expand Down