Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp389300pxu; Thu, 7 Jan 2021 07:32:45 -0800 (PST) X-Google-Smtp-Source: ABdhPJzA9c3wnu1KFDRdIDfmqpIu0mnY8MipU15mBWgsfSS9j2NPE203b0u04wdHX9Ud4WhRX9au X-Received: by 2002:a17:906:3999:: with SMTP id h25mr6840316eje.146.1610033565274; Thu, 07 Jan 2021 07:32:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610033565; cv=none; d=google.com; s=arc-20160816; b=Xbn0ONJTjQwxlRnWNuhS31zk/gilWfEsKhaIEYx+l6bXtxA45z7DPVaw9lQLLug/Lu 24Ei4c/ulz+4k6N9BSaOjGvtdKYPJn0w+2HKyUBhlucpr3KIjKWjxuP6x5KjM/Ogc0zR D8MYtluHkcN10becQX+MgP/V8WRD7jxzkzmkVHskJEwbOl5IkO0atBGk9Zp54IGjgR6D 0e7vD1phv6i1kWTsknj4Ij/baDdQIhlvC9m49AE5ttID/Hky4ENUgmS9H2NRY7rvbnnr 9hOJ5tVf8H8sJlJpEiWpewHINbdpVmoJfWWjnPj+m1f1ivlSBdhf4j9d4qZ8LljUEPr1 DSng== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:sender :dkim-signature; bh=4LDT2sH0B+UBh7Y3dMo9WT33hdKEn5IEUpEgVUr2to0=; b=jgH6pSIJbPRkLmAZL4B86iMtnNbcPT7Afjy3MkVnKCw6s0hJ71375NhCqbx01Ta2FV 35vImSnB7ZfdCwpGPJnATrPdTpX5SwnycpOZ6rbJ34ciYtmiltfpJimRN3I3PaMyMXNH 1IQClanggCV8CYTCG4p1bGkjSy7NGNKLKhHtDDkJGbv+JxLeuD6yMZ3Bpld8vJE9eTX/ NbfahKfyCJwlWIjDhhizxC9tCIwHTp8tGis/urOhp8sUk0gwtaLP7N6jme9jPlQMw5wR fs/8r4aZXYksvIaH28epcOnX0WBRbGlEyp2SNcsA+nirI2qoWcjaWxLoiMU3mG40Zo0G VVjg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=eSDoQXF9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id o21si2334359edr.305.2021.01.07.07.32.21; Thu, 07 Jan 2021 07:32:45 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=eSDoQXF9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728445AbhAGP2z (ORCPT + 99 others); Thu, 7 Jan 2021 10:28:55 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37278 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728355AbhAGP2y (ORCPT ); Thu, 7 Jan 2021 10:28:54 -0500 Received: from mail-oo1-xc36.google.com (mail-oo1-xc36.google.com [IPv6:2607:f8b0:4864:20::c36]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 851DAC0612F4; Thu, 7 Jan 2021 07:28:14 -0800 (PST) Received: by mail-oo1-xc36.google.com with SMTP id x23so1654950oop.1; Thu, 07 Jan 2021 07:28:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=4LDT2sH0B+UBh7Y3dMo9WT33hdKEn5IEUpEgVUr2to0=; b=eSDoQXF9dd+bZAgLgivUW84lcUKnPknMnMPzXqpVwlt9FICQUTnRIwAZjMhjmNOh4Y 7t77rMfcBLVOKCUOkQaRjBG6hLh8/CW6YZVYB44TTTX68wEnMprjlJEStRc/OAqUlHk2 NLU7bO3TQe8Dm9kCASettdgomFNaQZt82vBnbTAxfLdqSutePRGqqAtIz4ckJGCZjZRf PG8gIXzYMZxds/HFibVFDXdQ+v6U213XHfLsibUqEbVqYXTGNa3iCQ+cM3Ck4Xy17Rji tYEpzE8POOovZPbfOyuk/xGw/47XSynbeXI73+lJudtgDkdxnFyg5HEMyDwZ5K4NZ3pn cE6A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=4LDT2sH0B+UBh7Y3dMo9WT33hdKEn5IEUpEgVUr2to0=; b=liiGPwLKYPBq6EfjfOuodwPY1w2jmi0KVjf1d7NsCwuAZiaf9zpZBYW0nqxEUItGie b3/igq3nxUabtmDqmIIo2/Mbfx7pcbZTznjJEkEyG+msIene2LBhY5DBq7qD+YboDmEK 2M7XhCCjqUBkllYdkUMMi1G6pjqBQL4GKsTk0wxIH3iyeh5G6eGelNHmrXUPUFjfW6EP pbybwfuKoVNswf/LL9ncF72lGq0l10r7socMRF4248mPKyvM47cpK1Wfik8abrWuOIya y+2KPgZGLZz2tpIpxRQicbJyK/IojT4B0HjTEhynb6wNiwl6K2Tteu6xyneLSLvK+Zi0 /s0w== X-Gm-Message-State: AOAM533DTDDAkXcKtG0dvcmDYQBIc5dnQONxsIy3jhjqmkH7SjWRYPsa t5GwSLKu2DHPvuZwcVR5dBs= X-Received: by 2002:a4a:ded4:: with SMTP id w20mr1440491oou.49.1610033293863; Thu, 07 Jan 2021 07:28:13 -0800 (PST) Received: from localhost ([2600:1700:e321:62f0:329c:23ff:fee3:9d7c]) by smtp.gmail.com with ESMTPSA id y65sm1327187oie.39.2021.01.07.07.28.12 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 07 Jan 2021 07:28:13 -0800 (PST) Sender: Guenter Roeck Date: Thu, 7 Jan 2021 07:28:11 -0800 From: Guenter Roeck To: Alexandru Ardelean Cc: linux-hwmon@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, robh+dt@kernel.org, jdelvare@suse.com, mark.thoren@analog.com, ardeleanalex@gmail.com Subject: Re: [PATCH v3 0/4] hwmon: (ltc2945): add support for sense resistor Message-ID: <20210107152811.GD13040@roeck-us.net> References: <20210107103417.16010-1-alexandru.ardelean@analog.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210107103417.16010-1-alexandru.ardelean@analog.com> User-Agent: Mutt/1.9.4 (2018-02-28) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jan 07, 2021 at 12:34:13PM +0200, Alexandru Ardelean wrote: > Changeset adds support for sense resistor. > > Changelog v2 -> v3: > * https://lore.kernel.org/linux-hwmon/20201111091259.46773-1-alexandru.ardelean@analog.com/ > * dropped patch 'docs: hwmon: (ltc2945): change type of val to ULL in ltc2945_val_to_reg()' > * add patch 'hwmon: (ltc2945): clamp values before converting' > * for patch 'hwmon: (ltc2945): add support for sense resistor' > - sense-resistor is represented in milli-ohms internally; this > risks of any other potential overflows with the multiplication to > 1000; the scaling in the driver becomes simpler, but we can't allow > a lower resistor value that 1 mOhm, and all resistor values > need to be integer in mOhm. > - added max power and max amps limits, adjusted to sense resistor > * for patch 'dt-bindings: hwmon: ltc2945: add device tree doc for ltc2945 ' > added 'Reviewed-by: Rob Herring ' > > Alexandru Ardelean (4): > hwmon: (ltc2945): wrap regmap into an ltc2945_state struct > hwmon: (ltc2945): clamp values before converting > hwmon: (ltc2945): add support for sense resistor > dt-bindings: hwmon: ltc2945: add device tree doc for ltc2945 > As mentioned in patch 3/3, this series solves a generic problem affecting all hwmon drivers, but it only solves it for one of those drivers. We should work on a generic solution (in-kernel scaling) instead, one that works for all hwmon drivers, not just one. Thanks, Guenter > .../bindings/hwmon/adi,ltc2945.yaml | 49 +++++++ > drivers/hwmon/ltc2945.c | 128 +++++++++++++++--- > 2 files changed, 156 insertions(+), 21 deletions(-) > create mode 100644 Documentation/devicetree/bindings/hwmon/adi,ltc2945.yaml > > -- > 2.17.1 >