04f175954d
Add support for ADP1050 Digital Controller for Isolated Power Supplies with PMBus interface Voltage, Current and Temperature Monitor. The ADP1050 implements several features to enable a robust system of parallel and redundant operation for customers who require high availability. The device can measure voltage, current and temperature that can be used in different techniques to identify and safely shut down an erroneous power supply in parallel operation mode. Signed-off-by: Radu Sabau <radu.sabau@analog.com> Link: https://lore.kernel.org/r/20240321142201.10330-2-radu.sabau@analog.com [groeck: Fixed corrupted link in documentation] Signed-off-by: Guenter Roeck <linux@roeck-us.net>
59 lines
1.4 KiB
C
59 lines
1.4 KiB
C
// SPDX-License-Identifier: GPL-2.0
|
|
/*
|
|
* Hardware monitoring driver for Analog Devices ADP1050
|
|
*
|
|
* Copyright (C) 2024 Analog Devices, Inc.
|
|
*/
|
|
#include <linux/bits.h>
|
|
#include <linux/err.h>
|
|
#include <linux/i2c.h>
|
|
#include <linux/init.h>
|
|
#include <linux/kernel.h>
|
|
#include <linux/module.h>
|
|
#include <linux/of.h>
|
|
#include "pmbus.h"
|
|
|
|
static struct pmbus_driver_info adp1050_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_TEMP
|
|
| PMBUS_HAVE_STATUS_TEMP,
|
|
};
|
|
|
|
static int adp1050_probe(struct i2c_client *client)
|
|
{
|
|
return pmbus_do_probe(client, &adp1050_info);
|
|
}
|
|
|
|
static const struct i2c_device_id adp1050_id[] = {
|
|
{"adp1050", 0},
|
|
{}
|
|
};
|
|
MODULE_DEVICE_TABLE(i2c, adp1050_id);
|
|
|
|
static const struct of_device_id adp1050_of_match[] = {
|
|
{ .compatible = "adi,adp1050"},
|
|
{}
|
|
};
|
|
MODULE_DEVICE_TABLE(of, adp1050_of_match);
|
|
|
|
static struct i2c_driver adp1050_driver = {
|
|
.driver = {
|
|
.name = "adp1050",
|
|
.of_match_table = adp1050_of_match,
|
|
},
|
|
.probe = adp1050_probe,
|
|
.id_table = adp1050_id,
|
|
};
|
|
module_i2c_driver(adp1050_driver);
|
|
|
|
MODULE_AUTHOR("Radu Sabau <radu.sabau@analog.com>");
|
|
MODULE_DESCRIPTION("Analog Devices ADP1050 HWMON PMBus Driver");
|
|
MODULE_LICENSE("GPL");
|
|
MODULE_IMPORT_NS(PMBUS);
|