Received: by 10.213.65.68 with SMTP id h4csp849933imn; Sat, 7 Apr 2018 11:00:21 -0700 (PDT) X-Google-Smtp-Source: AIpwx4884R1V5WfIJGx9eyEuJrInPWZdpGxHJETnwTVHf1OzsVBga1PBbmU+0qysrVgeoBEsXzbl X-Received: by 2002:a17:902:b212:: with SMTP id t18-v6mr3080438plr.137.1523124021058; Sat, 07 Apr 2018 11:00:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523124021; cv=none; d=google.com; s=arc-20160816; b=kwX9U7F4UfLc6sApfEg5bcxTA6ipD1/pTEfJ5RaBrvE48ONl9zTo2S9OMTePHO75QG GKTKvUgznJknkG0qUtH7ZUhBV1fD0KO3p7J3R5LIj6LHnH2sgvln4xaJJozH7fxMRwAs eKdIT086pB9CvotvT9HBF/U0hxjnGFBoB6xxyJ1JGl20/wXlB7lXvBSsQ9nX8Q2mhoe1 oZg0xXJgVWNRt3ObJZWSGKIddlTej9+YGj2IW4jsEtwPVGa6cjhQ+7Jbig2Ehm+LZeEo tHfzY3Mw85OQ6jMPWohO3BCDVfMNIOwhnSOj8/AHZtmWUvx6SGD5KJ5+XNF42wCIc8AM gQBg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=7Npr3hkZ8jRWFYLzcZN54YgQ+ZRXThvheRDnsoDgoUA=; b=xcBB8e0gH7NsgbEGUCxhzXGuBb2UZaRpnMoW5SkEpfDUX+vU8XFdUYaiBlHbRST8sp cvx+QlD7wA5GI5bjpQ+4gbYln1knp6pZS6XDJ1EsF7/G+49LeRUo/hGkigSFBIcYR6NZ iXXEV47INCI2cODiHbPLc0K5UjFwVaghhfY6goiLfaPT9uyHESCJXpgCVQQ8HywwyIaA HmgABRBZQAGStaPK/2sx6n/MeuKVS5e3vxyG+erqa1Co6wa5vF1ue3K2NwjSwPssktOj hbBs73yO6yZnq6QrUshvToHKPJemJ5Sb6SM5vCicOL52dSYuxb0y3QITP+3GUu6gWLB0 i2KA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=vg5wZyFm; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y70si9999017pfg.121.2018.04.07.10.58.51; Sat, 07 Apr 2018 11:00:21 -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=@gmail.com header.s=20161025 header.b=vg5wZyFm; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751849AbeDGRyI (ORCPT + 99 others); Sat, 7 Apr 2018 13:54:08 -0400 Received: from mail-wr0-f194.google.com ([209.85.128.194]:42890 "EHLO mail-wr0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751482AbeDGRyG (ORCPT ); Sat, 7 Apr 2018 13:54:06 -0400 Received: by mail-wr0-f194.google.com with SMTP id s18so4332106wrg.9; Sat, 07 Apr 2018 10:54:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=7Npr3hkZ8jRWFYLzcZN54YgQ+ZRXThvheRDnsoDgoUA=; b=vg5wZyFmkDwISePPLElw6lr/9/pErpAjlnH7GEwQjqPQ0f/mJw1fMQn8joCKcizWEQ 99MRPSIe6ScoKsNFjFLMr/Hvor/L7U4FM1xOfni/7W9AMjDDev6nuO31L5gDFxLAqYy6 0cJX6wPYNWqbLezXQq88yhW9ijaV4HRTF7cy7UuGIox1AoQA1Vy9vu5DwQo1jbnisf77 2NWs/Jrh9c++mS/v3I+UfcW3dbxZqsWyQvD2Z9XogWncYWOQIgjiv2HQAADVTBHzx4+B A43BBVIz/pChB1pdVz9EZrI/LR42V18mG8Km89dZZnY8+wa3L5zZBX9ehnfk4mwSrN0j j4Aw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=7Npr3hkZ8jRWFYLzcZN54YgQ+ZRXThvheRDnsoDgoUA=; b=eUQh7FLUlg0gUgAHCqCjlxPbEU7W+XuxuCyjSfWj6ubYBPfsW1+W/uvced0MyWwqcW lushBRdcV8CeLVu9KKUsQej9BYJKTrUVkNUVn2Cs/soenVtk0fP2laC2znLfEGD4W/dv LZSsHylCDzPkaoUA6AJNpXhVL2S2rPpviLcWkAYh39Re7q3qltuwQH44MkfusUKHWORs YqTZjXSgKOLm6i8vv8FJyPDYCDXIFV/EmK6IUusw0LzVhkM6gT9jDGICMnMikIwigzKv rQ3eorHxLrkZe9IyuUBJjg0Ddt60BO2eCFoFsMdM+xzk+PMzCxR5h88saJDQeIcZVYGv A+iQ== X-Gm-Message-State: AElRT7HcJv1VwVEelKxOa/VU7F7yBZIw2J2wYXTXfCEv0Dq6JaummDUl FmFlg3R36hoAqJ2tE8UdYA== X-Received: by 10.223.184.234 with SMTP id c39mr20726695wrg.67.1523123644532; Sat, 07 Apr 2018 10:54:04 -0700 (PDT) Received: from arch.home (host86-177-67-114.range86-177.btcentralplus.com. [86.177.67.114]) by smtp.gmail.com with ESMTPSA id o23sm21788312wrf.93.2018.04.07.10.54.03 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 07 Apr 2018 10:54:04 -0700 (PDT) Date: Sat, 7 Apr 2018 18:54:01 +0100 From: Craig Tatlor To: Randy Dunlap Cc: linux-arm-msm@vger.kernel.org, Sebastian Reichel , Rob Herring , Mark Rutland , Mauro Carvalho Chehab , "David S. Miller" , Greg Kroah-Hartman , Linus Walleij , Andrew Morton , linux-pm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v3 1/3] power: supply: Add support for the Qualcomm Battery Monitoring System Message-ID: <20180407175401.GA28199@arch.home> References: <20180407135934.26122-1-ctatlor97@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Apr 07, 2018 at 09:37:21AM -0700, Randy Dunlap wrote: > On 04/07/2018 06:59 AM, Craig Tatlor wrote: > > This patch adds a driver for the BMS (Battery Monitoring System) > > block of the PM8941 PMIC, it uses a lookup table defined in the > > device tree to generate a capacity from the BMS supplied OCV, it > > then ammends the coulomb counter to that to increase the accuracy > > of the estimated capacity. > > > > Signed-off-by: Craig Tatlor > > --- > > drivers/power/supply/Kconfig | 9 + > > drivers/power/supply/Makefile | 1 + > > drivers/power/supply/qcom_bms.c | 500 ++++++++++++++++++++++++++++++++ > > 3 files changed, 510 insertions(+) > > create mode 100644 drivers/power/supply/qcom_bms.c > > > diff --git a/drivers/power/supply/qcom_bms.c b/drivers/power/supply/qcom_bms.c > > new file mode 100644 > > index 000000000000..5aa6e906d1b9 > > --- /dev/null > > +++ b/drivers/power/supply/qcom_bms.c > > @@ -0,0 +1,500 @@ > > Hi, Hey > > > +static unsigned int between(int left, int right, int val) > > +{ > > + if (left <= val && val >= right) > > maybe double-check those if() conditions? > [or I need my morning coffee] Yeah, they are wrong, will fix. > > > + return 1; > > + > > + return 0; > > +} > > thanks, > -- > ~Randy