hwmon: (pmbus): Add driver for Intersil ISL68137
PATCH 1/2 hwmon: (pmbus): Add driver for Intersil ISL68137
From: Maxim Sloyko <[email protected]>
Intersil ISL68137 is a digital output 7-phase configurable PWM controller with an AVSBus interface.
Signed-off-by Maxim Sloyko <[email protected]>
Signed-off-by Kun Yi <[email protected]>
--- drivers/hwmon/pmbus/Kconfig | 10 ++++ drivers/hwmon/pmbus/Makefile | 1 + drivers/hwmon/pmbus/isl68137.c | 86 ++++++++++++++++++++++++++++++++++ 3 files changed, 97 insertions(+) create mode 100644 drivers/hwmon/pmbus/isl68137.c
drivers/hwmon/pmbus/Kconfig +10 -0
@@ -54,6 +54,16 @@ config SENSORS_IR35221 This driver can also be built as a module. If so, the module will be called ir35521. +config SENSORS_ISL68137 + tristate "Intersil ISL68137" + default y + help + If you say yes here you get hardware monitoring support for Intersil + ISL68137. + + This driver can also be built as a module. If so, the module will + be called isl68137. + config SENSORS_LM25066 tristate "National Semiconductor LM25066 and compatibles" help
drivers/hwmon/pmbus/Makefile +1 -0
@@ -8,6 +8,7 @@ obj-$(CONFIG_SENSORS_PMBUS) += pmbus.o obj-$(CONFIG_SENSORS_ADM1275) += adm1275.o obj-$(CONFIG_SENSORS_IBM_CFFPS) += ibm-cffps.o obj-$(CONFIG_SENSORS_IR35221) += ir35221.o +obj-$(CONFIG_SENSORS_ISL68137) += isl68137.o obj-$(CONFIG_SENSORS_LM25066) += lm25066.o obj-$(CONFIG_SENSORS_LTC2978) += ltc2978.o obj-$(CONFIG_SENSORS_LTC3815) += ltc3815.o
drivers/hwmon/pmbus/isl68137.c new file +86 -0
86 lines not on this page · raw message
Signature · 1 line
2.19.1.331.ge82ca0e54c-goog
Guenter Roeck
maintainerQuoted 59 lines · Kun Yi
From: Maxim Sloyko <[email protected]>
Intersil ISL68137 is a digital output 7-phase configurable PWM controller with an AVSBus interface.
Signed-off-by Maxim Sloyko <[email protected]>Signed-off-by Kun Yi <[email protected]>--- drivers/hwmon/pmbus/Kconfig | 10 ++++ drivers/hwmon/pmbus/Makefile | 1 + drivers/hwmon/pmbus/isl68137.c | 86 ++++++++++++++++++++++++++++++++++ 3 files changed, 97 insertions(+)create mode 100644
drivers/hwmon/pmbus/isl68137.cdrivers/hwmon/pmbus/Kconfig +10
-0@@ -54,6 +54,16 @@ config SENSORS_IR35221 This driver can also be built as a module. If so, the module will be called ir35521. +config SENSORS_ISL68137 + tristate "Intersil ISL68137" + default y + help + If you say yes here you get hardware monitoring support for Intersil + ISL68137. + + This driver can also be built as a module. If so, the module will + be called isl68137. + config SENSORS_LM25066 tristate "National Semiconductor LM25066 and compatibles" helpdrivers/hwmon/pmbus/Makefile +1
-0@@ -8,6 +8,7 @@ obj-$(CONFIG_SENSORS_PMBUS) += pmbus.o obj-$(CONFIG_SENSORS_ADM1275) += adm1275.o obj-$(CONFIG_SENSORS_IBM_CFFPS) += ibm-cffps.o obj-$(CONFIG_SENSORS_IR35221) += ir35221.o +obj-$(CONFIG_SENSORS_ISL68137) += isl68137.o obj-$(CONFIG_SENSORS_LM25066) += lm25066.o obj-$(CONFIG_SENSORS_LTC2978) += ltc2978.o obj-$(CONFIG_SENSORS_LTC3815) += ltc3815.odrivers/hwmon/pmbus/isl68137.c new file +6
-0@@ -0,0 +1,86 @@ +/* +* Hardware monitoring driver for Intersil ISL68137 +* +* Copyright (c) 2017 Google Inc +* +* This program is free software; you can redistribute it and/or modify
drivers/hwmon/pmbus/isl68137.c line 16
Quoted 10 lines
drivers/hwmon/pmbus/isl68137.c new file +10
-0+* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 2 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +*/ +
Please use SPDX for new drivers.
drivers/hwmon/pmbus/isl68137.c line 21
Quoted 5 lines
drivers/hwmon/pmbus/isl68137.c new file +5
-0+#include <linux/kernel.h> +#include <linux/module.h> +#include <linux/init.h> +#include <linux/err.h> +#include <linux/i2c.h>
Alphabetic order, please.
Quoted 66 lines
drivers/hwmon/pmbus/isl68137.c new file +65
-0+#include "pmbus.h" + +static struct pmbus_driver_info isl68137_info = { + .pages =2 , + .format[PSC_VOLTAGE_IN ] = direct, + .format[PSC_VOLTAGE_OUT ] = direct, + .format[PSC_CURRENT_IN ] = direct, + .format[PSC_CURRENT_OUT ] = direct, + .format[PSC_POWER ] = direct, + .format[PSC_TEMPERATURE ] = direct, + .m[PSC_VOLTAGE_IN ] =1 , + .b[PSC_VOLTAGE_IN ] =0 , + .R[PSC_VOLTAGE_IN ] =3 , + .m[PSC_VOLTAGE_OUT ] =1 , + .b[PSC_VOLTAGE_OUT ] =0 , + .R[PSC_VOLTAGE_OUT ] =3 , + .m[PSC_CURRENT_IN ] =1 , + .b[PSC_CURRENT_IN ] =0 , + .R[PSC_CURRENT_IN ] =2 , + .m[PSC_CURRENT_OUT ] =1 , + .b[PSC_CURRENT_OUT ] =0 , + .R[PSC_CURRENT_OUT ] =1 , + .m[PSC_POWER ] =1 , + .b[PSC_POWER ] =0 , + .R[PSC_POWER ] =0 , + .m[PSC_TEMPERATURE ] =1 , + .b[PSC_TEMPERATURE ] =0 , + .R[PSC_TEMPERATURE ] =0 , + .func[0 ] =PMBUS_HAVE_VIN |PMBUS_HAVE_IIN |PMBUS_HAVE_PIN + |PMBUS_HAVE_STATUS_INPUT |PMBUS_HAVE_TEMP |PMBUS_HAVE_TEMP2 + |PMBUS_HAVE_TEMP3 |PMBUS_HAVE_STATUS_TEMP + |PMBUS_HAVE_VOUT |PMBUS_HAVE_STATUS_VOUT + |PMBUS_HAVE_IOUT |PMBUS_HAVE_STATUS_IOUT |PMBUS_HAVE_POUT , + .func[1 ] =PMBUS_HAVE_VOUT |PMBUS_HAVE_STATUS_VOUT + |PMBUS_HAVE_IOUT |PMBUS_HAVE_STATUS_IOUT |PMBUS_HAVE_POUT , +}; + +static int isl68137_probe (struct i2c_client *client, +const struct i2c_device_id *id) +{ +return pmbus_do_probe (client, id, &isl68137_info); +} + +static const struct i2c_device_id isl68137_id[] = { + {"isl68137" ,0 }, + {} +}; + +MODULE_DEVICE_TABLE (i2c, isl68137_id); + +/* This is the driver that will be inserted */ +static struct i2c_driver isl68137_driver = { + .driver = { + .name ="isl68137" , + }, + .probe = isl68137_probe, + .remove = pmbus_do_remove, + .id_table = isl68137_id, +}; + +module_i2c_driver (isl68137_driver); + +MODULE_AUTHOR ("Maxim Sloyko <[email protected]>" ); +MODULE_DESCRIPTION ("PMBus driver for Intersil ISL68137" ); +MODULE_LICENSE ("GPL" );