From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751599AbcI1H4q (ORCPT ); Wed, 28 Sep 2016 03:56:46 -0400 Received: from mailout4.w1.samsung.com ([210.118.77.14]:35305 "EHLO mailout4.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750853AbcI1H4g (ORCPT ); Wed, 28 Sep 2016 03:56:36 -0400 X-AuditID: cbfec7ef-f79e76d000005b57-56-57eb77af2dab Subject: Re: [PATCH 3/3] power_supply: max77693: Listen for cable events and enable charging To: Wolfgang Wiedmeyer Cc: sre@kernel.org, dbaryshkov@gmail.com, dwmw2@infradead.org, cw00.choi@samsung.com, b.zolnierkie@samsung.com, broonie@kernel.org, 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: <298d81d5-fe41-e2d1-32a7-d3dc35b0fe25@kernel.org> Date: Wed, 28 Sep 2016 09:56:28 +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: <87a8etwjnr.fsf@machinist.wiedmeyer.de> Content-type: text/plain; charset=windows-1252 Content-transfer-encoding: 7bit X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprOKsWRmVeSWpSXmKPExsWy7djPc7rry1+HG+zeL2ixccZ6VoupD5+w WVz/8pzVYtKT98wWE1dOZrZ4/cLQ4v7Xo4wW3650MFlc3jWHzeJz7xFGi9O7Syw+tLaxO/B4 7Jx1l91j8wotj02rOtk87lzbw+bRt2UVo8fnTXIed+9vYAlgj+KySUnNySxLLdK3S+DK6Jhw nb3grkhF58mDrA2MlwW6GDk5JARMJM6+PMkOYYtJXLi3nq2LkYtDSGAZo8Tlc69YIZzPjBJP upczdTFygHU8+i0BV/Tt8SJ2COcZo8SFJ+sYQU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Ev821IMsUFOord7 EtgcXgFbidl/rjOC2CwCqhIfVv5nA7FFBSIkbq36yAhRIyjxY/I9sHpOoEOvz3nKBDKSWUBP 4v5FLZAws4C8xOY1b5knMArOQtIxC6FqFpKqBYzMqxhFUkuLc9Nziw31ihNzi0vz0vWS83M3 MQLjdduxn5t3MF7aGHyIUYCDUYmH98PPV+FCrIllxZW5hxglOJiVRHinlr4OF+JNSaysSi3K jy8qzUktPsRoCvTCRGYp0eR8YCrJK4k3NDE0tzQ0MrawMDcyUhLnLflwJVxIID2xJDU7NbUg tQimj4mDU6qBUfam/7Z7zos/qZR9/mezy6Sg1E2idHNo+5Hdj2wXsQRycZXUNFoHb5xxyuqq +Wv95UF83p7Op+ZuMfCbdz7AnP2KZPdziRvlJ7vcN2z6+7Nd1u7yjl8/lyjdWDjpQ+TC8s9P ppyK8NaLXqMjkXqnR68+oGlGUovlikO/asqbby7Szr1a8n/7ISWW4oxEQy3mouJEAEhNBzPt AgAA X-MTR: 20000000000000000@CPGS X-CMS-MailID: 20160928075630eucas1p2a0d0b51fd4d24b90446fd29f6480ded2 X-Msg-Generator: CA X-Sender-IP: 182.198.249.179 CMS-TYPE: 201P X-HopCount: 7 X-CMS-RootMailID: 20160927133519eucas1p147b1e49693cde0e7e2d683901bdeb7ed X-RootMTR: 20160927133519eucas1p147b1e49693cde0e7e2d683901bdeb7ed References: <87a8etwjnr.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 03:34 PM, Wolfgang Wiedmeyer wrote: > > Krzysztof Kozlowski writes: > >> On Tue, Sep 27, 2016 at 01:31:10AM +0200, Wolfgang Wiedmeyer wrote: >>> This patch adds a listener for extcon cable events and enables >>> charging if an USB cable is connected. It recognizes SDP and DCP cable >>> types and treats them the same (same input current and fast charge >>> current). The maximum input current is set before the charger is >>> enabled and before the charger gets disabled, the maximum input >>> current is set to zero. The listener is inspired by the listener >>> implementation that was used for the AXP288 Charger driver. >>> >>> The patch also adds support for the CURRENT_NOW property. It reads the >>> fast charge current that gets set before the charger is enabled or >>> disabled. >>> >>> Signed-off-by: Wolfgang Wiedmeyer >> >> No. This power supply driver should not manage regulators. It is not a >> regulator consumer. For that specific need, there is a charger-manager driver. > > When I was in the middle of implementing this, I noticed that the > charger manager does everything that is needed. But it took me quite > some time to configure the DTS correctly until I realized that the > charger manager used a deprecated function > (extcon_register_interest()) and thus couldn't work. And as I didn't see > the charger-manager in any other device's DTS, I thought that this might > not be right way. > But Chanwoo Choi has a fix: https://patchwork.kernel.org/patch/8898541/ > So I will try to get it working with this patch. > >> I agree that you might configure here the charger. You might even expose >> some writeable properties through power supply class. However the >> purpose of this driver is to expose the battery charger to user-space, >> not to replace the user-space with its work. >> >> So... NACK. > > Ok, then I will try to reduce the patch to the CURRENT_NOW property > support. > >> If you would like to play with charger-manager, here is my old DTS for >> Trats2 (might need updates): > > Is there a reason that this patch is not in the kernel? It would have > been very helpful for me :) In general, DeviceTree should describe the hardware. Charger manager is an abstract device, not a real one. This DT node does not describe real hardware but it is a driver-specific glue needed to get things done. I am not convinced that we should add to DTS such abstract devices. What about people who want to control charging from user-space? They would have to disable charger-manager from config. Best regards, Krzysztof