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, 19b9fa0a3aSVadim Pasternak .vrm_version[0] = 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 29dd431939SStephen Kitt static int max20751_probe(struct i2c_client *client) 301f61cab8SGuenter Roeck { 31dd431939SStephen Kitt return pmbus_do_probe(client, &max20751_info); 321f61cab8SGuenter Roeck } 331f61cab8SGuenter Roeck 341f61cab8SGuenter Roeck static const struct i2c_device_id max20751_id[] = { 351f61cab8SGuenter Roeck {"max20751", 0}, 361f61cab8SGuenter Roeck {} 371f61cab8SGuenter Roeck }; 381f61cab8SGuenter Roeck 391f61cab8SGuenter Roeck MODULE_DEVICE_TABLE(i2c, max20751_id); 401f61cab8SGuenter Roeck 411f61cab8SGuenter Roeck static struct i2c_driver max20751_driver = { 421f61cab8SGuenter Roeck .driver = { 431f61cab8SGuenter Roeck .name = "max20751", 441f61cab8SGuenter Roeck }, 45dd431939SStephen Kitt .probe_new = max20751_probe, 461f61cab8SGuenter Roeck .id_table = max20751_id, 471f61cab8SGuenter Roeck }; 481f61cab8SGuenter Roeck 491f61cab8SGuenter Roeck module_i2c_driver(max20751_driver); 501f61cab8SGuenter Roeck 511f61cab8SGuenter Roeck MODULE_AUTHOR("Guenter Roeck <linux@roeck-us.net>"); 521f61cab8SGuenter Roeck MODULE_DESCRIPTION("PMBus driver for Maxim MAX20751"); 531f61cab8SGuenter Roeck MODULE_LICENSE("GPL"); 54*b94ca77eSGuenter Roeck MODULE_IMPORT_NS(PMBUS); 55