Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp1936154pxk; Sat, 19 Sep 2020 07:06:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwQeXgteSzlGQMNXAktn++haF1AxQNpah9ChL3XjrzYaSMniraFR+ZduugN1oXqIbDQscO5 X-Received: by 2002:a17:906:3553:: with SMTP id s19mr39938252eja.178.1600524383769; Sat, 19 Sep 2020 07:06:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600524383; cv=none; d=google.com; s=arc-20160816; b=0wozSYB5pdehLgBgxpQOMhcnAy1OuOLNtAW6UtR2djr2shDa6icwov/RB00ynjRTxz nxBOj7H2RnZvRVK98jbZeA8bdRXAtiVxRVy3/W/dMd7XghxTMzxBlManIUBy62bHZB7w zZtWweUZ9dOf2eL/7EvomXH3Ob+WmdR/je98ys9xoK/gqUKLzERFMC1Z/RUDzUlNueMv K5SWS/4rqW222uHLqcTR0ktTI5//D3xhiA9jW5+xOMYcSv1SdQXjtjr+OQJbxyBZtEy/ kp4W0f5nfJZecDReUrFWvxDKWEQ7RYR9ertsKKAkKI0ejns2EaotDRZqo7zJBWLas+Va OfVg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :to:from:dkim-signature; bh=MLlNIek8Ejz3ZXqMS6P/mwbzF3PDqi3zTXSfJ0veRVs=; b=ue+QwLIe8SBz/n4PCIbqhpsUqvPm4ZesD+UCX2keiPq40TahlryU1vKu9Mb3lG2JSq AmwJu9XPZ8uP7Ft5vrRnFQf+rDaZ36E8/zjSNev4N+45ssNG74dfFIaijVKAkc0unzv8 Qsa/BfS6a69NEMo75qPUeLZN7kA6uDllkLSOppqDbSVfECti18n5l0HH7u9fY0G5pqrs nZL985wUmz6pofLW0h8R8yM0gKKTCE02jRIhFiASpfbOSfl2DuDB99RSgwpI1srCNUk2 +aL6xvejgsXXb9v5Lq8Bt93T9az0tUqE8K3ZhrL3fcN2GfLOo3aVii41ztR+U0WtDQwm w0Qg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=mct18cNM; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x23si4022935ejb.588.2020.09.19.07.05.59; Sat, 19 Sep 2020 07:06:23 -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=@kernel.org header.s=default header.b=mct18cNM; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726551AbgISOEq (ORCPT + 99 others); Sat, 19 Sep 2020 10:04:46 -0400 Received: from mail.kernel.org ([198.145.29.99]:41528 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726159AbgISOEm (ORCPT ); Sat, 19 Sep 2020 10:04:42 -0400 Received: from localhost.localdomain (unknown [194.230.155.191]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 0359421707; Sat, 19 Sep 2020 14:04:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600524281; bh=G1rBETN5Htd6dGPg5Ma1dHWDGClo+P7ZqLA4Y4JKMW4=; h=From:To:Subject:Date:In-Reply-To:References:From; b=mct18cNMGz1DOsX6T2NsZg+aCRVHuh14skQESopDPlN3pj3+XQSSMy0VSmxj+HW5V mzOrM1S49k/rViDGj95PXIhFP+FVGsFOrqLRHJrAX5f8+DPQRg8uiBY0qdNWXeYmPu v0TJx+K4j4D8aMYPptAci8jjmQVyV7zc9DEXlrxE= From: Krzysztof Kozlowski To: Sebastian Reichel , Rob Herring , =?UTF-8?q?Pali=20Roh=C3=A1r?= , Dan Murphy , Krzysztof Kozlowski , linux-pm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 4/6] power: supply: bq27xxx: add separate flag for single SoC register Date: Sat, 19 Sep 2020 16:04:16 +0200 Message-Id: <20200919140418.3705-5-krzk@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200919140418.3705-1-krzk@kernel.org> References: <20200919140418.3705-1-krzk@kernel.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org bq27000, bq27010 and upcoming bq34z100 have a single byte SoC register. However except this similarity, bq34z100 is quite different than bq27000/bq27010, so flag BQ27XXX_O_ZERO cannot be reused here. Add a new bit flag describing that SoC is a single byte register. No functional change for bq27000 and bq27010. Signed-off-by: Krzysztof Kozlowski --- drivers/power/supply/bq27xxx_battery.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/power/supply/bq27xxx_battery.c b/drivers/power/supply/bq27xxx_battery.c index e971af43dd45..88cdad0ecb08 100644 --- a/drivers/power/supply/bq27xxx_battery.c +++ b/drivers/power/supply/bq27xxx_battery.c @@ -855,6 +855,7 @@ static struct bq27xxx_dm_reg bq27621_dm_regs[] = { #define BQ27XXX_O_CFGUP BIT(3) #define BQ27XXX_O_RAM BIT(4) #define BQ27Z561_O_BITS BIT(5) +#define BQ27XXX_O_SOC_SI BIT(6) /* SoC is single register */ #define BQ27XXX_DATA(ref, key, opt) { \ .opts = (opt), \ @@ -872,8 +873,8 @@ static struct { enum power_supply_property *props; size_t props_size; } bq27xxx_chip_data[] = { - [BQ27000] = BQ27XXX_DATA(bq27000, 0 , BQ27XXX_O_ZERO), - [BQ27010] = BQ27XXX_DATA(bq27010, 0 , BQ27XXX_O_ZERO), + [BQ27000] = BQ27XXX_DATA(bq27000, 0 , BQ27XXX_O_ZERO | BQ27XXX_O_SOC_SI), + [BQ27010] = BQ27XXX_DATA(bq27010, 0 , BQ27XXX_O_ZERO | BQ27XXX_O_SOC_SI), [BQ2750X] = BQ27XXX_DATA(bq2750x, 0 , BQ27XXX_O_OTDC), [BQ2751X] = BQ27XXX_DATA(bq2751x, 0 , BQ27XXX_O_OTDC), [BQ2752X] = BQ27XXX_DATA(bq2752x, 0 , BQ27XXX_O_OTDC), @@ -1420,7 +1421,7 @@ static int bq27xxx_battery_read_soc(struct bq27xxx_device_info *di) { int soc; - if (di->opts & BQ27XXX_O_ZERO) + if (di->opts & BQ27XXX_O_SOC_SI) soc = bq27xxx_read(di, BQ27XXX_REG_SOC, true); else soc = bq27xxx_read(di, BQ27XXX_REG_SOC, false); -- 2.17.1