Received: by 2002:a25:ca44:0:0:0:0:0 with SMTP id a65csp325972ybg; Tue, 28 Jul 2020 07:06:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxG4AUSE/QNl+XhwogoXCZPiNYCZq7cZ7xN+MpYZ4mffkxOtut9DmzM9RnkjlwLaN7jmEw+ X-Received: by 2002:a17:906:403:: with SMTP id d3mr8412551eja.522.1595945174785; Tue, 28 Jul 2020 07:06:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595945174; cv=none; d=google.com; s=arc-20160816; b=bqLJX+WLRL2bpzFXDfSsbSNs9XzhriU/vqgXwHTsrZMXTFZPv+x+3q7gD9ZbsipNzm XRDFu8Nq5MHnUhPABrEPoQeluayVn+oa9lAdoPJ0OQqdvw6dJXFEfbOsj3F1wIDk9GzH 8Ys9ZAvETe6rhK1AC8FYa597+q3ZpxyZ8H9327gKRWHTQwbpE/L9n+PVqLC6EGxtfnov pLX591AVEha8f6jlK1sXchCi4rOyL9oqP1j0zCbgKcCUfn9vZoVsi/Z80Wijjq/H+0kG 8JHj8VfRQXQ8V2xWSrIa8y5FATcVQeKlytbBBZ5Y4skhA96xPRw0jGo9EUSzOHZgP8rg 6byA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=XRCyFICfAbzoSRKBaeClzmOc5bpzSUxQPEJq6VvvJi8=; b=hhIePn8qh6LSf2/HjrE+ybv5YNFP4hAJasiK5OJhPT3vH/S4Lxj58EECI41u5DZOYE AR5IEjFdBtXd48yRQf649rNUsBq7Vip4aNKZ1WAsND3LFDETMXDb25vnWqlCbl2lAAgG 9TQ11mP+LycFDVY2uBfoXM+q0MxQ1MRO4XUWTUX00iaKcQYmzAe2yuC0o5JXfrAkWQuc nHB7nDylLgl35Cx8r8dP81FsDS//szIAKilKoHBOx+jgGNsBPSkS2KOYTvpKL5BYXhVV 9TtN2nq6f6nJkEYmm9TAlXsn84fRDs/PPA77Vra7L6wpB46gFMp5VXnZByU1s5Przh4w YSmw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=LdI8BzQj; 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; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i5si5709368edn.13.2020.07.28.07.05.50; Tue, 28 Jul 2020 07:06:14 -0700 (PDT) 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=@ti.com header.s=ti-com-17Q1 header.b=LdI8BzQj; 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; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730300AbgG1OEP (ORCPT + 99 others); Tue, 28 Jul 2020 10:04:15 -0400 Received: from lelv0142.ext.ti.com ([198.47.23.249]:58244 "EHLO lelv0142.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730211AbgG1OEP (ORCPT ); Tue, 28 Jul 2020 10:04:15 -0400 Received: from fllv0034.itg.ti.com ([10.64.40.246]) by lelv0142.ext.ti.com (8.15.2/8.15.2) with ESMTP id 06SE4D6C110713; Tue, 28 Jul 2020 09:04:13 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1595945053; bh=XRCyFICfAbzoSRKBaeClzmOc5bpzSUxQPEJq6VvvJi8=; h=Subject:To:CC:References:From:Date:In-Reply-To; b=LdI8BzQj93XvNZkZ4d4oESBsQm56cgloU20cB8l7PycNEa3+0aQqKRs0t3l667Hdv OnvPzyHESd0qTXUbz4bDMZFJKl8zP3o2HbwYRvOEPxHN2qGnV5UuopVDlI8HDPchXP QOo5hNE1gGSE2sqqHtxkJaNbzO32ABIypk1bDxfM= Received: from DLEE112.ent.ti.com (dlee112.ent.ti.com [157.170.170.23]) by fllv0034.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 06SE4Dvx057786 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 28 Jul 2020 09:04:13 -0500 Received: from DLEE114.ent.ti.com (157.170.170.25) by DLEE112.ent.ti.com (157.170.170.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1979.3; Tue, 28 Jul 2020 09:04:13 -0500 Received: from lelv0326.itg.ti.com (10.180.67.84) by DLEE114.ent.ti.com (157.170.170.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1979.3 via Frontend Transport; Tue, 28 Jul 2020 09:04:13 -0500 Received: from [10.250.35.192] (ileax41-snat.itg.ti.com [10.172.224.153]) by lelv0326.itg.ti.com (8.15.2/8.15.2) with ESMTP id 06SE4D1n101658; Tue, 28 Jul 2020 09:04:13 -0500 Subject: Re: [PATCH v3 2/4] power: supply: bq27xxx_battery: Add the BQ27561 Battery monitor To: Sebastian Reichel CC: , , , , , References: <20200721163206.25438-1-dmurphy@ti.com> <20200721163206.25438-2-dmurphy@ti.com> <20200727223646.vjnkyrmipwin3pj6@earth.universe> From: Dan Murphy Message-ID: Date: Tue, 28 Jul 2020 09:04:08 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <20200727223646.vjnkyrmipwin3pj6@earth.universe> Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Sebastian On 7/27/20 5:36 PM, Sebastian Reichel wrote: > Hi, > > On Tue, Jul 21, 2020 at 11:32:04AM -0500, Dan Murphy wrote: >> Add the Texas Instruments BQ27561 battery monitor. The register address >> map is laid out the same as compared to other devices within the file. >> The battery status register has differing bits to determine if the >> battery is full, discharging or dead. >> >> Signed-off-by: Dan Murphy >> --- > Looks mostly good to me, but > > [...] > >> @@ -1710,6 +1769,13 @@ static int bq27xxx_battery_capacity_level(struct bq27xxx_device_info *di, >> level = POWER_SUPPLY_CAPACITY_LEVEL_CRITICAL; >> else >> level = POWER_SUPPLY_CAPACITY_LEVEL_NORMAL; >> + } else if (di->opts & BQ27561_O_BITS) { >> + if (di->cache.flags & BQ27561_FLAG_FC) >> + level = POWER_SUPPLY_CAPACITY_LEVEL_FULL; >> + else if (di->cache.flags & BQ27561_FLAG_DIS_CH) >> + level = POWER_SUPPLY_CAPACITY_LEVEL_CRITICAL; > Shouldn't this be checking for FLAG_FDC instead of FLAG_DIS_CH? Yes. Dan > -- Sebastian