Received: by 2002:a05:6a10:a841:0:0:0:0 with SMTP id d1csp3444198pxy; Mon, 26 Apr 2021 01:43:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz5pXzXIFa76fcz3zHQgNKEhy1mtzFuevdndoxsbk9UrJrsS2s/vr0HTlLSYofk7kMrJz9z X-Received: by 2002:a17:90a:7185:: with SMTP id i5mr21726329pjk.92.1619426587626; Mon, 26 Apr 2021 01:43:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619426587; cv=none; d=google.com; s=arc-20160816; b=IhbjxNmKqY4KNJqSx4Y37qUXGv0njqYtto0hiHeupFibHmllP6Ex5LaMLWbky28XfN +YUO5DQpVbmm+X4/NUlsSDT+AACzIzaCyR1x1TmPXH+W7P/dedy2ubSJzB0LPfKrjj4+ FAuxdo4GoX4npFhTy7H7gEJ/fF418Bsp7adBhqRPOxMEBm+j+PsK3q1WzzFJTUW+IFW2 df1aen8OL4DxRGAIX9kSW8BxAfJ0mvRuSc4S6SHtjAr7sog3itTbuiYJRTrFxbyFnsfI e8MPfRETETb7Pjt00mnUPXDY2WH6d1mPHy7hHUTGJ5OGRM6aPfzagSXszTWVMFsWuZS0 psJw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:reply-to :in-reply-to:references:mime-version; bh=6gNVvOiR0ozmqw7vkwGL4qgwZk8wq86oyuvkoYSrXvU=; b=qqZoHf2YB8+gjXdBs48XTAvjp+GEcG2P0Gj2lnvua7otpNh4taWjGXWx9FZarqrX0t eMAmz8oQ+uqeU5XpvBLEtOc0c7PHG5m6b8jUIGilKqw69q2mHYi8DF5qWdNQ5ah3OXXk ENQsNJzIpvM72PRXreoLPEP6aLvpHKjNEObQZsliR+LMcqR+4P7DRvNtX8klHuNEdXtd wLqdgt+s8R/dDWpBSL5QBdblsZsuDqq0rfuA8X2K2ojTP1/Gr/7aM1/Q3/Elvodvmsdj GB3WitWah/X15053m6eJekuwLAi658JU/Ba/gFExr8BsKCWpB47q+JoRxoMHuWc5vnf8 nHAg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f11si15830081pgr.499.2021.04.26.01.42.55; Mon, 26 Apr 2021 01:43:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232363AbhDZIlf (ORCPT + 99 others); Mon, 26 Apr 2021 04:41:35 -0400 Received: from mail-lj1-f181.google.com ([209.85.208.181]:40567 "EHLO mail-lj1-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232314AbhDZIle (ORCPT ); Mon, 26 Apr 2021 04:41:34 -0400 Received: by mail-lj1-f181.google.com with SMTP id u25so24778500ljg.7; Mon, 26 Apr 2021 01:40:52 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:reply-to :from:date:message-id:subject:to:cc; bh=6gNVvOiR0ozmqw7vkwGL4qgwZk8wq86oyuvkoYSrXvU=; b=UaGoRJ/5kr9iBP3Kfbi/16ivZgTh+CVe8jCNzO+zVvxQHpyL5/N0oU8Ylkf7yLDxwB gsf2ipKEbCLr4a2y0JrX40YlwOUUBuC/ZS/b2ZR1c73bZ9zDwrkmx7WL47oZDVAPlgt4 2qTqUAZlScdCTtwebvMhdaS+zA/8UBFc32BgeLkO+nzOAAc/uDQU/xuk9P/0vhDxszj7 3deJKf6wY+nKQdwtLZOzbnRHByPah/0/4noeOaRsCptj2b0jlaVqZzqigFg5BK4XphZU zl9AtkbcGxoLV81eLvp1/B/wjIiKmJ0XcE/zzqxM1j0214VAVHZywaZT9kTBFINnUO+G qXhQ== X-Gm-Message-State: AOAM533ZDsN3LVkft4od/jTG6uwy3DbbH53yl5oSJvArXNZS1rcJTmgw m1Z0PjNwHnvlr/FL35cXh6NUJUpueVxSoA== X-Received: by 2002:a2e:9d05:: with SMTP id t5mr12404958lji.352.1619426451775; Mon, 26 Apr 2021 01:40:51 -0700 (PDT) Received: from mail-lf1-f47.google.com (mail-lf1-f47.google.com. [209.85.167.47]) by smtp.gmail.com with ESMTPSA id v11sm1445189ljp.63.2021.04.26.01.40.51 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 26 Apr 2021 01:40:51 -0700 (PDT) Received: by mail-lf1-f47.google.com with SMTP id 124so6020988lff.5; Mon, 26 Apr 2021 01:40:51 -0700 (PDT) X-Received: by 2002:ac2:550a:: with SMTP id j10mr12313284lfk.618.1619426451227; Mon, 26 Apr 2021 01:40:51 -0700 (PDT) MIME-Version: 1.0 References: <20210421090354.GF19953@lemon.iwr.uni-heidelberg.de> In-Reply-To: <20210421090354.GF19953@lemon.iwr.uni-heidelberg.de> Reply-To: wens@csie.org From: Chen-Yu Tsai Date: Mon, 26 Apr 2021 16:40:40 +0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [RFC PATCH] axp209 PMIC: setting constant_charge_current to 0 disables battery charging To: Hermann.Lauer@uni-heidelberg.de Cc: Sebastian Reichel , "open list:THERMAL" , linux-kernel Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On Wed, Apr 21, 2021 at 5:05 PM wrote: > > Dear Maintainers, First of all, please format the subject line like other commits to the same file. So that would be: power: supply: axp20x_battery: > this proposed patch allows setting constant_charge_current to 0 on axp209 > PMIC to disable charging. constant_charge_current_max with a value of 0 makes > no sense and should still report the maximum allowed value, so the getter code > is unrolled for the POWER_SUPPLY_PROP_CONSTANT_CHARGE_CURRENT case. This is probably not the right way to do it. The sysfs ABI docs say that some chargers implement a writable "status" sysfs property to allow disabling the charger [1]. IMO this is the proper place to enable/disable the charger. POWER_SUPPLY_PROP_CONSTANT_CHARGE_CURRENT only refers to the "constant current" portion of the charge cycle, and should not be used to implement full control of the charger. Regards ChenYu [1] https://elixir.bootlin.com/linux/latest/source/Documentation/ABI/testing/sysfs-class-power#L444