]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/blame - drivers/hwmon/pmbus/tps40422.c
UBUNTU: Ubuntu-5.11.0-22.23
[mirror_ubuntu-hirsute-kernel.git] / drivers / hwmon / pmbus / tps40422.c
CommitLineData
c942fddf 1// SPDX-License-Identifier: GPL-2.0-or-later
a8bfeceb
ZRNCB
2/*
3 * Hardware monitoring driver for TI TPS40422
4 *
5 * Copyright (c) 2014 Nokia Solutions and Networks.
a8bfeceb
ZRNCB
6 */
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 tps40422_info = {
16 .pages = 2,
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,
26};
27
dd431939 28static int tps40422_probe(struct i2c_client *client)
a8bfeceb 29{
dd431939 30 return pmbus_do_probe(client, &tps40422_info);
a8bfeceb
ZRNCB
31}
32
33static const struct i2c_device_id tps40422_id[] = {
34 {"tps40422", 0},
35 {}
36};
37
38MODULE_DEVICE_TABLE(i2c, tps40422_id);
39
40/* This is the driver that will be inserted */
41static struct i2c_driver tps40422_driver = {
42 .driver = {
43 .name = "tps40422",
44 },
dd431939 45 .probe_new = tps40422_probe,
a8bfeceb
ZRNCB
46 .id_table = tps40422_id,
47};
48
49module_i2c_driver(tps40422_driver);
50
51MODULE_AUTHOR("Zhu Laiwen <richard.zhu@nsn.com>");
52MODULE_DESCRIPTION("PMBus driver for TI TPS40422");
53MODULE_LICENSE("GPL");