[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20171109212945.2sgu56zkse7nbzo3@pali>
Date: Thu, 9 Nov 2017 22:29:45 +0100
From: Pali Rohár <pali.rohar@...il.com>
To: Pavel Machek <pavel@....cz>
Cc: sre@...nel.org, kernel list <linux-kernel@...r.kernel.org>,
linux-arm-kernel <linux-arm-kernel@...ts.infradead.org>,
linux-omap@...r.kernel.org, tony@...mide.com, khilman@...nel.org,
aaro.koskinen@....fi, ivo.g.dimitrov.75@...il.com,
patrikbachan@...il.com, serge@...lyn.com, abcloriens@...il.com,
clayton@...ftyguy.net, martijn@...xit.nl,
sakari.ailus@...ux.intel.com, afd@...com, kernel@...workimprov.net,
devicetree@...r.kernel.org, robh+dt@...nel.org
Subject: Re: [PATCH] Add support for bq27521 battery monitor
On Thursday 09 November 2017 22:06:15 Pavel Machek wrote:
> diff --git a/drivers/power/supply/bq27xxx_battery.c b/drivers/power/supply/bq27xxx_battery.c
> index ed44439..ee2851a 100644
> --- a/drivers/power/supply/bq27xxx_battery.c
> +++ b/drivers/power/supply/bq27xxx_battery.c
> @@ -381,6 +381,30 @@ static u8 bq27xxx_regs[][BQ27XXX_REG_MAX] = {
> [BQ27XXX_REG_AP] = INVALID_REG_ADDR,
> BQ27XXX_DM_REG_ROWS,
> },
> + [BQ27521] = { /* FIXME */
> + [BQ27XXX_REG_CTRL] = 0x02,
> + [BQ27XXX_REG_TEMP] = 0x0a,
> + [BQ27XXX_REG_INT_TEMP] = INVALID_REG_ADDR,
> + [BQ27XXX_REG_VOLT] = 0x0c,
> + [BQ27XXX_REG_AI] = 0x0e,
> + [BQ27XXX_REG_FLAGS] = 0x08,
> + [BQ27XXX_REG_TTE] = INVALID_REG_ADDR,
> + [BQ27XXX_REG_TTF] = INVALID_REG_ADDR,
> + [BQ27XXX_REG_TTES] = INVALID_REG_ADDR,
> + [BQ27XXX_REG_TTECP] = INVALID_REG_ADDR,
> + [BQ27XXX_REG_NAC] = INVALID_REG_ADDR,
> + [BQ27XXX_REG_FCC] = INVALID_REG_ADDR,
> + [BQ27XXX_REG_CYCT] = INVALID_REG_ADDR,
> + [BQ27XXX_REG_AE] = INVALID_REG_ADDR,
> + [BQ27XXX_REG_SOC] = INVALID_REG_ADDR,
> + [BQ27XXX_REG_DCAP] = INVALID_REG_ADDR,
> + [BQ27XXX_REG_AP] = INVALID_REG_ADDR,
> + [BQ27XXX_DM_CTRL] = INVALID_REG_ADDR,
> + [BQ27XXX_DM_CLASS] = INVALID_REG_ADDR,
> + [BQ27XXX_DM_BLOCK] = INVALID_REG_ADDR,
> + [BQ27XXX_DM_DATA] = INVALID_REG_ADDR,
> + [BQ27XXX_DM_CKSUM] = INVALID_REG_ADDR,
> + },
> [BQ27530] = {
> [BQ27XXX_REG_CTRL] = 0x00,
> [BQ27XXX_REG_TEMP] = 0x06,
Hi! IIRC those registers are valid only for sn27521 chip in revision 14
(or new). For older revision is used different register map. And
detection of chip revision is somehow possible via some registers.
--
Pali Rohár
pali.rohar@...il.com
Powered by blists - more mailing lists