-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
hwmon: (pmbus/ir38064) Add driver for Infineon IR38064 Voltage Regulator
Add the pmbus driver for the Infineon ir38064 voltage regulator. VOUT_MODE is not supported by the device. The driver fakes linear16 mode with exponent value -8. The device supports VOUT_PEAK, IOUT_PEAK, and TEMPERATURE_PEAK, however this driver does not enable them. Signed-off-by: Maxim Sloyko <maxims@google.com> Signed-off-by: Patrick Venture <venture@google.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
- Loading branch information
Maxim Sloyko
authored and
Guenter Roeck
committed
Apr 16, 2019
1 parent
c49b7b3
commit 00669d1
Showing
4 changed files
with
139 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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,64 @@ | ||
Kernel driver ir38064 | ||
===================== | ||
|
||
Supported chips: | ||
* Infineon IR38064 | ||
Prefix: 'ir38064' | ||
Addresses scanned: - | ||
Datasheet: Publicly available at the Infineon webiste | ||
https://www.infineon.com/dgdl/Infineon-IR38064MTRPBF-DS-v03_07-EN.pdf?fileId=5546d462584d1d4a0158db0d9efb67ca | ||
|
||
Datasheet is not publicly available. | ||
|
||
|
||
Authors: | ||
Maxim Sloyko <maxims@google.com> | ||
Patrick Venture <venture@google.com> | ||
|
||
Description | ||
----------- | ||
|
||
IR38064 is a Single-input Voltage, Synchronous Buck Regulator, DC-DC Converter. | ||
|
||
Usage Notes | ||
----------- | ||
|
||
This driver does not probe for PMBus devices. You will have to instantiate | ||
devices explicitly. | ||
|
||
Sysfs attributes | ||
---------------- | ||
|
||
curr1_label "iout1" | ||
curr1_input Measured output current | ||
curr1_crit Critical maximum current | ||
curr1_crit_alarm Current critical high alarm | ||
curr1_max Maximum current | ||
curr1_max_alarm Current high alarm | ||
|
||
in1_label "vin" | ||
in1_input Measured input voltage | ||
in1_crit Critical maximum input voltage | ||
in1_crit_alarm Input voltage critical high alarm | ||
in1_min Minimum input voltage | ||
in1_min_alarm Input voltage low 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 | ||
|
||
temp1_input Measured temperature | ||
temp1_crit Critical high temperature | ||
temp1_crit_alarm Chip temperature critical high alarm | ||
temp1_max Maximum temperature | ||
temp1_max_alarm Chip temperature high alarm |
This file contains 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 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 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,65 @@ | ||
// SPDX-License-Identifier: GPL-2.0+ | ||
/* | ||
* Hardware monitoring driver for Infineon IR38064 | ||
* | ||
* Copyright (c) 2017 Google Inc | ||
* | ||
* VOUT_MODE is not supported by the device. The driver fakes VOUT linear16 | ||
* mode with exponent value -8 as direct mode with m=256/b=0/R=0. | ||
* | ||
* The device supports VOUT_PEAK, IOUT_PEAK, and TEMPERATURE_PEAK, however | ||
* this driver does not currently support them. | ||
*/ | ||
|
||
#include <linux/err.h> | ||
#include <linux/i2c.h> | ||
#include <linux/init.h> | ||
#include <linux/kernel.h> | ||
#include <linux/module.h> | ||
#include "pmbus.h" | ||
|
||
static struct pmbus_driver_info ir38064_info = { | ||
.pages = 1, | ||
.format[PSC_VOLTAGE_IN] = linear, | ||
.format[PSC_VOLTAGE_OUT] = direct, | ||
.format[PSC_CURRENT_OUT] = linear, | ||
.format[PSC_POWER] = linear, | ||
.format[PSC_TEMPERATURE] = linear, | ||
.m[PSC_VOLTAGE_OUT] = 256, | ||
.b[PSC_VOLTAGE_OUT] = 0, | ||
.R[PSC_VOLTAGE_OUT] = 0, | ||
.func[0] = PMBUS_HAVE_VIN | PMBUS_HAVE_STATUS_INPUT | ||
| PMBUS_HAVE_TEMP | PMBUS_HAVE_STATUS_TEMP | ||
| PMBUS_HAVE_VOUT | PMBUS_HAVE_STATUS_VOUT | ||
| PMBUS_HAVE_IOUT | PMBUS_HAVE_STATUS_IOUT | ||
| PMBUS_HAVE_POUT, | ||
}; | ||
|
||
static int ir38064_probe(struct i2c_client *client, | ||
const struct i2c_device_id *id) | ||
{ | ||
return pmbus_do_probe(client, id, &ir38064_info); | ||
} | ||
|
||
static const struct i2c_device_id ir38064_id[] = { | ||
{"ir38064", 0}, | ||
{} | ||
}; | ||
|
||
MODULE_DEVICE_TABLE(i2c, ir38064_id); | ||
|
||
/* This is the driver that will be inserted */ | ||
static struct i2c_driver ir38064_driver = { | ||
.driver = { | ||
.name = "ir38064", | ||
}, | ||
.probe = ir38064_probe, | ||
.remove = pmbus_do_remove, | ||
.id_table = ir38064_id, | ||
}; | ||
|
||
module_i2c_driver(ir38064_driver); | ||
|
||
MODULE_AUTHOR("Maxim Sloyko <maxims@google.com>"); | ||
MODULE_DESCRIPTION("PMBus driver for Infineon IR38064"); | ||
MODULE_LICENSE("GPL"); |