Back to home page

OSCL-LXR

 
 

    


0001 // SPDX-License-Identifier: GPL-2.0-or-later
0002 /*
0003  * Hardware monitoring driver for Maxim MAX20751
0004  *
0005  * Copyright (c) 2015 Guenter Roeck
0006  */
0007 
0008 #include <linux/kernel.h>
0009 #include <linux/module.h>
0010 #include <linux/init.h>
0011 #include <linux/err.h>
0012 #include <linux/i2c.h>
0013 #include "pmbus.h"
0014 
0015 static struct pmbus_driver_info max20751_info = {
0016     .pages = 1,
0017     .format[PSC_VOLTAGE_IN] = linear,
0018     .format[PSC_VOLTAGE_OUT] = vid,
0019     .vrm_version[0] = vr12,
0020     .format[PSC_TEMPERATURE] = linear,
0021     .format[PSC_CURRENT_OUT] = linear,
0022     .format[PSC_POWER] = linear,
0023     .func[0] = PMBUS_HAVE_VIN | PMBUS_HAVE_VOUT | PMBUS_HAVE_STATUS_VOUT |
0024         PMBUS_HAVE_IOUT | PMBUS_HAVE_STATUS_IOUT |
0025         PMBUS_HAVE_TEMP | PMBUS_HAVE_STATUS_TEMP |
0026         PMBUS_HAVE_POUT,
0027 };
0028 
0029 static int max20751_probe(struct i2c_client *client)
0030 {
0031     return pmbus_do_probe(client, &max20751_info);
0032 }
0033 
0034 static const struct i2c_device_id max20751_id[] = {
0035     {"max20751", 0},
0036     {}
0037 };
0038 
0039 MODULE_DEVICE_TABLE(i2c, max20751_id);
0040 
0041 static struct i2c_driver max20751_driver = {
0042     .driver = {
0043            .name = "max20751",
0044            },
0045     .probe_new = max20751_probe,
0046     .id_table = max20751_id,
0047 };
0048 
0049 module_i2c_driver(max20751_driver);
0050 
0051 MODULE_AUTHOR("Guenter Roeck <linux@roeck-us.net>");
0052 MODULE_DESCRIPTION("PMBus driver for Maxim MAX20751");
0053 MODULE_LICENSE("GPL");
0054 MODULE_IMPORT_NS(PMBUS);