Received: by 2002:ab2:3141:0:b0:1ed:23cc:44d1 with SMTP id i1csp1382647lqg; Sun, 3 Mar 2024 07:31:52 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXL9ExPGIBcGHfpRSGbnAH1Bv72mgNDCQu7fBPje5+Ptz+zXghHIpQq/jwV056icLUIAgG9vjNRw/Z11WCjDsCRYsnxmvZvaGFPmgaKKw== X-Google-Smtp-Source: AGHT+IHPqQj+DhIN6ubnSKN96GWvs1wwmt0TncHaIPiWzNf7WuSLhdpcDbPTWr+q2DEVDuQspaz/ X-Received: by 2002:a05:6402:948:b0:565:4ac9:d69c with SMTP id h8-20020a056402094800b005654ac9d69cmr4434764edz.11.1709479912545; Sun, 03 Mar 2024 07:31:52 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709479912; cv=pass; d=google.com; s=arc-20160816; b=rFJBFfz+jP5aij+tRQKZE8XUR8f3Kht+Scy5v6o8PA/EokVeM40zuDTKQCqLvNDa1R 42dQD8iIAgXiBXrXp4V1LNufN+g2rIfyArsmvRU9DyDqj60siGgoUOaVPQbaH6U8+V/n cbOMZ/uiFYyu392L69lGYYu688hcMz4NSAI7mz4ZybqNazAesTmCR6dAelu5WKyuOHs5 zQTrUHw2x/Yrih2tjJdObh3q7pewRxh/PhHw3qyMNQRsjKUh40PYEOzNiwQ6CawFUqXv LaXay0TJVQKupJFKiOOmdBRwPDuf503Dj7NIFzO622uRAnFw3PXIn9WqPzMFGnYMljrP /dww== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:from :dkim-signature; bh=ytm0uiy8lVI7EqcgOBefyedQxgM1shrdXVac1yJFlfc=; fh=dENBTHx7kJ0jlNJaErTJ7Ld+rhETTNznjDk+Wc/4RaE=; b=WHfEUf8pRj5LdU+/22iJLbydpOwncjNIezMw5l2UzF+evC3hTd52qoFQOoqY8d01bF YCuKCyMeQFpfLR/GmcZtTmnIoaO2jNLLnPzF2n0Kiotwi7hsEmEOvbGP4MDnC0F5hz/j bD1EQ7L0zsCR70AJ9UKyCcDjR5L4GmQshnKbg1cbp2l7oinW50hHy/JSvdqNsUtdyIxa rKNmrwLuvkIK9VuZBDRuIDjEKc1ILlNtjeMYu0EGBL981/QrueuZYahx/vxUqV63pWh2 5PsuAL3P+Sd/0zWhpuRUCYsZYHpdcuQMSm0KXoeEGJ0316GJBdVQlm26pqu9MWGRrhN6 hCTg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@weissschuh.net header.s=mail header.b=ajFz9f3+; arc=pass (i=1 spf=pass spfdomain=weissschuh.net dkim=pass dkdomain=weissschuh.net); spf=pass (google.com: domain of linux-kernel+bounces-89799-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-89799-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id y10-20020a056402270a00b00566a4cab474si3170217edd.452.2024.03.03.07.31.52 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 03 Mar 2024 07:31:52 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-89799-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=ajFz9f3+; arc=pass (i=1 spf=pass spfdomain=weissschuh.net dkim=pass dkdomain=weissschuh.net); spf=pass (google.com: domain of linux-kernel+bounces-89799-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-89799-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 497431F215BB for ; Sun, 3 Mar 2024 15:31:52 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 623B367E6A; Sun, 3 Mar 2024 15:31:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=weissschuh.net header.i=@weissschuh.net header.b="ajFz9f3+" 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 3485A679F8; Sun, 3 Mar 2024 15:31:28 +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=1709479892; cv=none; b=sTfwoPt9cHpOj0p4O2zhAWmvt8rsY7xPHuIrmAiy80k5PzSRVvUoxTrNWNQR9eAdq9Jc1ofJhONjdh++g59Y8m0hgWlteIAAkLugnQpj5CHVyTtzaaDQ66V0ceA2ACR4PscNxLqsNjzYWEkzPRJiFPrAcVOcpd+uPh/XGE0huZc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709479892; c=relaxed/simple; bh=BMCjTdC0Fu2nH2LhHAv4BwNh5+V6v1koWf/3R/NO2HY=; h=From:Subject:Date:Message-Id:MIME-Version:Content-Type:To:Cc; b=L/cnQlvWZLsrbUY15qItfiyxJj4iLCh/3KIX85DZLy08Y1EgGHcrB0HeLq19Gp8RFQfQDzMBY6fhlksQ63AZepDGww+m50FquzFySkYWKx7B7tNp0AHGc0g/5bQuP1f9mJCySa0JOPESaBKHoVUgKvDw6ASZHgAUh54LzoDhz2s= 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=ajFz9f3+; 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=1709479880; bh=BMCjTdC0Fu2nH2LhHAv4BwNh5+V6v1koWf/3R/NO2HY=; h=From:Subject:Date:To:Cc:From; b=ajFz9f3+epov5O4TR5sYDNHUIyCrVUL29B8ronMM4c5yFRIOgarIy+RJmcv1rQVyb Jdz8FlQVKuHqWjzOR++3gPzSLKQSiOYeECcgFi1mnAP1Dbzt36kBWp02TclihwW6ug ncPInUdrOyKg2+RQwBYq1ecQpcapPR7MCY2PtO/o= From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= Subject: [PATCH v2 0/4] power: supply: core: align charge_behaviour format with docs Date: Sun, 03 Mar 2024 16:31:12 +0100 Message-Id: <20240303-power_supply-charge_behaviour_prop-v2-0-8ebb0a7c2409@weissschuh.net> 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-Transfer-Encoding: 8bit X-B4-Tracking: v=1; b=H4sIAMCX5GUC/42NQQ6CMBBFr0K6tmao2FhX3sMQgmWgkxjadKBIC He3eAKX7+fnvU0wRkIW92ITERMx+TGDOhXCunYcUFKXWShQFzDKyOAXjA3PIbxXmS9xwOaFrk3 k59iE6IMswdq+M7rVWossChF7+vwizzqzI558XH/NVB7roa9AQfWPPpUSJOhWgTXXW2/0Y0FiZ utmdx5xEvW+719gbi9P2QAAAA== To: Sebastian Reichel , Hans de Goede , Konrad Dybcio Cc: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Sebastian Reichel , =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1709479879; l=1906; i=linux@weissschuh.net; s=20221212; h=from:subject:message-id; bh=BMCjTdC0Fu2nH2LhHAv4BwNh5+V6v1koWf/3R/NO2HY=; b=NWAd8gl8NdXAXW/y8qaCv+zgnHRRG382XqOuVLW5lOlIiHDcmx9h56SiH8dC+3uzGWNI5uFg6 1iPIwDrn7wEBvPcHQNr821G+DnXFhR+tLW+wBxo0sTYRu1oVYqsWWHi X-Developer-Key: i=linux@weissschuh.net; a=ed25519; pk=KcycQgFPX2wGR5azS7RhpBqedglOZVgRPfdFSPB1LNw= The original submission of the charge_behaviour property did not implement proper formatting in the default formatting handler in power_supply_sysfs.c. At that time it was not a problem because the only provider of the UAPI, thinkpad_acpi, did its own formatting. Now there is an in-tree driver, mm8013, and out-of-tree driver which use the normal power-supply properties and are affected by the wrong formatting. In this revision the handling of CHARGE_BEHAVIOUR in mm8013 is dropped as it is not the correct API for it to use. That change was not tested by me as I don't have the hardware. Signed-off-by: Thomas Weißschuh --- Changes in v2: - Simplify the backwards-compatibility logic (adds a preparatory patch) - Extend test-power to also handle writing of charge_behaviour - Drop incorrect CHARGE_BEHAVIOUR from mm8013 driver - Replace special CHARGE_BEHAVIOUR_AVAILABLE property with bitmask in struct power_supply_desc - Link to v1: https://lore.kernel.org/r/20240204-power_supply-charge_behaviour_prop-v1-0-06a20c958f96@weissschuh.net --- Thomas Weißschuh (4): power: supply: mm8013: fix "not charging" detection power: supply: core: ease special formatting implementations power: supply: core: fix charge_behaviour formatting power: supply: test-power: implement charge_behaviour property drivers/power/supply/mm8013.c | 13 ++----------- drivers/power/supply/power_supply_sysfs.c | 32 +++++++++++++++++++++++++------ drivers/power/supply/test_power.c | 31 ++++++++++++++++++++++++++++++ include/linux/power_supply.h | 1 + 4 files changed, 60 insertions(+), 17 deletions(-) --- base-commit: 04b8076df2534f08bb4190f90a24e0f7f8930aca change-id: 20230929-power_supply-charge_behaviour_prop-10ccfd96a666 Best regards, -- Thomas Weißschuh