1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17#include <linux/kernel.h>
18#include <linux/module.h>
19#include <linux/init.h>
20#include <linux/err.h>
21#include <linux/i2c.h>
22#include "pmbus.h"
23
24static struct pmbus_driver_info max20751_info = {
25 .pages = 1,
26 .format[PSC_VOLTAGE_IN] = linear,
27 .format[PSC_VOLTAGE_OUT] = vid,
28 .vrm_version = vr12,
29 .format[PSC_TEMPERATURE] = linear,
30 .format[PSC_CURRENT_OUT] = linear,
31 .format[PSC_POWER] = linear,
32 .func[0] = PMBUS_HAVE_VIN | PMBUS_HAVE_VOUT | PMBUS_HAVE_STATUS_VOUT |
33 PMBUS_HAVE_IOUT | PMBUS_HAVE_STATUS_IOUT |
34 PMBUS_HAVE_TEMP | PMBUS_HAVE_STATUS_TEMP |
35 PMBUS_HAVE_POUT,
36};
37
38static int max20751_probe(struct i2c_client *client,
39 const struct i2c_device_id *id)
40{
41 return pmbus_do_probe(client, id, &max20751_info);
42}
43
44static const struct i2c_device_id max20751_id[] = {
45 {"max20751", 0},
46 {}
47};
48
49MODULE_DEVICE_TABLE(i2c, max20751_id);
50
51static struct i2c_driver max20751_driver = {
52 .driver = {
53 .name = "max20751",
54 },
55 .probe = max20751_probe,
56 .remove = pmbus_do_remove,
57 .id_table = max20751_id,
58};
59
60module_i2c_driver(max20751_driver);
61
62MODULE_AUTHOR("Guenter Roeck <linux@roeck-us.net>");
63MODULE_DESCRIPTION("PMBus driver for Maxim MAX20751");
64MODULE_LICENSE("GPL");
65