Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp643410ybb; Wed, 25 Mar 2020 06:58:58 -0700 (PDT) X-Google-Smtp-Source: ADFU+vswc2qkfmAUo+ajkOccpGA5lMABVlmQk1K56BKe99BL6nVmOVrAJrii1whMzxcV7WsOTuhU X-Received: by 2002:aca:e08a:: with SMTP id x132mr2524461oig.93.1585144738618; Wed, 25 Mar 2020 06:58:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585144738; cv=none; d=google.com; s=arc-20160816; b=nmhtry0W2ASopNvACo+18EMP30eMJMSA9bJWYk2tPFsuGVq5QdoQmOxceGsGRVEvtK N6mvTdhnfxKyZZXm44sBsN2Ksuex6JQmlv9co0JSa1s5tE351SN7+JC7C5Jj8WFt3qQc XG9lpz8WyWrurlSoNt2C0nt4WY+LZ0CalX0DU9E5xw6XoWaG7LmzbgJxrNUEQo0G2q6y XeI36TcUUmgkWhChP4m9tVm5eZF87+JQlFtpNVKSJBJ6a/PlZ6N058ESAP0Pwm8mQdsp iJxhNe2mfJf1icdktXq9Y3OG3TgWVonH4buInFg2/9ea8jFdLYfiTZZ4X8hrYHJhKO8M j7MQ== 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:autocrypt:from:references:cc:to:subject:dkim-signature; bh=Jc2Uda7VwDJvbIKlzSommWP6A5buVHnd0nGl7cJoVAQ=; b=WIhyaM0RoPkC6/viYNcCx9nx1bfsm9HSxfZg5ABd1vxKhrYfPdYVLCi8Sp91Z/2PfF HdDF3pvaXBraiRonMFmOT5E1ehcMzQ2MYwHzHik8n4CoGxLLqY4HxZGrgFCMTFUpGaq2 /gK+GIDIbAB7zEvc9tqQ5YC9EYEPp3hyTiYT5Sg9Q/Im96qQ6e1ByCtH7cMZK9P3ZQAa 68RBIDiAYOQwlX2MecO9HayoFiCcKxEP7cpqv9EBK9KDVHNpzeQaF4+v9TyESj2pLfI8 RsBbpJSIADqTy7AjHKSme+6qvsKsEpT+QkOd/cqcEwUdF+RAqoJ5i3ic/rb4ZrGd+/ru ljHw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=rv6naWBI; 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 j15si1548869oos.59.2020.03.25.06.58.44; Wed, 25 Mar 2020 06:58:58 -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=rv6naWBI; 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 S1727639AbgCYN6T (ORCPT + 99 others); Wed, 25 Mar 2020 09:58:19 -0400 Received: from mail-pf1-f196.google.com ([209.85.210.196]:41063 "EHLO mail-pf1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727277AbgCYN6S (ORCPT ); Wed, 25 Mar 2020 09:58:18 -0400 Received: by mail-pf1-f196.google.com with SMTP id z65so1071488pfz.8; Wed, 25 Mar 2020 06:58:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:cc:references:from:autocrypt:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=Jc2Uda7VwDJvbIKlzSommWP6A5buVHnd0nGl7cJoVAQ=; b=rv6naWBIae+heyDeue+XszyMFr9ITxv2CmzI8HU59VsoZp6TzEhgAjFX+ct/vvsDSm 8W7/O0qpUYexfgyX84uJJ7CjpNklNH52cqoWb0tuqMOtJ8R3ssMfdKwA3PVzJO8xxNg1 IUAKjntVyB28J0SXDKg+k4u/YLxFtUpERJPjJehMDpcpjsnCHV5xdbrBNsGzpnEhuvFx 8h6yMZ+joBxei1AikO+S+eXFrFVJxCqCs46prNoipDISkDoMbm0R2d+Fz9L3fhqMXX16 JlSqkHW+rj96uEwvnicXLKQ3JnSldB4zGvQ8eh9jtb72HeoQp5j6DOHTLBMpl82zm9US gToA== 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:autocrypt :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=Jc2Uda7VwDJvbIKlzSommWP6A5buVHnd0nGl7cJoVAQ=; b=W9elt+D9yBoSEjsvNy0SjLi6soiOVvalj4sGiXU831tmnXBP3KJ9JUGZizYb9cJmaq kAYrj9sWCfamzXNPGAHNdCkqxQ9Z8XNyXhNSeZtFYJ+F9AnqAS72GoLbxZm2m+DdF/MG RvRgHVAjVTSdSe1yzWYyGjscDaaTS5sUp8jceUn/v2kQr/p3tpwnA5SWix4zOzR/HZ0f J+xf6NaMSflqhFX5n84w1yJaO/FgulnC3f93SJt4CfjPVdWwSX+lUv8IOpBuBNPR8fRo 514LbmVX05i84/fEYL+zHvjfVUI8KVPXjPgoSvSZ78Iop1Px0iusduILx/NWieaMjjX0 crcw== X-Gm-Message-State: ANhLgQ351wrFQD6HiipI26N00UVfthN9a84X6zK1iHwfq40XZnv2oHqA AXgJTKxdgf2qgzNa/Y8Aoc8= X-Received: by 2002:a63:a35a:: with SMTP id v26mr3491212pgn.40.1585144697197; Wed, 25 Mar 2020 06:58:17 -0700 (PDT) Received: from server.roeck-us.net ([2600:1700:e321:62f0:329c:23ff:fee3:9d7c]) by smtp.gmail.com with ESMTPSA id hg20sm407909pjb.3.2020.03.25.06.58.15 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 25 Mar 2020 06:58:16 -0700 (PDT) Subject: Re: [PATCH v2 1/2] hwmon: pmbus: adm1266: add support To: alexandru.tachici@analog.com, linux-hwmon@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org Cc: robh+dt@kernel.org References: <20200325130605.2420-1-alexandru.tachici@analog.com> <20200325130605.2420-2-alexandru.tachici@analog.com> From: Guenter Roeck Autocrypt: addr=linux@roeck-us.net; keydata= xsFNBE6H1WcBEACu6jIcw5kZ5dGeJ7E7B2uweQR/4FGxH10/H1O1+ApmcQ9i87XdZQiB9cpN RYHA7RCEK2dh6dDccykQk3bC90xXMPg+O3R+C/SkwcnUak1UZaeK/SwQbq/t0tkMzYDRxfJ7 nyFiKxUehbNF3r9qlJgPqONwX5vJy4/GvDHdddSCxV41P/ejsZ8PykxyJs98UWhF54tGRWFl 7i1xvaDB9lN5WTLRKSO7wICuLiSz5WZHXMkyF4d+/O5ll7yz/o/JxK5vO/sduYDIlFTvBZDh gzaEtNf5tQjsjG4io8E0Yq0ViobLkS2RTNZT8ICq/Jmvl0SpbHRvYwa2DhNsK0YjHFQBB0FX IdhdUEzNefcNcYvqigJpdICoP2e4yJSyflHFO4dr0OrdnGLe1Zi/8Xo/2+M1dSSEt196rXaC kwu2KgIgmkRBb3cp2vIBBIIowU8W3qC1+w+RdMUrZxKGWJ3juwcgveJlzMpMZNyM1jobSXZ0 VHGMNJ3MwXlrEFPXaYJgibcg6brM6wGfX/LBvc/haWw4yO24lT5eitm4UBdIy9pKkKmHHh7s jfZJkB5fWKVdoCv/omy6UyH6ykLOPFugl+hVL2Prf8xrXuZe1CMS7ID9Lc8FaL1ROIN/W8Vk BIsJMaWOhks//7d92Uf3EArDlDShwR2+D+AMon8NULuLBHiEUQARAQABzTJHdWVudGVyIFJv ZWNrIChMaW51eCBhY2NvdW50KSA8bGludXhAcm9lY2stdXMubmV0PsLBgQQTAQIAKw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rJXsy3cyIGqvg9os4rNkUWmrCfLLsZDHD8FnU mDW4+i+XlNFUPUYMrIKi9joBhu18ssf5i5Q= Message-ID: <742d3220-7a2c-d0a7-d286-7f71a5e78511@roeck-us.net> Date: Wed, 25 Mar 2020 06:58:15 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.4.1 MIME-Version: 1.0 In-Reply-To: <20200325130605.2420-2-alexandru.tachici@analog.com> Content-Type: text/plain; charset=utf-8 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 Hi, On 3/25/20 6:06 AM, alexandru.tachici@analog.com wrote: > From: Alexandru Tachici > > Add pmbus probing driver for the adm1266 Cascadable > Super Sequencer with Margin Control and Fault Recording. > Driver is using the pmbus_core, creating sysfs files > under hwmon for inputs: vh1->vh4 and vp1->vp13. > > Signed-off-by: Alexandru Tachici It looks like the driver is reduced to just standard functionality. Can you try just adding the device ID to pmbus.c ? Thanks, Guenter > --- > Documentation/hwmon/adm1266.rst | 35 +++++++++++++++++++ > drivers/hwmon/pmbus/Kconfig | 9 +++++ > drivers/hwmon/pmbus/Makefile | 1 + > drivers/hwmon/pmbus/adm1266.c | 62 +++++++++++++++++++++++++++++++++ > 4 files changed, 107 insertions(+) > create mode 100644 Documentation/hwmon/adm1266.rst > create mode 100644 drivers/hwmon/pmbus/adm1266.c > > diff --git a/Documentation/hwmon/adm1266.rst b/Documentation/hwmon/adm1266.rst > new file mode 100644 > index 000000000000..65662115750c > --- /dev/null > +++ b/Documentation/hwmon/adm1266.rst > @@ -0,0 +1,35 @@ > +Kernel driver adm1266 > +===================== > + > +Supported chips: > + * Analog Devices ADM1266 > + Prefix: 'adm1266' > + Datasheet: https://www.analog.com/media/en/technical-documentation/data-sheets/ADM1266.pdf > + > +Author: Alexandru Tachici > + > + > +Description > +----------- > + > +This driver supports hardware monitoring for Analog Devices ADM1266 sequencer. > + > +ADM1266 is a sequencer that features voltage readback from 17 channels via an > +integrated 12 bit SAR ADC, accessed using a PMBus interface. > + > +The driver is a client driver to the core PMBus driver. Please see > +Documentation/hwmon/pmbus for details on PMBus client drivers. > + > + > +Sysfs entries > +------------- > + > +The following attributes are supported. Limits are read-write, history reset > +attributes are write-only, all other attributes are read-only. > + > +inX_label "voutx" > +inX_input Measured voltage. > +inX_min Minimum Voltage. > +inX_max Maximum voltage. > +inX_min_alarm Voltage low alarm. > +inX_max_alarm Voltage high alarm. > diff --git a/drivers/hwmon/pmbus/Kconfig b/drivers/hwmon/pmbus/Kconfig > index a9ea06204767..3096e46e2212 100644 > --- a/drivers/hwmon/pmbus/Kconfig > +++ b/drivers/hwmon/pmbus/Kconfig > @@ -26,6 +26,15 @@ config SENSORS_PMBUS > This driver can also be built as a module. If so, the module will > be called pmbus. > > +config SENSORS_ADM1266 > + tristate "Analog Devices ADM1266" > + help > + If you say yes here you get hardware monitoring support for Analog > + Devices ADM1266 Cascadable Super Sequencer. > + > + This driver can also be built as a module. If so, the module will > + be called adm1266. > + > config SENSORS_ADM1275 > tristate "Analog Devices ADM1275 and compatibles" > help > diff --git a/drivers/hwmon/pmbus/Makefile b/drivers/hwmon/pmbus/Makefile > index 5feb45806123..ed38f6d6f845 100644 > --- a/drivers/hwmon/pmbus/Makefile > +++ b/drivers/hwmon/pmbus/Makefile > @@ -5,6 +5,7 @@ > > obj-$(CONFIG_PMBUS) += pmbus_core.o > obj-$(CONFIG_SENSORS_PMBUS) += pmbus.o > +obj-$(CONFIG_SENSORS_ADM1266) += adm1266.o > obj-$(CONFIG_SENSORS_ADM1275) += adm1275.o > obj-$(CONFIG_SENSORS_BEL_PFE) += bel-pfe.o > obj-$(CONFIG_SENSORS_IBM_CFFPS) += ibm-cffps.o > diff --git a/drivers/hwmon/pmbus/adm1266.c b/drivers/hwmon/pmbus/adm1266.c > new file mode 100644 > index 000000000000..c1df21d564f3 > --- /dev/null > +++ b/drivers/hwmon/pmbus/adm1266.c > @@ -0,0 +1,62 @@ > +// SPDX-License-Identifier: GPL-2.0 > +/* > + * ADM1266 - Cascadable Super Sequencer with Margin > + * Control and Fault Recording > + * > + * Copyright 2020 Analog Devices Inc. > + */ > + > +#include > +#include > +#include > +#include > +#include > + > +#include "pmbus.h" > + > +static int adm1266_probe(struct i2c_client *client, > + const struct i2c_device_id *id) > +{ > + struct pmbus_driver_info *info; > + u32 funcs; > + int i; > + > + info = devm_kzalloc(&client->dev, sizeof(struct pmbus_driver_info), > + GFP_KERNEL); > + > + info->pages = 17; > + info->format[PSC_VOLTAGE_OUT] = linear; > + funcs = PMBUS_HAVE_VOUT | PMBUS_HAVE_STATUS_VOUT; > + for (i = 0; i < info->pages; i++) > + info->func[i] = funcs; > + > + return pmbus_do_probe(client, id, info); > +} > + > +static const struct of_device_id adm1266_of_match[] = { > + { .compatible = "adi,adm1266" }, > + { }, > +}; > +MODULE_DEVICE_TABLE(of, adm1266_of_match); > + > +static const struct i2c_device_id adm1266_id[] = { > + { "adm1266", 0 }, > + { }, > +}; > +MODULE_DEVICE_TABLE(i2c, adm1266_id); > + > +static struct i2c_driver adm1266_driver = { > + .driver = { > + .name = "adm1266", > + .of_match_table = adm1266_of_match, > + }, > + .probe = adm1266_probe, > + .remove = pmbus_do_remove, > + .id_table = adm1266_id, > +}; > + > +module_i2c_driver(adm1266_driver); > + > +MODULE_AUTHOR("Alexandru Tachici "); > +MODULE_DESCRIPTION("PMBus driver for Analog Devices ADM1266"); > +MODULE_LICENSE("GPL v2"); >