Skip to content

Commit 49000fe

Browse files
t-8chsre
authored andcommitted
power: supply: core: add wakeup source inhibit by power_supply_config
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 <[email protected]> Reviewed-by: Tzung-Bi Shih <[email protected]> Link: https://lore.kernel.org/r/20241005-power-supply-no-wakeup-source-v1-1-1d62bf9bcb1d@weissschuh.net Signed-off-by: Sebastian Reichel <[email protected]>
1 parent b5289ba commit 49000fe

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

drivers/power/supply/power_supply_core.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1410,6 +1410,9 @@ __power_supply_register(struct device *parent,
14101410
if (rc)
14111411
goto device_add_failed;
14121412

1413+
if (cfg && cfg->no_wakeup_source)
1414+
ws = false;
1415+
14131416
rc = device_init_wakeup(dev, ws);
14141417
if (rc)
14151418
goto wakeup_init_failed;

include/linux/power_supply.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,8 @@ struct power_supply_config {
236236

237237
char **supplied_to;
238238
size_t num_supplicants;
239+
240+
bool no_wakeup_source;
239241
};
240242

241243
/* Description of power supply */

0 commit comments

Comments
 (0)