From patchwork Fri Aug 2 19:20:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Morgan X-Patchwork-Id: 13751899 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 3F337C3DA4A for ; Fri, 2 Aug 2024 19:24:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=EOS6CB7c1t/IxbcoB65fP4OgyGzoOrEBpGmlG4zcGvM=; b=eH0YMVNGalJuGI2FBf50jnmVWM npoD0wTciikwn18K3exFtQetd0CBpTBkoA8z7MPBXXohAOAf7rGljkpDCLlxQa3vinns15A6GwrP9 wBmomo9pPM4rJthh0lOiYOEAD0hsDKU2QM8Kl8XkK9lOhhp07OSJUy0wYbnn12MSHzY9vkH8P6cGT ai6EwgoBABuNGBbNyDLCMb+8HC1Wf5PqXY3ZR3crZhE8Ech60dLRHSXBy3HAPrj0yWE+oSzJpzCyb 6PM1AgOm4uOY4iVnGT4ILYT6mqdlD8HIX7QD5btdxDhYbDGG4FSBxWL75bkkbU+DtJXfj1sb24C5W +cQrRFNw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sZxsx-00000009qnn-1S2j; Fri, 02 Aug 2024 19:24:19 +0000 Received: from mail-oi1-x22d.google.com ([2607:f8b0:4864:20::22d]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sZxrY-00000009qX6-0uNj for linux-arm-kernel@lists.infradead.org; Fri, 02 Aug 2024 19:22:53 +0000 Received: by mail-oi1-x22d.google.com with SMTP id 5614622812f47-3db50abf929so1805098b6e.2 for ; Fri, 02 Aug 2024 12:22:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1722626571; x=1723231371; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=EOS6CB7c1t/IxbcoB65fP4OgyGzoOrEBpGmlG4zcGvM=; b=ThbB/OvVFd/uEpNXlq9nV5jyxfM0DEHR6EyfsyjpFgEap+m0BdwBBhNyJOGMF0wxFI 1V0RhIBReYaoCfgYEcRVdHDzUnYWaK6szcEmc95nh/KtMEIUzPM/hn3KvFSgZv5LD1Lh uoMSvlTelNv5MHRo/uJ3Z0kkqn1NY8DKx778Cyk3e2ElWplcfoe8yuNBwnPNqoA9tzXv ktL6Hlk/WQtXPzeQCvW7pnpjfNQjXIMnZm0hJQ1LSSmIka9BvCZvuwqMZM3Pg/A8Pt3J 2fVCoT6J+wlCIdaYOiELDjjpPH++UJ1Hbq6kJ4OG5Io0eSLxlD9pZA5zolDgAGVks7y7 xiww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722626571; x=1723231371; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=EOS6CB7c1t/IxbcoB65fP4OgyGzoOrEBpGmlG4zcGvM=; b=ARDKZW4FHaPG8fSWqUYrpZcK843R/3AbaM6wYOONHL7Or1Xf0eOJmfFv7jTWF8wiYe 42W3hnPafS70PXFnUcNXH5NAOQr3IV7PeKKPsuhGCzoz18xCwzJRnTIKu9HGXYnfTGBp fGDVjtu0Cmc9UliYvd0vdFJn01nL0gPze1ZP7nhsbW8mYkeTKh4n4Q15ifuibQ+jrdkp 14sbLGBDK9/SbXrEVVn0Icpim6KqxSHNcoVerP64W08h0tsxwW40p9vkrHZA1qzj5nxv 5ZmfAUphc5Qdt9aS9oV1tl7CXr0xppyq7A8hm8vZfk64DxX8d57+t0kQvNx02zFSyXly DSGg== X-Forwarded-Encrypted: i=1; AJvYcCUtplRkdZuzidJxNnh10hQkLuIqWkVLzt7H8pZ8iyFoqoDqIJHYbTzi2doQ49XX4fBuRfUctjHP09Autpqm6eaPUmYOLeyvYb2AADg/NXSiVTXtsmw= X-Gm-Message-State: AOJu0YzjLpil6ipg64BFqCBtdM9cottVTSFEyal2AvW1zS+KQ3TV+iaL c1gE4rDtdgxSnd7TS7gZ4Cquw6mWjhEnOZyJl7YxVoCf20P3x/E6 X-Google-Smtp-Source: AGHT+IFJcAjiqo+BzQ7QTY8ocYPFJ2ywrHoQ1xB5Idyd/7diq5ZppHkiZrLU53qgCT0FJHZgYfZPjg== X-Received: by 2002:a05:6808:1919:b0:3db:27e6:8be5 with SMTP id 5614622812f47-3db55847b72mr5731454b6e.42.1722626571189; Fri, 02 Aug 2024 12:22:51 -0700 (PDT) Received: from localhost.localdomain ([2600:1700:fb0:1bcf::54]) by smtp.gmail.com with ESMTPSA id 5614622812f47-3db563b7065sm584592b6e.46.2024.08.02.12.22.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Aug 2024 12:22:50 -0700 (PDT) From: Chris Morgan To: linux-sunxi@lists.linux.dev Cc: linux-pm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, linux-iio@vger.kernel.org, quentin.schulz@free-electrons.com, mripard@kernel.org, tgamblin@baylibre.com, aidanmacdonald.0x0@gmail.com, u.kleine-koenig@pengutronix.de, lee@kernel.org, samuel@sholland.org, jernej.skrabec@gmail.com, sre@kernel.org, wens@csie.org, conor+dt@kernel.org, krzk+dt@kernel.org, robh@kernel.org, lars@metafoo.de, jic23@kernel.org, Chris Morgan , Chen-Yu Tsai Subject: [PATCH V2 02/15] power: supply: axp20x_battery: Remove design from min and max voltage Date: Fri, 2 Aug 2024 14:20:13 -0500 Message-Id: <20240802192026.446344-3-macroalpha82@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240802192026.446344-1-macroalpha82@gmail.com> References: <20240802192026.446344-1-macroalpha82@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240802_122252_282561_ACF849AC X-CRM114-Status: GOOD ( 13.77 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Chris Morgan The POWER_SUPPLY_PROP_VOLTAGE_MIN_DESIGN and POWER_SUPPLY_PROP_VOLTAGE_MAX_DESIGN values should be immutable properties of the battery, but for this driver they are writable values and used as the minimum and maximum values for charging. Remove the DESIGN designation from these values. Fixes: 46c202b5f25f ("power: supply: add battery driver for AXP20X and AXP22X PMICs") Suggested-by: Chen-Yu Tsai Signed-off-by: Chris Morgan --- drivers/power/supply/axp20x_battery.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/power/supply/axp20x_battery.c b/drivers/power/supply/axp20x_battery.c index 6ac5c80cfda2..7520b599eb3d 100644 --- a/drivers/power/supply/axp20x_battery.c +++ b/drivers/power/supply/axp20x_battery.c @@ -303,11 +303,11 @@ static int axp20x_battery_get_prop(struct power_supply *psy, val->intval = reg & AXP209_FG_PERCENT; break; - case POWER_SUPPLY_PROP_VOLTAGE_MAX_DESIGN: + case POWER_SUPPLY_PROP_VOLTAGE_MAX: return axp20x_batt->data->get_max_voltage(axp20x_batt, &val->intval); - case POWER_SUPPLY_PROP_VOLTAGE_MIN_DESIGN: + case POWER_SUPPLY_PROP_VOLTAGE_MIN: ret = regmap_read(axp20x_batt->regmap, AXP20X_V_OFF, ®); if (ret) return ret; @@ -455,10 +455,10 @@ static int axp20x_battery_set_prop(struct power_supply *psy, struct axp20x_batt_ps *axp20x_batt = power_supply_get_drvdata(psy); switch (psp) { - case POWER_SUPPLY_PROP_VOLTAGE_MIN_DESIGN: + case POWER_SUPPLY_PROP_VOLTAGE_MIN: return axp20x_set_voltage_min_design(axp20x_batt, val->intval); - case POWER_SUPPLY_PROP_VOLTAGE_MAX_DESIGN: + case POWER_SUPPLY_PROP_VOLTAGE_MAX: return axp20x_batt->data->set_max_voltage(axp20x_batt, val->intval); case POWER_SUPPLY_PROP_CONSTANT_CHARGE_CURRENT: @@ -493,8 +493,8 @@ static enum power_supply_property axp20x_battery_props[] = { POWER_SUPPLY_PROP_CONSTANT_CHARGE_CURRENT, POWER_SUPPLY_PROP_CONSTANT_CHARGE_CURRENT_MAX, POWER_SUPPLY_PROP_HEALTH, - POWER_SUPPLY_PROP_VOLTAGE_MAX_DESIGN, - POWER_SUPPLY_PROP_VOLTAGE_MIN_DESIGN, + POWER_SUPPLY_PROP_VOLTAGE_MAX, + POWER_SUPPLY_PROP_VOLTAGE_MIN, POWER_SUPPLY_PROP_CAPACITY, }; @@ -502,8 +502,8 @@ static int axp20x_battery_prop_writeable(struct power_supply *psy, enum power_supply_property psp) { return psp == POWER_SUPPLY_PROP_STATUS || - psp == POWER_SUPPLY_PROP_VOLTAGE_MIN_DESIGN || - psp == POWER_SUPPLY_PROP_VOLTAGE_MAX_DESIGN || + psp == POWER_SUPPLY_PROP_VOLTAGE_MIN || + psp == POWER_SUPPLY_PROP_VOLTAGE_MAX || psp == POWER_SUPPLY_PROP_CONSTANT_CHARGE_CURRENT || psp == POWER_SUPPLY_PROP_CONSTANT_CHARGE_CURRENT_MAX; }