Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp1227755imm; Wed, 17 Oct 2018 15:57:08 -0700 (PDT) X-Google-Smtp-Source: ACcGV6351HLl1dpEosmWBmTAZxtg/z0je/r6i1ERYr6aQWVxmJN98MzzI2GmN/tLV20ngdEEA4Il X-Received: by 2002:a62:ac15:: with SMTP id v21-v6mr28193749pfe.126.1539817028348; Wed, 17 Oct 2018 15:57:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539817028; cv=none; d=google.com; s=arc-20160816; b=aKcQwb0qW2T/dPtghmzjaAKZLbI1U9mLpuOLtt7nQ2KRMCscIFcgRGtus4viAiOzkl RsZK/HFA67MW07tAfdyXoncduL24otNbBA9Sq7g55vlrr87g4zW/FQQ3xA64MXJuvoKT j4sa0rkQELsLbACEqLWmseLZrr0A/Hq5uj/qKg3pWm5JGjyWS1m1DhCF+2j89nHZgs8O pn513T2jeI4ygKEw4e2yZ5mXwSHDs4x6g5/oSryDvRDOJCPejO9CEMdjrd//CDBkQsQd 2Qx1xJjUme4Y5kTwIwB/tBikWHYzZfm4/6uy/5jbsmNZ0eGsouxqtk9f5Kybu7cdm9Y9 uTxQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:cc:from:subject:mime-version :message-id:date:dkim-signature; bh=HFH3AFRn4plN0Si/b0ikFRnPPozJbTcZzpeAPcHPMWQ=; b=rjF60BA7hj4k65VxpVEDmgXDL9A0+TpnoI5thL0CZ2+mc5e/KebY8G54oFvNocqvNk wxEpibln4+bw+OVGCJmK5Uq2I1y4tlBV9GUxQD0V4f3K+HC/BvjyqAja70sAc795RqIK 5R6mbZJ71CkOnlu7gV/WaMfCDlxHoiRNaWMO81DgVw1AK6WG+FljE60OMsVQRenPg1Ln HIdEjmVcsW5I0HKBdQdXg1ydaS5Y6W3o7K8lLyAvNjKhsLaM/VW+MEDcg0hcMmtSqBq+ NqNv5WGIIc43/xwC3uBPAXA/IdMz1uzrh6B0cgEy/WMDbvh+oDoYqDoacYcRO9Weo3uj JQZQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=ZaatQBdn; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e17-v6si16606240pgv.54.2018.10.17.15.56.52; Wed, 17 Oct 2018 15:57:08 -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=pass header.i=@google.com header.s=20161025 header.b=ZaatQBdn; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727995AbeJRGyD (ORCPT + 99 others); Thu, 18 Oct 2018 02:54:03 -0400 Received: from mail-io1-f73.google.com ([209.85.166.73]:48765 "EHLO mail-io1-f73.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727814AbeJRGyD (ORCPT ); Thu, 18 Oct 2018 02:54:03 -0400 Received: by mail-io1-f73.google.com with SMTP id v12-v6so26149304iob.15 for ; Wed, 17 Oct 2018 15:56:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:message-id:mime-version:subject:from:cc; bh=HFH3AFRn4plN0Si/b0ikFRnPPozJbTcZzpeAPcHPMWQ=; b=ZaatQBdnBnOKW5Ql2CgoeEA8Cjl0skNn2QKOr7xjebIj9PBqdKtGxMCUshfRnjhlgn Ifs3CmJjq4ZkHYZ4DdqMYo1I9xbwx/WD6Wrv2GW8TUprCTgaUSWfTY3a8JwywycC7DEP Cp/HmwHGOhVrDXUJtgwPMIDNQhkeC0fzC5kG4+UODAWi90JYyW+QFL/UVIbTkXS0fcPS 0n+WNuwFy0TDMZ4d/TVWGYajyivD2JwcUWLrPb/J9wSwa75/Mk9EkrYC0rafgqP9G9bj DOramXfEObWO5QRuaSQ8v+UdJA5aOnNEHUK5Q+IN8z1mdHjqqTrU6Kld8+q4uSQDIDDt 7QAQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:message-id:mime-version:subject:from:cc; bh=HFH3AFRn4plN0Si/b0ikFRnPPozJbTcZzpeAPcHPMWQ=; b=jcAWGWR099J4IbG/vx1Mse+tTDXgcm1uHMTGiwlqMnrSwtlQ/JbeDCwgLRZyBiqNWZ xNNVOkItoMzxAX/ygUDhxSr4kPshuWP1JnCW6IMD9Hl4u4IKyOuj71X4xct1Sdvc/ySw 9dCodD6GYz97+6TYlX+hcTafnB9foFA4iWxgCXbpl5M33cK9841sjW21yi5X7UVfGNPC 1c9D2AcGxwofAEzN7AbFnWekILfsPqg4qfu6zsbo9bx93JbOonhuYjZ3/n9Oqf/gSH5t BhNcm5H/7FUF5Bbaeqk1/5Y6+vrqQ177faiMA+dXtN67l/uASWce8XUwwHYCy66YFeiS DPIQ== X-Gm-Message-State: ABuFfogmnDZJ/sknkaILr1Wt3MzfT7sibwR9yHtrv0+JfO1prcxoAuyf 4CMbKyjB1V8a0fKLwkf2Gf9Nlqug4w== X-Received: by 2002:a24:2153:: with SMTP id e80-v6mr22088599ita.1.1539816968731; Wed, 17 Oct 2018 15:56:08 -0700 (PDT) Date: Wed, 17 Oct 2018 15:56:02 -0700 Message-Id: <20181017225603.7782-1-kunyi@google.com> Mime-Version: 1.0 X-Mailer: git-send-email 2.19.1.331.ge82ca0e54c-goog Subject: [PATCH 1/2] hwmon: (pmbus): Add driver for Intersil ISL68137 From: Kun Yi Cc: openbmc@lists.ozlabs.org, kunyi@google.com, Maxim Sloyko , Guenter Roeck , Jean Delvare , linux-kernel@vger.kernel.org, linux-hwmon@vger.kernel.org Content-Type: text/plain; charset="UTF-8" To: unlisted-recipients:; (no To-header on input) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. + */ + +#include +#include +#include +#include +#include +#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"); -- 2.19.1.331.ge82ca0e54c-goog