From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bruno =?UTF-8?B?UHLDqW1vbnQ=?= Subject: Re: [PATCH 2/4] power: add axp20x-battery driver Date: Tue, 5 Jul 2016 14:43:17 +0200 Message-ID: <20160705144317.4a654376@pluto.restena.lu> References: <20160701092926.32005-1-icenowy@aosc.xyz> <20160701092926.32005-2-icenowy@aosc.xyz> <577B44FD.6040404@mailbox.org> <112861467708458@web7h.yandex.ru> Reply-To: bonbons-ud5FBsm0p/xEiooADzr8i9i2O/JbrIOy@public.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Return-path: Sender: linux-sunxi-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org In-Reply-To: <112861467708458-tvSLaYVQeptuio3avFS2gg@public.gmane.org> List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , To: Icenowy Zheng Cc: Michael Haas , Wens , Maxime Ripard , sre-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org, dbaryshkov-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org, dwmw2-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org, robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org, Mark Rutland , linux-I+IVW8TIWO2tmTQ+vhA3Yw@public.gmane.org, devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-pm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-sunxi-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org List-Id: linux-pm@vger.kernel.org On Tue, 05 Jul 2016 16:47:38 +0800 Icenowy Zheng wrote: > I read the datasheet of axp20x, and then found that this driver does > not support backup RTC battery. > (But maybe backup battery do not need a driver -- at least on IBM PC > it has no driver) A driver is needed to enable/disable the RTC battery charging (unless uboot does it). However all the driver can do according to datasheet is configure the charge voltage/current or disable charging completely. Monitoring RTC battery is not possible, neither is presence detection. So driver should just apply configuration it finds in device-tree and eventually share that information via power supply class. > And I don't know whether the axp20x has default Li-ion/LiPo battery > OCV parameter. (axp22x seems to be have a set of default OCV) It seems to have default OCV parameters as well. With empty RTC battery OCV values are present. > You can test this driver on AXP20x. (I think I didn't access to > AXP22x-specified registers in the power supply code) Bruno From mboxrd@z Thu Jan 1 00:00:00 1970 From: bonbons@linux-vserver.org (Bruno =?UTF-8?B?UHLDqW1vbnQ=?=) Date: Tue, 5 Jul 2016 14:43:17 +0200 Subject: [linux-sunxi] [PATCH 2/4] power: add axp20x-battery driver In-Reply-To: <112861467708458@web7h.yandex.ru> References: <20160701092926.32005-1-icenowy@aosc.xyz> <20160701092926.32005-2-icenowy@aosc.xyz> <577B44FD.6040404@mailbox.org> <112861467708458@web7h.yandex.ru> Message-ID: <20160705144317.4a654376@pluto.restena.lu> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org On Tue, 05 Jul 2016 16:47:38 +0800 Icenowy Zheng wrote: > I read the datasheet of axp20x, and then found that this driver does > not support backup RTC battery. > (But maybe backup battery do not need a driver -- at least on IBM PC > it has no driver) A driver is needed to enable/disable the RTC battery charging (unless uboot does it). However all the driver can do according to datasheet is configure the charge voltage/current or disable charging completely. Monitoring RTC battery is not possible, neither is presence detection. So driver should just apply configuration it finds in device-tree and eventually share that information via power supply class. > And I don't know whether the axp20x has default Li-ion/LiPo battery > OCV parameter. (axp22x seems to be have a set of default OCV) It seems to have default OCV parameters as well. With empty RTC battery OCV values are present. > You can test this driver on AXP20x. (I think I didn't access to > AXP22x-specified registers in the power supply code) Bruno From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932988AbcGEMnh (ORCPT ); Tue, 5 Jul 2016 08:43:37 -0400 Received: from smtprelay.restena.lu ([158.64.1.62]:54221 "EHLO smtprelay.restena.lu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932877AbcGEMne (ORCPT ); Tue, 5 Jul 2016 08:43:34 -0400 Date: Tue, 5 Jul 2016 14:43:17 +0200 From: Bruno =?UTF-8?B?UHLDqW1vbnQ=?= To: Icenowy Zheng Cc: Michael Haas , Wens , Maxime Ripard , sre@kernel.org, dbaryshkov@gmail.com, dwmw2@infradead.org, robh+dt@kernel.org, Mark Rutland , linux@armlinux.org.uk, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, linux-sunxi@googlegroups.com Subject: Re: [linux-sunxi] [PATCH 2/4] power: add axp20x-battery driver Message-ID: <20160705144317.4a654376@pluto.restena.lu> In-Reply-To: <112861467708458@web7h.yandex.ru> References: <20160701092926.32005-1-icenowy@aosc.xyz> <20160701092926.32005-2-icenowy@aosc.xyz> <577B44FD.6040404@mailbox.org> <112861467708458@web7h.yandex.ru> X-Mailer: Claws Mail 3.13.2 (GTK+ 2.24.30; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 05 Jul 2016 16:47:38 +0800 Icenowy Zheng wrote: > I read the datasheet of axp20x, and then found that this driver does > not support backup RTC battery. > (But maybe backup battery do not need a driver -- at least on IBM PC > it has no driver) A driver is needed to enable/disable the RTC battery charging (unless uboot does it). However all the driver can do according to datasheet is configure the charge voltage/current or disable charging completely. Monitoring RTC battery is not possible, neither is presence detection. So driver should just apply configuration it finds in device-tree and eventually share that information via power supply class. > And I don't know whether the axp20x has default Li-ion/LiPo battery > OCV parameter. (axp22x seems to be have a set of default OCV) It seems to have default OCV parameters as well. With empty RTC battery OCV values are present. > You can test this driver on AXP20x. (I think I didn't access to > AXP22x-specified registers in the power supply code) Bruno