brintos

brintos / linux-shallow public Read only

0
0
Text · 1.3 KiB · 20f2273 Raw
57 lines · c
1// SPDX-License-Identifier: GPL-2.02/*3 * Hardware monitoring driver for Analog Devices ADP10504 *5 * Copyright (C) 2024 Analog Devices, Inc.6 */7#include <linux/bits.h>8#include <linux/i2c.h>9#include <linux/mod_devicetable.h>10#include <linux/module.h>11 12#include "pmbus.h"13 14static struct pmbus_driver_info adp1050_info = {15	.pages = 1,16	.format[PSC_VOLTAGE_IN] = linear,17	.format[PSC_VOLTAGE_OUT] = linear,18	.format[PSC_CURRENT_IN] = linear,19	.format[PSC_TEMPERATURE] = linear,20	.func[0] = PMBUS_HAVE_VOUT | PMBUS_HAVE_STATUS_VOUT21		| PMBUS_HAVE_VIN | PMBUS_HAVE_STATUS_INPUT22		| PMBUS_HAVE_IIN | PMBUS_HAVE_TEMP23		| PMBUS_HAVE_STATUS_TEMP,24};25 26static int adp1050_probe(struct i2c_client *client)27{28	return pmbus_do_probe(client, &adp1050_info);29}30 31static const struct i2c_device_id adp1050_id[] = {32	{"adp1050"},33	{}34};35MODULE_DEVICE_TABLE(i2c, adp1050_id);36 37static const struct of_device_id adp1050_of_match[] = {38	{ .compatible = "adi,adp1050"},39	{}40};41MODULE_DEVICE_TABLE(of, adp1050_of_match);42 43static struct i2c_driver adp1050_driver = {44	.driver = {45		.name = "adp1050",46		.of_match_table = adp1050_of_match,47	},48	.probe = adp1050_probe,49	.id_table = adp1050_id,50};51module_i2c_driver(adp1050_driver);52 53MODULE_AUTHOR("Radu Sabau <radu.sabau@analog.com>");54MODULE_DESCRIPTION("Analog Devices ADP1050 HWMON PMBus Driver");55MODULE_LICENSE("GPL");56MODULE_IMPORT_NS(PMBUS);57