Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp1930750imm; Thu, 18 Oct 2018 06:37:17 -0700 (PDT) X-Google-Smtp-Source: ACcGV61/YsKAszht1To7QWki/Xj7EDDSbluGGcfqSO6kUFx9uTZLUINK+DyCQ04g6/jnALho4I4s X-Received: by 2002:a62:1ccb:: with SMTP id c194-v6mr30265578pfc.203.1539869837936; Thu, 18 Oct 2018 06:37:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539869837; cv=none; d=google.com; s=arc-20160816; b=C5JPDnh+udGKhkacPN5Sy3o7bj96vvmoRVY9bGPQjCbJZdo7GJbl/t+F2McGNiEQr9 v6P6xyHfaD85SeZFCJmfLsrgYO2WchMHzTp802K4Pefm+Uzmz7Jfy3wxrVMTG0Gg6cpi aPg97gNcDybAuacFDvFSjJZCOzsy0uBJEuika4lFpjV6BPpj8qaxjugXmNNq6NCrxYbf VwuH6IU9cu96VID7jOzSRwASxUF4F1NbUqCmloF7ZxhhMX6tCiBL93YT8b+IKvRDdSwJ X2kR53kzDQJErIMNVxaykB0+uKriGUY31FgbNfvfZvHBqdE4Ogh4FbLkr68JRjZ0Twic bOOw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=PUvIZBAn5MGosJFxh8DKMZjGLR4RFzbQ3x6OJZ/wuZs=; b=L+7ug/f7pLl7dOpJg9NqZz3r6Evjpim1wFTNmglvEqtR1ILdfK4t3V9wNjLPHCz8ub K5X0HcdV4jWwur+KqHEAb1t3gsBliRsdAfgG7AxGUE9CpYNEFdrenP4ecqS9VCRANAoe YFcaHGg5aKJzyrOIJwMNr55tsBXiSWbZhlFQxQIatb8653DlzOK2zHSWwOqhh9CjQFfo p8QXT9/zmhZ294XKK8wxJckdsCQZbu6P3rQku+zy03O0RF2NkmXcaIfKF0F+Uis6NctG a1FtiCE1ka6Oo7V3iVwQ/3a0qdhWQftX6aPw1jweDAuDVrX8c2JADN2O8aaINGdffvzD l/og== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=KHRmvzKF; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e1-v6si21059377pld.277.2018.10.18.06.37.01; Thu, 18 Oct 2018 06:37:17 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=KHRmvzKF; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728007AbeJRVhc (ORCPT + 99 others); Thu, 18 Oct 2018 17:37:32 -0400 Received: from mail-pl1-f196.google.com ([209.85.214.196]:40701 "EHLO mail-pl1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727199AbeJRVhb (ORCPT ); Thu, 18 Oct 2018 17:37:31 -0400 Received: by mail-pl1-f196.google.com with SMTP id 1-v6so14341050plv.7; Thu, 18 Oct 2018 06:36:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=PUvIZBAn5MGosJFxh8DKMZjGLR4RFzbQ3x6OJZ/wuZs=; b=KHRmvzKFZT8b31kf2eHUaF3WIl0kijfXgATUopTbYBMC/6dxqRm5av3Zly2YsI4IZJ 2ob1cy50NEt48Uqez1aqL8q70YxccQyuEaX3SMC4Yatk7sN8i7Gv4b+dKJgFkMjvos+W yZoeXA6bQoThmo4TdeTa/G482FvjP9cNhkITyfbGPuIZhIdLZpuxwGHUmmX9IRPywKD5 ETJuGOzdNp6T/ERzax/PGupIt1k3EYU9elieO/FbCecdu8S3QPF1csk+Pao7H6VLh0o+ KE7QjxA9bjJXxQM9EdFHzF/o5NzY6ZZ9piosyY+ODB/OpjATRoaWS4PHZvI1cB69/7zV 1Q/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:to:cc:references:from:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=PUvIZBAn5MGosJFxh8DKMZjGLR4RFzbQ3x6OJZ/wuZs=; b=gao5lvGjbnlnyaGllMFlfzhJ+IHMCgyRrxRiJ41touUizUogh5DoesDbiC1rajhVXE Plmy9HC6mJ5wKR0o09lmCVUeCRvOdxTWml/yZIH/D7VKMqOgfLMEbvqbAhnYeudxXFPs 2ZOeMeovafImPzulKb7PFrw3/DfggXusrwhfKObuGOtRNdGGz0tbLPb9g2a+iZMX4H9U dfi1hydMIALumKZ1sQudDu9xTf7IvHAqY+bs+AlMb8IDnffMOPouc7PjAaMschgljKKp 393Y6OAgdSr9KD+150yijCeMYzIPkgkc63duuCSYjOfreWCcP8wz2XHfMorhZCPs6gMb iYgA== X-Gm-Message-State: ABuFfoix7jM/kM03qblNsQF7/R6/PVA3uqniYzkH2TE9ds30acbA9Iql qJO0FPnVdFZpzGVCiT2yvPTLV22P X-Received: by 2002:a17:902:ba8d:: with SMTP id k13-v6mr30275683pls.12.1539869786292; Thu, 18 Oct 2018 06:36:26 -0700 (PDT) Received: from server.roeck-us.net (108-223-40-66.lightspeed.sntcca.sbcglobal.net. [108.223.40.66]) by smtp.gmail.com with ESMTPSA id j3-v6sm20416142pfn.175.2018.10.18.06.36.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 18 Oct 2018 06:36:25 -0700 (PDT) Subject: Re: [PATCH 1/2] hwmon: (pmbus): Add driver for Intersil ISL68137 To: Kun Yi Cc: openbmc@lists.ozlabs.org, Maxim Sloyko , Jean Delvare , linux-kernel@vger.kernel.org, linux-hwmon@vger.kernel.org References: <20181017225603.7782-1-kunyi@google.com> From: Guenter Roeck Message-ID: <51dbddbc-0e92-7bb5-03c7-4bad3a0af029@roeck-us.net> Date: Thu, 18 Oct 2018 06:36:24 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20181017225603.7782-1-kunyi@google.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10/17/2018 03:56 PM, Kun Yi wrote: > From: Maxim Sloyko > > Intersil ISL68137 is a digital output 7-phase configurable PWM > controller with an AVSBus interface. > > Signed-off-by: Maxim Sloyko > Signed-off-by: Kun Yi > --- > 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 > > diff --git a/drivers/hwmon/pmbus/Kconfig b/drivers/hwmon/pmbus/Kconfig > index 629cb45f8557..15c197f1c4c4 100644 > --- a/drivers/hwmon/pmbus/Kconfig > +++ b/drivers/hwmon/pmbus/Kconfig > @@ -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 > diff --git a/drivers/hwmon/pmbus/Makefile b/drivers/hwmon/pmbus/Makefile > index ea0e39518c21..0684b35216da 100644 > --- a/drivers/hwmon/pmbus/Makefile > +++ b/drivers/hwmon/pmbus/Makefile > @@ -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 > diff --git a/drivers/hwmon/pmbus/isl68137.c b/drivers/hwmon/pmbus/isl68137.c > new file mode 100644 > index 000000000000..2a5322e4a286 > --- /dev/null > +++ b/drivers/hwmon/pmbus/isl68137.c > @@ -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 > + * 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. > +#include > +#include > +#include > +#include > +#include Alphabetic order, please. > +#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 "); > +MODULE_DESCRIPTION("PMBus driver for Intersil ISL68137"); > +MODULE_LICENSE("GPL"); >