1 // SPDX-License-Identifier: GPL-2.0-or-later 2 /* 3 * Hardware monitoring driver for E50SN12051 4 */ 5 6 #include <linux/i2c.h> 7 #include <linux/module.h> 8 #include <linux/mod_devicetable.h> 9 #include "pmbus.h" 10 11 static struct pmbus_driver_info e50sn12051_info = { 12 .pages = 1, 13 .format[PSC_VOLTAGE_IN] = linear, 14 .format[PSC_VOLTAGE_OUT] = linear, 15 .format[PSC_CURRENT_OUT] = linear, 16 .format[PSC_TEMPERATURE] = linear, 17 .func[0] = PMBUS_HAVE_VIN | PMBUS_HAVE_STATUS_INPUT | 18 PMBUS_HAVE_VOUT | PMBUS_HAVE_STATUS_VOUT | 19 PMBUS_HAVE_IOUT | PMBUS_HAVE_STATUS_IOUT | 20 PMBUS_HAVE_TEMP | PMBUS_HAVE_STATUS_TEMP, 21 }; 22 23 static const struct i2c_device_id e50sn12051_id[] = { { "e50sn12051", 0 }, {} }; 24 MODULE_DEVICE_TABLE(i2c, e50sn12051_id); 25 26 static const struct of_device_id e50sn12051_of_match[] = { 27 { .compatible = "delta,e50sn12051" }, 28 {}, 29 }; 30 MODULE_DEVICE_TABLE(of, e50sn12051_of_match); 31 32 static int e50sn12051_probe(struct i2c_client *client) 33 { 34 return pmbus_do_probe(client, &e50sn12051_info); 35 } 36 37 static struct i2c_driver e50sn12051_driver = { 38 .driver = { 39 .name = "e50sn12051", 40 .of_match_table = e50sn12051_of_match, 41 }, 42 .probe = e50sn12051_probe, 43 44 .id_table = e50sn12051_id, 45 }; 46 47 module_i2c_driver(e50sn12051_driver); 48 49 MODULE_AUTHOR("Kevin Chang <kevin.chang2@amd.com>"); 50 MODULE_DESCRIPTION("PMBus driver for E50SN12051"); 51 MODULE_LICENSE("GPL"); 52 MODULE_IMPORT_NS("PMBUS"); 53