Received: by 10.223.176.5 with SMTP id f5csp251184wra; Tue, 30 Jan 2018 10:54:30 -0800 (PST) X-Google-Smtp-Source: AH8x225llqQwXMCemAolMLchzevfq+5CF8gFIvJt/1dGFobIk9aDJHA5KOgGD8uSnuZqFLOLpxGO X-Received: by 10.99.123.74 with SMTP id k10mr24235337pgn.165.1517338470299; Tue, 30 Jan 2018 10:54:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517338470; cv=none; d=google.com; s=arc-20160816; b=oYITaQtkLGdDPPF3dNiFcbxi3CLk1Azl4M8FEL6WqI06yIpB+MRVvxVRqM4u/eZEah xojRMFyXK32dQub8xxHVh2IyNsNykaS9WIjntUJjURqPoCaGT9J2Rx2PpcZGnb7CejpD w1/D+5HBmadh/uwXPVhKUxdPJIp8pbdSdI4FIF1KAiXb9yyNlkmFNryPbMCM9vwIgzbS 5FY1CzGbSUx//MG8Tlcr8DH/AeFoCQnW1kPGBWIo+dg9qpSkhNCClFvWUsCGMSWge+17 Nw4Zk63xzfYVWufZBKd2Au4VeZLxFlx1lEGsEjqxXtk/rsiv1M3DaeFQXpFnrJP7pPPe kE3A== 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=hiRCmG3K0610N3CrJmWPnp8JoKJQISfpZvf/2FDD7ow=; b=xlYnYaI6edZIaV16DVXgxjeYwUxdo3TJlqmft8CaI75lyx2zhtc2b21D+Bs213ZzCq vROyM5GBXj6fMbTrD078NLOeQ8qUqS3VvP/x385M8bqIaTPvRo6rRlpBdauPv9jewvpu RClOyoQ8pvHLMffi6BA9nCnBEdlTuuJc7ZcESgBTn99GR1VlwAK1bTcPSVXlMUAgMBDm cqYGApbqK2WFs5jilRyfiaO4RlUl6fieQf7xXn0VoI3N6yOv/OszNjp2vp0PEWL7qpF2 mXF6zi45HcJHE2dn+3Mi2gbcbJum3vP4JrMGtPTSA2+9JJUIoCiNywDZBMn/rc/nnTIf ntYQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=WzlAtQTU; 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=NONE 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 w23-v6si12034218plk.537.2018.01.30.10.54.15; Tue, 30 Jan 2018 10:54:30 -0800 (PST) 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=WzlAtQTU; 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=NONE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752772AbeA3Swm (ORCPT + 99 others); Tue, 30 Jan 2018 13:52:42 -0500 Received: from mail-wr0-f194.google.com ([209.85.128.194]:44158 "EHLO mail-wr0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752358AbeA3Swk (ORCPT ); Tue, 30 Jan 2018 13:52:40 -0500 Received: by mail-wr0-f194.google.com with SMTP id v31so12313374wrc.11; Tue, 30 Jan 2018 10:52:39 -0800 (PST) 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=hiRCmG3K0610N3CrJmWPnp8JoKJQISfpZvf/2FDD7ow=; b=WzlAtQTUXt3kqNh1OC2liJYPx1vZu9NwTuTf1IZzZTy6gFoXp2i8MKQeKBvfd0g3ds S/pXjWcHFh97MpI1UCbTAgBpYSJnSUGU++FgnxPOMjj+o7hBsn9yuLyZ7U1IqqpGJNsH C+kPWiqp2p34eUOCuJCpGjW8p3h5YA30fGWY9I5dslkm2+gNB1em/dypr+XcPbnMtUHe 6KaFHJOGWC5cZjH2yhN+U9sDljkRPOsi42EaCSHc1+9oK/5ZD7kO5N0Mze4K3hCLZQCz 9f8AjsL2EYvMJpZrLQshSpAhS0KW22SMiKcJTaMozleoj2mXfL4zBobRRUsP6/utfrKF m8dQ== 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=hiRCmG3K0610N3CrJmWPnp8JoKJQISfpZvf/2FDD7ow=; b=tciBM8MtGdctrFfdQALdErkEE7Aeu3SjiB1rDgGq/T5EnRPkmIs5AsjoPlHDjhuzQb J0eWiyZV0r9KsKfOXgsNeNnQY1Ed+aQhdj0MCS3nZCqPbzDwjLF8cyDGEspVThYluRai WZ8/h/7GkvhG8JX/1YKeakXJq6XxIycjaPaO25/nnM01I27fsGAb6pfwGV1xL/5YDpip Pj3asEF9L9WwrlPW7HMwfxsm6Jxg9/QZP2sFj8WTnJdI+2Ta+h/Lm5pEfFnlbuPaFw/P nBl0aEQNmJ3QCoMYWjQ5B8k3YKltG5rH2Q5C3MxLLWdZAOHExjlgkos0DbjP41Ty2SYg FtYQ== X-Gm-Message-State: AKwxytepiHn2pBa+nTyR2stN4lO1gOcQLd1sYO58/m7DEME0218dz3Ie 9UvYF8VYCILp/8hNr86AI8+P/g== X-Received: by 10.223.133.103 with SMTP id 94mr24377944wrh.266.1517338358758; Tue, 30 Jan 2018 10:52:38 -0800 (PST) Received: from pali ([2a02:2b88:2:1::5cc6:2f]) by smtp.gmail.com with ESMTPSA id d125sm20222910wmc.47.2018.01.30.10.52.37 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 30 Jan 2018 10:52:37 -0800 (PST) Date: Tue, 30 Jan 2018 19:52:37 +0100 From: Pali =?utf-8?B?Um9ow6Fy?= To: Liu Xiang Cc: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, sre@kernel.org, afd@ti.com Subject: Re: [PATCH] power: supply: bq27xxx: Add bq27411 support Message-ID: <20180130185237.mguuclb4t5th7fcq@pali> References: <1517063136-23210-1-git-send-email-liu.xiang6@zte.com.cn> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="3lqdsanpnwr5q5ef" Content-Disposition: inline In-Reply-To: <1517063136-23210-1-git-send-email-liu.xiang6@zte.com.cn> User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --3lqdsanpnwr5q5ef Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Saturday 27 January 2018 22:25:36 Liu Xiang wrote: > According to the datasheet, bq27411 is similar to bq27421. >=20 > Signed-off-by: Liu Xiang > --- > drivers/power/supply/bq27xxx_battery.c | 14 ++++++++++++++ > include/linux/power/bq27xxx_battery.h | 3 ++- > 2 files changed, 16 insertions(+), 1 deletion(-) >=20 > diff --git a/drivers/power/supply/bq27xxx_battery.c b/drivers/power/suppl= y/bq27xxx_battery.c > index 51f0961..2de378a 100644 > --- a/drivers/power/supply/bq27xxx_battery.c > +++ b/drivers/power/supply/bq27xxx_battery.c > @@ -410,6 +410,7 @@ enum bq27xxx_reg_index { > #define bq27425_regs bq27421_regs > #define bq27441_regs bq27421_regs > #define bq27621_regs bq27421_regs > +#define bq27411_regs bq27421_regs > =20 > static enum power_supply_property bq27000_props[] =3D { > POWER_SUPPLY_PROP_STATUS, > @@ -633,6 +634,7 @@ enum bq27xxx_reg_index { > #define bq27425_props bq27421_props > #define bq27441_props bq27421_props > #define bq27621_props bq27421_props > +#define bq27411_props bq27421_props > =20 > struct bq27xxx_dm_reg { > u8 subclass_id; > @@ -716,6 +718,17 @@ enum bq27xxx_dm_reg_id { > #define bq27621_dm_regs 0 > #endif > =20 > +#if 0 /* not yet tested */ > +static struct bq27xxx_dm_reg bq27411_dm_regs[] =3D { > + [BQ27XXX_DM_DESIGN_CAPACITY] =3D { 82, 10, 2, 0, 32767 }, > + [BQ27XXX_DM_DESIGN_ENERGY] =3D { 82, 12, 2, 0, 32767 }, > + [BQ27XXX_DM_TERMINATE_VOLTAGE] =3D { 82, 16, 2, 2800, 3700 }, > +}; > +#else > +#define bq27411_dm_regs 0 > +#endif Can you test it? I do not think it is a good idea to add dead code into mainline kernel. > + > + > #define BQ27XXX_O_ZERO 0x00000001 > #define BQ27XXX_O_OTDC 0x00000002 > #define BQ27XXX_O_UTOT 0x00000004 > @@ -762,6 +775,7 @@ enum bq27xxx_dm_reg_id { > [BQ27425] =3D BQ27XXX_DATA(bq27425, 0x04143672, BQ27XXX_O_UTOT | BQ= 27XXX_O_CFGUP), > [BQ27441] =3D BQ27XXX_DATA(bq27441, 0x80008000, BQ27XXX_O_UTOT | BQ= 27XXX_O_CFGUP | BQ27XXX_O_RAM), > [BQ27621] =3D BQ27XXX_DATA(bq27621, 0x80008000, BQ27XXX_O_UTOT | BQ= 27XXX_O_CFGUP | BQ27XXX_O_RAM), > + [BQ27411] =3D BQ27XXX_DATA(bq27411, 0x80008000, BQ27XXX_O_UTOT | BQ= 27XXX_O_CFGUP | BQ27XXX_O_RAM), > }; > =20 > static DEFINE_MUTEX(bq27xxx_list_lock); > diff --git a/include/linux/power/bq27xxx_battery.h b/include/linux/power/= bq27xxx_battery.h > index e6187f5..5f48eb0 100644 > --- a/include/linux/power/bq27xxx_battery.h > +++ b/include/linux/power/bq27xxx_battery.h > @@ -23,10 +23,11 @@ enum bq27xxx_chip { > BQ27546, > BQ27742, > BQ27545, /* bq27545 */ > - BQ27421, /* bq27421, bq27425, bq27441, bq27621 */ > + BQ27421, /* bq27421, bq27425, bq27441, bq27621, bq27411 */ > BQ27425, > BQ27441, > BQ27621, > + BQ27411, > }; > =20 > struct bq27xxx_device_info; --=20 Pali Roh=C3=A1r pali.rohar@gmail.com --3lqdsanpnwr5q5ef Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EABECAB0WIQS4VrIQdKium2krgIWL8Mk9A+RDUgUCWnC+8QAKCRCL8Mk9A+RD UqaOAJ9oliRhLbx12jInQv7sm2zJVyE1CACfUr4jFo6fCEmfy5G7yNLXtU8Oafs= =VsNL -----END PGP SIGNATURE----- --3lqdsanpnwr5q5ef--