Received: by 2002:a05:7412:bbc7:b0:fc:a2b0:25d7 with SMTP id kh7csp2303886rdb; Mon, 5 Feb 2024 02:15:01 -0800 (PST) X-Google-Smtp-Source: AGHT+IE0VB6rkcGiYRAklKU4vBSLnZfEfTVifPZq83mVRA4fQCesYYsl24uVzVI76byMKZji7qaW X-Received: by 2002:aa7:8397:0:b0:6df:f7b7:1e20 with SMTP id u23-20020aa78397000000b006dff7b71e20mr8737957pfm.10.1707128101047; Mon, 05 Feb 2024 02:15:01 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707128101; cv=pass; d=google.com; s=arc-20160816; b=Qv8hQNPXUr7hNe4QA8YFXSoj2eZ9Y9S8UjD3gB+OpPSnOgyb8lQn+dGRgBnHpJKhB5 3m6JC638zrAygUWV3knbtvMNP0EGMSIzvW/QhFKf2OOAI+Y1R0diC007LWHx+UikIExB UDDULeyuK9F7P6enCg7SxPqE2BOxVzx5LxR0y/zScFsxh2v/gmo4QqtinSVr4fWZU7XO gWpLJOL7IERIoq8HgOqMTP7HbTX+MbxJA6DiWGM/oL9dkoeVkrMviFwgbTqmmlSfx3Sg XZBJ89NpfcEmnDoCNVx4yrBvWhYv3Nu8/dHIB5NTQKYAg6uhYK+AmQtlNUiXlLUbsYLC edpw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=Y1Gn5QY0RzFz/c12Z/qyBnZZspPbZJTFIJYfZUyz5g0=; fh=50pRTUWmg3xWnnvMVAL9wpYpmZ7SUy+IoEQ1fun1T1g=; b=gMeqqgHgxAJrtm4i6NAD7zeR+uGeCYZPNd45ftVM8vfuGA5pSgN31VXfM6hp71Z/AW 2lpdrUaAQH2hLwAUCbV7583YfIU2PFAXNt2s7Tt+0ZuE3IP1KVFHv5kopab1fWgYTStU sPrMXoOs1pBhsWVREi8eqW4CA9pCXtaQc26+G+uAtDal+9EPd6NwkP8A/Dwy54eNfEMN J6xahT6pvdM4tPAwei6t+a/HdHwSN1p5HTSNy842mZM/uVb7sPAEzmYqWCJUeEjKVkXD U5pqzyxiazL6iqi2xHDlWmpP49421FiWdMcrDEwq5WX2L+JTTpwl1QdpykSeVohGgSCQ yafg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="Rc/JlJEj"; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-52365-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-52365-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com X-Forwarded-Encrypted: i=1; AJvYcCUQ5f3kaW3Pn0/tiembd1MXsCjvpDLnUrK++wPw8OR+3pEOes95Qo26TKR1dotAXN+C/esWrjbOxy2vCaRhb9QfFAtj7Zjr/KarzWrIpg== Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id 14-20020a63020e000000b005ce04795a98si5569496pgc.32.2024.02.05.02.15.00 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 05 Feb 2024 02:15:01 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-52365-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="Rc/JlJEj"; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-52365-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-52365-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com 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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 0376828AD01 for ; Mon, 5 Feb 2024 10:00:14 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8AAA0134A3; Mon, 5 Feb 2024 10:00:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="Rc/JlJEj" Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (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 424CE12E45 for ; Mon, 5 Feb 2024 10:00:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707127207; cv=none; b=UFscxg7mUgteAlMadExj5rdV6ziQdKSacHg7SfwbbSwGsDmqfTgZ6Ev34aFbNz2v0J17cbxwZqFmcq8rPvkbIfxhOrfz4AmVYGW83vQQ7q273/7xkr91wbIUlFnAyZ3JX1byyXihAuiPUxqIdwR2Btlyx1Su+Ih3/2aODsib4qE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707127207; c=relaxed/simple; bh=0zwGLQozIm1xLIUb+JT1QR0nH+Sj7un9j5w6FlqwRqA=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=g+VP8wOZk0xyqCOG+ERex6RjwlK9qNkq/lLTrRu9rY1DRbb83kMxiy+7rlgjfqAudocdN+OW7/kNLVIyOMlMenKbpS+eUKeWT28FTYyXIvylvlpDyMMelz701pcBt7msC2NsFRD0YNCZyuuFVF4sH2aQKhk6oLVaOARmW6nYVfY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=Rc/JlJEj; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1707127205; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Y1Gn5QY0RzFz/c12Z/qyBnZZspPbZJTFIJYfZUyz5g0=; b=Rc/JlJEjFs+lQ/VsqDODI7PqwNqGtTZ+XMuTuOdOYew0oQg6BH0+QL282adZukX+o/yhPQ Jyv8PZXkRmLzPMHjaZdqnxuxQXDwGtC068pSpIAfw4tc8sqIvgy3LFxLtnTtl6CLhDWUVc zq9T3Rs+kLCzMkWeGBYJ5q6Xr87PgMM= Received: from mail-ej1-f71.google.com (mail-ej1-f71.google.com [209.85.218.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-527-1WmNpTp7OcqK7EMeteud7A-1; Mon, 05 Feb 2024 05:00:03 -0500 X-MC-Unique: 1WmNpTp7OcqK7EMeteud7A-1 Received: by mail-ej1-f71.google.com with SMTP id a640c23a62f3a-a35118e98caso252618166b.0 for ; Mon, 05 Feb 2024 02:00:03 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707127202; x=1707732002; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=Y1Gn5QY0RzFz/c12Z/qyBnZZspPbZJTFIJYfZUyz5g0=; b=VnJAAFbq0vn7fjhK6sCvDMHbZrpHb8JNEOiEUtwvPWfGAaha9dgsvbtFwvij4j6vN7 E308ptzTlAxNlohmTHhureCwzTEpgEuMKYQQ+vU6h+HXxakWSeP6YzQpaAEDzoclNvEb OKEL08zHBiP/qvQULzNxdH0//cxU+T5T4KtinFqfSV+ClNiCCSsZoAKc2ZAsSfyYOwRX LnDyl0wdyxshAY34RMWr+2bpJW9uTo1fvLEvQ2JrYia2+CeW6eSs0WDkjp6u3BGfYfg7 bY1XvVpkv6v8zoKF8Lg82vzSFqEl0qOMgKsN5JQpszlzfDfMQwYcFlfY0SdM3ZxV1lNg 92zw== X-Gm-Message-State: AOJu0YzkJ7la58fQZ1N+ZFmcgFBJbO1D/vYACPBPvnFKF29teC58tliE r+YprQvxyzXC7Y7y2jLgD5AATQzuoCcndM+VqKwreB5Z75GwNJkgKHNv3CYXIycSHk/h/qNwx1R fEvnKgoinjdvdi7fYzB8H6jkVyCgaBcfbCuqlVejUG14hi6F8jYn44E0ltlHnzQ== X-Received: by 2002:a17:906:6c9a:b0:a37:7e9c:17ea with SMTP id s26-20020a1709066c9a00b00a377e9c17eamr2558741ejr.12.1707127202756; Mon, 05 Feb 2024 02:00:02 -0800 (PST) X-Received: by 2002:a17:906:6c9a:b0:a37:7e9c:17ea with SMTP id s26-20020a1709066c9a00b00a377e9c17eamr2558726ejr.12.1707127202454; Mon, 05 Feb 2024 02:00:02 -0800 (PST) X-Forwarded-Encrypted: i=0; AJvYcCXHkc55LLSsMQmfs5K3PghfD0W5Y6o+ipTZQwDlhI1YPtrAzL/9GF/wwI4wDRsnZ7N0EybIZobE6yyZV2QDLJ7xLHaFKjf1bXNJ5zfk50Yqh6Sh36nzquGVd62Tf95f1E3nFAD4YsvTwAisbkSx6SDQzabBCkMYuSM+ml756DyN1OdwNqPTmYBifwido3Ab2PdlMlD4Nw== Received: from ?IPV6:2001:1c00:c32:7800:5bfa:a036:83f0:f9ec? (2001-1c00-0c32-7800-5bfa-a036-83f0-f9ec.cable.dynamic.v6.ziggo.nl. [2001:1c00:c32:7800:5bfa:a036:83f0:f9ec]) by smtp.gmail.com with ESMTPSA id a20-20020a170906671400b00a34d0a865ecsm4078151ejp.163.2024.02.05.02.00.01 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 05 Feb 2024 02:00:01 -0800 (PST) Message-ID: <2f244f9f-8796-4cad-8bf8-d0c3411588c1@redhat.com> Date: Mon, 5 Feb 2024 11:00:01 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 3/4] power: supply: mm8013: implement POWER_SUPPLY_PROP_CHARGE_BEHAVIOUR_AVAILABLE Content-Language: en-US, nl To: =?UTF-8?Q?Thomas_Wei=C3=9Fschuh?= , Sebastian Reichel , Konrad Dybcio Cc: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Sebastian Reichel References: <20240204-power_supply-charge_behaviour_prop-v1-0-06a20c958f96@weissschuh.net> <20240204-power_supply-charge_behaviour_prop-v1-3-06a20c958f96@weissschuh.net> From: Hans de Goede In-Reply-To: <20240204-power_supply-charge_behaviour_prop-v1-3-06a20c958f96@weissschuh.net> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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: Reviewed-by: Hans de Goede Regards, Hans > --- > drivers/power/supply/mm8013.c | 5 +++++ > 1 file changed, 5 insertions(+) > > diff --git a/drivers/power/supply/mm8013.c b/drivers/power/supply/mm8013.c > index caa272b03564..695df8bd6cb0 100644 > --- a/drivers/power/supply/mm8013.c > +++ b/drivers/power/supply/mm8013.c > @@ -72,6 +72,7 @@ static int mm8013_checkdevice(struct mm8013_chip *chip) > static enum power_supply_property mm8013_battery_props[] = { > POWER_SUPPLY_PROP_CAPACITY, > POWER_SUPPLY_PROP_CHARGE_BEHAVIOUR, > + POWER_SUPPLY_PROP_CHARGE_BEHAVIOUR_AVAILABLE, > POWER_SUPPLY_PROP_CHARGE_FULL, > POWER_SUPPLY_PROP_CHARGE_FULL_DESIGN, > POWER_SUPPLY_PROP_CHARGE_NOW, > @@ -113,6 +114,10 @@ static int mm8013_get_property(struct power_supply *psy, > else > val->intval = POWER_SUPPLY_CHARGE_BEHAVIOUR_AUTO; > break; > + case POWER_SUPPLY_PROP_CHARGE_BEHAVIOUR_AVAILABLE: > + val->intval = BIT(POWER_SUPPLY_CHARGE_BEHAVIOUR_AUTO) > + | BIT(POWER_SUPPLY_CHARGE_BEHAVIOUR_INHIBIT_CHARGE); > + break; > case POWER_SUPPLY_PROP_CHARGE_FULL: > ret = regmap_read(chip->regmap, REG_FULL_CHARGE_CAPACITY, ®val); > if (ret < 0) >