-
Notifications
You must be signed in to change notification settings - Fork 892
Add driver for LTP8800-1A, LTP8800-4A and LTP8800-2 #2611
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
Open
cencarna
wants to merge
3
commits into
analogdevicesinc:main
Choose a base branch
from
cencarna:dev/ltp8800
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+214
−0
Open
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -122,6 +122,7 @@ Hardware Monitoring Kernel Drivers | |
ltc4245 | ||
ltc4260 | ||
ltc4261 | ||
ltp8800 | ||
max127 | ||
max15301 | ||
max16064 | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,103 @@ | ||
.. SPDX-License-Identifier: GPL-2.0 | ||
|
||
Kernel driver ltp8800 | ||
===================== | ||
|
||
Supported chips: | ||
|
||
* Analog Devices LTP8800-1A | ||
|
||
Prefix: 'ltp8800-1a' | ||
|
||
Addresses scanned: I2C 0x40 - 0x4F | ||
|
||
Datasheet: https://www.analog.com/media/en/technical-documentation/data-sheets/ltp8800-1a.pdf | ||
|
||
* Analog Devices LTP8800-4A | ||
|
||
Prefix: 'ltp8800-4a' | ||
|
||
Addresses scanned: I2C 0x40 - 0x4F | ||
|
||
Datasheet: https://www.analog.com/media/en/technical-documentation/data-sheets/ltp8800-4a.pdf | ||
|
||
* Analog Devices LTP8800-2 | ||
|
||
Prefix: 'ltp8800-2' | ||
|
||
Addresses scanned: I2C 0x40 - 0x4F | ||
|
||
Datasheet: https://www.analog.com/media/en/technical-documentation/data-sheets/ltp8800-2.pdf | ||
|
||
Authors: | ||
- Cedric Encarnacion <cedricjustine.encarnacion@analog.com> | ||
|
||
|
||
Description | ||
----------- | ||
|
||
The LTP8800 is a family of step-down μModule regulators that provides | ||
microprocessor core voltage from 54V power distribution architecture. LTP8800 | ||
features telemetry monitoring of input/output voltage, input current, output | ||
power, and temperature over PMBus. | ||
|
||
The driver is a client driver to the core PMBus driver. Please see | ||
Documentation/hwmon/pmbus.rst for details on PMBus client drivers. | ||
|
||
Usage Notes | ||
----------- | ||
|
||
This driver does not auto-detect devices. You will have to instantiate the | ||
devices explicitly. Please see Documentation/i2c/instantiating-devices.rst for | ||
details. | ||
|
||
Platform data support | ||
--------------------- | ||
|
||
The driver supports standard PMBus driver platform data. Please see | ||
Documentation/hwmon/pmbus.rst for details. | ||
|
||
Sysfs Attributes | ||
---------------- | ||
|
||
======================= =========================== | ||
curr1_label "iin" | ||
curr1_input Measured input current | ||
curr1_crit Critical maximum current | ||
curr1_crit_alarm Current critical high alarm | ||
|
||
curr2_label "iout1" | ||
curr2_input Measured output current | ||
curr2_lcrit Critical minimum current | ||
curr2_crit Critical maximum current | ||
curr2_max Maximum output current | ||
curr2_alarm Current alarm | ||
|
||
in1_label "vin" | ||
in1_input Measured input voltage | ||
in1_lcrit Critical minimum input voltage | ||
in1_lcrit_alarm Input voltage critical low alarm | ||
in1_crit Critical maximum input voltage | ||
in1_crit_alarm Input voltage critical high alarm | ||
|
||
in2_label "vout1" | ||
in2_input Measured output voltage | ||
in2_lcrit Critical minimum output voltage | ||
in2_lcrit_alarm Output voltage critical low alarm | ||
in2_crit Critical maximum output voltage | ||
in2_crit_alarm Output voltage critical high alarm | ||
in2_max Maximum output voltage | ||
in2_max_alarm Output voltage high alarm | ||
in2_min Minimum output voltage | ||
in2_min_alarm Output voltage low alarm | ||
|
||
power1_label "pout1" | ||
power1_input Measured output power | ||
power1_crit Critical maximum output power | ||
|
||
temp1_input Measured temperature | ||
temp1_lcrit Critical low temperature | ||
temp1_lcrit_alarm Chip temperature critical low alarm | ||
temp1_crit Critical high temperature | ||
temp1_crit_alarm Chiptemperature critical high alarm | ||
======================= =========================== |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
// SPDX-License-Identifier: GPL-2.0 | ||
/* | ||
* Hardware monitoring driver for Analog Devices LTP8800 | ||
* | ||
* Copyright (C) 2024 Analog Devices, Inc. | ||
*/ | ||
#include <linux/bits.h> | ||
#include <linux/i2c.h> | ||
#include <linux/module.h> | ||
#include <linux/mod_devicetable.h> | ||
#include "pmbus.h" | ||
|
||
static const struct regulator_desc ltp8800_reg_desc[] = { | ||
PMBUS_REGULATOR("vout", 0), | ||
}; | ||
|
||
static struct pmbus_driver_info ltp8800_info = { | ||
.pages = 1, | ||
.format[PSC_VOLTAGE_IN] = linear, | ||
.format[PSC_VOLTAGE_OUT] = linear, | ||
.format[PSC_CURRENT_IN] = linear, | ||
.format[PSC_TEMPERATURE] = linear, | ||
.func[0] = PMBUS_HAVE_VOUT | PMBUS_HAVE_STATUS_VOUT | | ||
PMBUS_HAVE_VIN | PMBUS_HAVE_STATUS_INPUT | | ||
PMBUS_HAVE_IIN | PMBUS_HAVE_IOUT | | ||
PMBUS_HAVE_TEMP | PMBUS_HAVE_STATUS_TEMP | | ||
PMBUS_HAVE_POUT, | ||
}; | ||
|
||
/* 6.1 requires i2c_device_id */ | ||
static int ltp8800_probe(struct i2c_client *client, | ||
const struct i2c_device_id *id) | ||
{ | ||
if (!i2c_check_functionality(client->adapter, | ||
I2C_FUNC_SMBUS_READ_BYTE_DATA | | ||
I2C_FUNC_SMBUS_READ_WORD_DATA)) | ||
return -ENODEV; | ||
|
||
if (IS_ENABLED(CONFIG_SENSORS_LTP8800_REGULATOR)) { | ||
ltp8800_info.num_regulators = 1; | ||
ltp8800_info.reg_desc = ltp8800_reg_desc; | ||
} | ||
|
||
return pmbus_do_probe(client, <p8800_info); | ||
} | ||
|
||
static const struct i2c_device_id ltp8800_id[] = { | ||
{"ltp8800-1a", 0}, | ||
{"ltp8800-2", 0}, | ||
{"ltp8800-4a", 0}, | ||
{} | ||
}; | ||
MODULE_DEVICE_TABLE(i2c, ltp8800_id); | ||
|
||
static const struct of_device_id ltp8800_of_match[] = { | ||
{ .compatible = "adi,ltp8800-1a"}, | ||
{ .compatible = "adi,ltp8800-2"}, | ||
{ .compatible = "adi,ltp8800-4a"}, | ||
{} | ||
}; | ||
MODULE_DEVICE_TABLE(of, ltp8800_of_match); | ||
|
||
static struct i2c_driver ltp8800_driver = { | ||
.driver = { | ||
.name = "ltp8800", | ||
.of_match_table = ltp8800_of_match, | ||
}, | ||
.probe = ltp8800_probe, | ||
.id_table = ltp8800_id, | ||
}; | ||
module_i2c_driver(ltp8800_driver); | ||
|
||
MODULE_AUTHOR("Cedric Encarnacion <cedricjustine.encarnacion@analog.com>"); | ||
MODULE_DESCRIPTION("Analog Devices LTP8800 HWMON PMBus Driver"); | ||
MODULE_LICENSE("GPL"); | ||
MODULE_IMPORT_NS(PMBUS); |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.