blob: da3c38cb9a5cdd19eced253eaf0eecc9eb8620e4 [file] [log] [blame]
Thomas Gleixnerc942fdd2019-05-27 08:55:06 +02001// SPDX-License-Identifier: GPL-2.0-or-later
Guenter Roeck1f61cab2015-06-08 11:15:23 -07002/*
3 * Hardware monitoring driver for Maxim MAX20751
4 *
5 * Copyright (c) 2015 Guenter Roeck
Guenter Roeck1f61cab2015-06-08 11:15:23 -07006 */
7
8#include <linux/kernel.h>
9#include <linux/module.h>
10#include <linux/init.h>
11#include <linux/err.h>
12#include <linux/i2c.h>
13#include "pmbus.h"
14
15static struct pmbus_driver_info max20751_info = {
16 .pages = 1,
17 .format[PSC_VOLTAGE_IN] = linear,
18 .format[PSC_VOLTAGE_OUT] = vid,
Vadim Pasternakb9fa0a32020-01-13 15:08:36 +000019 .vrm_version[0] = vr12,
Guenter Roeck1f61cab2015-06-08 11:15:23 -070020 .format[PSC_TEMPERATURE] = linear,
21 .format[PSC_CURRENT_OUT] = linear,
22 .format[PSC_POWER] = linear,
23 .func[0] = PMBUS_HAVE_VIN | PMBUS_HAVE_VOUT | PMBUS_HAVE_STATUS_VOUT |
24 PMBUS_HAVE_IOUT | PMBUS_HAVE_STATUS_IOUT |
25 PMBUS_HAVE_TEMP | PMBUS_HAVE_STATUS_TEMP |
26 PMBUS_HAVE_POUT,
27};
28
29static int max20751_probe(struct i2c_client *client,
30 const struct i2c_device_id *id)
31{
32 return pmbus_do_probe(client, id, &max20751_info);
33}
34
35static const struct i2c_device_id max20751_id[] = {
36 {"max20751", 0},
37 {}
38};
39
40MODULE_DEVICE_TABLE(i2c, max20751_id);
41
42static struct i2c_driver max20751_driver = {
43 .driver = {
44 .name = "max20751",
45 },
46 .probe = max20751_probe,
47 .remove = pmbus_do_remove,
48 .id_table = max20751_id,
49};
50
51module_i2c_driver(max20751_driver);
52
53MODULE_AUTHOR("Guenter Roeck <linux@roeck-us.net>");
54MODULE_DESCRIPTION("PMBus driver for Maxim MAX20751");
55MODULE_LICENSE("GPL");