From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751569AbcI1IFA (ORCPT ); Wed, 28 Sep 2016 04:05:00 -0400 Received: from mailout4.w1.samsung.com ([210.118.77.14]:35864 "EHLO mailout4.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751006AbcI1IEu (ORCPT ); Wed, 28 Sep 2016 04:04:50 -0400 X-AuditID: cbfec7f4-f791c6d000006eac-73-57eb799c6cdf Subject: Re: [PATCH 2/3] regulator: max77693: Also manipulate the fast charge current To: Wolfgang Wiedmeyer , Mark Brown Cc: sre@kernel.org, dbaryshkov@gmail.com, dwmw2@infradead.org, cw00.choi@samsung.com, b.zolnierkie@samsung.com, lgirdwood@gmail.com, lee.jones@linaro.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org From: Krzysztof Kozlowski X-Enigmail-Draft-Status: N1110 Message-id: Date: Wed, 28 Sep 2016 10:04:41 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-version: 1.0 In-reply-to: <874m51w7r7.fsf@machinist.wiedmeyer.de> Content-type: text/plain; charset=windows-1252 Content-transfer-encoding: 7bit X-Brightmail-Tracker: H4sIAAAAAAAAA01Sa0hTUQDm7N7dXccmt83cydRiPQgtnaFwiSzDghtGaRCL/UiH3lRyKrs+ 0l8mbE1t5bNkWgk+0GXopkxzBqamgVjLR4I47TFsKJo0TYWwNu8E/33ne/Gdw8ER0VNuAJ6e mUOrM5UZUoyPWka2P52pL1iWy+oq/UlTbQeXrPnmwMiZ9Z9cstLxCyEr2qoQctkZQS5svAfk nykdh5zsq8dIl34YkGPWHHJNo+XFCKg3BjuP6moNoczGEoya+9KPUY+7jYBymYMp+0InGs9T 8M+n0BnpebQ6/EISP61vcx3J1gvurzU+QovAZ59S4INDIhLO2kyAxf7QNt+BlQI+LiKaAXT+ 6EHZgwvA10163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rAFogKREjcWvWREaJGUOLH5HssIGM4gU79ftUZxGQW0JO4f1EL pIJZQF5i85q3zBMYBWchaZiFUDULSdUCRuZVjCKppcW56bnFhnrFibnFpXnpesn5uZsYgRG7 7djPzTsYL20MPsQowMGoxMP74eercCHWxLLiytxDjBIczEoivF/KX4cL8aYkVlalFuXHF5Xm pBYfYjQF+mAis5Rocj4wmeSVxBuaGJpbGhoZW1iYGxkpifOWfLgSLiSQnliSmp2aWpBaBNPH xMEp1cBo3qd1TqZc8s60itWHBUMMX7TfMIj+oFN4I8Jn3dHr55SXJ2Q+vilq262WJsYus/y/ 60Jxoe1Jm5qdX08VcKhIdXyX//GS75oMuYTYpEmMixw3nBBe8cWrebmHQLlT9vWtUy70Cl1u 3pHPw3n1zGwNjqlCasLMPvfmyr1Xdk3zeJgeYLLtnqESS3FGoqEWc1FxIgDcw6807gIAAA== X-MTR: 20000000000000000@CPGS X-CMS-MailID: 20160928080443eucas1p29cbcc28e2feac062527c162a22534b8a X-Msg-Generator: CA X-Sender-IP: 182.198.249.179 CMS-TYPE: 201P X-HopCount: 7 X-CMS-RootMailID: 20160927175220eucas1p2885508f3fe274837693845ffc6745671 X-RootMTR: 20160927175220eucas1p2885508f3fe274837693845ffc6745671 References: <874m51w7r7.fsf@machinist.wiedmeyer.de> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 09/27/2016 07:51 PM, Wolfgang Wiedmeyer wrote: > > Mark Brown writes: > >> On Tue, Sep 27, 2016 at 03:50:42PM +0200, Wolfgang Wiedmeyer wrote: >> >>> When charging is disabled (e.g. by removing the USB cable) the charge >>> current is not reset to zero. So if I expose the current by the >>> CURRENT_NOW property, it incorrectly reports the current that was set >>> when charging was enabled, although there is no charging going on >>> anymore. So I felt the need to update the charge current every time the >>> charger gets enabled or disabled. >>> Initially, the charge current is set to zero, so I think it needs to be >>> set at least at the beginning to enable charging. >> >> Are you sure that the register value you're looking at is the actual >> charge current right now and not just the maximum that the charger will >> try to use depending on the conditions (supply available, battery >> state...)? It seems like you're acting as though it's the latter but >> that's not what the chip is doing. > > I was looking at the vendor code that was released for the Galaxy S3 and > there the same register gets accessed for getting the current for > the CURRENT_NOW property [1] and for setting the current [2]. So is this > probably the wrong use of the CURRENT_NOW property because not the > actual charge current is read but the maximum value that was > set? Yes, reading from this register will give only information about currently set charge current. Not the real current. Best regards, Krzysztof