1 // SPDX-License-Identifier: GPL-2.0
3 * Hardware monitoring driver for Analog Devices ADP1050
5 * Copyright (C) 2024 Analog Devices, Inc.
7 #include <linux/bits.h>
9 #include <linux/mod_devicetable.h>
10 #include <linux/module.h>
14 static struct pmbus_driver_info adp1050_info = {
16 .format[PSC_VOLTAGE_IN] = linear,
17 .format[PSC_VOLTAGE_OUT] = linear,
18 .format[PSC_CURRENT_IN] = linear,
19 .format[PSC_TEMPERATURE] = linear,
20 .func[0] = PMBUS_HAVE_VOUT | PMBUS_HAVE_STATUS_VOUT
21 | PMBUS_HAVE_VIN | PMBUS_HAVE_STATUS_INPUT
22 | PMBUS_HAVE_IIN | PMBUS_HAVE_TEMP
23 | PMBUS_HAVE_STATUS_TEMP,
26 static int adp1050_probe(struct i2c_client *client)
28 return pmbus_do_probe(client, &adp1050_info);
31 static const struct i2c_device_id adp1050_id[] = {
35 MODULE_DEVICE_TABLE(i2c, adp1050_id);
37 static const struct of_device_id adp1050_of_match[] = {
38 { .compatible = "adi,adp1050"},
41 MODULE_DEVICE_TABLE(of, adp1050_of_match);
43 static struct i2c_driver adp1050_driver = {
46 .of_match_table = adp1050_of_match,
48 .probe = adp1050_probe,
49 .id_table = adp1050_id,
51 module_i2c_driver(adp1050_driver);
54 MODULE_DESCRIPTION("Analog Devices ADP1050 HWMON PMBus Driver");
55 MODULE_LICENSE("GPL");
56 MODULE_IMPORT_NS("PMBUS");