1c942fddfSThomas Gleixner // SPDX-License-Identifier: GPL-2.0-or-later 21f61cab8SGuenter Roeck /* 31f61cab8SGuenter Roeck * Hardware monitoring driver for Maxim MAX20751 41f61cab8SGuenter Roeck * 51f61cab8SGuenter Roeck * Copyright (c) 2015 Guenter Roeck 61f61cab8SGuenter Roeck */ 71f61cab8SGuenter Roeck 81f61cab8SGuenter Roeck #include <linux/kernel.h> 91f61cab8SGuenter Roeck #include <linux/module.h> 101f61cab8SGuenter Roeck #include <linux/init.h> 111f61cab8SGuenter Roeck #include <linux/err.h> 121f61cab8SGuenter Roeck #include <linux/i2c.h> 131f61cab8SGuenter Roeck #include "pmbus.h" 141f61cab8SGuenter Roeck 151f61cab8SGuenter Roeck static struct pmbus_driver_info max20751_info = { 161f61cab8SGuenter Roeck .pages = 1, 171f61cab8SGuenter Roeck .format[PSC_VOLTAGE_IN] = linear, 181f61cab8SGuenter Roeck .format[PSC_VOLTAGE_OUT] = vid, 191f61cab8SGuenter Roeck .vrm_version = vr12, 201f61cab8SGuenter Roeck .format[PSC_TEMPERATURE] = linear, 211f61cab8SGuenter Roeck .format[PSC_CURRENT_OUT] = linear, 221f61cab8SGuenter Roeck .format[PSC_POWER] = linear, 231f61cab8SGuenter Roeck .func[0] = PMBUS_HAVE_VIN | PMBUS_HAVE_VOUT | PMBUS_HAVE_STATUS_VOUT | 241f61cab8SGuenter Roeck PMBUS_HAVE_IOUT | PMBUS_HAVE_STATUS_IOUT | 251f61cab8SGuenter Roeck PMBUS_HAVE_TEMP | PMBUS_HAVE_STATUS_TEMP | 261f61cab8SGuenter Roeck PMBUS_HAVE_POUT, 271f61cab8SGuenter Roeck }; 281f61cab8SGuenter Roeck 291f61cab8SGuenter Roeck static int max20751_probe(struct i2c_client *client, 301f61cab8SGuenter Roeck const struct i2c_device_id *id) 311f61cab8SGuenter Roeck { 321f61cab8SGuenter Roeck return pmbus_do_probe(client, id, &max20751_info); 331f61cab8SGuenter Roeck } 341f61cab8SGuenter Roeck 351f61cab8SGuenter Roeck static const struct i2c_device_id max20751_id[] = { 361f61cab8SGuenter Roeck {"max20751", 0}, 371f61cab8SGuenter Roeck {} 381f61cab8SGuenter Roeck }; 391f61cab8SGuenter Roeck 401f61cab8SGuenter Roeck MODULE_DEVICE_TABLE(i2c, max20751_id); 411f61cab8SGuenter Roeck 421f61cab8SGuenter Roeck static struct i2c_driver max20751_driver = { 431f61cab8SGuenter Roeck .driver = { 441f61cab8SGuenter Roeck .name = "max20751", 451f61cab8SGuenter Roeck }, 461f61cab8SGuenter Roeck .probe = max20751_probe, 471f61cab8SGuenter Roeck .remove = pmbus_do_remove, 481f61cab8SGuenter Roeck .id_table = max20751_id, 491f61cab8SGuenter Roeck }; 501f61cab8SGuenter Roeck 511f61cab8SGuenter Roeck module_i2c_driver(max20751_driver); 521f61cab8SGuenter Roeck 531f61cab8SGuenter Roeck MODULE_AUTHOR("Guenter Roeck <linux@roeck-us.net>"); 541f61cab8SGuenter Roeck MODULE_DESCRIPTION("PMBus driver for Maxim MAX20751"); 551f61cab8SGuenter Roeck MODULE_LICENSE("GPL"); 56