Received: by 2002:a05:7412:bbc7:b0:fc:a2b0:25d7 with SMTP id kh7csp2310035rdb; Mon, 5 Feb 2024 02:29:59 -0800 (PST) X-Google-Smtp-Source: AGHT+IH9OIGhb/zDUvVsg2++6LuX0PQkWwmRkCI5BjH2KREDkCjUK+k6Quknnz1yqjnXuGeqp9ou X-Received: by 2002:a05:6a00:2190:b0:6e0:4ddf:b74 with SMTP id h16-20020a056a00219000b006e04ddf0b74mr777128pfi.26.1707128998793; Mon, 05 Feb 2024 02:29:58 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707128998; cv=pass; d=google.com; s=arc-20160816; b=zvTr+W4jw7ttKzoZDXA2vFt/YJ4VaAIvhEDfh2AHEO3xNeOavITTNeBtx7FXBlx3DH R2v+oNtD4T5YPC/2ecGZV62p2XXpBthrTDGXQ2nbKAcM84vuX4ZTcxm1kdUTyoFtHDod ouhKg/Vhnv/uaKBlPToQZzWtdNp7GZfF1/fqFmJnqQYefu8C9CkEIRJG4JdqT6Vz0fgc zTc8xpDnxUuvAYlug8FQKaOYYruH29Ivv4BqD5ho7tYx7VEBzYaudQZQPfpFhN4BDNoM 0p6rMRwNeLtGeUjsx+YKHtxvX03bDqKVA069gor0h9+HiMxzMOHNj0Eoy2B/VVIWge+k YFdA== 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=lwyUnWvLJnNe+bRoKls+n+VgwPZLrmW2ivHplJ0jsYA=; fh=wzhlI+eiLKN5CjGmAj3GgVcfsX0jaexrT1xICZYMXac=; b=tt8Bvj1anqGsQd7jMzuZnVaYr4QLKpTfRL0ZPg7NBwBfmeeQtkE/6rvhTQvz4H1l9d FfQJFZsrGaGkMQNw1wUMzYPjOXOG2KSka0gklJ3oAKi9aUmCYk7JIfCQsixBdm7EGKsA 2IzhIJJ4NWcrjBxVyL8238zd8o4KhQ0Hm0HZ3KAuWSWKwSvKdaJeipiN3fbSC8CsAFTD FFuA1E4KB31YOiKbCi/oXt+g6e/PNjGV5qDuwFEX2fIERfsR5cDPRj0bLPIJhgEbt3iY cLsbhYfXJZQCFGR0M5YQLO5jEEQg7PNuA2jk+O4CPA4g+pTKRk3+F20Jy+lsb2scjORt qDKg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=jMgcCBNT; 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-52364-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-52364-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; AJvYcCVDVskbhdJhxN3s22RkZjqMnwbLZDhDDTemxsjja1tnjyryhFuOFJAvtx+y2vItOf+lBFtQvWkVFOlKTfokhCqyZhimEuQRtjJO603jAQ== Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id f6-20020a056a001ac600b006dd86f78e95si5784784pfv.1.2024.02.05.02.29.58 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 05 Feb 2024 02:29:58 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-52364-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=jMgcCBNT; 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-52364-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-52364-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 81E79B28F51 for ; Mon, 5 Feb 2024 09:59:18 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1DE9012B9D; Mon, 5 Feb 2024 09:59:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="jMgcCBNT" 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 7075F12E71 for ; Mon, 5 Feb 2024 09:59:05 +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=1707127147; cv=none; b=RD7MXHD4V0/LActNq6uv5ZCAqfYmhwHpaHOf+MXaDpNJt8ms/byx/72QI30mxX184lR5mw1jzfbAPuwSuEld1B13c9Stic4+wSgBOTPRlQOc0jmN5QxLKZwFf/WTT7qFICpRGkQG6EewaeQSwZfm4P76ZCIgQO9yHG4YgvUwSMI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707127147; c=relaxed/simple; bh=b92Et2DKhcyog6J47YUJMcwyYAegyfdYl6Uh+aPv74A=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=f8P6VAxzqlfxCqgz49RAJv0xOC+onblqNix4lZWZ7fmYWMNKoDDxhEUxZhus4G30S1R6A2PMuwmVgh0lErqbDVPNGRln+RBdIN1Civ85pJbHlkJgVijeYhtW4W1Uc0m+1tfZ7ceYAz6W314BtKrP9UAMh4Q76JpDKS9ITKZBURM= 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=jMgcCBNT; 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=1707127144; 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=lwyUnWvLJnNe+bRoKls+n+VgwPZLrmW2ivHplJ0jsYA=; b=jMgcCBNTFv/g6x15aa4HSljlgGqIHXmZCM0pBcDvuZ5Zas3wBuC21iDDcOIBge+Dr68nNc +OhCyWE2y5Shl8mGNtuI3r1SpF4LbuhKlhtiqHix0MtVWQsN1Zc3REhebKFnbzehyDmZrx lv53SEv75NmZ4yKI1RKoqmTuGBo5PbQ= Received: from mail-ej1-f70.google.com (mail-ej1-f70.google.com [209.85.218.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-369-AGEzIErtM3K2unqLQyI46A-1; Mon, 05 Feb 2024 04:59:02 -0500 X-MC-Unique: AGEzIErtM3K2unqLQyI46A-1 Received: by mail-ej1-f70.google.com with SMTP id a640c23a62f3a-a2cb0d70d6cso261895066b.2 for ; Mon, 05 Feb 2024 01:59:02 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707127141; x=1707731941; 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=lwyUnWvLJnNe+bRoKls+n+VgwPZLrmW2ivHplJ0jsYA=; b=kjogxZJ5Sdkb4E4hYlbCwpmyYu3bqa0bQDjN+sey/SDP9CsGOCu6ZGrGLpqmxv4uBi dgSPPxmljKsR1nO+EIKKfgjBfFUNSGjvTnicLPNdWuBh9LcqdNzFnoxr5Y2fnLYRn7gv IsNoAz1dgVo3lgf4e2nKwyjbf8Cwzm3UMeQmGuG9clIoC7v+eDBH9+W9/SQd8f+XGgTv 71/wqt2IP0lQnOCaaL3SSRqIHe8BXyOECaTOh22euv4SXrx9e0coqMrOl4Qgm+OO4/y+ ecWI3gN1mjKg364WOG0x0mWhw0+b1HxUPd1ruNiDi1yn5LTpDkUASQEfz8YxNJ/D/LR4 1xjw== X-Gm-Message-State: AOJu0Yz0ZcDvEaTovMcwa5Y9yTNbaabpCWj2eAuEcIMCo/CE/gZ63LOc 2WL77JdSQlezs7YPpDAr2PndkH5iPDV5MDiieGBSaenTIVhDheRQdX9Rd6SGBX2g73GK1SE97HW alEuia/ihybSxiHfTGAl35fZklJt89Rd+RnzGvL4mmiyqhmQID7VsHgnIJXaseKu5EmVss807 X-Received: by 2002:a17:906:f45:b0:a36:6c96:3161 with SMTP id h5-20020a1709060f4500b00a366c963161mr6602681ejj.32.1707127141450; Mon, 05 Feb 2024 01:59:01 -0800 (PST) X-Received: by 2002:a17:906:f45:b0:a36:6c96:3161 with SMTP id h5-20020a1709060f4500b00a366c963161mr6602660ejj.32.1707127141073; Mon, 05 Feb 2024 01:59:01 -0800 (PST) X-Forwarded-Encrypted: i=0; AJvYcCXbmR08Gr4n2NVg2c2voT6qsslhwvbpLNUuX3+9zcQ0UKxxCe2NORxePOnvdjaxqz05hZREihbacA+Hjs9M4ENNvC9Fu959Gz4tG7MmU/kNJsWkTH2EhTzLMrkkKRsFt4vgqHM/LWALD1cvwxq+HGlEj5FkTN7ZxyLHAtox2IZxJ8oPlUZ3/kTdl2DY4iyfgrGcum7Nrw== 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.01.59.00 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 05 Feb 2024 01:59:00 -0800 (PST) Message-ID: <47253c5e-4ec3-4794-9cd3-c7aeb95fb5c7@redhat.com> Date: Mon, 5 Feb 2024 10:59:00 +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 2/4] power: supply: test-power: implement charge_behaviour property 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-2-06a20c958f96@weissschuh.net> From: Hans de Goede In-Reply-To: <20240204-power_supply-charge_behaviour_prop-v1-2-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: > To validate the special formatting of the "charge_behaviour" sysfs > property add it to the example driver. > > Signed-off-by: Thomas Weißschuh Thanks, patch looks good to me: Reviewed-by: Hans de Goede Regards, Hans > --- > drivers/power/supply/test_power.c | 10 ++++++++++ > 1 file changed, 10 insertions(+) > > diff --git a/drivers/power/supply/test_power.c b/drivers/power/supply/test_power.c > index 0d0a77584c5d..4da0420996c9 100644 > --- a/drivers/power/supply/test_power.c > +++ b/drivers/power/supply/test_power.c > @@ -123,6 +123,14 @@ static int test_power_get_battery_property(struct power_supply *psy, > case POWER_SUPPLY_PROP_CURRENT_NOW: > val->intval = battery_current; > break; > + case POWER_SUPPLY_PROP_CHARGE_BEHAVIOUR: > + val->intval = POWER_SUPPLY_CHARGE_BEHAVIOUR_INHIBIT_CHARGE; > + break; > + case POWER_SUPPLY_PROP_CHARGE_BEHAVIOUR_AVAILABLE: > + val->intval = BIT(POWER_SUPPLY_CHARGE_BEHAVIOUR_AUTO) > + | BIT(POWER_SUPPLY_CHARGE_BEHAVIOUR_INHIBIT_CHARGE) > + | BIT(POWER_SUPPLY_CHARGE_BEHAVIOUR_FORCE_DISCHARGE); > + break; > default: > pr_info("%s: some properties deliberately report errors.\n", > __func__); > @@ -156,6 +164,8 @@ static enum power_supply_property test_power_battery_props[] = { > POWER_SUPPLY_PROP_VOLTAGE_NOW, > POWER_SUPPLY_PROP_CURRENT_AVG, > POWER_SUPPLY_PROP_CURRENT_NOW, > + POWER_SUPPLY_PROP_CHARGE_BEHAVIOUR, > + POWER_SUPPLY_PROP_CHARGE_BEHAVIOUR_AVAILABLE, > }; > > static char *test_power_ac_supplied_to[] = { >