1 // SPDX-License-Identifier: GPL-2.0-or-later
3 * Hardware monitoring driver for TI TPS40422
5 * Copyright (c) 2014 Nokia Solutions and Networks.
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>
15 static struct pmbus_driver_info tps40422_info
= {
17 .format
[PSC_VOLTAGE_IN
] = linear
,
18 .format
[PSC_VOLTAGE_OUT
] = linear
,
19 .format
[PSC_TEMPERATURE
] = linear
,
20 .func
[0] = PMBUS_HAVE_VOUT
| PMBUS_HAVE_TEMP2
21 | PMBUS_HAVE_STATUS_VOUT
| PMBUS_HAVE_STATUS_TEMP
22 | PMBUS_HAVE_IOUT
| PMBUS_HAVE_STATUS_IOUT
,
23 .func
[1] = PMBUS_HAVE_VOUT
| PMBUS_HAVE_TEMP2
24 | PMBUS_HAVE_STATUS_VOUT
| PMBUS_HAVE_STATUS_TEMP
25 | PMBUS_HAVE_IOUT
| PMBUS_HAVE_STATUS_IOUT
,
28 static int tps40422_probe(struct i2c_client
*client
)
30 return pmbus_do_probe(client
, &tps40422_info
);
33 static const struct i2c_device_id tps40422_id
[] = {
38 MODULE_DEVICE_TABLE(i2c
, tps40422_id
);
40 /* This is the driver that will be inserted */
41 static struct i2c_driver tps40422_driver
= {
45 .probe
= tps40422_probe
,
46 .id_table
= tps40422_id
,
49 module_i2c_driver(tps40422_driver
);
51 MODULE_AUTHOR("Zhu Laiwen <richard.zhu@nsn.com>");
52 MODULE_DESCRIPTION("PMBus driver for TI TPS40422");
53 MODULE_LICENSE("GPL");
54 MODULE_IMPORT_NS("PMBUS");