Received: by 2002:a05:7412:bbc7:b0:fc:a2b0:25d7 with SMTP id kh7csp2331735rdb; Mon, 5 Feb 2024 03:22:08 -0800 (PST) X-Google-Smtp-Source: AGHT+IGsm4213KlR4rGOYJ1trB7tWCjAQlzDfxeYrJdS38A66WNfSu69D0Qt7rOWqsCWIiB45d4y X-Received: by 2002:a17:906:23e9:b0:a37:27a8:9a66 with SMTP id j9-20020a17090623e900b00a3727a89a66mr5717760ejg.39.1707132128613; Mon, 05 Feb 2024 03:22:08 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707132128; cv=pass; d=google.com; s=arc-20160816; b=enUdj3xkW8lxCBmfzox3OLJuRQGqDboFPoQQvcis6cuZ7nyEmdj+Cx85kAWb4YX9MA 8x+E3ewdC8p8wGWzt+ryFsLAzbzVaMjt4KXerwXq86wpETsWfUTHNwPU5jBxgq9ntE3R d8bFxcHgxnwe3zxTpSrmgcDWDHEvzcycxwhJvqoDrqHQxkyV79trxljA0R7nkRUYwoMx D+TcCHKdpfCLjPctDOqYYzkiUHP7rIpY73cc0ZaEuxl1feCVU8ThPPt4hulLk+7UAahG EEv6mX+7HaOK+Eh1eZ0ulKIzEaueFHDN9nTTYf1bMmXthi2bzhcxYYOJU9z1mI3yQBkJ 9EJA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:message-id:subject:cc:to:from:date:dkim-signature; bh=CDbeEzPJhYJes3oKEGI3JhUqWGPhhboDnGxO/g0R0lc=; fh=1rKYQd8MYya7kQr0Qi2jPh9IQ+2/6XEcx8d71332G/A=; b=iliaWuZhLEgMgqb5FvMZ6yeyIbpET7nSak46D0AVvYaifbMWWoO+/+VQaR9/R57n6T /rPrPoRsR5zZxhPM5pDue5ryyNPfYDrChtI4RT16M0u5qzpZAu6XMQcoUZeTc3gM/llQ WumuAXhktlY+piAShw95LOBha2Vg61SVkfn9wYImRHX2B5NeyiLMlmGM+N1bmsc64TnI 3cvz5nyyRsfeAMdRoZEpsIfbW4SGqbJxuCc93bpzVV6iOyQ4UUYGccDCwrJn+RX0lH/I oAU8c+jOHQ6Pr2mMwruCWJAZa4sLSUwCPbCCFZypc8X9B24PPc7UZeIQGBiBVENRl7TS Tw+g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@weissschuh.net header.s=mail header.b=MAgVFpPc; arc=pass (i=1 spf=pass spfdomain=weissschuh.net dkim=pass dkdomain=weissschuh.net); spf=pass (google.com: domain of linux-kernel+bounces-52477-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-52477-linux.lists.archive=gmail.com@vger.kernel.org" X-Forwarded-Encrypted: i=1; AJvYcCUUnlujpjHLXEwe6TdiYkkiNBie1M1EpEFJq2kQ1yspB4sTArhz63szD+zr44u2AUqTJBUzEF17+ccGrITs7ZrMC28HnI17UNTqzmXMOg== Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id a23-20020a17090680d700b00a37ef516b64si154474ejx.636.2024.02.05.03.22.08 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 05 Feb 2024 03:22:08 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-52477-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@weissschuh.net header.s=mail header.b=MAgVFpPc; arc=pass (i=1 spf=pass spfdomain=weissschuh.net dkim=pass dkdomain=weissschuh.net); spf=pass (google.com: domain of linux-kernel+bounces-52477-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-52477-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 5AC061F2286A for ; Mon, 5 Feb 2024 11:22:08 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0075A18B14; Mon, 5 Feb 2024 11:22:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=weissschuh.net header.i=@weissschuh.net header.b="MAgVFpPc" Received: from todd.t-8ch.de (todd.t-8ch.de [159.69.126.157]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9711518641; Mon, 5 Feb 2024 11:21:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=159.69.126.157 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707132118; cv=none; b=QJAbxdpJaKXl2eBFDig14G2Hps8MRPXsiu/g3NYvDVZPqd7DwgwbdY+OEIJfVJYH/RKHhBvesArhuMvvz3CuiKhCrpW/wSoSZUDJ8Updxn2qv6uqV65EhrRmyEy14WYm5S/IzaoFBEeEDGSvWEBvbyRloadeRv97u3WZqwepOik= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707132118; c=relaxed/simple; bh=6vdRADLmto/3CuW0UJ6BuYaz7DLwN+tvUOa2KNkTtd0=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=Rdk5c5Cp8k/vN6+sK2M63nMvie0uecJgAZjz4Kbw2tx6iziGWbdhlY20RhCZs/l+ZiENK1stQXtp7+QHCwgkceGj5LuyRgLHitnXB/D+lG917+8AzIzEH2c6bFITYDyhFREsYMNKWw+A73M+mVKia+w47MrOWR5EPJ+fMR1S1Mo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=weissschuh.net; spf=pass smtp.mailfrom=weissschuh.net; dkim=pass (1024-bit key) header.d=weissschuh.net header.i=@weissschuh.net header.b=MAgVFpPc; arc=none smtp.client-ip=159.69.126.157 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=weissschuh.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=weissschuh.net DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=weissschuh.net; s=mail; t=1707132110; bh=6vdRADLmto/3CuW0UJ6BuYaz7DLwN+tvUOa2KNkTtd0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=MAgVFpPcDvjdp/mDzcBcyI5VATplfjxVibtuzVMZtFNGs8ZQiUV1G4BibKmWbDuUL hLlgNIrAPVF1aC/bbBR7WzzpXhSzYYb0qaNK3fRGUXUYwouhGGd+dK16QyE3SAAhuf yEgXJCfGsQCpJa4XF1w/nC/+ITDrqjZs2Z7hKST4= Date: Mon, 5 Feb 2024 12:21:45 +0100 From: Thomas =?utf-8?Q?Wei=C3=9Fschuh?= To: Hans de Goede Cc: Sebastian Reichel , Konrad Dybcio , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Sebastian Reichel Subject: Re: [PATCH 3/4] power: supply: mm8013: implement POWER_SUPPLY_PROP_CHARGE_BEHAVIOUR_AVAILABLE Message-ID: <569bbc9f-1c34-40c1-a563-e7f6aecf63d5@t-8ch.de> References: <20240204-power_supply-charge_behaviour_prop-v1-0-06a20c958f96@weissschuh.net> <20240204-power_supply-charge_behaviour_prop-v1-3-06a20c958f96@weissschuh.net> <2f244f9f-8796-4cad-8bf8-d0c3411588c1@redhat.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <2f244f9f-8796-4cad-8bf8-d0c3411588c1@redhat.com> On 2024-02-05 11:00:01+0100, Hans de Goede wrote: > Hi, > > On 2/4/24 18:26, Thomas Weißschuh wrote: > > The sysfs is documented to report both the current and all available > > behaviours. For this POWER_SUPPLY_PROP_CHARGE_BEHAVIOUR_AVAILABLE needs > > to be implemented. > > > > Note that this changes the format of the sysfs file > > (to the documented format): > > > > Before: "auto" > > After: "[auto] inhibit-charge" > > > > Signed-off-by: Thomas Weißschuh > > Changing userspace API like this is never ideal, but given how > new the mm8013 driver is and that this brings things inline > with the docs I think that this should be fine: I agree that it's unfortunate. However looking at the datasheet [0] it seems to me the driver is not correctly using the API. Page 23 documents the flag CHG_INH as follows: CHG_INH : Charge Inhibit When the current is more than or equal to charge threshold current, charge inhibit temperature (upper/lower limit) :1 charge permission temperature or the current is less than charge threshold current :0 This is only diagnostic information and not a control-knob, which the API was meant for. So POWER_SUPPLY_STATUS_NOT_CHARGING seems like the better match. > [..] Thomas [0] https://product.minebeamitsumi.com/en/product/category/ics/battery/fuel_gauge/parts/download/__icsFiles/afieldfile/2023/07/12/1_download_01_12.pdf