From patchwork Sat Oct 5 10:05:03 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Patchwork-Id: 833237 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 F291D146593; Sat, 5 Oct 2024 10:05: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=1728122731; cv=none; b=PAgVYjtmL3ci2un147/XYz1+53nbMKbuWQK6/i6imO1EFZoPexKoEODKQoANIgaanyQWXr0YMks+HlzAHOF9imSxsK/ugfwPw0Pp4qdIYop39SK4wTgMJ18s5epHt0mh5vd+82wT4jdHvpgHAfJ0p5gOipBjA+6SBBnvso//bPE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728122731; c=relaxed/simple; bh=ijS07aEByhrA+n6K2twDkykEXtvnzQLVfRKUwwjEGxk=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=gQRV9gNG3xaa+X1IRfsN3oyCktV2J0PIJMLKxnGfZZ8Z9nIt2rvMg5k4MQrJ+F0rVgmZ3QeRleVK+yPbaL3rgixB+tmjObASWZxJZpaELAtuN5uCK9iQu3m/1EyqMPCBedmfmY+plcjEbkNgaENvMRYaUWdZ1CagKOt1KRIQCrs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine 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=nAqi6hga; arc=none smtp.client-ip=159.69.126.157 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=weissschuh.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=weissschuh.net Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=weissschuh.net header.i=@weissschuh.net header.b="nAqi6hga" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=weissschuh.net; s=mail; t=1728122726; bh=ijS07aEByhrA+n6K2twDkykEXtvnzQLVfRKUwwjEGxk=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=nAqi6hgaITg2oVn3L69qa4x8PokHo/GV4BGerq3Sq2QzM6tK+v1Hbt2ZmnwaM5IRN Uanm6jjFelNc7parev+EuGS/ilA8rjiOqgoPhDzdEo54UpHsbmvV6R3jvH606KPWFL jWgDMdxxmGbKWBsAbbUBdvBiti4mzbQIVBEmlxlY= From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= Date: Sat, 05 Oct 2024 12:05:03 +0200 Subject: [PATCH 1/8] power: supply: core: add wakeup source inhibit by power_supply_config Precedence: bulk X-Mailing-List: linux-acpi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20241005-power-supply-no-wakeup-source-v1-1-1d62bf9bcb1d@weissschuh.net> References: <20241005-power-supply-no-wakeup-source-v1-0-1d62bf9bcb1d@weissschuh.net> In-Reply-To: <20241005-power-supply-no-wakeup-source-v1-0-1d62bf9bcb1d@weissschuh.net> To: Sebastian Reichel , "Rafael J. Wysocki" , Len Brown , =?utf-8?q?Pali_Roh=C3=A1r?= , Benson Leung , Guenter Roeck , Luca Ceresoli Cc: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org, chrome-platform@lists.linux.dev, =?utf-8?q?Tho?= =?utf-8?q?mas_Wei=C3=9Fschuh?= X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1728122726; l=1549; i=linux@weissschuh.net; s=20221212; h=from:subject:message-id; bh=ijS07aEByhrA+n6K2twDkykEXtvnzQLVfRKUwwjEGxk=; b=q1QrO+VM8DvVjekwT7aC6UoANhEktHr2rCBQ2IWIzfHShh+XuAtDiqWE1UL1A315Btf9A60vj Zz+I35sESEKCI3pwKsn3QaCz+LneOPNLH3vCxsfjGfde6hm2Hkq1QbD X-Developer-Key: i=linux@weissschuh.net; a=ed25519; pk=KcycQgFPX2wGR5azS7RhpBqedglOZVgRPfdFSPB1LNw= To inhibit wakeup users currently have to use dedicated functions to register the power supply: {,devm_}power_supply_register_no_ws(). This is inconsistent to other runtime settings which can be configured through struct power_supply_config. It's also not obvious what _no_ws() is meant to mean. Extend power_supply_config to also be able to inhibit the wakeup source. Signed-off-by: Thomas Weißschuh --- drivers/power/supply/power_supply_core.c | 3 +++ include/linux/power_supply.h | 2 ++ 2 files changed, 5 insertions(+) diff --git a/drivers/power/supply/power_supply_core.c b/drivers/power/supply/power_supply_core.c index 49534458a9f7d3f6d7c01bd91fa1bb6ed23bc7ad..5b5a3abca0b554d809054026f8cf32b2d18a3362 100644 --- a/drivers/power/supply/power_supply_core.c +++ b/drivers/power/supply/power_supply_core.c @@ -1410,6 +1410,9 @@ __power_supply_register(struct device *parent, if (rc) goto device_add_failed; + if (cfg && cfg->no_wakeup_source) + ws = false; + rc = device_init_wakeup(dev, ws); if (rc) goto wakeup_init_failed; diff --git a/include/linux/power_supply.h b/include/linux/power_supply.h index 910d407ebe6323aaf4b31f0081f2cdd4be43a9fa..412646e055d79ff23346a99c4485e594363857ed 100644 --- a/include/linux/power_supply.h +++ b/include/linux/power_supply.h @@ -236,6 +236,8 @@ struct power_supply_config { char **supplied_to; size_t num_supplicants; + + bool no_wakeup_source; }; /* Description of power supply */ From patchwork Sat Oct 5 10:05:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Patchwork-Id: 833032 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 8FF3E145B10; Sat, 5 Oct 2024 10:05: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=1728122730; cv=none; b=dYhO0VVyLQUXcnt0c08CMZ9b04d4HFwlE0kcNnSNfinAajCW+kJzVy7ZxMF3Pemj5O1ge7B+Pmp/LW5n2YkLKvrUv4jlNQaC5xL4RxpM/nCvAYkCwcjBS5MO94eyBOkSehVmeNMYhWYaasAgaB/hNwYTbnDCfkMzOcij1LD2ppM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728122730; c=relaxed/simple; bh=r6VqPKJndOSTJfo57apH3Pg1CyWBmiP5JsMt4rLFKFU=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=VVhaS0OYZUc0tW6muRdXMj22WScPThdJib+zl2nHw6HTemMYbYM2Wm0GbmXWAfEYSh6JWo4J8M+fyzVWz0923L+XejwWx/xSGEbu9r8HVH7KWfB57U8cBTuWu5+n6DHWDm6lDzDhLedJROtO7/5SXNeeBv4f4f3xihSxf7rQj5A= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine 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=WQyDcrB8; arc=none smtp.client-ip=159.69.126.157 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=weissschuh.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=weissschuh.net Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=weissschuh.net header.i=@weissschuh.net header.b="WQyDcrB8" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=weissschuh.net; s=mail; t=1728122726; bh=r6VqPKJndOSTJfo57apH3Pg1CyWBmiP5JsMt4rLFKFU=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=WQyDcrB8RLAqjTGnlBsySLN+Egn0GPkwyi+XgeITucgfHmA6u+odPPBKtYZq2EOA4 KV4+4jPfzuKwaofux/k+Zn6qPiJHXMCHn9LJRF1KG8vN+BlVVnY3xRNqQKwZY2axkz Yj3A6lYKUHFV3Eo/1wabvvc2zaqXcv+Nr7TQGB4g= From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= Date: Sat, 05 Oct 2024 12:05:04 +0200 Subject: [PATCH 2/8] ACPI: battery: Register power supply with power_supply_register() Precedence: bulk X-Mailing-List: linux-acpi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20241005-power-supply-no-wakeup-source-v1-2-1d62bf9bcb1d@weissschuh.net> References: <20241005-power-supply-no-wakeup-source-v1-0-1d62bf9bcb1d@weissschuh.net> In-Reply-To: <20241005-power-supply-no-wakeup-source-v1-0-1d62bf9bcb1d@weissschuh.net> To: Sebastian Reichel , "Rafael J. Wysocki" , Len Brown , =?utf-8?q?Pali_Roh=C3=A1r?= , Benson Leung , Guenter Roeck , Luca Ceresoli Cc: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org, chrome-platform@lists.linux.dev, =?utf-8?q?Tho?= =?utf-8?q?mas_Wei=C3=9Fschuh?= X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1728122726; l=1138; i=linux@weissschuh.net; s=20221212; h=from:subject:message-id; bh=r6VqPKJndOSTJfo57apH3Pg1CyWBmiP5JsMt4rLFKFU=; b=J59RzEPdQuB35y2GIKegik92KvMQTF53sRsbhC0YelLPfOGPNUtJ15nzYc4xjr5xAFnRX2a/7 K+wF8HXrdhjAEIuaR+Yw/jp49NNtmrRE9ZRRF1AYwlcBJkgZR4/1oXm X-Developer-Key: i=linux@weissschuh.net; a=ed25519; pk=KcycQgFPX2wGR5azS7RhpBqedglOZVgRPfdFSPB1LNw= power_supply_register_no_ws() is going to be removed. Switch to the general registration API. Signed-off-by: Thomas Weißschuh --- drivers/acpi/battery.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/acpi/battery.c b/drivers/acpi/battery.c index 65fa3444367a13ac83644444076a11f08152c382..9a3a475f8ad334bb365e6a0273084034b8baa3bd 100644 --- a/drivers/acpi/battery.c +++ b/drivers/acpi/battery.c @@ -853,6 +853,7 @@ static int sysfs_add_battery(struct acpi_battery *battery) struct power_supply_config psy_cfg = { .drv_data = battery, .attr_grp = acpi_battery_groups, + .no_wakeup_source = true, }; bool full_cap_broken = false; @@ -888,7 +889,7 @@ static int sysfs_add_battery(struct acpi_battery *battery) battery->bat_desc.type = POWER_SUPPLY_TYPE_BATTERY; battery->bat_desc.get_property = acpi_battery_get_property; - battery->bat = power_supply_register_no_ws(&battery->device->dev, + battery->bat = power_supply_register(&battery->device->dev, &battery->bat_desc, &psy_cfg); if (IS_ERR(battery->bat)) { From patchwork Sat Oct 5 10:05:05 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Patchwork-Id: 833238 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 7BE0513D276; Sat, 5 Oct 2024 10:05: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=1728122730; cv=none; b=pUA3bsXeZXb5LBCw5LQINSYdmLvVIjYifKRj09BGHZbpAnjPb/ER6GrEBJZpjkh/2nzgK4mKZ6PZAAz/lNiAHRyHdtQ1f59J9WHULi5WGAMhBT5D/QN0WJgBokcnC3Cvr8dj7zXjh6WNTqgMyYFLhKC/kVHj4HRzcpHBiRIyKkE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728122730; c=relaxed/simple; bh=WQKSkjSktZCriiwkdWIUgiePB+EnguIBlEAzjDlXbT8=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=BUs8kCqI/ZOnWbEFOdBu12dF/lqPcPyEqNsisUK44PCaM/roPiYOqN9x6euqCRd0LJrpzLjiIIBV+nFurquo8d1/Z3jUtR/ryWqc2EObKCjy8JbcielQ9KilHT0rp7fWxDqRFBS7gdbd9uO2KmEUc83ydqUf7+ooM1preM2JHLg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine 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=NHfnLLUb; arc=none smtp.client-ip=159.69.126.157 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=weissschuh.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=weissschuh.net Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=weissschuh.net header.i=@weissschuh.net header.b="NHfnLLUb" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=weissschuh.net; s=mail; t=1728122726; bh=WQKSkjSktZCriiwkdWIUgiePB+EnguIBlEAzjDlXbT8=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=NHfnLLUbldI/L+kjukmJjkdP/ksheXaJsmwm0+R7zyiiftDHfCQH4kZqPeGKRxCLs 1AMSBIy/5PbmfOBsl3dCKHjGT5zY+LphyrmNMRtfxHyTI/cudjqtiZDbBvdJ0WIn9a +7amOUZFxqm8aHObS6IS2MyiGDQFl8fIWmcpR+HY= From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= Date: Sat, 05 Oct 2024 12:05:05 +0200 Subject: [PATCH 3/8] power: supply: acer_a500_battery: register power supply with devm_power_supply_register() Precedence: bulk X-Mailing-List: linux-acpi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20241005-power-supply-no-wakeup-source-v1-3-1d62bf9bcb1d@weissschuh.net> References: <20241005-power-supply-no-wakeup-source-v1-0-1d62bf9bcb1d@weissschuh.net> In-Reply-To: <20241005-power-supply-no-wakeup-source-v1-0-1d62bf9bcb1d@weissschuh.net> To: Sebastian Reichel , "Rafael J. Wysocki" , Len Brown , =?utf-8?q?Pali_Roh=C3=A1r?= , Benson Leung , Guenter Roeck , Luca Ceresoli Cc: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org, chrome-platform@lists.linux.dev, =?utf-8?q?Tho?= =?utf-8?q?mas_Wei=C3=9Fschuh?= X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1728122726; l=1231; i=linux@weissschuh.net; s=20221212; h=from:subject:message-id; bh=WQKSkjSktZCriiwkdWIUgiePB+EnguIBlEAzjDlXbT8=; b=kJ4kyvm3rSkSK9d7BH2dX6xc6AmzbCJi+3MyyQvRFk32eAI889qmopc+SG6KbmeFgfZDBI3UT auXgsi7YK6XAIZl+9+aizcn6z38bUCsYnnT6CeSaRqIWJX1fUNhKgZi X-Developer-Key: i=linux@weissschuh.net; a=ed25519; pk=KcycQgFPX2wGR5azS7RhpBqedglOZVgRPfdFSPB1LNw= devm_power_supply_register_no_ws() is going to be removed. Switch to the general registration API. Signed-off-by: Thomas Weißschuh --- drivers/power/supply/acer_a500_battery.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/power/supply/acer_a500_battery.c b/drivers/power/supply/acer_a500_battery.c index ef5c419b1b7f20744b48e1648c38289f4d546cf9..58e7b2eac68f9745f5a2c48ba27951f65e681d2f 100644 --- a/drivers/power/supply/acer_a500_battery.c +++ b/drivers/power/supply/acer_a500_battery.c @@ -233,14 +233,15 @@ static int a500_battery_probe(struct platform_device *pdev) psy_cfg.of_node = pdev->dev.parent->of_node; psy_cfg.drv_data = bat; + psy_cfg.no_wakeup_source = true; bat->regmap = dev_get_regmap(pdev->dev.parent, "KB930"); if (!bat->regmap) return -EINVAL; - bat->psy = devm_power_supply_register_no_ws(&pdev->dev, - &a500_battery_desc, - &psy_cfg); + bat->psy = devm_power_supply_register(&pdev->dev, + &a500_battery_desc, + &psy_cfg); if (IS_ERR(bat->psy)) return dev_err_probe(&pdev->dev, PTR_ERR(bat->psy), "failed to register battery\n"); From patchwork Sat Oct 5 10:05:06 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Patchwork-Id: 833030 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 E668B15687C; Sat, 5 Oct 2024 10:05:31 +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=1728122733; cv=none; b=GX/u8Umi2yDJNswVxcWNlmlDLi65835dv+h9d5SRCkQIs4pS9iP8gUeS/ZqxtnlN1C4niIc2JvUMaUUKhbMvMYZyuIOxXsdlM/M4h44HYwtEg6SYVbmCQpN6BldJ/+FHizJp34gf7NQgMQ2Rk3SeQv86f5ATQCCaJUWFPey5KHM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728122733; c=relaxed/simple; bh=moxkro+CB+xOsJiW1z/X3lMPdX4iMCNAf6TleiEEwmk=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=mtICFTM4IezLET3Tiy0vfQipHX7WZR+zxnK+3Bcd0LP2VARcBNyFdamQhPqOqW7hNWrMKygu7MkV1L/skRaFJ5bceNnNi2lSox1TwfNq+aqHqK6B9/Df09xWPwvues34wiPCEy2i5K3p81pPjRu0N5xA4JgDPl9VQi+r6FXzs+o= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine 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=Kwqa7tMU; arc=none smtp.client-ip=159.69.126.157 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=weissschuh.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=weissschuh.net Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=weissschuh.net header.i=@weissschuh.net header.b="Kwqa7tMU" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=weissschuh.net; s=mail; t=1728122726; bh=moxkro+CB+xOsJiW1z/X3lMPdX4iMCNAf6TleiEEwmk=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=Kwqa7tMUb+H3aKu2W258Qs14tw0tw3cKhWG3YMEEsfndpclsWatGHqvhv2NNx7gAr OcfEdX/wGbehTlPzF9QfgxiBQgdKh6JY6acezjlr+en1v34TNhUygSyTORttZ6XcaG jMoDhzEPS/SeJYjVLlYJG4M6qTdr1Tf4Vcx+v8LI= From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= Date: Sat, 05 Oct 2024 12:05:06 +0200 Subject: [PATCH 4/8] power: supply: bq27xxx_battery: register power supply with power_supply_register() Precedence: bulk X-Mailing-List: linux-acpi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20241005-power-supply-no-wakeup-source-v1-4-1d62bf9bcb1d@weissschuh.net> References: <20241005-power-supply-no-wakeup-source-v1-0-1d62bf9bcb1d@weissschuh.net> In-Reply-To: <20241005-power-supply-no-wakeup-source-v1-0-1d62bf9bcb1d@weissschuh.net> To: Sebastian Reichel , "Rafael J. Wysocki" , Len Brown , =?utf-8?q?Pali_Roh=C3=A1r?= , Benson Leung , Guenter Roeck , Luca Ceresoli Cc: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org, chrome-platform@lists.linux.dev, =?utf-8?q?Tho?= =?utf-8?q?mas_Wei=C3=9Fschuh?= X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1728122726; l=1268; i=linux@weissschuh.net; s=20221212; h=from:subject:message-id; bh=moxkro+CB+xOsJiW1z/X3lMPdX4iMCNAf6TleiEEwmk=; b=QRuIUev1efYRdNAvqBQ+zRFuEfyQr5o1ubmALwExgLuVPWNX8Xqf4YhFZSA04glfrEE6II1Wp w8Hre2VV+HuCM0NLXqoLHVlJepzsWhGqT1T8cMl0/M8sdYcuI78M89V X-Developer-Key: i=linux@weissschuh.net; a=ed25519; pk=KcycQgFPX2wGR5azS7RhpBqedglOZVgRPfdFSPB1LNw= devm_power_supply_register_no_ws() is going to be removed. Switch to the general registration API. Signed-off-by: Thomas Weißschuh --- drivers/power/supply/bq27xxx_battery.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/power/supply/bq27xxx_battery.c b/drivers/power/supply/bq27xxx_battery.c index 750fda543308c873f65ef3600546b086af68fafd..e47556ec3cfeadd6ce014559d90807b293d781d5 100644 --- a/drivers/power/supply/bq27xxx_battery.c +++ b/drivers/power/supply/bq27xxx_battery.c @@ -2131,6 +2131,7 @@ int bq27xxx_battery_setup(struct bq27xxx_device_info *di) struct power_supply_config psy_cfg = { .of_node = di->dev->of_node, .drv_data = di, + .no_wakeup_source = true, }; int ret; @@ -2157,7 +2158,7 @@ int bq27xxx_battery_setup(struct bq27xxx_device_info *di) psy_desc->get_property = bq27xxx_battery_get_property; psy_desc->external_power_changed = bq27xxx_external_power_changed; - di->bat = devm_power_supply_register_no_ws(di->dev, psy_desc, &psy_cfg); + di->bat = devm_power_supply_register(di->dev, psy_desc, &psy_cfg); if (IS_ERR(di->bat)) return dev_err_probe(di->dev, PTR_ERR(di->bat), "failed to register battery\n"); From patchwork Sat Oct 5 10:05:07 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Patchwork-Id: 833029 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 D9A85156676; Sat, 5 Oct 2024 10:05:31 +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=1728122734; cv=none; b=TPqvzsqS2p1G/MhNutMYjmTBO2kr8J89CtDjruH/axQsdWO0+szGOEL4k99Td/GXgD+X08UfS96J19auja7jjfJ68HyRppcd7WmwXR8Vrw93JwirPpgecXKB0rDmZqTzeNTHkDt7WW3UdrFOdNOfSkKdaYsmI2FJKLj5P8eV9M4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728122734; c=relaxed/simple; bh=YXJ4Fir9eqOqi0FqoCYgm/ICDLFYsW7/A4um6dWTZJ4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=TFGRyYv5BHzH2mKpXKDcbwD+xFN+vhHEsXuyg/3yuVhu6VxX4wTZr5lgRn6Fpajt3zTB2rZeV2kH+mlfEYtDEFapL8x+c6QpaJzUz5j3RREHZwZVAzzQK1F2FqHE9EMzTYF8ee+HXZ2CO4JNkkcog7POSqWwg/13Rt2BWdJ/h80= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine 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=i86JFv2d; arc=none smtp.client-ip=159.69.126.157 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=weissschuh.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=weissschuh.net Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=weissschuh.net header.i=@weissschuh.net header.b="i86JFv2d" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=weissschuh.net; s=mail; t=1728122727; bh=YXJ4Fir9eqOqi0FqoCYgm/ICDLFYsW7/A4um6dWTZJ4=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=i86JFv2dtl8WLc/GYrYsC/nn7BuANhfkG/ee9pPJaP0qRWjr82/UD67taXHeuYy2C a1/sbMGGJJrULHcpmsTMjVZZB5xlznKgXgKEq/tN9qulLcSdiSjhZ0kT77nmkf0qLl /fP86hrlttKmlamPnyo9xkqwOXL6XzRHyVeO2QBY= From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= Date: Sat, 05 Oct 2024 12:05:07 +0200 Subject: [PATCH 5/8] power: supply: cros_usbpd-charger: register power supply with devm_power_supply_register() Precedence: bulk X-Mailing-List: linux-acpi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20241005-power-supply-no-wakeup-source-v1-5-1d62bf9bcb1d@weissschuh.net> References: <20241005-power-supply-no-wakeup-source-v1-0-1d62bf9bcb1d@weissschuh.net> In-Reply-To: <20241005-power-supply-no-wakeup-source-v1-0-1d62bf9bcb1d@weissschuh.net> To: Sebastian Reichel , "Rafael J. Wysocki" , Len Brown , =?utf-8?q?Pali_Roh=C3=A1r?= , Benson Leung , Guenter Roeck , Luca Ceresoli Cc: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org, chrome-platform@lists.linux.dev, =?utf-8?q?Tho?= =?utf-8?q?mas_Wei=C3=9Fschuh?= X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1728122726; l=1287; i=linux@weissschuh.net; s=20221212; h=from:subject:message-id; bh=YXJ4Fir9eqOqi0FqoCYgm/ICDLFYsW7/A4um6dWTZJ4=; b=zMABkNI/yH/mHTfFBL90ELge7YlPIZ79Fq2gURl8pwSUdznUygzgIu6i1GNlNbX6WWihS54dJ FB2MJCjrplWCgdd1/BKXLFWj45aBa6+0Vph+uuFUEB4cegtHallZcOX X-Developer-Key: i=linux@weissschuh.net; a=ed25519; pk=KcycQgFPX2wGR5azS7RhpBqedglOZVgRPfdFSPB1LNw= devm_power_supply_register_no_ws() is going to be removed. Switch to the general registration API. Signed-off-by: Thomas Weißschuh --- drivers/power/supply/cros_usbpd-charger.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/power/supply/cros_usbpd-charger.c b/drivers/power/supply/cros_usbpd-charger.c index bed3e2e9bfea971142f10956ed499b1ac2d834dd..47d3f58aa15ceb792b3c3dc2468e770890d76b7e 100644 --- a/drivers/power/supply/cros_usbpd-charger.c +++ b/drivers/power/supply/cros_usbpd-charger.c @@ -618,6 +618,7 @@ static int cros_usbpd_charger_probe(struct platform_device *pd) psy_desc->external_power_changed = cros_usbpd_charger_power_changed; psy_cfg.drv_data = port; + psy_cfg.no_wakeup_source = true; if (cros_usbpd_charger_port_is_dedicated(port)) { sprintf(port->name, CHARGER_DEDICATED_DIR_NAME); @@ -644,8 +645,7 @@ static int cros_usbpd_charger_probe(struct platform_device *pd) psy_desc->name = port->name; - psy = devm_power_supply_register_no_ws(dev, psy_desc, - &psy_cfg); + psy = devm_power_supply_register(dev, psy_desc, &psy_cfg); if (IS_ERR(psy)) { dev_err(dev, "Failed to register power supply\n"); continue; From patchwork Sat Oct 5 10:05:08 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Patchwork-Id: 833235 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 E67C1156887; Sat, 5 Oct 2024 10:05:31 +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=1728122734; cv=none; b=GLB2RuN9D0LWH8Nv2YzEAwBS3S1Jfz7679oH3pHQxnW8/KFJSR2S0/TPTrWCSU24VavU4KWfJ+zUziyqK/pqmW8YVb9HTjuK1YKlsmkaytHcK6R8qfNzsBxVWb5GmxqFFV7LoSKeCXgH/TBNJN+Zae8VVBKQWhRDxCzGyEy5ZEQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728122734; c=relaxed/simple; bh=tuUyOoOOYHY8iDGRGbdi+WxIWgqrr87gAbpI7vZbnPM=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=YbtPHgkd1Cz8eKhDi+rN4hu2tAYy47DK95OWrxJm4bdWe1iv3H/aGEgHIXuPB2xJfhQYHDOhCuaBDyToCAZnkygj+3YxcQz9ZDabraeEB4/w3kZuMjkF59qN2SM4iJ5H68Fvr55Vgo0c7DkYTPga06WS/FtDdxS5cfPwW87QV0M= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine 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=dt5jVMQd; arc=none smtp.client-ip=159.69.126.157 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=weissschuh.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=weissschuh.net Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=weissschuh.net header.i=@weissschuh.net header.b="dt5jVMQd" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=weissschuh.net; s=mail; t=1728122727; bh=tuUyOoOOYHY8iDGRGbdi+WxIWgqrr87gAbpI7vZbnPM=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=dt5jVMQdArecgtN2/XQ36wxQTDu6IWVFvNMeWjg3Ib1jTtBQ1I8PjFJxczXx5oY4u 1eEMJ+kKME8lAiUOqStjcjpRqdUIQv0h3I/5DiSaeVXr/qXaEI2xIV6nrokBw5DmCr fKb14d2+kIsNY8G9RSs1TOYa9561u/vGI8Zy+5Mc= From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= Date: Sat, 05 Oct 2024 12:05:08 +0200 Subject: [PATCH 6/8] power: supply: lenovo_yoga_c630_battery: register power supplies with power_supply_register() Precedence: bulk X-Mailing-List: linux-acpi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20241005-power-supply-no-wakeup-source-v1-6-1d62bf9bcb1d@weissschuh.net> References: <20241005-power-supply-no-wakeup-source-v1-0-1d62bf9bcb1d@weissschuh.net> In-Reply-To: <20241005-power-supply-no-wakeup-source-v1-0-1d62bf9bcb1d@weissschuh.net> To: Sebastian Reichel , "Rafael J. Wysocki" , Len Brown , =?utf-8?q?Pali_Roh=C3=A1r?= , Benson Leung , Guenter Roeck , Luca Ceresoli Cc: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org, chrome-platform@lists.linux.dev, =?utf-8?q?Tho?= =?utf-8?q?mas_Wei=C3=9Fschuh?= X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1728122726; l=1943; i=linux@weissschuh.net; s=20221212; h=from:subject:message-id; bh=tuUyOoOOYHY8iDGRGbdi+WxIWgqrr87gAbpI7vZbnPM=; b=01TTVw+n3v/wVo5h+Gth0Wq5fG+yLZ4Lq9uaGnFlpGrgtEfNteDcNOfoVUe2HQpOSmuCFtcll cKmOZc2yKXcAteB5/nBeL1LTZd44RgvUmh10E/88U1CKFHowzVo/Er4 X-Developer-Key: i=linux@weissschuh.net; a=ed25519; pk=KcycQgFPX2wGR5azS7RhpBqedglOZVgRPfdFSPB1LNw= {,devm_}power_supply_register_no_ws() are going to be removed. Switch to the general registration API. Signed-off-by: Thomas Weißschuh --- drivers/power/supply/lenovo_yoga_c630_battery.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/drivers/power/supply/lenovo_yoga_c630_battery.c b/drivers/power/supply/lenovo_yoga_c630_battery.c index f98f65e00831a5c463b133f7c074182c7db00e7e..7a6c8af9e8c24810abf2b6448fe061991738f87c 100644 --- a/drivers/power/supply/lenovo_yoga_c630_battery.c +++ b/drivers/power/supply/lenovo_yoga_c630_battery.c @@ -368,11 +368,12 @@ static int yoga_c630_psy_register_bat_psy(struct yoga_c630_psy *ecbat) bat_cfg.drv_data = ecbat; bat_cfg.fwnode = ecbat->fwnode; - ecbat->bat_psy = power_supply_register_no_ws(ecbat->dev, - ecbat->unit_mA ? - &yoga_c630_psy_bat_psy_desc_mA : - &yoga_c630_psy_bat_psy_desc_mWh, - &bat_cfg); + bat_cfg.no_wakeup_source = true; + ecbat->bat_psy = power_supply_register(ecbat->dev, + ecbat->unit_mA ? + &yoga_c630_psy_bat_psy_desc_mA : + &yoga_c630_psy_bat_psy_desc_mWh, + &bat_cfg); if (IS_ERR(ecbat->bat_psy)) { dev_err(ecbat->dev, "failed to register battery supply\n"); return PTR_ERR(ecbat->bat_psy); @@ -442,7 +443,8 @@ static int yoga_c630_psy_probe(struct auxiliary_device *adev, adp_cfg.fwnode = ecbat->fwnode; adp_cfg.supplied_to = (char **)&yoga_c630_psy_bat_psy_desc_mA.name; adp_cfg.num_supplicants = 1; - ecbat->adp_psy = devm_power_supply_register_no_ws(dev, &yoga_c630_psy_adpt_psy_desc, &adp_cfg); + adp_cfg.no_wakeup_source = true; + ecbat->adp_psy = devm_power_supply_register(dev, &yoga_c630_psy_adpt_psy_desc, &adp_cfg); if (IS_ERR(ecbat->adp_psy)) { dev_err(dev, "failed to register AC adapter supply\n"); return PTR_ERR(ecbat->adp_psy); From patchwork Sat Oct 5 10:05:09 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Patchwork-Id: 833236 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 E66E3156880; Sat, 5 Oct 2024 10:05:31 +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=1728122733; cv=none; b=f6Fgq5cWn1uXHzkwqoZZ+VNS1HnM6qqYlneOn9hLCaYVLApkd12B9OkXd0x6tVpcYCf4tnWGhNgKOkktjWYeASjucluUlXfzKfoleK/8uVU+QQ8/IjaoMJlWNfSN1y4zlTpK7soFGk6GFm5lnsizQYFLG+HxOP2MNPWx6hirN+0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728122733; c=relaxed/simple; bh=3snWepe9T3lSQIhIsMzHnhIEWoE3d7gmIqXXaoMOHIQ=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=sH8sZt+1xi3SRvQFQIjC4tmjCX1tlzMYDA9wbESHH7pREG9KL37oj1k0vNBwnapj9cGMoD8hl/gwSgdHqJw5EG7UTXfcAWUihEFCVtCjDYIfuZ6DPo3YKnmp7LKbkJup5C8nYFvMEs79IcNyKB1cUGY/KaRgBwo1kULCbXXyZDE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine 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=BVgqe0Kh; arc=none smtp.client-ip=159.69.126.157 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=weissschuh.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=weissschuh.net Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=weissschuh.net header.i=@weissschuh.net header.b="BVgqe0Kh" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=weissschuh.net; s=mail; t=1728122727; bh=3snWepe9T3lSQIhIsMzHnhIEWoE3d7gmIqXXaoMOHIQ=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=BVgqe0KhMmiPeizZjTssaawplS6rO+dMYTHMeJRyW5QX2STc/OvJBesdWia2vsnpJ gBjtwV+L7+g3gKrW8IZJ5Us1ChmS1zbqQBhzHLRyJJf5mWrTLo1C/HXvGsqn1AYb10 c/x+cLLgGBJ8bw9LitAcgjbnudXMk1YbaI4fxa0k= From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= Date: Sat, 05 Oct 2024 12:05:09 +0200 Subject: [PATCH 7/8] power: supply: max77976_charger: register power supply with devm_power_supply_register() Precedence: bulk X-Mailing-List: linux-acpi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20241005-power-supply-no-wakeup-source-v1-7-1d62bf9bcb1d@weissschuh.net> References: <20241005-power-supply-no-wakeup-source-v1-0-1d62bf9bcb1d@weissschuh.net> In-Reply-To: <20241005-power-supply-no-wakeup-source-v1-0-1d62bf9bcb1d@weissschuh.net> To: Sebastian Reichel , "Rafael J. Wysocki" , Len Brown , =?utf-8?q?Pali_Roh=C3=A1r?= , Benson Leung , Guenter Roeck , Luca Ceresoli Cc: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org, chrome-platform@lists.linux.dev, =?utf-8?q?Tho?= =?utf-8?q?mas_Wei=C3=9Fschuh?= X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1728122726; l=1188; i=linux@weissschuh.net; s=20221212; h=from:subject:message-id; bh=3snWepe9T3lSQIhIsMzHnhIEWoE3d7gmIqXXaoMOHIQ=; b=3UsHP+aMkWRD1r9zQMg7Af2LSY8LFcimqVICArhDMt7Esm+h5fI1iBx0vrkAM2Ck0VoEiFvpV sDO+rIQxEu0DlDtmK9jJqDhQNSdqJVmO0ioWVXIezvndn4hMi9J37pr X-Developer-Key: i=linux@weissschuh.net; a=ed25519; pk=KcycQgFPX2wGR5azS7RhpBqedglOZVgRPfdFSPB1LNw= devm_power_supply_register_no_ws() is going to be removed. Switch to the general registration API. Signed-off-by: Thomas Weißschuh --- drivers/power/supply/max77976_charger.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/power/supply/max77976_charger.c b/drivers/power/supply/max77976_charger.c index d7e520da768864f7f7e5177195ec0a16a51724f5..e6fe68cebc32b6fa39df71616ca293ce20098150 100644 --- a/drivers/power/supply/max77976_charger.c +++ b/drivers/power/supply/max77976_charger.c @@ -452,6 +452,7 @@ static int max77976_probe(struct i2c_client *client) i2c_set_clientdata(client, chg); psy_cfg.drv_data = chg; + psy_cfg.no_wakeup_source = true; chg->client = client; chg->regmap = devm_regmap_init_i2c(client, &max77976_regmap_config); @@ -475,7 +476,7 @@ static int max77976_probe(struct i2c_client *client) if (err) return err; - psy = devm_power_supply_register_no_ws(dev, &max77976_psy_desc, &psy_cfg); + psy = devm_power_supply_register(dev, &max77976_psy_desc, &psy_cfg); if (IS_ERR(psy)) return dev_err_probe(dev, PTR_ERR(psy), "cannot register\n"); From patchwork Sat Oct 5 10:05:10 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Patchwork-Id: 833031 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 D7D6914600C; Sat, 5 Oct 2024 10:05: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=1728122731; cv=none; b=Fh7uyjyQWfqtKy+IdMfsossTr9BdwhQ8oMY07nMOv0imxuwu9kil2Y85VBhPGifUI8eunyALYK7NHX9aIV62xkKdelp/CkpsJTq4zweXtaXwaXFyY3I0AJBC/kb3ARW0lZ+Epeo6PgEEk33uH7TnFOAMwF8c4sep8pB5FhdZyCQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728122731; c=relaxed/simple; bh=iVn9zkMkqlm7S5h5JRqhUrYnlB6s71UZJiFr3ZeXgCk=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=iKVhDrRVBTjWZjCHNVl3BX+415XDjiNjCdhWBRESICaLnHln9Nf98wd9KHoKsbd1TzNlKsK4y+QSGNy2QE2QP2N0hpzUcrbclGyEVVoTAuacoBmabE1ePNwk03qk3R8s6r4m9c0n2j9ErqmRTVE8KfH7/X5tja+je9IwTzxlkcY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine 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=DQo7haTZ; arc=none smtp.client-ip=159.69.126.157 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=weissschuh.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=weissschuh.net Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=weissschuh.net header.i=@weissschuh.net header.b="DQo7haTZ" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=weissschuh.net; s=mail; t=1728122727; bh=iVn9zkMkqlm7S5h5JRqhUrYnlB6s71UZJiFr3ZeXgCk=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=DQo7haTZNrDFyCZdNEQ2m9cbXikgBe1NkRRveOdLqxB0AYoQSNdbsSQMyr2bTfaNd /INj6TS5swooVTBrDDQqXmo9+QFE9EUdFPd/CyX3W5dRq4ONwzDwMgikUg3jrUPOvr 29QOEVxXcmFQUfLWfcUW8jeK86Xdpi+Omj27BFLo= From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= Date: Sat, 05 Oct 2024 12:05:10 +0200 Subject: [PATCH 8/8] power: supply: core: remove {,devm_}power_supply_register_no_ws() Precedence: bulk X-Mailing-List: linux-acpi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20241005-power-supply-no-wakeup-source-v1-8-1d62bf9bcb1d@weissschuh.net> References: <20241005-power-supply-no-wakeup-source-v1-0-1d62bf9bcb1d@weissschuh.net> In-Reply-To: <20241005-power-supply-no-wakeup-source-v1-0-1d62bf9bcb1d@weissschuh.net> To: Sebastian Reichel , "Rafael J. Wysocki" , Len Brown , =?utf-8?q?Pali_Roh=C3=A1r?= , Benson Leung , Guenter Roeck , Luca Ceresoli Cc: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org, chrome-platform@lists.linux.dev, =?utf-8?q?Tho?= =?utf-8?q?mas_Wei=C3=9Fschuh?= X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1728122726; l=5742; i=linux@weissschuh.net; s=20221212; h=from:subject:message-id; bh=iVn9zkMkqlm7S5h5JRqhUrYnlB6s71UZJiFr3ZeXgCk=; b=zG7LJNwygoALWccpB6SUz7CPwxNuIRXMEyaMZBFMz6fMCuifyaCI+ppfL2i98I7Sh2N52k9vi Q9gofR2fQ8PCJ+Ok9kf8CCS/m898xzK9M/YdBUrIOW+WQ6qi4C2kYBU X-Developer-Key: i=linux@weissschuh.net; a=ed25519; pk=KcycQgFPX2wGR5azS7RhpBqedglOZVgRPfdFSPB1LNw= The same functionality is available through power_supply_config::no_wakeup_source, which is more idiomatic. All users of the old API have been converted. Also remove the argument "ws" from __power_supply_register(), as it is now always "true". Signed-off-by: Thomas Weißschuh --- drivers/power/supply/power_supply_core.c | 71 ++------------------------------ include/linux/power_supply.h | 8 ---- 2 files changed, 4 insertions(+), 75 deletions(-) diff --git a/drivers/power/supply/power_supply_core.c b/drivers/power/supply/power_supply_core.c index 5b5a3abca0b554d809054026f8cf32b2d18a3362..650da0d1331f87a9682f92084b937ed879105b39 100644 --- a/drivers/power/supply/power_supply_core.c +++ b/drivers/power/supply/power_supply_core.c @@ -1342,8 +1342,7 @@ static void psy_unregister_thermal(struct power_supply *psy) static struct power_supply *__must_check __power_supply_register(struct device *parent, const struct power_supply_desc *desc, - const struct power_supply_config *cfg, - bool ws) + const struct power_supply_config *cfg) { struct device *dev; struct power_supply *psy; @@ -1410,10 +1409,7 @@ __power_supply_register(struct device *parent, if (rc) goto device_add_failed; - if (cfg && cfg->no_wakeup_source) - ws = false; - - rc = device_init_wakeup(dev, ws); + rc = device_init_wakeup(dev, cfg ? !cfg->no_wakeup_source : true); if (rc) goto wakeup_init_failed; @@ -1479,33 +1475,10 @@ struct power_supply *__must_check power_supply_register(struct device *parent, const struct power_supply_desc *desc, const struct power_supply_config *cfg) { - return __power_supply_register(parent, desc, cfg, true); + return __power_supply_register(parent, desc, cfg); } EXPORT_SYMBOL_GPL(power_supply_register); -/** - * power_supply_register_no_ws() - Register new non-waking-source power supply - * @parent: Device to be a parent of power supply's device, usually - * the device which probe function calls this - * @desc: Description of power supply, must be valid through whole - * lifetime of this power supply - * @cfg: Run-time specific configuration accessed during registering, - * may be NULL - * - * Return: A pointer to newly allocated power_supply on success - * or ERR_PTR otherwise. - * Use power_supply_unregister() on returned power_supply pointer to release - * resources. - */ -struct power_supply *__must_check -power_supply_register_no_ws(struct device *parent, - const struct power_supply_desc *desc, - const struct power_supply_config *cfg) -{ - return __power_supply_register(parent, desc, cfg, false); -} -EXPORT_SYMBOL_GPL(power_supply_register_no_ws); - static void devm_power_supply_release(struct device *dev, void *res) { struct power_supply **psy = res; @@ -1538,7 +1511,7 @@ devm_power_supply_register(struct device *parent, if (!ptr) return ERR_PTR(-ENOMEM); - psy = __power_supply_register(parent, desc, cfg, true); + psy = __power_supply_register(parent, desc, cfg); if (IS_ERR(psy)) { devres_free(ptr); } else { @@ -1549,42 +1522,6 @@ devm_power_supply_register(struct device *parent, } EXPORT_SYMBOL_GPL(devm_power_supply_register); -/** - * devm_power_supply_register_no_ws() - Register managed non-waking-source power supply - * @parent: Device to be a parent of power supply's device, usually - * the device which probe function calls this - * @desc: Description of power supply, must be valid through whole - * lifetime of this power supply - * @cfg: Run-time specific configuration accessed during registering, - * may be NULL - * - * Return: A pointer to newly allocated power_supply on success - * or ERR_PTR otherwise. - * The returned power_supply pointer will be automatically unregistered - * on driver detach. - */ -struct power_supply *__must_check -devm_power_supply_register_no_ws(struct device *parent, - const struct power_supply_desc *desc, - const struct power_supply_config *cfg) -{ - struct power_supply **ptr, *psy; - - ptr = devres_alloc(devm_power_supply_release, sizeof(*ptr), GFP_KERNEL); - - if (!ptr) - return ERR_PTR(-ENOMEM); - psy = __power_supply_register(parent, desc, cfg, false); - if (IS_ERR(psy)) { - devres_free(ptr); - } else { - *ptr = psy; - devres_add(parent, ptr); - } - return psy; -} -EXPORT_SYMBOL_GPL(devm_power_supply_register_no_ws); - /** * power_supply_unregister() - Remove this power supply from system * @psy: Pointer to power supply to unregister diff --git a/include/linux/power_supply.h b/include/linux/power_supply.h index 412646e055d79ff23346a99c4485e594363857ed..6562d52151f62fadfefa718483b954067d088875 100644 --- a/include/linux/power_supply.h +++ b/include/linux/power_supply.h @@ -874,17 +874,9 @@ power_supply_register(struct device *parent, const struct power_supply_desc *desc, const struct power_supply_config *cfg); extern struct power_supply *__must_check -power_supply_register_no_ws(struct device *parent, - const struct power_supply_desc *desc, - const struct power_supply_config *cfg); -extern struct power_supply *__must_check devm_power_supply_register(struct device *parent, const struct power_supply_desc *desc, const struct power_supply_config *cfg); -extern struct power_supply *__must_check -devm_power_supply_register_no_ws(struct device *parent, - const struct power_supply_desc *desc, - const struct power_supply_config *cfg); extern void power_supply_unregister(struct power_supply *psy); extern int power_supply_powers(struct power_supply *psy, struct device *dev);