* [PATCH 0/7] power: supply: core: convert to fwnode
@ 2025-02-24 23:21 Sebastian Reichel
2025-02-24 23:21 ` [PATCH 1/7] power: supply: core: get rid of of_node Sebastian Reichel
` (7 more replies)
0 siblings, 8 replies; 32+ messages in thread
From: Sebastian Reichel @ 2025-02-24 23:21 UTC (permalink / raw)
To: Sebastian Reichel, Mark Brown, Greg Kroah-Hartman, Linus Walleij,
Hans de Goede
Cc: Liam Girdwood, Chen-Yu Tsai, Matti Vaittinen, Pali Rohár,
Paul Cercueil, Samuel Holland, David Lechner, Krzysztof Kozlowski,
Marek Szyprowski, Sebastian Krzyszkowiak, Purism Kernel Team,
Bartosz Golaszewski, Konrad Dybcio, Matthias Brugger,
AngeloGioacchino Del Regno, Orson Zhai, Baolin Wang,
Chunyan Zhang, linux-pm, linux-kernel, linux-usb,
Sebastian Reichel
The goal of this series is to replace any OF specific code in the
power-supply core with more generic fwnode code.
The first 5 patches of this series mostly take care of removing .of_node
from power_supply_config in favor of using the existing .fwnode.
Patch 6 replaces the OF specific logic in battery-info. This will
hopefully also allow Hans de Goede reusing the code with his Intel
Dollar Cove TI CC battery driver series.
Last but not least patch 7 replaces the OF phandle code with fwnode to
have everything converted.
Note, that I do not own a single device making use of the
"ocv-capacity-celsius" and "resistance-temp-table", which means patch 7
is basically untested. I would really appreciate if somebody gives this
series a test run on an affected device.
---
Sebastian Reichel (7):
power: supply: core: get rid of of_node
regulator: act8865-regulator: switch psy_cfg from of_node to fwnode
usb: common: usb-conn-gpio: switch psy_cfg from of_node to fwnode
power: supply: all: switch psy_cfg from of_node to fwnode
power: supply: core: remove of_node from power_supply_config
power: supply: core: battery-info: fully switch to fwnode
power: supply: core: convert to fwnnode
drivers/power/supply/ab8500_charger.c | 4 +-
drivers/power/supply/acer_a500_battery.c | 3 +-
drivers/power/supply/act8945a_charger.c | 2 +-
drivers/power/supply/axp20x_ac_power.c | 2 +-
drivers/power/supply/axp20x_battery.c | 2 +-
drivers/power/supply/axp20x_usb_power.c | 2 +-
drivers/power/supply/bd99954-charger.c | 2 +-
drivers/power/supply/bq2415x_charger.c | 4 +-
drivers/power/supply/bq24190_charger.c | 2 +-
drivers/power/supply/bq24735-charger.c | 2 +-
drivers/power/supply/bq2515x_charger.c | 2 +-
drivers/power/supply/bq256xx_charger.c | 2 +-
drivers/power/supply/bq25980_charger.c | 2 +-
drivers/power/supply/bq27xxx_battery.c | 2 +-
drivers/power/supply/cpcap-battery.c | 2 +-
drivers/power/supply/cpcap-charger.c | 2 +-
drivers/power/supply/ds2760_battery.c | 3 +-
drivers/power/supply/generic-adc-battery.c | 2 +-
drivers/power/supply/gpio-charger.c | 2 +-
drivers/power/supply/ingenic-battery.c | 2 +-
drivers/power/supply/ip5xxx_power.c | 2 +-
drivers/power/supply/lego_ev3_battery.c | 3 +-
drivers/power/supply/lt3651-charger.c | 2 +-
drivers/power/supply/ltc4162-l-charger.c | 2 +-
drivers/power/supply/max17042_battery.c | 2 +-
drivers/power/supply/max77650-charger.c | 2 +-
drivers/power/supply/max8903_charger.c | 2 +-
drivers/power/supply/mm8013.c | 2 +-
drivers/power/supply/mt6360_charger.c | 2 +-
drivers/power/supply/mt6370-charger.c | 2 +-
drivers/power/supply/olpc_battery.c | 4 +-
drivers/power/supply/pm8916_bms_vm.c | 2 +-
drivers/power/supply/pm8916_lbc.c | 2 +-
drivers/power/supply/power_supply_core.c | 178 +++++++++++++++-------------
drivers/power/supply/qcom_battmgr.c | 5 +-
drivers/power/supply/qcom_pmi8998_charger.c | 2 +-
drivers/power/supply/qcom_smbb.c | 2 +-
drivers/power/supply/rk817_charger.c | 2 +-
drivers/power/supply/rt5033_battery.c | 2 +-
drivers/power/supply/rt5033_charger.c | 3 +-
drivers/power/supply/rt9455_charger.c | 2 +-
drivers/power/supply/rt9467-charger.c | 2 +-
drivers/power/supply/rt9471.c | 2 +-
drivers/power/supply/sbs-battery.c | 2 +-
drivers/power/supply/sbs-charger.c | 2 +-
drivers/power/supply/sbs-manager.c | 2 +-
drivers/power/supply/sc2731_charger.c | 2 +-
drivers/power/supply/sc27xx_fuel_gauge.c | 3 +-
drivers/power/supply/smb347-charger.c | 2 +-
drivers/power/supply/tps65090-charger.c | 2 +-
drivers/power/supply/tps65217_charger.c | 2 +-
drivers/power/supply/ucs1002_power.c | 2 +-
drivers/regulator/act8865-regulator.c | 2 +-
drivers/usb/common/usb-conn-gpio.c | 2 +-
include/linux/power_supply.h | 4 +-
55 files changed, 158 insertions(+), 144 deletions(-)
---
base-commit: 2014c95afecee3e76ca4a56956a936e23283f05b
change-id: 20250221-psy-core-convert-to-fwnode-d5a5442fc3f9
Best regards,
--
Sebastian Reichel <sebastian.reichel@collabora.com>
^ permalink raw reply [flat|nested] 32+ messages in thread
* [PATCH 1/7] power: supply: core: get rid of of_node
2025-02-24 23:21 [PATCH 0/7] power: supply: core: convert to fwnode Sebastian Reichel
@ 2025-02-24 23:21 ` Sebastian Reichel
2025-02-25 10:47 ` AngeloGioacchino Del Regno
2025-02-25 11:14 ` Matti Vaittinen
2025-02-24 23:21 ` [PATCH 2/7] regulator: act8865-regulator: switch psy_cfg from of_node to fwnode Sebastian Reichel
` (6 subsequent siblings)
7 siblings, 2 replies; 32+ messages in thread
From: Sebastian Reichel @ 2025-02-24 23:21 UTC (permalink / raw)
To: Sebastian Reichel, Mark Brown, Greg Kroah-Hartman, Linus Walleij,
Hans de Goede
Cc: Liam Girdwood, Chen-Yu Tsai, Matti Vaittinen, Pali Rohár,
Paul Cercueil, Samuel Holland, David Lechner, Krzysztof Kozlowski,
Marek Szyprowski, Sebastian Krzyszkowiak, Purism Kernel Team,
Bartosz Golaszewski, Konrad Dybcio, Matthias Brugger,
AngeloGioacchino Del Regno, Orson Zhai, Baolin Wang,
Chunyan Zhang, linux-pm, linux-kernel, linux-usb,
Sebastian Reichel
This removes .of_node from 'struct power_supply', since there
is already a copy in .dev.of_node and there is no need to have
two copies.
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
---
drivers/power/supply/power_supply_core.c | 17 ++++++++---------
include/linux/power_supply.h | 1 -
2 files changed, 8 insertions(+), 10 deletions(-)
diff --git a/drivers/power/supply/power_supply_core.c b/drivers/power/supply/power_supply_core.c
index d0bb52a7a0367a8e07787be211691cad14a41a54..11030035da6f121ca76bebf800c06cfd5db57578 100644
--- a/drivers/power/supply/power_supply_core.c
+++ b/drivers/power/supply/power_supply_core.c
@@ -200,11 +200,11 @@ static int __power_supply_populate_supplied_from(struct power_supply *epsy,
int i = 0;
do {
- np = of_parse_phandle(psy->of_node, "power-supplies", i++);
+ np = of_parse_phandle(psy->dev.of_node, "power-supplies", i++);
if (!np)
break;
- if (np == epsy->of_node) {
+ if (np == epsy->dev.of_node) {
dev_dbg(&psy->dev, "%s: Found supply : %s\n",
psy->desc->name, epsy->desc->name);
psy->supplied_from[i-1] = (char *)epsy->desc->name;
@@ -235,7 +235,7 @@ static int __power_supply_find_supply_from_node(struct power_supply *epsy,
struct device_node *np = data;
/* returning non-zero breaks out of power_supply_for_each_psy loop */
- if (epsy->of_node == np)
+ if (epsy->dev.of_node == np)
return 1;
return 0;
@@ -270,13 +270,13 @@ static int power_supply_check_supplies(struct power_supply *psy)
return 0;
/* No device node found, nothing to do */
- if (!psy->of_node)
+ if (!psy->dev.of_node)
return 0;
do {
int ret;
- np = of_parse_phandle(psy->of_node, "power-supplies", cnt++);
+ np = of_parse_phandle(psy->dev.of_node, "power-supplies", cnt++);
if (!np)
break;
@@ -606,8 +606,8 @@ int power_supply_get_battery_info(struct power_supply *psy,
const __be32 *list;
u32 min_max[2];
- if (psy->of_node) {
- battery_np = of_parse_phandle(psy->of_node, "monitored-battery", 0);
+ if (psy->dev.of_node) {
+ battery_np = of_parse_phandle(psy->dev.of_node, "monitored-battery", 0);
if (!battery_np)
return -ENODEV;
@@ -1544,9 +1544,8 @@ __power_supply_register(struct device *parent,
if (cfg) {
dev->groups = cfg->attr_grp;
psy->drv_data = cfg->drv_data;
- psy->of_node =
+ dev->of_node =
cfg->fwnode ? to_of_node(cfg->fwnode) : cfg->of_node;
- dev->of_node = psy->of_node;
psy->supplied_to = cfg->supplied_to;
psy->num_supplicants = cfg->num_supplicants;
}
diff --git a/include/linux/power_supply.h b/include/linux/power_supply.h
index 6ed53b292162469d7b357734d5589bff18a201d0..975ccab56597ef579ef0c9dc913dcb0a26b5855a 100644
--- a/include/linux/power_supply.h
+++ b/include/linux/power_supply.h
@@ -316,7 +316,6 @@ struct power_supply {
char **supplied_from;
size_t num_supplies;
- struct device_node *of_node;
/* Driver private data */
void *drv_data;
--
2.47.2
^ permalink raw reply related [flat|nested] 32+ messages in thread
* [PATCH 2/7] regulator: act8865-regulator: switch psy_cfg from of_node to fwnode
2025-02-24 23:21 [PATCH 0/7] power: supply: core: convert to fwnode Sebastian Reichel
2025-02-24 23:21 ` [PATCH 1/7] power: supply: core: get rid of of_node Sebastian Reichel
@ 2025-02-24 23:21 ` Sebastian Reichel
2025-02-24 23:21 ` [PATCH 3/7] usb: common: usb-conn-gpio: " Sebastian Reichel
` (5 subsequent siblings)
7 siblings, 0 replies; 32+ messages in thread
From: Sebastian Reichel @ 2025-02-24 23:21 UTC (permalink / raw)
To: Sebastian Reichel, Mark Brown, Greg Kroah-Hartman, Linus Walleij,
Hans de Goede
Cc: Liam Girdwood, Chen-Yu Tsai, Matti Vaittinen, Pali Rohár,
Paul Cercueil, Samuel Holland, David Lechner, Krzysztof Kozlowski,
Marek Szyprowski, Sebastian Krzyszkowiak, Purism Kernel Team,
Bartosz Golaszewski, Konrad Dybcio, Matthias Brugger,
AngeloGioacchino Del Regno, Orson Zhai, Baolin Wang,
Chunyan Zhang, linux-pm, linux-kernel, linux-usb,
Sebastian Reichel
In order to remove .of_node from the power_supply_config struct,
use .fwnode instead.
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
---
drivers/regulator/act8865-regulator.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/regulator/act8865-regulator.c b/drivers/regulator/act8865-regulator.c
index 0457af23c55acdd97b2cdc6fd6bfd07ae0f9d11f..b2a6ddc6f56d32e8758977e25858b972e294bc84 100644
--- a/drivers/regulator/act8865-regulator.c
+++ b/drivers/regulator/act8865-regulator.c
@@ -643,7 +643,7 @@ static int act8600_charger_probe(struct device *dev, struct regmap *regmap)
struct power_supply *charger;
struct power_supply_config cfg = {
.drv_data = regmap,
- .of_node = dev->of_node,
+ .fwnode = dev_fwnode(dev),
};
charger = devm_power_supply_register(dev, &act8600_charger_desc, &cfg);
--
2.47.2
^ permalink raw reply related [flat|nested] 32+ messages in thread
* [PATCH 3/7] usb: common: usb-conn-gpio: switch psy_cfg from of_node to fwnode
2025-02-24 23:21 [PATCH 0/7] power: supply: core: convert to fwnode Sebastian Reichel
2025-02-24 23:21 ` [PATCH 1/7] power: supply: core: get rid of of_node Sebastian Reichel
2025-02-24 23:21 ` [PATCH 2/7] regulator: act8865-regulator: switch psy_cfg from of_node to fwnode Sebastian Reichel
@ 2025-02-24 23:21 ` Sebastian Reichel
2025-02-25 3:32 ` Greg Kroah-Hartman
2025-02-25 10:50 ` AngeloGioacchino Del Regno
2025-02-24 23:21 ` [PATCH 4/7] power: supply: all: " Sebastian Reichel
` (4 subsequent siblings)
7 siblings, 2 replies; 32+ messages in thread
From: Sebastian Reichel @ 2025-02-24 23:21 UTC (permalink / raw)
To: Sebastian Reichel, Mark Brown, Greg Kroah-Hartman, Linus Walleij,
Hans de Goede
Cc: Liam Girdwood, Chen-Yu Tsai, Matti Vaittinen, Pali Rohár,
Paul Cercueil, Samuel Holland, David Lechner, Krzysztof Kozlowski,
Marek Szyprowski, Sebastian Krzyszkowiak, Purism Kernel Team,
Bartosz Golaszewski, Konrad Dybcio, Matthias Brugger,
AngeloGioacchino Del Regno, Orson Zhai, Baolin Wang,
Chunyan Zhang, linux-pm, linux-kernel, linux-usb,
Sebastian Reichel
In order to remove .of_node from the power_supply_config struct,
use .fwnode instead.
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
---
drivers/usb/common/usb-conn-gpio.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/usb/common/usb-conn-gpio.c b/drivers/usb/common/usb-conn-gpio.c
index aa710b50791b0282be0a6a26cffdd981b794acaa..1e36be2a28fd5ca5e1495b7923e4d3e25d7cedef 100644
--- a/drivers/usb/common/usb-conn-gpio.c
+++ b/drivers/usb/common/usb-conn-gpio.c
@@ -158,7 +158,7 @@ static int usb_conn_psy_register(struct usb_conn_info *info)
struct device *dev = info->dev;
struct power_supply_desc *desc = &info->desc;
struct power_supply_config cfg = {
- .of_node = dev->of_node,
+ .fwnode = dev_fwnode(dev),
};
desc->name = "usb-charger";
--
2.47.2
^ permalink raw reply related [flat|nested] 32+ messages in thread
* [PATCH 4/7] power: supply: all: switch psy_cfg from of_node to fwnode
2025-02-24 23:21 [PATCH 0/7] power: supply: core: convert to fwnode Sebastian Reichel
` (2 preceding siblings ...)
2025-02-24 23:21 ` [PATCH 3/7] usb: common: usb-conn-gpio: " Sebastian Reichel
@ 2025-02-24 23:21 ` Sebastian Reichel
2025-02-25 2:40 ` Chen-Yu Tsai
` (2 more replies)
2025-02-24 23:21 ` [PATCH 5/7] power: supply: core: remove of_node from power_supply_config Sebastian Reichel
` (3 subsequent siblings)
7 siblings, 3 replies; 32+ messages in thread
From: Sebastian Reichel @ 2025-02-24 23:21 UTC (permalink / raw)
To: Sebastian Reichel, Mark Brown, Greg Kroah-Hartman, Linus Walleij,
Hans de Goede
Cc: Liam Girdwood, Chen-Yu Tsai, Matti Vaittinen, Pali Rohár,
Paul Cercueil, Samuel Holland, David Lechner, Krzysztof Kozlowski,
Marek Szyprowski, Sebastian Krzyszkowiak, Purism Kernel Team,
Bartosz Golaszewski, Konrad Dybcio, Matthias Brugger,
AngeloGioacchino Del Regno, Orson Zhai, Baolin Wang,
Chunyan Zhang, linux-pm, linux-kernel, linux-usb,
Sebastian Reichel
When registering a power-supply device, either a of_node or the more
recent fwnode can be supplied. Since fwnode can also contain an of_node,
let's try to get rid of it.
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
---
drivers/power/supply/ab8500_charger.c | 4 ++--
drivers/power/supply/acer_a500_battery.c | 3 ++-
drivers/power/supply/act8945a_charger.c | 2 +-
drivers/power/supply/axp20x_ac_power.c | 2 +-
drivers/power/supply/axp20x_battery.c | 2 +-
drivers/power/supply/axp20x_usb_power.c | 2 +-
drivers/power/supply/bd99954-charger.c | 2 +-
drivers/power/supply/bq2415x_charger.c | 2 +-
drivers/power/supply/bq24190_charger.c | 2 +-
drivers/power/supply/bq24735-charger.c | 2 +-
drivers/power/supply/bq2515x_charger.c | 2 +-
drivers/power/supply/bq256xx_charger.c | 2 +-
drivers/power/supply/bq25980_charger.c | 2 +-
drivers/power/supply/bq27xxx_battery.c | 2 +-
drivers/power/supply/cpcap-battery.c | 2 +-
drivers/power/supply/cpcap-charger.c | 2 +-
drivers/power/supply/ds2760_battery.c | 3 +--
drivers/power/supply/generic-adc-battery.c | 2 +-
drivers/power/supply/gpio-charger.c | 2 +-
drivers/power/supply/ingenic-battery.c | 2 +-
drivers/power/supply/ip5xxx_power.c | 2 +-
drivers/power/supply/lego_ev3_battery.c | 3 ++-
drivers/power/supply/lt3651-charger.c | 2 +-
drivers/power/supply/ltc4162-l-charger.c | 2 +-
drivers/power/supply/max17042_battery.c | 2 +-
drivers/power/supply/max77650-charger.c | 2 +-
drivers/power/supply/max8903_charger.c | 2 +-
drivers/power/supply/mm8013.c | 2 +-
drivers/power/supply/mt6360_charger.c | 2 +-
drivers/power/supply/mt6370-charger.c | 2 +-
drivers/power/supply/olpc_battery.c | 4 ++--
drivers/power/supply/pm8916_bms_vm.c | 2 +-
drivers/power/supply/pm8916_lbc.c | 2 +-
drivers/power/supply/qcom_battmgr.c | 5 +++--
drivers/power/supply/qcom_pmi8998_charger.c | 2 +-
drivers/power/supply/qcom_smbb.c | 2 +-
drivers/power/supply/rk817_charger.c | 2 +-
drivers/power/supply/rt5033_battery.c | 2 +-
drivers/power/supply/rt5033_charger.c | 3 ++-
drivers/power/supply/rt9455_charger.c | 2 +-
drivers/power/supply/rt9467-charger.c | 2 +-
drivers/power/supply/rt9471.c | 2 +-
drivers/power/supply/sbs-battery.c | 2 +-
drivers/power/supply/sbs-charger.c | 2 +-
drivers/power/supply/sbs-manager.c | 2 +-
drivers/power/supply/sc2731_charger.c | 2 +-
drivers/power/supply/sc27xx_fuel_gauge.c | 3 +--
drivers/power/supply/smb347-charger.c | 2 +-
drivers/power/supply/tps65090-charger.c | 2 +-
drivers/power/supply/tps65217_charger.c | 2 +-
drivers/power/supply/ucs1002_power.c | 2 +-
51 files changed, 58 insertions(+), 56 deletions(-)
diff --git a/drivers/power/supply/ab8500_charger.c b/drivers/power/supply/ab8500_charger.c
index 1042d37424f5b0351edd02b5c76e58dd447d1783..5f4537766e5b907d66b44964c320bc31acc7408b 100644
--- a/drivers/power/supply/ab8500_charger.c
+++ b/drivers/power/supply/ab8500_charger.c
@@ -3494,11 +3494,11 @@ static int ab8500_charger_probe(struct platform_device *pdev)
di->invalid_charger_detect_state = 0;
/* AC and USB supply config */
- ac_psy_cfg.of_node = np;
+ ac_psy_cfg.fwnode = dev_fwnode(dev);
ac_psy_cfg.supplied_to = supply_interface;
ac_psy_cfg.num_supplicants = ARRAY_SIZE(supply_interface);
ac_psy_cfg.drv_data = &di->ac_chg;
- usb_psy_cfg.of_node = np;
+ usb_psy_cfg.fwnode = dev_fwnode(dev);
usb_psy_cfg.supplied_to = supply_interface;
usb_psy_cfg.num_supplicants = ARRAY_SIZE(supply_interface);
usb_psy_cfg.drv_data = &di->usb_chg;
diff --git a/drivers/power/supply/acer_a500_battery.c b/drivers/power/supply/acer_a500_battery.c
index 39d85b11a13c2350876da22ee5c427479d161351..daf01dc8025bb3d95a42b3bace2ffa8bca029263 100644
--- a/drivers/power/supply/acer_a500_battery.c
+++ b/drivers/power/supply/acer_a500_battery.c
@@ -17,6 +17,7 @@
#include <linux/sched.h>
#include <linux/slab.h>
#include <linux/workqueue.h>
+#include <linux/property.h>
enum {
REG_CAPACITY,
@@ -231,7 +232,7 @@ static int a500_battery_probe(struct platform_device *pdev)
platform_set_drvdata(pdev, bat);
- psy_cfg.of_node = pdev->dev.parent->of_node;
+ psy_cfg.fwnode = dev_fwnode(pdev->dev.parent);
psy_cfg.drv_data = bat;
psy_cfg.no_wakeup_source = true;
diff --git a/drivers/power/supply/act8945a_charger.c b/drivers/power/supply/act8945a_charger.c
index b2b82f97a471204e458bcdf85f68280638451a08..3901a02f326a55f820e85346ebe0420ac9a6f113 100644
--- a/drivers/power/supply/act8945a_charger.c
+++ b/drivers/power/supply/act8945a_charger.c
@@ -614,7 +614,7 @@ static int act8945a_charger_probe(struct platform_device *pdev)
if (ret)
return -EINVAL;
- psy_cfg.of_node = pdev->dev.of_node;
+ psy_cfg.fwnode = dev_fwnode(&pdev->dev);
psy_cfg.drv_data = charger;
charger->psy = devm_power_supply_register(&pdev->dev,
diff --git a/drivers/power/supply/axp20x_ac_power.c b/drivers/power/supply/axp20x_ac_power.c
index e5733cb9e19e057f6c6d015b572530ca3d9c7e55..5f6ea416fa30a0328e6e1145cce3330b2fa63071 100644
--- a/drivers/power/supply/axp20x_ac_power.c
+++ b/drivers/power/supply/axp20x_ac_power.c
@@ -364,7 +364,7 @@ static int axp20x_ac_power_probe(struct platform_device *pdev)
platform_set_drvdata(pdev, power);
- psy_cfg.of_node = pdev->dev.of_node;
+ psy_cfg.fwnode = dev_fwnode(&pdev->dev);
psy_cfg.drv_data = power;
power->supply = devm_power_supply_register(&pdev->dev,
diff --git a/drivers/power/supply/axp20x_battery.c b/drivers/power/supply/axp20x_battery.c
index fa27195f074e7d553a7d0bb095a62d6628ef5f8e..a8d6178963d04d0266a1b4aeb8b00e6d4bae1cb2 100644
--- a/drivers/power/supply/axp20x_battery.c
+++ b/drivers/power/supply/axp20x_battery.c
@@ -1091,7 +1091,7 @@ static int axp20x_power_probe(struct platform_device *pdev)
platform_set_drvdata(pdev, axp20x_batt);
psy_cfg.drv_data = axp20x_batt;
- psy_cfg.of_node = pdev->dev.of_node;
+ psy_cfg.fwnode = dev_fwnode(&pdev->dev);
axp20x_batt->data = (struct axp_data *)of_device_get_match_data(dev);
diff --git a/drivers/power/supply/axp20x_usb_power.c b/drivers/power/supply/axp20x_usb_power.c
index 9722912268fe8e33fa102f8998a96d7d4b041d2a..e6c5726108dc32b16fd3920e62a390ada1c5d0ad 100644
--- a/drivers/power/supply/axp20x_usb_power.c
+++ b/drivers/power/supply/axp20x_usb_power.c
@@ -1011,7 +1011,7 @@ static int axp20x_usb_power_probe(struct platform_device *pdev)
return ret;
}
- psy_cfg.of_node = pdev->dev.of_node;
+ psy_cfg.fwnode = dev_fwnode(&pdev->dev);
psy_cfg.drv_data = power;
power->supply = devm_power_supply_register(&pdev->dev,
diff --git a/drivers/power/supply/bd99954-charger.c b/drivers/power/supply/bd99954-charger.c
index 54bf882625101664fa15abd611aba0e82c073298..22453322456f744484be04b56de54ffe99f56096 100644
--- a/drivers/power/supply/bd99954-charger.c
+++ b/drivers/power/supply/bd99954-charger.c
@@ -982,7 +982,7 @@ static int bd9995x_probe(struct i2c_client *client)
bd->client = client;
bd->dev = dev;
psy_cfg.drv_data = bd;
- psy_cfg.of_node = dev->of_node;
+ psy_cfg.fwnode = dev_fwnode(dev);
mutex_init(&bd->lock);
diff --git a/drivers/power/supply/bq2415x_charger.c b/drivers/power/supply/bq2415x_charger.c
index 22f6a3b71632b637e3c8023e6d187fc136cdff20..9e3b9181ee76a4f473228bba022917677acce256 100644
--- a/drivers/power/supply/bq2415x_charger.c
+++ b/drivers/power/supply/bq2415x_charger.c
@@ -1497,7 +1497,7 @@ static int bq2415x_power_supply_init(struct bq2415x_device *bq)
char revstr[8];
struct power_supply_config psy_cfg = {
.drv_data = bq,
- .of_node = bq->dev->of_node,
+ .fwnode = dev_fwnode(bq->dev),
.attr_grp = bq2415x_sysfs_groups,
};
diff --git a/drivers/power/supply/bq24190_charger.c b/drivers/power/supply/bq24190_charger.c
index b4ba01744368c2a338105a2735a481fe36dca169..f0d97ab45bd87f3baab20bb316eaebef77d99ae8 100644
--- a/drivers/power/supply/bq24190_charger.c
+++ b/drivers/power/supply/bq24190_charger.c
@@ -2117,7 +2117,7 @@ static int bq24190_probe(struct i2c_client *client)
#endif
charger_cfg.drv_data = bdi;
- charger_cfg.of_node = dev->of_node;
+ charger_cfg.fwnode = dev_fwnode(dev);
charger_cfg.supplied_to = bq24190_charger_supplied_to;
charger_cfg.num_supplicants = ARRAY_SIZE(bq24190_charger_supplied_to);
bdi->charger = power_supply_register(dev, &bq24190_charger_desc,
diff --git a/drivers/power/supply/bq24735-charger.c b/drivers/power/supply/bq24735-charger.c
index 73a7fc867b0344cd0305d3d4b29c0e85c361554f..637e0da65f8739f623420a25d079bfb152109bc7 100644
--- a/drivers/power/supply/bq24735-charger.c
+++ b/drivers/power/supply/bq24735-charger.c
@@ -402,7 +402,7 @@ static int bq24735_charger_probe(struct i2c_client *client)
psy_cfg.supplied_to = charger->pdata->supplied_to;
psy_cfg.num_supplicants = charger->pdata->num_supplicants;
- psy_cfg.of_node = client->dev.of_node;
+ psy_cfg.fwnode = dev_fwnode(&client->dev);
psy_cfg.drv_data = charger;
i2c_set_clientdata(client, charger);
diff --git a/drivers/power/supply/bq2515x_charger.c b/drivers/power/supply/bq2515x_charger.c
index a3424f67f2b1d7b607903806291896eb68aba707..a238de10750ddfe71494f5eaad3eceffb8012671 100644
--- a/drivers/power/supply/bq2515x_charger.c
+++ b/drivers/power/supply/bq2515x_charger.c
@@ -1102,7 +1102,7 @@ static int bq2515x_probe(struct i2c_client *client)
i2c_set_clientdata(client, bq2515x);
charger_cfg.drv_data = bq2515x;
- charger_cfg.of_node = dev->of_node;
+ charger_cfg.fwnode = dev_fwnode(dev);
ret = bq2515x_read_properties(bq2515x);
if (ret) {
diff --git a/drivers/power/supply/bq256xx_charger.c b/drivers/power/supply/bq256xx_charger.c
index 5514d1896bb847da6937e7c60fb540a51b46edd6..9f9b6019f8e13f986c39fbf170c622af0ac9fd37 100644
--- a/drivers/power/supply/bq256xx_charger.c
+++ b/drivers/power/supply/bq256xx_charger.c
@@ -1657,7 +1657,7 @@ static int bq256xx_parse_dt(struct bq256xx_device *bq,
int ret = 0;
psy_cfg->drv_data = bq;
- psy_cfg->of_node = dev->of_node;
+ psy_cfg->fwnode = dev_fwnode(dev);
ret = device_property_read_u32(bq->dev, "ti,watchdog-timeout-ms",
&bq->watchdog_timer);
diff --git a/drivers/power/supply/bq25980_charger.c b/drivers/power/supply/bq25980_charger.c
index 0c5e2938bb36d6b758ebd2759b41e285716349d8..af5f0d2ad54043d35da54e2b070f03ae7c61ff7a 100644
--- a/drivers/power/supply/bq25980_charger.c
+++ b/drivers/power/supply/bq25980_charger.c
@@ -1057,7 +1057,7 @@ static int bq25980_power_supply_init(struct bq25980_device *bq,
struct device *dev)
{
struct power_supply_config psy_cfg = { .drv_data = bq,
- .of_node = dev->of_node, };
+ .fwnode = dev_fwnode(dev), };
psy_cfg.supplied_to = bq25980_charger_supplied_to;
psy_cfg.num_supplicants = ARRAY_SIZE(bq25980_charger_supplied_to);
diff --git a/drivers/power/supply/bq27xxx_battery.c b/drivers/power/supply/bq27xxx_battery.c
index 90a5bccfc6b9bc37403eadd31e5ad98bd16204de..9bf66da1e49e775726c6127628d23274b95c3f21 100644
--- a/drivers/power/supply/bq27xxx_battery.c
+++ b/drivers/power/supply/bq27xxx_battery.c
@@ -2199,7 +2199,7 @@ int bq27xxx_battery_setup(struct bq27xxx_device_info *di)
{
struct power_supply_desc *psy_desc;
struct power_supply_config psy_cfg = {
- .of_node = di->dev->of_node,
+ .fwnode = dev_fwnode(di->dev),
.drv_data = di,
.no_wakeup_source = true,
};
diff --git a/drivers/power/supply/cpcap-battery.c b/drivers/power/supply/cpcap-battery.c
index 813037c00ded567e6acdff4f202b7c8d6de80dfd..8106d1edcbc26a738874d16e6bf3ce0547a38143 100644
--- a/drivers/power/supply/cpcap-battery.c
+++ b/drivers/power/supply/cpcap-battery.c
@@ -1130,7 +1130,7 @@ static int cpcap_battery_probe(struct platform_device *pdev)
if (error)
return error;
- psy_cfg.of_node = pdev->dev.of_node;
+ psy_cfg.fwnode = dev_fwnode(&pdev->dev);
psy_cfg.drv_data = ddata;
ddata->psy = devm_power_supply_register(ddata->dev,
diff --git a/drivers/power/supply/cpcap-charger.c b/drivers/power/supply/cpcap-charger.c
index 6625d539d9ae76e63cf6539f7fade727956c39b5..13300dc60baf9b8ba143c784fc2a1d1badf64fc6 100644
--- a/drivers/power/supply/cpcap-charger.c
+++ b/drivers/power/supply/cpcap-charger.c
@@ -902,7 +902,7 @@ static int cpcap_charger_probe(struct platform_device *pdev)
atomic_set(&ddata->active, 1);
- psy_cfg.of_node = pdev->dev.of_node;
+ psy_cfg.fwnode = dev_fwnode(&pdev->dev);
psy_cfg.drv_data = ddata;
psy_cfg.supplied_to = cpcap_charger_supplied_to;
psy_cfg.num_supplicants = ARRAY_SIZE(cpcap_charger_supplied_to);
diff --git a/drivers/power/supply/ds2760_battery.c b/drivers/power/supply/ds2760_battery.c
index 83bdec5a2bda901460e0a8618949baa7ecc11e46..bf933f8d052c566de6a57330e6adf8bd97caea2f 100644
--- a/drivers/power/supply/ds2760_battery.c
+++ b/drivers/power/supply/ds2760_battery.c
@@ -697,12 +697,11 @@ static int w1_ds2760_add_slave(struct w1_slave *sl)
ds2760_battery_external_power_changed;
psy_cfg.drv_data = di;
+ psy_cfg.fwnode = dev_fwnode(dev);
if (dev->of_node) {
u32 tmp;
- psy_cfg.of_node = dev->of_node;
-
if (!of_property_read_bool(dev->of_node, "maxim,pmod-enabled"))
pmod_enabled = true;
diff --git a/drivers/power/supply/generic-adc-battery.c b/drivers/power/supply/generic-adc-battery.c
index d5d215f5ad8b1684ea6272a82d614338a7bf19a9..f5f2566b3a32d59e3f873b6efc781f4701819545 100644
--- a/drivers/power/supply/generic-adc-battery.c
+++ b/drivers/power/supply/generic-adc-battery.c
@@ -166,7 +166,7 @@ static int gab_probe(struct platform_device *pdev)
if (!adc_bat)
return -ENOMEM;
- psy_cfg.of_node = pdev->dev.of_node;
+ psy_cfg.fwnode = dev_fwnode(&pdev->dev);
psy_cfg.drv_data = adc_bat;
psy_desc = &adc_bat->psy_desc;
psy_desc->name = dev_name(&pdev->dev);
diff --git a/drivers/power/supply/gpio-charger.c b/drivers/power/supply/gpio-charger.c
index 46d18ce6a7392b95e44cbf459566661e7f7cb0f3..1dfd5b0cb30d8e30897ed19013b79cb9dfddaeeb 100644
--- a/drivers/power/supply/gpio-charger.c
+++ b/drivers/power/supply/gpio-charger.c
@@ -333,7 +333,7 @@ static int gpio_charger_probe(struct platform_device *pdev)
charger_desc->property_is_writeable =
gpio_charger_property_is_writeable;
- psy_cfg.of_node = dev->of_node;
+ psy_cfg.fwnode = dev_fwnode(dev);
psy_cfg.drv_data = gpio_charger;
if (pdata) {
diff --git a/drivers/power/supply/ingenic-battery.c b/drivers/power/supply/ingenic-battery.c
index 0a40f425c27723ccec49985b8b5e14a737b6a7eb..b111c7ce2be30b8110c3d34f4b8b2faf9ab99969 100644
--- a/drivers/power/supply/ingenic-battery.c
+++ b/drivers/power/supply/ingenic-battery.c
@@ -146,7 +146,7 @@ static int ingenic_battery_probe(struct platform_device *pdev)
desc->num_properties = ARRAY_SIZE(ingenic_battery_properties);
desc->get_property = ingenic_battery_get_property;
psy_cfg.drv_data = bat;
- psy_cfg.of_node = dev->of_node;
+ psy_cfg.fwnode = dev_fwnode(dev);
bat->battery = devm_power_supply_register(dev, desc, &psy_cfg);
if (IS_ERR(bat->battery))
diff --git a/drivers/power/supply/ip5xxx_power.c b/drivers/power/supply/ip5xxx_power.c
index c448e0ac0dfac2fff6e43d3bcb427189391bc36e..a031eadb49ddce66f45c30edc2cb546985ca503e 100644
--- a/drivers/power/supply/ip5xxx_power.c
+++ b/drivers/power/supply/ip5xxx_power.c
@@ -848,7 +848,7 @@ static int ip5xxx_power_probe(struct i2c_client *client)
fields = (const struct ip5xxx_regfield_config *)of_id->data;
ip5xxx_setup_regs(dev, ip5xxx, fields);
- psy_cfg.of_node = dev->of_node;
+ psy_cfg.fwnode = dev_fwnode(dev);
psy_cfg.drv_data = ip5xxx;
psy = devm_power_supply_register(dev, &ip5xxx_battery_desc, &psy_cfg);
diff --git a/drivers/power/supply/lego_ev3_battery.c b/drivers/power/supply/lego_ev3_battery.c
index 9085de0ae1b2c6350604177ee8f5eab30d571f01..28454de057612a945c7926e4ee089aeeff9e1a49 100644
--- a/drivers/power/supply/lego_ev3_battery.c
+++ b/drivers/power/supply/lego_ev3_battery.c
@@ -23,6 +23,7 @@
#include <linux/mod_devicetable.h>
#include <linux/platform_device.h>
#include <linux/power_supply.h>
+#include <linux/property.h>
struct lego_ev3_battery {
struct iio_channel *iio_v;
@@ -198,7 +199,7 @@ static int lego_ev3_battery_probe(struct platform_device *pdev)
batt->v_min = 48000000;
}
- psy_cfg.of_node = pdev->dev.of_node;
+ psy_cfg.fwnode = dev_fwnode(&pdev->dev);
psy_cfg.drv_data = batt;
batt->psy = devm_power_supply_register(dev, &lego_ev3_battery_desc,
diff --git a/drivers/power/supply/lt3651-charger.c b/drivers/power/supply/lt3651-charger.c
index 8de500ffad95a5b0e7460155e186e5eeee206d96..ebfbdbcb7683216f01c37a2c39c1b30e22b00b53 100644
--- a/drivers/power/supply/lt3651-charger.c
+++ b/drivers/power/supply/lt3651-charger.c
@@ -131,7 +131,7 @@ static int lt3651_charger_probe(struct platform_device *pdev)
charger_desc->properties = lt3651_charger_properties;
charger_desc->num_properties = ARRAY_SIZE(lt3651_charger_properties);
charger_desc->get_property = lt3651_charger_get_property;
- psy_cfg.of_node = pdev->dev.of_node;
+ psy_cfg.fwnode = dev_fwnode(&pdev->dev);
psy_cfg.drv_data = lt3651_charger;
lt3651_charger->charger = devm_power_supply_register(&pdev->dev,
diff --git a/drivers/power/supply/ltc4162-l-charger.c b/drivers/power/supply/ltc4162-l-charger.c
index 23eb426295dbbb4ffd3f69dbe47f51df5136497b..e276668b803d2ee2436b9d7eeb50afd4de97a72f 100644
--- a/drivers/power/supply/ltc4162-l-charger.c
+++ b/drivers/power/supply/ltc4162-l-charger.c
@@ -1185,7 +1185,7 @@ static int ltc4162l_probe(struct i2c_client *client)
if (!device_property_read_u32(dev, "lltc,cell-count", &value))
info->cell_count = value;
- ltc4162l_config.of_node = dev->of_node;
+ ltc4162l_config.fwnode = dev_fwnode(dev);
ltc4162l_config.drv_data = info;
ltc4162l_config.attr_grp = ltc4162l_attr_groups;
diff --git a/drivers/power/supply/max17042_battery.c b/drivers/power/supply/max17042_battery.c
index 655b3f25dbd7ca78f530aee3663cbe241722c3cf..acea176101fa88ff2e5a9187be17575c8278d097 100644
--- a/drivers/power/supply/max17042_battery.c
+++ b/drivers/power/supply/max17042_battery.c
@@ -1066,7 +1066,7 @@ static int max17042_probe(struct i2c_client *client, struct device *dev, int irq
dev_set_drvdata(dev, chip);
psy_cfg.drv_data = chip;
- psy_cfg.of_node = dev->of_node;
+ psy_cfg.fwnode = dev_fwnode(dev);
/* When current is not measured,
* CURRENT_NOW and CURRENT_AVG properties should be invisible. */
diff --git a/drivers/power/supply/max77650-charger.c b/drivers/power/supply/max77650-charger.c
index 5f58c0c24b4d63bad410ea086c6ccf6b2a6fcf15..4ae43668992ecda319966ffd09734986187cd653 100644
--- a/drivers/power/supply/max77650-charger.c
+++ b/drivers/power/supply/max77650-charger.c
@@ -298,7 +298,7 @@ static int max77650_charger_probe(struct platform_device *pdev)
chg->dev = dev;
- pscfg.of_node = dev->of_node;
+ pscfg.fwnode = dev_fwnode(dev);
pscfg.drv_data = chg;
chg_irq = platform_get_irq_byname(pdev, "CHG");
diff --git a/drivers/power/supply/max8903_charger.c b/drivers/power/supply/max8903_charger.c
index e65d0141f260b1094393f6ecd26e810da4329bce..45fbaad6c6470ad51c6a9d2fefb3d7d1f4f2f4b3 100644
--- a/drivers/power/supply/max8903_charger.c
+++ b/drivers/power/supply/max8903_charger.c
@@ -349,7 +349,7 @@ static int max8903_probe(struct platform_device *pdev)
data->psy_desc.properties = max8903_charger_props;
data->psy_desc.num_properties = ARRAY_SIZE(max8903_charger_props);
- psy_cfg.of_node = dev->of_node;
+ psy_cfg.fwnode = dev_fwnode(dev);
psy_cfg.drv_data = data;
data->psy = devm_power_supply_register(dev, &data->psy_desc, &psy_cfg);
diff --git a/drivers/power/supply/mm8013.c b/drivers/power/supply/mm8013.c
index 4adf2acc2779366323e52c467cff4f99ebb9d6ea..93c50cff31bca3b7d526d67b22ee1f64e3f29add 100644
--- a/drivers/power/supply/mm8013.c
+++ b/drivers/power/supply/mm8013.c
@@ -274,7 +274,7 @@ static int mm8013_probe(struct i2c_client *client)
return dev_err_probe(dev, ret, "MM8013 not found\n");
psy_cfg.drv_data = chip;
- psy_cfg.of_node = dev->of_node;
+ psy_cfg.fwnode = dev_fwnode(dev);
psy = devm_power_supply_register(dev, &mm8013_desc, &psy_cfg);
if (IS_ERR(psy))
diff --git a/drivers/power/supply/mt6360_charger.c b/drivers/power/supply/mt6360_charger.c
index e99e551489761aa3b70ef33f8b65d59a8e117166..77747eb51667230008e2318543e6cdf0aab3664a 100644
--- a/drivers/power/supply/mt6360_charger.c
+++ b/drivers/power/supply/mt6360_charger.c
@@ -810,7 +810,7 @@ static int mt6360_charger_probe(struct platform_device *pdev)
memcpy(&mci->psy_desc, &mt6360_charger_desc, sizeof(mci->psy_desc));
mci->psy_desc.name = dev_name(&pdev->dev);
charger_cfg.drv_data = mci;
- charger_cfg.of_node = pdev->dev.of_node;
+ charger_cfg.fwnode = dev_fwnode(&pdev->dev);
mci->psy = devm_power_supply_register(&pdev->dev,
&mci->psy_desc, &charger_cfg);
if (IS_ERR(mci->psy))
diff --git a/drivers/power/supply/mt6370-charger.c b/drivers/power/supply/mt6370-charger.c
index ad8793bf997e15a7d6a6bca96e538e6056bb3153..a6939c6059c7fd0da08087d87fdaf2244914d222 100644
--- a/drivers/power/supply/mt6370-charger.c
+++ b/drivers/power/supply/mt6370-charger.c
@@ -752,7 +752,7 @@ static int mt6370_chg_init_psy(struct mt6370_priv *priv)
{
struct power_supply_config cfg = {
.drv_data = priv,
- .of_node = dev_of_node(priv->dev),
+ .fwnode = dev_fwnode(priv->dev),
};
priv->psy = devm_power_supply_register(priv->dev, &mt6370_chg_psy_desc,
diff --git a/drivers/power/supply/olpc_battery.c b/drivers/power/supply/olpc_battery.c
index 849f63e89ba09047bba30813723512780b9cdeb0..b9b6078226763459ad805db266d6e52d6de057ee 100644
--- a/drivers/power/supply/olpc_battery.c
+++ b/drivers/power/supply/olpc_battery.c
@@ -674,7 +674,7 @@ static int olpc_battery_probe(struct platform_device *pdev)
/* Ignore the status. It doesn't actually matter */
- ac_psy_cfg.of_node = pdev->dev.of_node;
+ ac_psy_cfg.fwnode = dev_fwnode(&pdev->dev);
ac_psy_cfg.drv_data = data;
data->olpc_ac = devm_power_supply_register(&pdev->dev, &olpc_ac_desc,
@@ -692,7 +692,7 @@ static int olpc_battery_probe(struct platform_device *pdev)
olpc_bat_desc.num_properties = ARRAY_SIZE(olpc_xo1_bat_props);
}
- bat_psy_cfg.of_node = pdev->dev.of_node;
+ bat_psy_cfg.fwnode = dev_fwnode(&pdev->dev);
bat_psy_cfg.drv_data = data;
bat_psy_cfg.attr_grp = olpc_bat_sysfs_groups;
diff --git a/drivers/power/supply/pm8916_bms_vm.c b/drivers/power/supply/pm8916_bms_vm.c
index 5d0dd842509c4b90853b23266a30c6cae172fc53..5120be086e6ffc6bb86f297a67192b29e2162d43 100644
--- a/drivers/power/supply/pm8916_bms_vm.c
+++ b/drivers/power/supply/pm8916_bms_vm.c
@@ -210,7 +210,7 @@ static int pm8916_bms_vm_battery_probe(struct platform_device *pdev)
bat->vbat_now = bat->last_ocv;
psy_cfg.drv_data = bat;
- psy_cfg.of_node = dev->of_node;
+ psy_cfg.fwnode = dev_fwnode(dev);
bat->battery = devm_power_supply_register(dev, &pm8916_bms_vm_battery_psy_desc, &psy_cfg);
if (IS_ERR(bat->battery))
diff --git a/drivers/power/supply/pm8916_lbc.c b/drivers/power/supply/pm8916_lbc.c
index 6d92e98cbecc682768bf8c6048735b4687088186..c74b75b1b2676c3dfbb782dad048c8356cc0e951 100644
--- a/drivers/power/supply/pm8916_lbc.c
+++ b/drivers/power/supply/pm8916_lbc.c
@@ -322,7 +322,7 @@ static int pm8916_lbc_charger_probe(struct platform_device *pdev)
dev_err_probe(dev, ret, "Error while parsing device tree\n");
psy_cfg.drv_data = chg;
- psy_cfg.of_node = dev->of_node;
+ psy_cfg.fwnode = dev_fwnode(dev);
chg->charger = devm_power_supply_register(dev, &pm8916_lbc_charger_psy_desc, &psy_cfg);
if (IS_ERR(chg->charger))
diff --git a/drivers/power/supply/qcom_battmgr.c b/drivers/power/supply/qcom_battmgr.c
index 47d29271ddf400b76dd5b0a1b8d1ba86c017afc0..fe27676fbc7cd12292caa6fb3b5b46a18c426e6d 100644
--- a/drivers/power/supply/qcom_battmgr.c
+++ b/drivers/power/supply/qcom_battmgr.c
@@ -8,6 +8,7 @@
#include <linux/mutex.h>
#include <linux/of_device.h>
#include <linux/power_supply.h>
+#include <linux/property.h>
#include <linux/soc/qcom/pdr.h>
#include <linux/soc/qcom/pmic_glink.h>
#include <linux/math.h>
@@ -1336,10 +1337,10 @@ static int qcom_battmgr_probe(struct auxiliary_device *adev,
battmgr->dev = dev;
psy_cfg.drv_data = battmgr;
- psy_cfg.of_node = adev->dev.of_node;
+ psy_cfg.fwnode = dev_fwnode(&adev->dev);
psy_cfg_supply.drv_data = battmgr;
- psy_cfg_supply.of_node = adev->dev.of_node;
+ psy_cfg_supply.fwnode = dev_fwnode(&adev->dev);
psy_cfg_supply.supplied_to = qcom_battmgr_battery;
psy_cfg_supply.num_supplicants = 1;
diff --git a/drivers/power/supply/qcom_pmi8998_charger.c b/drivers/power/supply/qcom_pmi8998_charger.c
index 3b4132376649e088d14753de05982e8ea0d18371..74a8d8ed8d9fa305416b1e543ecf12846d557091 100644
--- a/drivers/power/supply/qcom_pmi8998_charger.c
+++ b/drivers/power/supply/qcom_pmi8998_charger.c
@@ -964,7 +964,7 @@ static int smb2_probe(struct platform_device *pdev)
return rc;
supply_config.drv_data = chip;
- supply_config.of_node = pdev->dev.of_node;
+ supply_config.fwnode = dev_fwnode(&pdev->dev);
desc = devm_kzalloc(chip->dev, sizeof(smb2_psy_desc), GFP_KERNEL);
if (!desc)
diff --git a/drivers/power/supply/qcom_smbb.c b/drivers/power/supply/qcom_smbb.c
index a79563f6ff7a0c1b7d4aab85f6a42cc27fbb43ca..28afe758a2dabe31eaf753b907467a667ab42f61 100644
--- a/drivers/power/supply/qcom_smbb.c
+++ b/drivers/power/supply/qcom_smbb.c
@@ -880,7 +880,7 @@ static int smbb_charger_probe(struct platform_device *pdev)
}
bat_cfg.drv_data = chg;
- bat_cfg.of_node = pdev->dev.of_node;
+ bat_cfg.fwnode = dev_fwnode(&pdev->dev);
chg->bat_psy = devm_power_supply_register(&pdev->dev,
&bat_psy_desc,
&bat_cfg);
diff --git a/drivers/power/supply/rk817_charger.c b/drivers/power/supply/rk817_charger.c
index e5f35d083c23d5d86b3dca454f666383f828e524..945c7720c4ae905e2f0204cbef1534f7ec2a3a62 100644
--- a/drivers/power/supply/rk817_charger.c
+++ b/drivers/power/supply/rk817_charger.c
@@ -1088,7 +1088,7 @@ static int rk817_charger_probe(struct platform_device *pdev)
rk817_bat_calib_vol(charger);
pscfg.drv_data = charger;
- pscfg.of_node = node;
+ pscfg.fwnode = node ? &node->fwnode : NULL;
/*
* Get sample resistor value. Note only values of 10000 or 20000
diff --git a/drivers/power/supply/rt5033_battery.c b/drivers/power/supply/rt5033_battery.c
index 7a27b262fb84a73db82b12e97c2fb57162709e14..b2674adfa30b41475abae1d6973a37272dbcfb92 100644
--- a/drivers/power/supply/rt5033_battery.c
+++ b/drivers/power/supply/rt5033_battery.c
@@ -160,7 +160,7 @@ static int rt5033_battery_probe(struct i2c_client *client)
}
i2c_set_clientdata(client, battery);
- psy_cfg.of_node = client->dev.of_node;
+ psy_cfg.fwnode = dev_fwnode(&client->dev);
psy_cfg.drv_data = battery;
battery->psy = devm_power_supply_register(&client->dev,
diff --git a/drivers/power/supply/rt5033_charger.c b/drivers/power/supply/rt5033_charger.c
index d19c7e80a92aa8f1f2f018e8e8d59ed0c58cc8a9..2fdc5843970754270754623ddf8abf758c69e2cf 100644
--- a/drivers/power/supply/rt5033_charger.c
+++ b/drivers/power/supply/rt5033_charger.c
@@ -16,6 +16,7 @@
#include <linux/power_supply.h>
#include <linux/regmap.h>
#include <linux/mfd/rt5033-private.h>
+#include <linux/property.h>
struct rt5033_charger_data {
unsigned int pre_uamp;
@@ -675,7 +676,7 @@ static int rt5033_charger_probe(struct platform_device *pdev)
charger->regmap = dev_get_regmap(pdev->dev.parent, NULL);
mutex_init(&charger->lock);
- psy_cfg.of_node = pdev->dev.of_node;
+ psy_cfg.fwnode = dev_fwnode(&pdev->dev);
psy_cfg.drv_data = charger;
charger->psy = devm_power_supply_register(charger->dev,
diff --git a/drivers/power/supply/rt9455_charger.c b/drivers/power/supply/rt9455_charger.c
index 64a23e3d7bb00f03a548a551d3fd523299fd00cd..4b714b4c3e2b596280f09901f68dbae9296d8605 100644
--- a/drivers/power/supply/rt9455_charger.c
+++ b/drivers/power/supply/rt9455_charger.c
@@ -1658,7 +1658,7 @@ static int rt9455_probe(struct i2c_client *client)
INIT_DEFERRABLE_WORK(&info->batt_presence_work,
rt9455_batt_presence_work_callback);
- rt9455_charger_config.of_node = dev->of_node;
+ rt9455_charger_config.fwnode = dev_fwnode(dev);
rt9455_charger_config.drv_data = info;
rt9455_charger_config.supplied_to = rt9455_charger_supplied_to;
rt9455_charger_config.num_supplicants =
diff --git a/drivers/power/supply/rt9467-charger.c b/drivers/power/supply/rt9467-charger.c
index 235169c85c5d8a8014ff585b6740aaec3243a068..e9aba9ad393c9cec309c49e7fb21286f77555261 100644
--- a/drivers/power/supply/rt9467-charger.c
+++ b/drivers/power/supply/rt9467-charger.c
@@ -826,7 +826,7 @@ static int rt9467_register_psy(struct rt9467_chg_data *data)
{
struct power_supply_config cfg = {
.drv_data = data,
- .of_node = dev_of_node(data->dev),
+ .fwnode = dev_fwnode(data->dev),
.attr_grp = rt9467_sysfs_groups,
};
diff --git a/drivers/power/supply/rt9471.c b/drivers/power/supply/rt9471.c
index 67b86ac91a21ddc0e3d0271b5f535c47600bc101..bd966abb4df5767f6f0353d08ea0eac2c3972b5b 100644
--- a/drivers/power/supply/rt9471.c
+++ b/drivers/power/supply/rt9471.c
@@ -723,7 +723,7 @@ static int rt9471_register_psy(struct rt9471_chip *chip)
char *psy_name;
cfg.drv_data = chip;
- cfg.of_node = dev->of_node;
+ cfg.fwnode = dev_fwnode(dev);
cfg.attr_grp = rt9471_sysfs_groups;
psy_name = devm_kasprintf(dev, GFP_KERNEL, "rt9471-%s", dev_name(dev));
diff --git a/drivers/power/supply/sbs-battery.c b/drivers/power/supply/sbs-battery.c
index 6f3d0413b1c127fc4c5a16728d71be8ae340d05d..943c82ee978f40abd2b1f2ecd4850cf3b41fd446 100644
--- a/drivers/power/supply/sbs-battery.c
+++ b/drivers/power/supply/sbs-battery.c
@@ -1138,7 +1138,7 @@ static int sbs_probe(struct i2c_client *client)
chip->flags = (uintptr_t)i2c_get_match_data(client);
chip->client = client;
- psy_cfg.of_node = client->dev.of_node;
+ psy_cfg.fwnode = dev_fwnode(&client->dev);
psy_cfg.drv_data = chip;
chip->last_state = POWER_SUPPLY_STATUS_UNKNOWN;
sbs_invalidate_cached_props(chip);
diff --git a/drivers/power/supply/sbs-charger.c b/drivers/power/supply/sbs-charger.c
index ab3f095d90ea7c1c599aea61acce9138c37a269a..27764123b929e2357daf29676506531a6f3f7664 100644
--- a/drivers/power/supply/sbs-charger.c
+++ b/drivers/power/supply/sbs-charger.c
@@ -173,7 +173,7 @@ static int sbs_probe(struct i2c_client *client)
return -ENOMEM;
chip->client = client;
- psy_cfg.of_node = client->dev.of_node;
+ psy_cfg.fwnode = dev_fwnode(&client->dev);
psy_cfg.drv_data = chip;
i2c_set_clientdata(client, chip);
diff --git a/drivers/power/supply/sbs-manager.c b/drivers/power/supply/sbs-manager.c
index 7d2f39f19acbf00d2d29850cd97063bb5f02eb3c..869729dfcd664c061dfff1bff30ab756748d73d4 100644
--- a/drivers/power/supply/sbs-manager.c
+++ b/drivers/power/supply/sbs-manager.c
@@ -379,7 +379,7 @@ static int sbsm_probe(struct i2c_client *client)
return ret;
psy_cfg.drv_data = data;
- psy_cfg.of_node = dev->of_node;
+ psy_cfg.fwnode = dev_fwnode(dev);
data->psy = devm_power_supply_register(dev, psy_desc, &psy_cfg);
if (IS_ERR(data->psy))
return dev_err_probe(dev, PTR_ERR(data->psy),
diff --git a/drivers/power/supply/sc2731_charger.c b/drivers/power/supply/sc2731_charger.c
index 50d5157af9277dc09fe24852747f4f62e72bc712..58b86fd78771360f74ffdad152c3905e1bee7c1b 100644
--- a/drivers/power/supply/sc2731_charger.c
+++ b/drivers/power/supply/sc2731_charger.c
@@ -480,7 +480,7 @@ static int sc2731_charger_probe(struct platform_device *pdev)
}
charger_cfg.drv_data = info;
- charger_cfg.of_node = np;
+ charger_cfg.fwnode = dev_fwnode(&pdev->dev);
info->psy_usb = devm_power_supply_register(&pdev->dev,
&sc2731_charger_desc,
&charger_cfg);
diff --git a/drivers/power/supply/sc27xx_fuel_gauge.c b/drivers/power/supply/sc27xx_fuel_gauge.c
index f36edc2ba708748d0ceb61298056f8c905aca012..196d96cd986266738785d8582e907858faaf2ba3 100644
--- a/drivers/power/supply/sc27xx_fuel_gauge.c
+++ b/drivers/power/supply/sc27xx_fuel_gauge.c
@@ -1141,7 +1141,6 @@ static int sc27xx_fgu_hw_init(struct sc27xx_fgu_data *data)
static int sc27xx_fgu_probe(struct platform_device *pdev)
{
struct device *dev = &pdev->dev;
- struct device_node *np = dev->of_node;
struct power_supply_config fgu_cfg = { };
struct sc27xx_fgu_data *data;
int ret, irq;
@@ -1205,7 +1204,7 @@ static int sc27xx_fgu_probe(struct platform_device *pdev)
platform_set_drvdata(pdev, data);
fgu_cfg.drv_data = data;
- fgu_cfg.of_node = np;
+ fgu_cfg.fwnode = dev_fwnode(dev);
data->battery = devm_power_supply_register(dev, &sc27xx_fgu_desc,
&fgu_cfg);
if (IS_ERR(data->battery)) {
diff --git a/drivers/power/supply/smb347-charger.c b/drivers/power/supply/smb347-charger.c
index c8392933ee285255438a78f5bbd9429f9f1c6764..893551dce7d2c9902df5a6141935661b342c00f9 100644
--- a/drivers/power/supply/smb347-charger.c
+++ b/drivers/power/supply/smb347-charger.c
@@ -1553,7 +1553,7 @@ static int smb347_probe(struct i2c_client *client)
return PTR_ERR(smb->regmap);
mains_usb_cfg.drv_data = smb;
- mains_usb_cfg.of_node = dev->of_node;
+ mains_usb_cfg.fwnode = dev_fwnode(dev);
if (smb->use_mains) {
smb->mains = devm_power_supply_register(dev, &smb347_mains_desc,
&mains_usb_cfg);
diff --git a/drivers/power/supply/tps65090-charger.c b/drivers/power/supply/tps65090-charger.c
index d65193e410a6251e80e481ed6fc3d36128c5678c..d010f013af8cec790d135b651fbc6330c8907b0e 100644
--- a/drivers/power/supply/tps65090-charger.c
+++ b/drivers/power/supply/tps65090-charger.c
@@ -259,7 +259,7 @@ static int tps65090_charger_probe(struct platform_device *pdev)
psy_cfg.supplied_to = pdata->supplied_to;
psy_cfg.num_supplicants = pdata->num_supplicants;
- psy_cfg.of_node = pdev->dev.of_node;
+ psy_cfg.fwnode = dev_fwnode(&pdev->dev);
psy_cfg.drv_data = cdata;
cdata->ac = devm_power_supply_register(&pdev->dev, &tps65090_charger_desc,
diff --git a/drivers/power/supply/tps65217_charger.c b/drivers/power/supply/tps65217_charger.c
index 6fff44e1ecac80797fd33cdc3c10b0c23ce19c28..6af17ce0b2040bb3ba5835c6dc13b867f316141d 100644
--- a/drivers/power/supply/tps65217_charger.c
+++ b/drivers/power/supply/tps65217_charger.c
@@ -198,7 +198,7 @@ static int tps65217_charger_probe(struct platform_device *pdev)
charger->tps = tps;
charger->dev = &pdev->dev;
- cfg.of_node = pdev->dev.of_node;
+ cfg.fwnode = dev_fwnode(&pdev->dev);
cfg.drv_data = charger;
charger->psy = devm_power_supply_register(&pdev->dev,
diff --git a/drivers/power/supply/ucs1002_power.c b/drivers/power/supply/ucs1002_power.c
index 7382bec6a43c776119bbcfd9070d6ca9629ab810..d32a7633f9e7d725cecf6659ed5b49c4fe2accd5 100644
--- a/drivers/power/supply/ucs1002_power.c
+++ b/drivers/power/supply/ucs1002_power.c
@@ -560,7 +560,7 @@ static int ucs1002_probe(struct i2c_client *client)
irq_a_det = of_irq_get_byname(dev->of_node, "a_det");
irq_alert = of_irq_get_byname(dev->of_node, "alert");
- charger_config.of_node = dev->of_node;
+ charger_config.fwnode = dev_fwnode(dev);
charger_config.drv_data = info;
ret = regmap_read(info->regmap, UCS1002_REG_PRODUCT_ID, ®val);
--
2.47.2
^ permalink raw reply related [flat|nested] 32+ messages in thread
* [PATCH 5/7] power: supply: core: remove of_node from power_supply_config
2025-02-24 23:21 [PATCH 0/7] power: supply: core: convert to fwnode Sebastian Reichel
` (3 preceding siblings ...)
2025-02-24 23:21 ` [PATCH 4/7] power: supply: all: " Sebastian Reichel
@ 2025-02-24 23:21 ` Sebastian Reichel
2025-02-25 10:49 ` AngeloGioacchino Del Regno
2025-02-24 23:21 ` [PATCH 6/7] power: supply: core: battery-info: fully switch to fwnode Sebastian Reichel
` (2 subsequent siblings)
7 siblings, 1 reply; 32+ messages in thread
From: Sebastian Reichel @ 2025-02-24 23:21 UTC (permalink / raw)
To: Sebastian Reichel, Mark Brown, Greg Kroah-Hartman, Linus Walleij,
Hans de Goede
Cc: Liam Girdwood, Chen-Yu Tsai, Matti Vaittinen, Pali Rohár,
Paul Cercueil, Samuel Holland, David Lechner, Krzysztof Kozlowski,
Marek Szyprowski, Sebastian Krzyszkowiak, Purism Kernel Team,
Bartosz Golaszewski, Konrad Dybcio, Matthias Brugger,
AngeloGioacchino Del Regno, Orson Zhai, Baolin Wang,
Chunyan Zhang, linux-pm, linux-kernel, linux-usb,
Sebastian Reichel
All drivers have been migrated from .of_node to .fwnode,
so let's kill the former.
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
---
drivers/power/supply/power_supply_core.c | 3 +--
include/linux/power_supply.h | 1 -
2 files changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/power/supply/power_supply_core.c b/drivers/power/supply/power_supply_core.c
index 11030035da6f121ca76bebf800c06cfd5db57578..c43539ea1318506ada0a6fcbcdbf7ece253f5257 100644
--- a/drivers/power/supply/power_supply_core.c
+++ b/drivers/power/supply/power_supply_core.c
@@ -1542,10 +1542,9 @@ __power_supply_register(struct device *parent,
dev_set_drvdata(dev, psy);
psy->desc = desc;
if (cfg) {
+ device_set_node(dev, cfg->fwnode);
dev->groups = cfg->attr_grp;
psy->drv_data = cfg->drv_data;
- dev->of_node =
- cfg->fwnode ? to_of_node(cfg->fwnode) : cfg->of_node;
psy->supplied_to = cfg->supplied_to;
psy->num_supplicants = cfg->num_supplicants;
}
diff --git a/include/linux/power_supply.h b/include/linux/power_supply.h
index 975ccab56597ef579ef0c9dc913dcb0a26b5855a..a785742f97721e7e70d0e4c17a1ded7b985acb6d 100644
--- a/include/linux/power_supply.h
+++ b/include/linux/power_supply.h
@@ -229,7 +229,6 @@ struct power_supply;
/* Run-time specific power supply configuration */
struct power_supply_config {
- struct device_node *of_node;
struct fwnode_handle *fwnode;
/* Driver private data */
--
2.47.2
^ permalink raw reply related [flat|nested] 32+ messages in thread
* [PATCH 6/7] power: supply: core: battery-info: fully switch to fwnode
2025-02-24 23:21 [PATCH 0/7] power: supply: core: convert to fwnode Sebastian Reichel
` (4 preceding siblings ...)
2025-02-24 23:21 ` [PATCH 5/7] power: supply: core: remove of_node from power_supply_config Sebastian Reichel
@ 2025-02-24 23:21 ` Sebastian Reichel
2025-02-25 10:49 ` AngeloGioacchino Del Regno
2025-02-24 23:21 ` [PATCH 7/7] power: supply: core: convert to fwnnode Sebastian Reichel
2025-03-08 0:45 ` (subset) [PATCH 0/7] power: supply: core: convert to fwnode Sebastian Reichel
7 siblings, 1 reply; 32+ messages in thread
From: Sebastian Reichel @ 2025-02-24 23:21 UTC (permalink / raw)
To: Sebastian Reichel, Mark Brown, Greg Kroah-Hartman, Linus Walleij,
Hans de Goede
Cc: Liam Girdwood, Chen-Yu Tsai, Matti Vaittinen, Pali Rohár,
Paul Cercueil, Samuel Holland, David Lechner, Krzysztof Kozlowski,
Marek Szyprowski, Sebastian Krzyszkowiak, Purism Kernel Team,
Bartosz Golaszewski, Konrad Dybcio, Matthias Brugger,
AngeloGioacchino Del Regno, Orson Zhai, Baolin Wang,
Chunyan Zhang, linux-pm, linux-kernel, linux-usb,
Sebastian Reichel
Also use fwnode based parsing for "ocv-capacity-celsius" and
"resistance-temp-table", so that any DT specific bits are
removed from the power-supply core.
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
---
drivers/power/supply/power_supply_core.c | 109 ++++++++++++++++++-------------
1 file changed, 63 insertions(+), 46 deletions(-)
diff --git a/drivers/power/supply/power_supply_core.c b/drivers/power/supply/power_supply_core.c
index c43539ea1318506ada0a6fcbcdbf7ece253f5257..0e5fa16fd8f832414f34fae31086128928fa57cc 100644
--- a/drivers/power/supply/power_supply_core.c
+++ b/drivers/power/supply/power_supply_core.c
@@ -598,32 +598,19 @@ int power_supply_get_battery_info(struct power_supply *psy,
{
struct power_supply_resistance_temp_table *resist_table;
struct power_supply_battery_info *info;
- struct device_node *battery_np = NULL;
- struct fwnode_reference_args args;
- struct fwnode_handle *fwnode = NULL;
+ struct fwnode_handle *srcnode, *fwnode;
const char *value;
- int err, len, index;
- const __be32 *list;
+ int err, len, index, proplen;
+ u32 *propdata;
u32 min_max[2];
- if (psy->dev.of_node) {
- battery_np = of_parse_phandle(psy->dev.of_node, "monitored-battery", 0);
- if (!battery_np)
- return -ENODEV;
+ srcnode = dev_fwnode(&psy->dev);
+ if (!srcnode && psy->dev.parent)
+ srcnode = dev_fwnode(psy->dev.parent);
- fwnode = fwnode_handle_get(of_fwnode_handle(battery_np));
- } else if (psy->dev.parent) {
- err = fwnode_property_get_reference_args(
- dev_fwnode(psy->dev.parent),
- "monitored-battery", NULL, 0, 0, &args);
- if (err)
- return err;
-
- fwnode = args.fwnode;
- }
-
- if (!fwnode)
- return -ENOENT;
+ fwnode = fwnode_find_reference(srcnode, "monitored-battery", 0);
+ if (IS_ERR(fwnode))
+ return PTR_ERR(fwnode);
err = fwnode_property_read_string(fwnode, "compatible", &value);
if (err)
@@ -753,15 +740,7 @@ int power_supply_get_battery_info(struct power_supply *psy,
info->temp_max = min_max[1];
}
- /*
- * The below code uses raw of-data parsing to parse
- * /schemas/types.yaml#/definitions/uint32-matrix
- * data, so for now this is only support with of.
- */
- if (!battery_np)
- goto out_ret_pointer;
-
- len = of_property_count_u32_elems(battery_np, "ocv-capacity-celsius");
+ len = fwnode_property_count_u32(fwnode, "ocv-capacity-celsius");
if (len < 0 && len != -EINVAL) {
err = len;
goto out_put_node;
@@ -770,13 +749,13 @@ int power_supply_get_battery_info(struct power_supply *psy,
err = -EINVAL;
goto out_put_node;
} else if (len > 0) {
- of_property_read_u32_array(battery_np, "ocv-capacity-celsius",
+ fwnode_property_read_u32_array(fwnode, "ocv-capacity-celsius",
info->ocv_temp, len);
}
for (index = 0; index < len; index++) {
struct power_supply_battery_ocv_table *table;
- int i, tab_len, size;
+ int i, tab_len;
char *propname __free(kfree) = kasprintf(GFP_KERNEL, "ocv-capacity-table-%d",
index);
@@ -785,60 +764,98 @@ int power_supply_get_battery_info(struct power_supply *psy,
err = -ENOMEM;
goto out_put_node;
}
- list = of_get_property(battery_np, propname, &size);
- if (!list || !size) {
+ proplen = fwnode_property_count_u32(fwnode, propname);
+ if (proplen < 0 || proplen % 2 != 0) {
dev_err(&psy->dev, "failed to get %s\n", propname);
power_supply_put_battery_info(psy, info);
err = -EINVAL;
goto out_put_node;
}
+ propdata = kcalloc(proplen, sizeof(*propdata), GFP_KERNEL);
+ if (!propdata) {
+ kfree(propname);
+ power_supply_put_battery_info(psy, info);
+ err = -EINVAL;
+ goto out_put_node;
+ }
+ err = fwnode_property_read_u32_array(fwnode, propname, propdata, proplen);
+ if (err < 0) {
+ dev_err(&psy->dev, "failed to get %s\n", propname);
+ kfree(propname);
+ kfree(propdata);
+ power_supply_put_battery_info(psy, info);
+ goto out_put_node;
+ }
- tab_len = size / (2 * sizeof(__be32));
+ tab_len = proplen / 2;
info->ocv_table_size[index] = tab_len;
info->ocv_table[index] = table =
devm_kcalloc(&psy->dev, tab_len, sizeof(*table), GFP_KERNEL);
if (!info->ocv_table[index]) {
+ kfree(propdata);
power_supply_put_battery_info(psy, info);
err = -ENOMEM;
goto out_put_node;
}
for (i = 0; i < tab_len; i++) {
- table[i].ocv = be32_to_cpu(*list);
- list++;
- table[i].capacity = be32_to_cpu(*list);
- list++;
+ table[i].ocv = propdata[i*2];
+ table[i].capacity = propdata[i*2+1];
}
+
+ kfree(propdata);
}
- list = of_get_property(battery_np, "resistance-temp-table", &len);
- if (!list || !len)
+ proplen = fwnode_property_count_u32(fwnode, "resistance-temp-table");
+ if (proplen < 0 || proplen % 2 != 0) {
+ power_supply_put_battery_info(psy, info);
+ err = -ENOMEM;
goto out_ret_pointer;
+ } else if (proplen == 0) {
+ goto out_ret_pointer;
+ }
- info->resist_table_size = len / (2 * sizeof(__be32));
+ propdata = kcalloc(proplen, sizeof(*propdata), GFP_KERNEL);
+ if (!propdata) {
+ power_supply_put_battery_info(psy, info);
+ err = -ENOMEM;
+ goto out_ret_pointer;
+ }
+
+ err = fwnode_property_read_u32_array(fwnode, "resistance-temp-table",
+ propdata, proplen);
+ if (err < 0) {
+ kfree(propdata);
+ power_supply_put_battery_info(psy, info);
+ goto out_put_node;
+ }
+
+ info->resist_table_size = proplen / 2;
info->resist_table = resist_table = devm_kcalloc(&psy->dev,
info->resist_table_size,
sizeof(*resist_table),
GFP_KERNEL);
if (!info->resist_table) {
+ kfree(propdata);
power_supply_put_battery_info(psy, info);
err = -ENOMEM;
goto out_put_node;
}
for (index = 0; index < info->resist_table_size; index++) {
- resist_table[index].temp = be32_to_cpu(*list++);
- resist_table[index].resistance = be32_to_cpu(*list++);
+ resist_table[index].temp = propdata[index*2];
+ resist_table[index].resistance = propdata[index*2+1];
}
+ kfree(propdata);
+
out_ret_pointer:
/* Finally return the whole thing */
*info_out = info;
out_put_node:
fwnode_handle_put(fwnode);
- of_node_put(battery_np);
return err;
}
EXPORT_SYMBOL_GPL(power_supply_get_battery_info);
--
2.47.2
^ permalink raw reply related [flat|nested] 32+ messages in thread
* [PATCH 7/7] power: supply: core: convert to fwnnode
2025-02-24 23:21 [PATCH 0/7] power: supply: core: convert to fwnode Sebastian Reichel
` (5 preceding siblings ...)
2025-02-24 23:21 ` [PATCH 6/7] power: supply: core: battery-info: fully switch to fwnode Sebastian Reichel
@ 2025-02-24 23:21 ` Sebastian Reichel
2025-02-25 10:49 ` AngeloGioacchino Del Regno
2025-02-25 13:16 ` Hans de Goede
2025-03-08 0:45 ` (subset) [PATCH 0/7] power: supply: core: convert to fwnode Sebastian Reichel
7 siblings, 2 replies; 32+ messages in thread
From: Sebastian Reichel @ 2025-02-24 23:21 UTC (permalink / raw)
To: Sebastian Reichel, Mark Brown, Greg Kroah-Hartman, Linus Walleij,
Hans de Goede
Cc: Liam Girdwood, Chen-Yu Tsai, Matti Vaittinen, Pali Rohár,
Paul Cercueil, Samuel Holland, David Lechner, Krzysztof Kozlowski,
Marek Szyprowski, Sebastian Krzyszkowiak, Purism Kernel Team,
Bartosz Golaszewski, Konrad Dybcio, Matthias Brugger,
AngeloGioacchino Del Regno, Orson Zhai, Baolin Wang,
Chunyan Zhang, linux-pm, linux-kernel, linux-usb,
Sebastian Reichel
Replace any DT specific code with fwnode in the power-supply
core.
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
---
drivers/power/supply/bq2415x_charger.c | 2 +-
drivers/power/supply/power_supply_core.c | 65 ++++++++++++++++----------------
include/linux/power_supply.h | 2 +-
3 files changed, 34 insertions(+), 35 deletions(-)
diff --git a/drivers/power/supply/bq2415x_charger.c b/drivers/power/supply/bq2415x_charger.c
index 9e3b9181ee76a4f473228bba022917677acce256..1ecbca510bba99ee7abcda33a719035adfceeb5f 100644
--- a/drivers/power/supply/bq2415x_charger.c
+++ b/drivers/power/supply/bq2415x_charger.c
@@ -1674,7 +1674,7 @@ static int bq2415x_probe(struct i2c_client *client)
/* Query for initial reported_mode and set it */
if (bq->nb.notifier_call) {
if (np) {
- notify_psy = power_supply_get_by_phandle(np,
+ notify_psy = power_supply_get_by_phandle(of_fwnode_handle(np),
"ti,usb-charger-detection");
if (IS_ERR(notify_psy))
notify_psy = NULL;
diff --git a/drivers/power/supply/power_supply_core.c b/drivers/power/supply/power_supply_core.c
index 0e5fa16fd8f832414f34fae31086128928fa57cc..a01e6e1815da2ac70ce93d8bd5d06517a0eb1082 100644
--- a/drivers/power/supply/power_supply_core.c
+++ b/drivers/power/supply/power_supply_core.c
@@ -18,7 +18,6 @@
#include <linux/device.h>
#include <linux/notifier.h>
#include <linux/err.h>
-#include <linux/of.h>
#include <linux/power_supply.h>
#include <linux/property.h>
#include <linux/thermal.h>
@@ -196,24 +195,24 @@ static int __power_supply_populate_supplied_from(struct power_supply *epsy,
void *data)
{
struct power_supply *psy = data;
- struct device_node *np;
+ struct fwnode_handle *np;
int i = 0;
do {
- np = of_parse_phandle(psy->dev.of_node, "power-supplies", i++);
- if (!np)
+ np = fwnode_find_reference(psy->dev.fwnode, "power-supplies", i++);
+ if (IS_ERR(np))
break;
- if (np == epsy->dev.of_node) {
+ if (np == epsy->dev.fwnode) {
dev_dbg(&psy->dev, "%s: Found supply : %s\n",
psy->desc->name, epsy->desc->name);
psy->supplied_from[i-1] = (char *)epsy->desc->name;
psy->num_supplies++;
- of_node_put(np);
+ fwnode_handle_put(np);
break;
}
- of_node_put(np);
- } while (np);
+ fwnode_handle_put(np);
+ } while (!IS_ERR(np));
return 0;
}
@@ -232,16 +231,16 @@ static int power_supply_populate_supplied_from(struct power_supply *psy)
static int __power_supply_find_supply_from_node(struct power_supply *epsy,
void *data)
{
- struct device_node *np = data;
+ struct fwnode_handle *fwnode = data;
/* returning non-zero breaks out of power_supply_for_each_psy loop */
- if (epsy->dev.of_node == np)
+ if (epsy->dev.fwnode == fwnode)
return 1;
return 0;
}
-static int power_supply_find_supply_from_node(struct device_node *supply_node)
+static int power_supply_find_supply_from_fwnode(struct fwnode_handle *supply_node)
{
int error;
@@ -249,7 +248,7 @@ static int power_supply_find_supply_from_node(struct device_node *supply_node)
* power_supply_for_each_psy() either returns its own errors or values
* returned by __power_supply_find_supply_from_node().
*
- * __power_supply_find_supply_from_node() will return 0 (no match)
+ * __power_supply_find_supply_from_fwnode() will return 0 (no match)
* or 1 (match).
*
* We return 0 if power_supply_for_each_psy() returned 1, -EPROBE_DEFER if
@@ -262,7 +261,7 @@ static int power_supply_find_supply_from_node(struct device_node *supply_node)
static int power_supply_check_supplies(struct power_supply *psy)
{
- struct device_node *np;
+ struct fwnode_handle *np;
int cnt = 0;
/* If there is already a list honor it */
@@ -270,24 +269,24 @@ static int power_supply_check_supplies(struct power_supply *psy)
return 0;
/* No device node found, nothing to do */
- if (!psy->dev.of_node)
+ if (!psy->dev.fwnode)
return 0;
do {
int ret;
- np = of_parse_phandle(psy->dev.of_node, "power-supplies", cnt++);
- if (!np)
+ np = fwnode_find_reference(psy->dev.fwnode, "power-supplies", cnt++);
+ if (IS_ERR(np))
break;
- ret = power_supply_find_supply_from_node(np);
- of_node_put(np);
+ ret = power_supply_find_supply_from_fwnode(np);
+ fwnode_handle_put(np);
if (ret) {
dev_dbg(&psy->dev, "Failed to find supply!\n");
return ret;
}
- } while (np);
+ } while (!IS_ERR(np));
/* Missing valid "power-supplies" entries */
if (cnt == 1)
@@ -511,14 +510,14 @@ void power_supply_put(struct power_supply *psy)
EXPORT_SYMBOL_GPL(power_supply_put);
#ifdef CONFIG_OF
-static int power_supply_match_device_node(struct device *dev, const void *data)
+static int power_supply_match_device_fwnode(struct device *dev, const void *data)
{
- return dev->parent && dev->parent->of_node == data;
+ return dev->parent && dev_fwnode(dev->parent) == data;
}
/**
* power_supply_get_by_phandle() - Search for a power supply and returns its ref
- * @np: Pointer to device node holding phandle property
+ * @fwnode: Pointer to fwnode holding phandle property
* @property: Name of property holding a power supply name
*
* If power supply was found, it increases reference count for the
@@ -528,21 +527,21 @@ static int power_supply_match_device_node(struct device *dev, const void *data)
* Return: On success returns a reference to a power supply with
* matching name equals to value under @property, NULL or ERR_PTR otherwise.
*/
-struct power_supply *power_supply_get_by_phandle(struct device_node *np,
- const char *property)
+struct power_supply *power_supply_get_by_phandle(struct fwnode_handle *fwnode,
+ const char *property)
{
- struct device_node *power_supply_np;
+ struct fwnode_handle *power_supply_fwnode;
struct power_supply *psy = NULL;
struct device *dev;
- power_supply_np = of_parse_phandle(np, property, 0);
- if (!power_supply_np)
- return ERR_PTR(-ENODEV);
+ power_supply_fwnode = fwnode_find_reference(fwnode, property, 0);
+ if (IS_ERR(power_supply_fwnode))
+ return ERR_CAST(power_supply_fwnode);
- dev = class_find_device(&power_supply_class, NULL, power_supply_np,
- power_supply_match_device_node);
+ dev = class_find_device(&power_supply_class, NULL, power_supply_fwnode,
+ power_supply_match_device_fwnode);
- of_node_put(power_supply_np);
+ fwnode_handle_put(power_supply_fwnode);
if (dev) {
psy = dev_to_psy(dev);
@@ -574,14 +573,14 @@ struct power_supply *devm_power_supply_get_by_phandle(struct device *dev,
{
struct power_supply **ptr, *psy;
- if (!dev->of_node)
+ if (!dev_fwnode(dev))
return ERR_PTR(-ENODEV);
ptr = devres_alloc(devm_power_supply_put, sizeof(*ptr), GFP_KERNEL);
if (!ptr)
return ERR_PTR(-ENOMEM);
- psy = power_supply_get_by_phandle(dev->of_node, property);
+ psy = power_supply_get_by_phandle(dev_fwnode(dev), property);
if (IS_ERR_OR_NULL(psy)) {
devres_free(ptr);
} else {
diff --git a/include/linux/power_supply.h b/include/linux/power_supply.h
index a785742f97721e7e70d0e4c17a1ded7b985acb6d..9afde8c04efc72691c81a373d8dd03477b4efd7e 100644
--- a/include/linux/power_supply.h
+++ b/include/linux/power_supply.h
@@ -805,7 +805,7 @@ static inline struct power_supply *power_supply_get_by_name(const char *name)
{ return NULL; }
#endif
#ifdef CONFIG_OF
-extern struct power_supply *power_supply_get_by_phandle(struct device_node *np,
+extern struct power_supply *power_supply_get_by_phandle(struct fwnode_handle *fwnode,
const char *property);
extern struct power_supply *devm_power_supply_get_by_phandle(
struct device *dev, const char *property);
--
2.47.2
^ permalink raw reply related [flat|nested] 32+ messages in thread
* Re: [PATCH 4/7] power: supply: all: switch psy_cfg from of_node to fwnode
2025-02-24 23:21 ` [PATCH 4/7] power: supply: all: " Sebastian Reichel
@ 2025-02-25 2:40 ` Chen-Yu Tsai
2025-02-25 3:39 ` Baolin Wang
2025-02-25 10:47 ` AngeloGioacchino Del Regno
2 siblings, 0 replies; 32+ messages in thread
From: Chen-Yu Tsai @ 2025-02-25 2:40 UTC (permalink / raw)
To: Sebastian Reichel
Cc: Sebastian Reichel, Mark Brown, Greg Kroah-Hartman, Linus Walleij,
Hans de Goede, Liam Girdwood, Matti Vaittinen, Pali Rohár,
Paul Cercueil, Samuel Holland, David Lechner, Krzysztof Kozlowski,
Marek Szyprowski, Sebastian Krzyszkowiak, Purism Kernel Team,
Bartosz Golaszewski, Konrad Dybcio, Matthias Brugger,
AngeloGioacchino Del Regno, Orson Zhai, Baolin Wang,
Chunyan Zhang, linux-pm, linux-kernel, linux-usb
On Tue, Feb 25, 2025 at 7:22 AM Sebastian Reichel
<sebastian.reichel@collabora.com> wrote:
>
> When registering a power-supply device, either a of_node or the more
> recent fwnode can be supplied. Since fwnode can also contain an of_node,
> let's try to get rid of it.
>
> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
> ---
> drivers/power/supply/axp20x_ac_power.c | 2 +-
> drivers/power/supply/axp20x_battery.c | 2 +-
> drivers/power/supply/axp20x_usb_power.c | 2 +-
For AXP stuff,
Acked-by: Chen-Yu Tsai <wens@csie.org>
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [PATCH 3/7] usb: common: usb-conn-gpio: switch psy_cfg from of_node to fwnode
2025-02-24 23:21 ` [PATCH 3/7] usb: common: usb-conn-gpio: " Sebastian Reichel
@ 2025-02-25 3:32 ` Greg Kroah-Hartman
2025-03-08 1:10 ` Sebastian Reichel
2025-02-25 10:50 ` AngeloGioacchino Del Regno
1 sibling, 1 reply; 32+ messages in thread
From: Greg Kroah-Hartman @ 2025-02-25 3:32 UTC (permalink / raw)
To: Sebastian Reichel
Cc: Sebastian Reichel, Mark Brown, Linus Walleij, Hans de Goede,
Liam Girdwood, Chen-Yu Tsai, Matti Vaittinen, Pali Rohár,
Paul Cercueil, Samuel Holland, David Lechner, Krzysztof Kozlowski,
Marek Szyprowski, Sebastian Krzyszkowiak, Purism Kernel Team,
Bartosz Golaszewski, Konrad Dybcio, Matthias Brugger,
AngeloGioacchino Del Regno, Orson Zhai, Baolin Wang,
Chunyan Zhang, linux-pm, linux-kernel, linux-usb
On Tue, Feb 25, 2025 at 12:21:36AM +0100, Sebastian Reichel wrote:
> In order to remove .of_node from the power_supply_config struct,
> use .fwnode instead.
>
> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
> ---
> drivers/usb/common/usb-conn-gpio.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/usb/common/usb-conn-gpio.c b/drivers/usb/common/usb-conn-gpio.c
> index aa710b50791b0282be0a6a26cffdd981b794acaa..1e36be2a28fd5ca5e1495b7923e4d3e25d7cedef 100644
> --- a/drivers/usb/common/usb-conn-gpio.c
> +++ b/drivers/usb/common/usb-conn-gpio.c
> @@ -158,7 +158,7 @@ static int usb_conn_psy_register(struct usb_conn_info *info)
> struct device *dev = info->dev;
> struct power_supply_desc *desc = &info->desc;
> struct power_supply_config cfg = {
> - .of_node = dev->of_node,
> + .fwnode = dev_fwnode(dev),
> };
>
> desc->name = "usb-charger";
>
> --
> 2.47.2
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [PATCH 4/7] power: supply: all: switch psy_cfg from of_node to fwnode
2025-02-24 23:21 ` [PATCH 4/7] power: supply: all: " Sebastian Reichel
2025-02-25 2:40 ` Chen-Yu Tsai
@ 2025-02-25 3:39 ` Baolin Wang
2025-02-25 10:47 ` AngeloGioacchino Del Regno
2 siblings, 0 replies; 32+ messages in thread
From: Baolin Wang @ 2025-02-25 3:39 UTC (permalink / raw)
To: Sebastian Reichel, Sebastian Reichel, Mark Brown,
Greg Kroah-Hartman, Linus Walleij, Hans de Goede
Cc: Liam Girdwood, Chen-Yu Tsai, Matti Vaittinen, Pali Rohár,
Paul Cercueil, Samuel Holland, David Lechner, Krzysztof Kozlowski,
Marek Szyprowski, Sebastian Krzyszkowiak, Purism Kernel Team,
Bartosz Golaszewski, Konrad Dybcio, Matthias Brugger,
AngeloGioacchino Del Regno, Orson Zhai, Chunyan Zhang, linux-pm,
linux-kernel, linux-usb
On 2025/2/25 07:21, Sebastian Reichel wrote:
> When registering a power-supply device, either a of_node or the more
> recent fwnode can be supplied. Since fwnode can also contain an of_node,
> let's try to get rid of it.
>
> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
> ---
[snip]
> drivers/power/supply/sc2731_charger.c | 2 +-
> drivers/power/supply/sc27xx_fuel_gauge.c | 3 +--
> diff --git a/drivers/power/supply/sc2731_charger.c b/drivers/power/supply/sc2731_charger.c
> index 50d5157af9277dc09fe24852747f4f62e72bc712..58b86fd78771360f74ffdad152c3905e1bee7c1b 100644
> --- a/drivers/power/supply/sc2731_charger.c
> +++ b/drivers/power/supply/sc2731_charger.c
> @@ -480,7 +480,7 @@ static int sc2731_charger_probe(struct platform_device *pdev)
> }
>
> charger_cfg.drv_data = info;
> - charger_cfg.of_node = np;
> + charger_cfg.fwnode = dev_fwnode(&pdev->dev);
> info->psy_usb = devm_power_supply_register(&pdev->dev,
> &sc2731_charger_desc,
> &charger_cfg);
> diff --git a/drivers/power/supply/sc27xx_fuel_gauge.c b/drivers/power/supply/sc27xx_fuel_gauge.c
> index f36edc2ba708748d0ceb61298056f8c905aca012..196d96cd986266738785d8582e907858faaf2ba3 100644
> --- a/drivers/power/supply/sc27xx_fuel_gauge.c
> +++ b/drivers/power/supply/sc27xx_fuel_gauge.c
> @@ -1141,7 +1141,6 @@ static int sc27xx_fgu_hw_init(struct sc27xx_fgu_data *data)
> static int sc27xx_fgu_probe(struct platform_device *pdev)
> {
> struct device *dev = &pdev->dev;
> - struct device_node *np = dev->of_node;
> struct power_supply_config fgu_cfg = { };
> struct sc27xx_fgu_data *data;
> int ret, irq;
> @@ -1205,7 +1204,7 @@ static int sc27xx_fgu_probe(struct platform_device *pdev)
> platform_set_drvdata(pdev, data);
>
> fgu_cfg.drv_data = data;
> - fgu_cfg.of_node = np;
> + fgu_cfg.fwnode = dev_fwnode(dev);
> data->battery = devm_power_supply_register(dev, &sc27xx_fgu_desc,
> &fgu_cfg);
> if (IS_ERR(data->battery)) {
For sc27xx parts:
Acked-by: Baolin Wang <baolin.wang@linux.alibaba.com>
Thanks.
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [PATCH 4/7] power: supply: all: switch psy_cfg from of_node to fwnode
2025-02-24 23:21 ` [PATCH 4/7] power: supply: all: " Sebastian Reichel
2025-02-25 2:40 ` Chen-Yu Tsai
2025-02-25 3:39 ` Baolin Wang
@ 2025-02-25 10:47 ` AngeloGioacchino Del Regno
2 siblings, 0 replies; 32+ messages in thread
From: AngeloGioacchino Del Regno @ 2025-02-25 10:47 UTC (permalink / raw)
To: Sebastian Reichel, Sebastian Reichel, Mark Brown,
Greg Kroah-Hartman, Linus Walleij, Hans de Goede
Cc: Liam Girdwood, Chen-Yu Tsai, Matti Vaittinen, Pali Rohár,
Paul Cercueil, Samuel Holland, David Lechner, Krzysztof Kozlowski,
Marek Szyprowski, Sebastian Krzyszkowiak, Purism Kernel Team,
Bartosz Golaszewski, Konrad Dybcio, Matthias Brugger, Orson Zhai,
Baolin Wang, Chunyan Zhang, linux-pm, linux-kernel, linux-usb
Il 25/02/25 00:21, Sebastian Reichel ha scritto:
> When registering a power-supply device, either a of_node or the more
> recent fwnode can be supplied. Since fwnode can also contain an of_node,
> let's try to get rid of it.
>
> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
#MediaTek
> ---
> drivers/power/supply/ab8500_charger.c | 4 ++--
> drivers/power/supply/acer_a500_battery.c | 3 ++-
> drivers/power/supply/act8945a_charger.c | 2 +-
> drivers/power/supply/axp20x_ac_power.c | 2 +-
> drivers/power/supply/axp20x_battery.c | 2 +-
> drivers/power/supply/axp20x_usb_power.c | 2 +-
> drivers/power/supply/bd99954-charger.c | 2 +-
> drivers/power/supply/bq2415x_charger.c | 2 +-
> drivers/power/supply/bq24190_charger.c | 2 +-
> drivers/power/supply/bq24735-charger.c | 2 +-
> drivers/power/supply/bq2515x_charger.c | 2 +-
> drivers/power/supply/bq256xx_charger.c | 2 +-
> drivers/power/supply/bq25980_charger.c | 2 +-
> drivers/power/supply/bq27xxx_battery.c | 2 +-
> drivers/power/supply/cpcap-battery.c | 2 +-
> drivers/power/supply/cpcap-charger.c | 2 +-
> drivers/power/supply/ds2760_battery.c | 3 +--
> drivers/power/supply/generic-adc-battery.c | 2 +-
> drivers/power/supply/gpio-charger.c | 2 +-
> drivers/power/supply/ingenic-battery.c | 2 +-
> drivers/power/supply/ip5xxx_power.c | 2 +-
> drivers/power/supply/lego_ev3_battery.c | 3 ++-
> drivers/power/supply/lt3651-charger.c | 2 +-
> drivers/power/supply/ltc4162-l-charger.c | 2 +-
> drivers/power/supply/max17042_battery.c | 2 +-
> drivers/power/supply/max77650-charger.c | 2 +-
> drivers/power/supply/max8903_charger.c | 2 +-
> drivers/power/supply/mm8013.c | 2 +-
> drivers/power/supply/mt6360_charger.c | 2 +-
> drivers/power/supply/mt6370-charger.c | 2 +-
> drivers/power/supply/olpc_battery.c | 4 ++--
> drivers/power/supply/pm8916_bms_vm.c | 2 +-
> drivers/power/supply/pm8916_lbc.c | 2 +-
> drivers/power/supply/qcom_battmgr.c | 5 +++--
> drivers/power/supply/qcom_pmi8998_charger.c | 2 +-
> drivers/power/supply/qcom_smbb.c | 2 +-
> drivers/power/supply/rk817_charger.c | 2 +-
> drivers/power/supply/rt5033_battery.c | 2 +-
> drivers/power/supply/rt5033_charger.c | 3 ++-
> drivers/power/supply/rt9455_charger.c | 2 +-
> drivers/power/supply/rt9467-charger.c | 2 +-
> drivers/power/supply/rt9471.c | 2 +-
> drivers/power/supply/sbs-battery.c | 2 +-
> drivers/power/supply/sbs-charger.c | 2 +-
> drivers/power/supply/sbs-manager.c | 2 +-
> drivers/power/supply/sc2731_charger.c | 2 +-
> drivers/power/supply/sc27xx_fuel_gauge.c | 3 +--
> drivers/power/supply/smb347-charger.c | 2 +-
> drivers/power/supply/tps65090-charger.c | 2 +-
> drivers/power/supply/tps65217_charger.c | 2 +-
> drivers/power/supply/ucs1002_power.c | 2 +-
> 51 files changed, 58 insertions(+), 56 deletions(-)
>
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [PATCH 1/7] power: supply: core: get rid of of_node
2025-02-24 23:21 ` [PATCH 1/7] power: supply: core: get rid of of_node Sebastian Reichel
@ 2025-02-25 10:47 ` AngeloGioacchino Del Regno
2025-02-25 11:14 ` Matti Vaittinen
1 sibling, 0 replies; 32+ messages in thread
From: AngeloGioacchino Del Regno @ 2025-02-25 10:47 UTC (permalink / raw)
To: Sebastian Reichel, Sebastian Reichel, Mark Brown,
Greg Kroah-Hartman, Linus Walleij, Hans de Goede
Cc: Liam Girdwood, Chen-Yu Tsai, Matti Vaittinen, Pali Rohár,
Paul Cercueil, Samuel Holland, David Lechner, Krzysztof Kozlowski,
Marek Szyprowski, Sebastian Krzyszkowiak, Purism Kernel Team,
Bartosz Golaszewski, Konrad Dybcio, Matthias Brugger, Orson Zhai,
Baolin Wang, Chunyan Zhang, linux-pm, linux-kernel, linux-usb
Il 25/02/25 00:21, Sebastian Reichel ha scritto:
> This removes .of_node from 'struct power_supply', since there
> is already a copy in .dev.of_node and there is no need to have
> two copies.
>
> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [PATCH 5/7] power: supply: core: remove of_node from power_supply_config
2025-02-24 23:21 ` [PATCH 5/7] power: supply: core: remove of_node from power_supply_config Sebastian Reichel
@ 2025-02-25 10:49 ` AngeloGioacchino Del Regno
0 siblings, 0 replies; 32+ messages in thread
From: AngeloGioacchino Del Regno @ 2025-02-25 10:49 UTC (permalink / raw)
To: Sebastian Reichel, Sebastian Reichel, Mark Brown,
Greg Kroah-Hartman, Linus Walleij, Hans de Goede
Cc: Liam Girdwood, Chen-Yu Tsai, Matti Vaittinen, Pali Rohár,
Paul Cercueil, Samuel Holland, David Lechner, Krzysztof Kozlowski,
Marek Szyprowski, Sebastian Krzyszkowiak, Purism Kernel Team,
Bartosz Golaszewski, Konrad Dybcio, Matthias Brugger, Orson Zhai,
Baolin Wang, Chunyan Zhang, linux-pm, linux-kernel, linux-usb
Il 25/02/25 00:21, Sebastian Reichel ha scritto:
> All drivers have been migrated from .of_node to .fwnode,
> so let's kill the former.
>
> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [PATCH 7/7] power: supply: core: convert to fwnnode
2025-02-24 23:21 ` [PATCH 7/7] power: supply: core: convert to fwnnode Sebastian Reichel
@ 2025-02-25 10:49 ` AngeloGioacchino Del Regno
2025-02-25 13:16 ` Hans de Goede
1 sibling, 0 replies; 32+ messages in thread
From: AngeloGioacchino Del Regno @ 2025-02-25 10:49 UTC (permalink / raw)
To: Sebastian Reichel, Sebastian Reichel, Mark Brown,
Greg Kroah-Hartman, Linus Walleij, Hans de Goede
Cc: Liam Girdwood, Chen-Yu Tsai, Matti Vaittinen, Pali Rohár,
Paul Cercueil, Samuel Holland, David Lechner, Krzysztof Kozlowski,
Marek Szyprowski, Sebastian Krzyszkowiak, Purism Kernel Team,
Bartosz Golaszewski, Konrad Dybcio, Matthias Brugger, Orson Zhai,
Baolin Wang, Chunyan Zhang, linux-pm, linux-kernel, linux-usb
Il 25/02/25 00:21, Sebastian Reichel ha scritto:
> Replace any DT specific code with fwnode in the power-supply
> core.
>
> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [PATCH 6/7] power: supply: core: battery-info: fully switch to fwnode
2025-02-24 23:21 ` [PATCH 6/7] power: supply: core: battery-info: fully switch to fwnode Sebastian Reichel
@ 2025-02-25 10:49 ` AngeloGioacchino Del Regno
0 siblings, 0 replies; 32+ messages in thread
From: AngeloGioacchino Del Regno @ 2025-02-25 10:49 UTC (permalink / raw)
To: Sebastian Reichel, Sebastian Reichel, Mark Brown,
Greg Kroah-Hartman, Linus Walleij, Hans de Goede
Cc: Liam Girdwood, Chen-Yu Tsai, Matti Vaittinen, Pali Rohár,
Paul Cercueil, Samuel Holland, David Lechner, Krzysztof Kozlowski,
Marek Szyprowski, Sebastian Krzyszkowiak, Purism Kernel Team,
Bartosz Golaszewski, Konrad Dybcio, Matthias Brugger, Orson Zhai,
Baolin Wang, Chunyan Zhang, linux-pm, linux-kernel, linux-usb
Il 25/02/25 00:21, Sebastian Reichel ha scritto:
> Also use fwnode based parsing for "ocv-capacity-celsius" and
> "resistance-temp-table", so that any DT specific bits are
> removed from the power-supply core.
>
> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [PATCH 3/7] usb: common: usb-conn-gpio: switch psy_cfg from of_node to fwnode
2025-02-24 23:21 ` [PATCH 3/7] usb: common: usb-conn-gpio: " Sebastian Reichel
2025-02-25 3:32 ` Greg Kroah-Hartman
@ 2025-02-25 10:50 ` AngeloGioacchino Del Regno
1 sibling, 0 replies; 32+ messages in thread
From: AngeloGioacchino Del Regno @ 2025-02-25 10:50 UTC (permalink / raw)
To: Sebastian Reichel, Sebastian Reichel, Mark Brown,
Greg Kroah-Hartman, Linus Walleij, Hans de Goede
Cc: Liam Girdwood, Chen-Yu Tsai, Matti Vaittinen, Pali Rohár,
Paul Cercueil, Samuel Holland, David Lechner, Krzysztof Kozlowski,
Marek Szyprowski, Sebastian Krzyszkowiak, Purism Kernel Team,
Bartosz Golaszewski, Konrad Dybcio, Matthias Brugger, Orson Zhai,
Baolin Wang, Chunyan Zhang, linux-pm, linux-kernel, linux-usb
Il 25/02/25 00:21, Sebastian Reichel ha scritto:
> In order to remove .of_node from the power_supply_config struct,
> use .fwnode instead.
>
> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [PATCH 1/7] power: supply: core: get rid of of_node
2025-02-24 23:21 ` [PATCH 1/7] power: supply: core: get rid of of_node Sebastian Reichel
2025-02-25 10:47 ` AngeloGioacchino Del Regno
@ 2025-02-25 11:14 ` Matti Vaittinen
2025-02-25 13:11 ` Sebastian Reichel
1 sibling, 1 reply; 32+ messages in thread
From: Matti Vaittinen @ 2025-02-25 11:14 UTC (permalink / raw)
To: Sebastian Reichel, Sebastian Reichel, Mark Brown,
Greg Kroah-Hartman, Linus Walleij, Hans de Goede
Cc: Liam Girdwood, Chen-Yu Tsai, Pali Rohár, Paul Cercueil,
Samuel Holland, David Lechner, Krzysztof Kozlowski,
Marek Szyprowski, Sebastian Krzyszkowiak, Purism Kernel Team,
Bartosz Golaszewski, Konrad Dybcio, Matthias Brugger,
AngeloGioacchino Del Regno, Orson Zhai, Baolin Wang,
Chunyan Zhang, linux-pm, linux-kernel, linux-usb
On 25/02/2025 01:21, Sebastian Reichel wrote:
> This removes .of_node from 'struct power_supply', since there
> is already a copy in .dev.of_node and there is no need to have
> two copies.
>
> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
> ---
> drivers/power/supply/power_supply_core.c | 17 ++++++++---------
> include/linux/power_supply.h | 1 -
> 2 files changed, 8 insertions(+), 10 deletions(-)
>
> diff --git a/drivers/power/supply/power_supply_core.c b/drivers/power/supply/power_supply_core.c
> index d0bb52a7a0367a8e07787be211691cad14a41a54..11030035da6f121ca76bebf800c06cfd5db57578 100644
> --- a/drivers/power/supply/power_supply_core.c
> +++ b/drivers/power/supply/power_supply_core.c
> @@ -200,11 +200,11 @@ static int __power_supply_populate_supplied_from(struct power_supply *epsy,
> int i = 0;
>
> do {
> - np = of_parse_phandle(psy->of_node, "power-supplies", i++);
> + np = of_parse_phandle(psy->dev.of_node, "power-supplies", i++);
> if (!np)
> break;
>
> - if (np == epsy->of_node) {
> + if (np == epsy->dev.of_node) {
> dev_dbg(&psy->dev, "%s: Found supply : %s\n",
> psy->desc->name, epsy->desc->name);
> psy->supplied_from[i-1] = (char *)epsy->desc->name;
> @@ -235,7 +235,7 @@ static int __power_supply_find_supply_from_node(struct power_supply *epsy,
> struct device_node *np = data;
>
> /* returning non-zero breaks out of power_supply_for_each_psy loop */
> - if (epsy->of_node == np)
> + if (epsy->dev.of_node == np)
> return 1;
>
> return 0;
> @@ -270,13 +270,13 @@ static int power_supply_check_supplies(struct power_supply *psy)
> return 0;
>
> /* No device node found, nothing to do */
> - if (!psy->of_node)
> + if (!psy->dev.of_node)
> return 0;
>
> do {
> int ret;
>
> - np = of_parse_phandle(psy->of_node, "power-supplies", cnt++);
> + np = of_parse_phandle(psy->dev.of_node, "power-supplies", cnt++);
> if (!np)
> break;
>
> @@ -606,8 +606,8 @@ int power_supply_get_battery_info(struct power_supply *psy,
> const __be32 *list;
> u32 min_max[2];
>
> - if (psy->of_node) {
> - battery_np = of_parse_phandle(psy->of_node, "monitored-battery", 0);
> + if (psy->dev.of_node) {
> + battery_np = of_parse_phandle(psy->dev.of_node, "monitored-battery", 0);
> if (!battery_np)
> return -ENODEV;
This reminded me of a change I once did to power_supply - but maybe
never got it further than RFC stage. Anyways, do you think it would be
possible to decouple the battery info and struct power_suppply (while at
it)?
I believe that the chargers and especially fuel-gauges which are
designed to operate with different batteries (and which get battery
details using static battery nodes), would like to get the battery info
_before_ registering the power_supply (to avoid sending bogus values
while operating on defaults, before the battery info is read and before
things are set accordingly).
I know this may be a bit much to ask, but I believe it'd be an improvement.
Other than that, looks good to me.
>
> @@ -1544,9 +1544,8 @@ __power_supply_register(struct device *parent,
> if (cfg) {
> dev->groups = cfg->attr_grp;
> psy->drv_data = cfg->drv_data;
> - psy->of_node =
> + dev->of_node =
> cfg->fwnode ? to_of_node(cfg->fwnode) : cfg->of_node;
> - dev->of_node = psy->of_node;
> psy->supplied_to = cfg->supplied_to;
> psy->num_supplicants = cfg->num_supplicants;
> }
> diff --git a/include/linux/power_supply.h b/include/linux/power_supply.h
> index 6ed53b292162469d7b357734d5589bff18a201d0..975ccab56597ef579ef0c9dc913dcb0a26b5855a 100644
> --- a/include/linux/power_supply.h
> +++ b/include/linux/power_supply.h
> @@ -316,7 +316,6 @@ struct power_supply {
>
> char **supplied_from;
> size_t num_supplies;
> - struct device_node *of_node;
>
> /* Driver private data */
> void *drv_data;
>
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [PATCH 1/7] power: supply: core: get rid of of_node
2025-02-25 11:14 ` Matti Vaittinen
@ 2025-02-25 13:11 ` Sebastian Reichel
2025-02-25 13:25 ` Matti Vaittinen
0 siblings, 1 reply; 32+ messages in thread
From: Sebastian Reichel @ 2025-02-25 13:11 UTC (permalink / raw)
To: Matti Vaittinen
Cc: Mark Brown, Greg Kroah-Hartman, Linus Walleij, Hans de Goede,
Liam Girdwood, Chen-Yu Tsai, Pali Rohár, Paul Cercueil,
Samuel Holland, David Lechner, Krzysztof Kozlowski,
Marek Szyprowski, Sebastian Krzyszkowiak, Purism Kernel Team,
Bartosz Golaszewski, Konrad Dybcio, Matthias Brugger,
AngeloGioacchino Del Regno, Orson Zhai, Baolin Wang,
Chunyan Zhang, linux-pm, linux-kernel, linux-usb
[-- Attachment #1: Type: text/plain, Size: 3683 bytes --]
Hi,
On Tue, Feb 25, 2025 at 01:14:03PM +0200, Matti Vaittinen wrote:
> On 25/02/2025 01:21, Sebastian Reichel wrote:
> > This removes .of_node from 'struct power_supply', since there
> > is already a copy in .dev.of_node and there is no need to have
> > two copies.
> >
> > Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
> > ---
> > drivers/power/supply/power_supply_core.c | 17 ++++++++---------
> > include/linux/power_supply.h | 1 -
> > 2 files changed, 8 insertions(+), 10 deletions(-)
> >
> > diff --git a/drivers/power/supply/power_supply_core.c b/drivers/power/supply/power_supply_core.c
> > index d0bb52a7a0367a8e07787be211691cad14a41a54..11030035da6f121ca76bebf800c06cfd5db57578 100644
> > --- a/drivers/power/supply/power_supply_core.c
> > +++ b/drivers/power/supply/power_supply_core.c
> > @@ -200,11 +200,11 @@ static int __power_supply_populate_supplied_from(struct power_supply *epsy,
> > int i = 0;
> > do {
> > - np = of_parse_phandle(psy->of_node, "power-supplies", i++);
> > + np = of_parse_phandle(psy->dev.of_node, "power-supplies", i++);
> > if (!np)
> > break;
> > - if (np == epsy->of_node) {
> > + if (np == epsy->dev.of_node) {
> > dev_dbg(&psy->dev, "%s: Found supply : %s\n",
> > psy->desc->name, epsy->desc->name);
> > psy->supplied_from[i-1] = (char *)epsy->desc->name;
> > @@ -235,7 +235,7 @@ static int __power_supply_find_supply_from_node(struct power_supply *epsy,
> > struct device_node *np = data;
> > /* returning non-zero breaks out of power_supply_for_each_psy loop */
> > - if (epsy->of_node == np)
> > + if (epsy->dev.of_node == np)
> > return 1;
> > return 0;
> > @@ -270,13 +270,13 @@ static int power_supply_check_supplies(struct power_supply *psy)
> > return 0;
> > /* No device node found, nothing to do */
> > - if (!psy->of_node)
> > + if (!psy->dev.of_node)
> > return 0;
> > do {
> > int ret;
> > - np = of_parse_phandle(psy->of_node, "power-supplies", cnt++);
> > + np = of_parse_phandle(psy->dev.of_node, "power-supplies", cnt++);
> > if (!np)
> > break;
> > @@ -606,8 +606,8 @@ int power_supply_get_battery_info(struct power_supply *psy,
> > const __be32 *list;
> > u32 min_max[2];
> > - if (psy->of_node) {
> > - battery_np = of_parse_phandle(psy->of_node, "monitored-battery", 0);
> > + if (psy->dev.of_node) {
> > + battery_np = of_parse_phandle(psy->dev.of_node, "monitored-battery", 0);
> > if (!battery_np)
> > return -ENODEV;
>
> This reminded me of a change I once did to power_supply - but maybe never
> got it further than RFC stage. Anyways, do you think it would be possible to
> decouple the battery info and struct power_suppply (while at it)?
>
> I believe that the chargers and especially fuel-gauges which are designed to
> operate with different batteries (and which get battery details using static
> battery nodes), would like to get the battery info _before_ registering the
> power_supply (to avoid sending bogus values while operating on defaults,
> before the battery info is read and before things are set accordingly).
>
> I know this may be a bit much to ask, but I believe it'd be an improvement.
>
> Other than that, looks good to me.
I was thinking about adding an init function to power_supply_desc,
which would be called directly before psy->initialized is set to
true in the power-supply registration phase. I think that would be
the right place to setup device registers based on battery-info data.
But it's definitely not a thing for this series.
Greetings,
-- Sebastian
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [PATCH 7/7] power: supply: core: convert to fwnnode
2025-02-24 23:21 ` [PATCH 7/7] power: supply: core: convert to fwnnode Sebastian Reichel
2025-02-25 10:49 ` AngeloGioacchino Del Regno
@ 2025-02-25 13:16 ` Hans de Goede
2025-02-25 21:22 ` Sebastian Reichel
1 sibling, 1 reply; 32+ messages in thread
From: Hans de Goede @ 2025-02-25 13:16 UTC (permalink / raw)
To: Sebastian Reichel, Sebastian Reichel, Mark Brown,
Greg Kroah-Hartman, Linus Walleij
Cc: Liam Girdwood, Chen-Yu Tsai, Matti Vaittinen, Pali Rohár,
Paul Cercueil, Samuel Holland, David Lechner, Krzysztof Kozlowski,
Marek Szyprowski, Sebastian Krzyszkowiak, Purism Kernel Team,
Bartosz Golaszewski, Konrad Dybcio, Matthias Brugger,
AngeloGioacchino Del Regno, Orson Zhai, Baolin Wang,
Chunyan Zhang, linux-pm, linux-kernel, linux-usb
Hi Sebastian,
Thank you for your work on this.
A few small remarks inline / below.
On 25-Feb-25 12:21 AM, Sebastian Reichel wrote:
<snip>
> diff --git a/include/linux/power_supply.h b/include/linux/power_supply.h
> index a785742f97721e7e70d0e4c17a1ded7b985acb6d..9afde8c04efc72691c81a373d8dd03477b4efd7e 100644
> --- a/include/linux/power_supply.h
> +++ b/include/linux/power_supply.h
> @@ -805,7 +805,7 @@ static inline struct power_supply *power_supply_get_by_name(const char *name)
> { return NULL; }
> #endif
> #ifdef CONFIG_OF
> -extern struct power_supply *power_supply_get_by_phandle(struct device_node *np,
> +extern struct power_supply *power_supply_get_by_phandle(struct fwnode_handle *fwnode,
> const char *property);
this function now no longer is DT/OF/open-firmware specific, so I think it should be moved
outside of the #ifdef CONFIG_OF block now ? The same goes for the devm variant I think
and the implementations of course also should no longer be "#ifdef CONFIG_OF" .
> extern struct power_supply *devm_power_supply_get_by_phandle(
> struct device *dev, const char *property);
Regards,
Hans
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [PATCH 1/7] power: supply: core: get rid of of_node
2025-02-25 13:11 ` Sebastian Reichel
@ 2025-02-25 13:25 ` Matti Vaittinen
0 siblings, 0 replies; 32+ messages in thread
From: Matti Vaittinen @ 2025-02-25 13:25 UTC (permalink / raw)
To: Sebastian Reichel
Cc: Mark Brown, Greg Kroah-Hartman, Linus Walleij, Hans de Goede,
Liam Girdwood, Chen-Yu Tsai, Pali Rohár, Paul Cercueil,
Samuel Holland, David Lechner, Krzysztof Kozlowski,
Marek Szyprowski, Sebastian Krzyszkowiak, Purism Kernel Team,
Bartosz Golaszewski, Konrad Dybcio, Matthias Brugger,
AngeloGioacchino Del Regno, Orson Zhai, Baolin Wang,
Chunyan Zhang, linux-pm, linux-kernel, linux-usb
On 25/02/2025 15:11, Sebastian Reichel wrote:
> Hi,
>
> On Tue, Feb 25, 2025 at 01:14:03PM +0200, Matti Vaittinen wrote:
>> On 25/02/2025 01:21, Sebastian Reichel wrote:
>>> This removes .of_node from 'struct power_supply', since there
>>> is already a copy in .dev.of_node and there is no need to have
>>> two copies.
>>>
>>> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
>>> ---
>>> drivers/power/supply/power_supply_core.c | 17 ++++++++---------
>>> include/linux/power_supply.h | 1 -
>>> 2 files changed, 8 insertions(+), 10 deletions(-)
>>>
>>> diff --git a/drivers/power/supply/power_supply_core.c b/drivers/power/supply/power_supply_core.c
>>> index d0bb52a7a0367a8e07787be211691cad14a41a54..11030035da6f121ca76bebf800c06cfd5db57578 100644
>>> --- a/drivers/power/supply/power_supply_core.c
>>> +++ b/drivers/power/supply/power_supply_core.c
>>> @@ -200,11 +200,11 @@ static int __power_supply_populate_supplied_from(struct power_supply *epsy,
>>> int i = 0;
>>> do {
>>> - np = of_parse_phandle(psy->of_node, "power-supplies", i++);
>>> + np = of_parse_phandle(psy->dev.of_node, "power-supplies", i++);
>>> if (!np)
>>> break;
>>> - if (np == epsy->of_node) {
>>> + if (np == epsy->dev.of_node) {
>>> dev_dbg(&psy->dev, "%s: Found supply : %s\n",
>>> psy->desc->name, epsy->desc->name);
>>> psy->supplied_from[i-1] = (char *)epsy->desc->name;
>>> @@ -235,7 +235,7 @@ static int __power_supply_find_supply_from_node(struct power_supply *epsy,
>>> struct device_node *np = data;
>>> /* returning non-zero breaks out of power_supply_for_each_psy loop */
>>> - if (epsy->of_node == np)
>>> + if (epsy->dev.of_node == np)
>>> return 1;
>>> return 0;
>>> @@ -270,13 +270,13 @@ static int power_supply_check_supplies(struct power_supply *psy)
>>> return 0;
>>> /* No device node found, nothing to do */
>>> - if (!psy->of_node)
>>> + if (!psy->dev.of_node)
>>> return 0;
>>> do {
>>> int ret;
>>> - np = of_parse_phandle(psy->of_node, "power-supplies", cnt++);
>>> + np = of_parse_phandle(psy->dev.of_node, "power-supplies", cnt++);
>>> if (!np)
>>> break;
>>> @@ -606,8 +606,8 @@ int power_supply_get_battery_info(struct power_supply *psy,
>>> const __be32 *list;
>>> u32 min_max[2];
>>> - if (psy->of_node) {
>>> - battery_np = of_parse_phandle(psy->of_node, "monitored-battery", 0);
>>> + if (psy->dev.of_node) {
>>> + battery_np = of_parse_phandle(psy->dev.of_node, "monitored-battery", 0);
>>> if (!battery_np)
>>> return -ENODEV;
>>
>> This reminded me of a change I once did to power_supply - but maybe never
>> got it further than RFC stage. Anyways, do you think it would be possible to
>> decouple the battery info and struct power_suppply (while at it)?
>>
>> I believe that the chargers and especially fuel-gauges which are designed to
>> operate with different batteries (and which get battery details using static
>> battery nodes), would like to get the battery info _before_ registering the
>> power_supply (to avoid sending bogus values while operating on defaults,
>> before the battery info is read and before things are set accordingly).
>>
>> I know this may be a bit much to ask, but I believe it'd be an improvement.
>>
>> Other than that, looks good to me.
>
> I was thinking about adding an init function to power_supply_desc,
> which would be called directly before psy->initialized is set to
> true in the power-supply registration phase. I think that would be
> the right place to setup device registers based on battery-info data.
Hm. I suppose that would work.
> But it's definitely not a thing for this series.
Fair enough. I thought that might be the case but decided to ask
anyways, because, AFAIR there were no real problems what comes to not
requiring the struct power_supply for reading the battery_info. But yes,
I can see why killing the of_nodes is a big enough series, even without
added complexity :)
Yours,
-- Matti
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [PATCH 7/7] power: supply: core: convert to fwnnode
2025-02-25 13:16 ` Hans de Goede
@ 2025-02-25 21:22 ` Sebastian Reichel
0 siblings, 0 replies; 32+ messages in thread
From: Sebastian Reichel @ 2025-02-25 21:22 UTC (permalink / raw)
To: Hans de Goede
Cc: Mark Brown, Greg Kroah-Hartman, Linus Walleij, Liam Girdwood,
Chen-Yu Tsai, Matti Vaittinen, Pali Rohár, Paul Cercueil,
Samuel Holland, David Lechner, Krzysztof Kozlowski,
Marek Szyprowski, Sebastian Krzyszkowiak, Purism Kernel Team,
Bartosz Golaszewski, Konrad Dybcio, Matthias Brugger,
AngeloGioacchino Del Regno, Orson Zhai, Baolin Wang,
Chunyan Zhang, linux-pm, linux-kernel, linux-usb
[-- Attachment #1: Type: text/plain, Size: 1518 bytes --]
Hello Hans,
On Tue, Feb 25, 2025 at 02:16:12PM +0100, Hans de Goede wrote:
> Hi Sebastian,
>
> Thank you for your work on this.
>
> A few small remarks inline / below.
>
> On 25-Feb-25 12:21 AM, Sebastian Reichel wrote:
>
> <snip>
>
> > diff --git a/include/linux/power_supply.h b/include/linux/power_supply.h
> > index a785742f97721e7e70d0e4c17a1ded7b985acb6d..9afde8c04efc72691c81a373d8dd03477b4efd7e 100644
> > --- a/include/linux/power_supply.h
> > +++ b/include/linux/power_supply.h
> > @@ -805,7 +805,7 @@ static inline struct power_supply *power_supply_get_by_name(const char *name)
> > { return NULL; }
> > #endif
> > #ifdef CONFIG_OF
> > -extern struct power_supply *power_supply_get_by_phandle(struct device_node *np,
> > +extern struct power_supply *power_supply_get_by_phandle(struct fwnode_handle *fwnode,
> > const char *property);
>
> this function now no longer is DT/OF/open-firmware specific, so I think it should be moved
> outside of the #ifdef CONFIG_OF block now ? The same goes for the devm variant I think
> and the implementations of course also should no longer be "#ifdef CONFIG_OF".
Good point. I suppose ideally the name should also change to power_supply_get_by_reference,
since phandle is a DT/OF term. I will prepare these two changes for v2.
Greetings,
-- Sebastian
> > extern struct power_supply *devm_power_supply_get_by_phandle(
> > struct device *dev, const char *property);
>
> Regards,
>
> Hans
>
>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: (subset) [PATCH 0/7] power: supply: core: convert to fwnode
2025-02-24 23:21 [PATCH 0/7] power: supply: core: convert to fwnode Sebastian Reichel
` (6 preceding siblings ...)
2025-02-24 23:21 ` [PATCH 7/7] power: supply: core: convert to fwnnode Sebastian Reichel
@ 2025-03-08 0:45 ` Sebastian Reichel
7 siblings, 0 replies; 32+ messages in thread
From: Sebastian Reichel @ 2025-03-08 0:45 UTC (permalink / raw)
To: Sebastian Reichel, Mark Brown, Greg Kroah-Hartman, Linus Walleij,
Hans de Goede, Sebastian Reichel
Cc: Liam Girdwood, Chen-Yu Tsai, Matti Vaittinen, Pali Rohár,
Paul Cercueil, Samuel Holland, David Lechner, Krzysztof Kozlowski,
Marek Szyprowski, Sebastian Krzyszkowiak, Purism Kernel Team,
Bartosz Golaszewski, Konrad Dybcio, Matthias Brugger,
AngeloGioacchino Del Regno, Orson Zhai, Baolin Wang,
Chunyan Zhang, linux-pm, linux-kernel, linux-usb
On Tue, 25 Feb 2025 00:21:33 +0100, Sebastian Reichel wrote:
> The goal of this series is to replace any OF specific code in the
> power-supply core with more generic fwnode code.
>
> The first 5 patches of this series mostly take care of removing .of_node
> from power_supply_config in favor of using the existing .fwnode.
>
> Patch 6 replaces the OF specific logic in battery-info. This will
> hopefully also allow Hans de Goede reusing the code with his Intel
> Dollar Cove TI CC battery driver series.
>
> [...]
Applied, thanks!
[1/7] power: supply: core: get rid of of_node
commit: 134254038739a6c6ecb7548a2f895d89a0dc9d2a
[4/7] power: supply: all: switch psy_cfg from of_node to fwnode
commit: 46d0c03c55033693811d5e4ae36a7eade1ebc82c
Best regards,
--
Sebastian Reichel <sebastian.reichel@collabora.com>
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [PATCH 3/7] usb: common: usb-conn-gpio: switch psy_cfg from of_node to fwnode
2025-02-25 3:32 ` Greg Kroah-Hartman
@ 2025-03-08 1:10 ` Sebastian Reichel
2025-03-08 5:57 ` Greg Kroah-Hartman
0 siblings, 1 reply; 32+ messages in thread
From: Sebastian Reichel @ 2025-03-08 1:10 UTC (permalink / raw)
To: Greg Kroah-Hartman
Cc: Mark Brown, Linus Walleij, Hans de Goede, Liam Girdwood,
Chen-Yu Tsai, Matti Vaittinen, Pali Rohár, Paul Cercueil,
Samuel Holland, David Lechner, Krzysztof Kozlowski,
Marek Szyprowski, Sebastian Krzyszkowiak, Purism Kernel Team,
Bartosz Golaszewski, Konrad Dybcio, Matthias Brugger,
AngeloGioacchino Del Regno, Orson Zhai, Baolin Wang,
Chunyan Zhang, linux-pm, linux-kernel, linux-usb
[-- Attachment #1: Type: text/plain, Size: 1543 bytes --]
Hello Greg,
On Tue, Feb 25, 2025 at 04:32:50AM +0100, Greg Kroah-Hartman wrote:
> On Tue, Feb 25, 2025 at 12:21:36AM +0100, Sebastian Reichel wrote:
> > In order to remove .of_node from the power_supply_config struct,
> > use .fwnode instead.
> >
> > Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
> > ---
> > drivers/usb/common/usb-conn-gpio.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/usb/common/usb-conn-gpio.c b/drivers/usb/common/usb-conn-gpio.c
> > index aa710b50791b0282be0a6a26cffdd981b794acaa..1e36be2a28fd5ca5e1495b7923e4d3e25d7cedef 100644
> > --- a/drivers/usb/common/usb-conn-gpio.c
> > +++ b/drivers/usb/common/usb-conn-gpio.c
> > @@ -158,7 +158,7 @@ static int usb_conn_psy_register(struct usb_conn_info *info)
> > struct device *dev = info->dev;
> > struct power_supply_desc *desc = &info->desc;
> > struct power_supply_config cfg = {
> > - .of_node = dev->of_node,
> > + .fwnode = dev_fwnode(dev),
> > };
> >
> > desc->name = "usb-charger";
> >
> > --
> > 2.47.2
>
> Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Please just merge this patch through the USB tree.
There are no dependencies and I will send a new version for the
later patches, but they won't make it to 6.15 as I want enough
time in linux-next for them. This patch is rather simple and
getting it merged now means we avoid immutable branches or
merging through the wrong tree in the 6.16 cycle.
Thanks,
-- Sebastian
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [PATCH 3/7] usb: common: usb-conn-gpio: switch psy_cfg from of_node to fwnode
2025-03-08 1:10 ` Sebastian Reichel
@ 2025-03-08 5:57 ` Greg Kroah-Hartman
2025-03-08 9:34 ` Konrad Dybcio
0 siblings, 1 reply; 32+ messages in thread
From: Greg Kroah-Hartman @ 2025-03-08 5:57 UTC (permalink / raw)
To: Sebastian Reichel
Cc: Mark Brown, Linus Walleij, Hans de Goede, Liam Girdwood,
Chen-Yu Tsai, Matti Vaittinen, Pali Rohár, Paul Cercueil,
Samuel Holland, David Lechner, Krzysztof Kozlowski,
Marek Szyprowski, Sebastian Krzyszkowiak, Purism Kernel Team,
Bartosz Golaszewski, Konrad Dybcio, Matthias Brugger,
AngeloGioacchino Del Regno, Orson Zhai, Baolin Wang,
Chunyan Zhang, linux-pm, linux-kernel, linux-usb
On Sat, Mar 08, 2025 at 02:10:29AM +0100, Sebastian Reichel wrote:
> Hello Greg,
>
> On Tue, Feb 25, 2025 at 04:32:50AM +0100, Greg Kroah-Hartman wrote:
> > On Tue, Feb 25, 2025 at 12:21:36AM +0100, Sebastian Reichel wrote:
> > > In order to remove .of_node from the power_supply_config struct,
> > > use .fwnode instead.
> > >
> > > Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
> > > ---
> > > drivers/usb/common/usb-conn-gpio.c | 2 +-
> > > 1 file changed, 1 insertion(+), 1 deletion(-)
> > >
> > > diff --git a/drivers/usb/common/usb-conn-gpio.c b/drivers/usb/common/usb-conn-gpio.c
> > > index aa710b50791b0282be0a6a26cffdd981b794acaa..1e36be2a28fd5ca5e1495b7923e4d3e25d7cedef 100644
> > > --- a/drivers/usb/common/usb-conn-gpio.c
> > > +++ b/drivers/usb/common/usb-conn-gpio.c
> > > @@ -158,7 +158,7 @@ static int usb_conn_psy_register(struct usb_conn_info *info)
> > > struct device *dev = info->dev;
> > > struct power_supply_desc *desc = &info->desc;
> > > struct power_supply_config cfg = {
> > > - .of_node = dev->of_node,
> > > + .fwnode = dev_fwnode(dev),
> > > };
> > >
> > > desc->name = "usb-charger";
> > >
> > > --
> > > 2.47.2
> >
> > Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
>
> Please just merge this patch through the USB tree.
>
> There are no dependencies and I will send a new version for the
> later patches, but they won't make it to 6.15 as I want enough
> time in linux-next for them. This patch is rather simple and
> getting it merged now means we avoid immutable branches or
> merging through the wrong tree in the 6.16 cycle.
Attempting to merge a single patch out of a series is hard with our
current tools, you know that. Please resend just the single patch if
you want that applied.
thanks,
greg k-h
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [PATCH 3/7] usb: common: usb-conn-gpio: switch psy_cfg from of_node to fwnode
2025-03-08 5:57 ` Greg Kroah-Hartman
@ 2025-03-08 9:34 ` Konrad Dybcio
2025-03-08 16:33 ` Sebastian Reichel
0 siblings, 1 reply; 32+ messages in thread
From: Konrad Dybcio @ 2025-03-08 9:34 UTC (permalink / raw)
To: Greg Kroah-Hartman, Sebastian Reichel
Cc: Mark Brown, Linus Walleij, Hans de Goede, Liam Girdwood,
Chen-Yu Tsai, Matti Vaittinen, Pali Rohár, Paul Cercueil,
Samuel Holland, David Lechner, Krzysztof Kozlowski,
Marek Szyprowski, Sebastian Krzyszkowiak, Purism Kernel Team,
Bartosz Golaszewski, Konrad Dybcio, Matthias Brugger,
AngeloGioacchino Del Regno, Orson Zhai, Baolin Wang,
Chunyan Zhang, linux-pm, linux-kernel, linux-usb
On 8.03.2025 6:57 AM, Greg Kroah-Hartman wrote:
> On Sat, Mar 08, 2025 at 02:10:29AM +0100, Sebastian Reichel wrote:
>> Hello Greg,
>>
>> On Tue, Feb 25, 2025 at 04:32:50AM +0100, Greg Kroah-Hartman wrote:
>>> On Tue, Feb 25, 2025 at 12:21:36AM +0100, Sebastian Reichel wrote:
>>>> In order to remove .of_node from the power_supply_config struct,
>>>> use .fwnode instead.
>>>>
>>>> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
>>>> ---
>>>> drivers/usb/common/usb-conn-gpio.c | 2 +-
>>>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>>>
>>>> diff --git a/drivers/usb/common/usb-conn-gpio.c b/drivers/usb/common/usb-conn-gpio.c
>>>> index aa710b50791b0282be0a6a26cffdd981b794acaa..1e36be2a28fd5ca5e1495b7923e4d3e25d7cedef 100644
>>>> --- a/drivers/usb/common/usb-conn-gpio.c
>>>> +++ b/drivers/usb/common/usb-conn-gpio.c
>>>> @@ -158,7 +158,7 @@ static int usb_conn_psy_register(struct usb_conn_info *info)
>>>> struct device *dev = info->dev;
>>>> struct power_supply_desc *desc = &info->desc;
>>>> struct power_supply_config cfg = {
>>>> - .of_node = dev->of_node,
>>>> + .fwnode = dev_fwnode(dev),
>>>> };
>>>>
>>>> desc->name = "usb-charger";
>>>>
>>>> --
>>>> 2.47.2
>>>
>>> Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
>>
>> Please just merge this patch through the USB tree.
>>
>> There are no dependencies and I will send a new version for the
>> later patches, but they won't make it to 6.15 as I want enough
>> time in linux-next for them. This patch is rather simple and
>> getting it merged now means we avoid immutable branches or
>> merging through the wrong tree in the 6.16 cycle.
>
> Attempting to merge a single patch out of a series is hard with our
> current tools, you know that. Please resend just the single patch if
> you want that applied.
b4 shazam <msgid> -P 3
to apply the third patch (such as this one) in a thread
unless you use some other set of tools..
Konrad
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [PATCH 3/7] usb: common: usb-conn-gpio: switch psy_cfg from of_node to fwnode
2025-03-08 9:34 ` Konrad Dybcio
@ 2025-03-08 16:33 ` Sebastian Reichel
2025-03-08 17:27 ` Greg Kroah-Hartman
0 siblings, 1 reply; 32+ messages in thread
From: Sebastian Reichel @ 2025-03-08 16:33 UTC (permalink / raw)
To: Konrad Dybcio
Cc: Greg Kroah-Hartman, Mark Brown, Linus Walleij, Hans de Goede,
Liam Girdwood, Chen-Yu Tsai, Matti Vaittinen, Pali Rohár,
Paul Cercueil, Samuel Holland, David Lechner, Krzysztof Kozlowski,
Marek Szyprowski, Sebastian Krzyszkowiak, Purism Kernel Team,
Bartosz Golaszewski, Konrad Dybcio, Matthias Brugger,
AngeloGioacchino Del Regno, Orson Zhai, Baolin Wang,
Chunyan Zhang, linux-pm, linux-kernel, linux-usb
[-- Attachment #1: Type: text/plain, Size: 2553 bytes --]
Hi,
On Sat, Mar 08, 2025 at 10:34:45AM +0100, Konrad Dybcio wrote:
> On 8.03.2025 6:57 AM, Greg Kroah-Hartman wrote:
> > On Sat, Mar 08, 2025 at 02:10:29AM +0100, Sebastian Reichel wrote:
> >> On Tue, Feb 25, 2025 at 04:32:50AM +0100, Greg Kroah-Hartman wrote:
> >>> On Tue, Feb 25, 2025 at 12:21:36AM +0100, Sebastian Reichel wrote:
> >>>> In order to remove .of_node from the power_supply_config struct,
> >>>> use .fwnode instead.
> >>>>
> >>>> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
> >>>> ---
> >>>> drivers/usb/common/usb-conn-gpio.c | 2 +-
> >>>> 1 file changed, 1 insertion(+), 1 deletion(-)
> >>>>
> >>>> diff --git a/drivers/usb/common/usb-conn-gpio.c b/drivers/usb/common/usb-conn-gpio.c
> >>>> index aa710b50791b0282be0a6a26cffdd981b794acaa..1e36be2a28fd5ca5e1495b7923e4d3e25d7cedef 100644
> >>>> --- a/drivers/usb/common/usb-conn-gpio.c
> >>>> +++ b/drivers/usb/common/usb-conn-gpio.c
> >>>> @@ -158,7 +158,7 @@ static int usb_conn_psy_register(struct usb_conn_info *info)
> >>>> struct device *dev = info->dev;
> >>>> struct power_supply_desc *desc = &info->desc;
> >>>> struct power_supply_config cfg = {
> >>>> - .of_node = dev->of_node,
> >>>> + .fwnode = dev_fwnode(dev),
> >>>> };
> >>>>
> >>>> desc->name = "usb-charger";
> >>>>
> >>>> --
> >>>> 2.47.2
> >>>
> >>> Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> >>
> >> Please just merge this patch through the USB tree.
> >>
> >> There are no dependencies and I will send a new version for the
> >> later patches, but they won't make it to 6.15 as I want enough
> >> time in linux-next for them. This patch is rather simple and
> >> getting it merged now means we avoid immutable branches or
> >> merging through the wrong tree in the 6.16 cycle.
> >
> > Attempting to merge a single patch out of a series is hard with our
> > current tools, you know that.
Sorry, I did not know your tooling has issues with that. AFAIK most
maintainers are using b4 nowadays, which makes it really easy. Might
be I am biased because I mostly work on ARM stuff where series often
have patches for the driver and the device tree and thus merging
partial patch series is basically the norm.
> > Please resend just the single patch if you want that applied.
>
> b4 shazam <msgid> -P 3
>
> to apply the third patch (such as this one) in a thread
> unless you use some other set of tools..
Exactly.
But I can send this patch separately of course.
Greetings,
-- Sebastian
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [PATCH 3/7] usb: common: usb-conn-gpio: switch psy_cfg from of_node to fwnode
2025-03-08 16:33 ` Sebastian Reichel
@ 2025-03-08 17:27 ` Greg Kroah-Hartman
2025-03-08 18:27 ` Konrad Dybcio
0 siblings, 1 reply; 32+ messages in thread
From: Greg Kroah-Hartman @ 2025-03-08 17:27 UTC (permalink / raw)
To: Sebastian Reichel
Cc: Konrad Dybcio, Mark Brown, Linus Walleij, Hans de Goede,
Liam Girdwood, Chen-Yu Tsai, Matti Vaittinen, Pali Rohár,
Paul Cercueil, Samuel Holland, David Lechner, Krzysztof Kozlowski,
Marek Szyprowski, Sebastian Krzyszkowiak, Purism Kernel Team,
Bartosz Golaszewski, Konrad Dybcio, Matthias Brugger,
AngeloGioacchino Del Regno, Orson Zhai, Baolin Wang,
Chunyan Zhang, linux-pm, linux-kernel, linux-usb
On Sat, Mar 08, 2025 at 05:33:05PM +0100, Sebastian Reichel wrote:
> Hi,
>
> On Sat, Mar 08, 2025 at 10:34:45AM +0100, Konrad Dybcio wrote:
> > On 8.03.2025 6:57 AM, Greg Kroah-Hartman wrote:
> > > On Sat, Mar 08, 2025 at 02:10:29AM +0100, Sebastian Reichel wrote:
> > >> On Tue, Feb 25, 2025 at 04:32:50AM +0100, Greg Kroah-Hartman wrote:
> > >>> On Tue, Feb 25, 2025 at 12:21:36AM +0100, Sebastian Reichel wrote:
> > >>>> In order to remove .of_node from the power_supply_config struct,
> > >>>> use .fwnode instead.
> > >>>>
> > >>>> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
> > >>>> ---
> > >>>> drivers/usb/common/usb-conn-gpio.c | 2 +-
> > >>>> 1 file changed, 1 insertion(+), 1 deletion(-)
> > >>>>
> > >>>> diff --git a/drivers/usb/common/usb-conn-gpio.c b/drivers/usb/common/usb-conn-gpio.c
> > >>>> index aa710b50791b0282be0a6a26cffdd981b794acaa..1e36be2a28fd5ca5e1495b7923e4d3e25d7cedef 100644
> > >>>> --- a/drivers/usb/common/usb-conn-gpio.c
> > >>>> +++ b/drivers/usb/common/usb-conn-gpio.c
> > >>>> @@ -158,7 +158,7 @@ static int usb_conn_psy_register(struct usb_conn_info *info)
> > >>>> struct device *dev = info->dev;
> > >>>> struct power_supply_desc *desc = &info->desc;
> > >>>> struct power_supply_config cfg = {
> > >>>> - .of_node = dev->of_node,
> > >>>> + .fwnode = dev_fwnode(dev),
> > >>>> };
> > >>>>
> > >>>> desc->name = "usb-charger";
> > >>>>
> > >>>> --
> > >>>> 2.47.2
> > >>>
> > >>> Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> > >>
> > >> Please just merge this patch through the USB tree.
> > >>
> > >> There are no dependencies and I will send a new version for the
> > >> later patches, but they won't make it to 6.15 as I want enough
> > >> time in linux-next for them. This patch is rather simple and
> > >> getting it merged now means we avoid immutable branches or
> > >> merging through the wrong tree in the 6.16 cycle.
> > >
> > > Attempting to merge a single patch out of a series is hard with our
> > > current tools, you know that.
>
> Sorry, I did not know your tooling has issues with that. AFAIK most
> maintainers are using b4 nowadays, which makes it really easy. Might
> be I am biased because I mostly work on ARM stuff where series often
> have patches for the driver and the device tree and thus merging
> partial patch series is basically the norm.
I do use b4, but it wants to suck the whole series down. If I want to
pick an individual one out, I have to manually cut the message-id out
of the email and type out the command and pick the individual commit
out (or use the -P 3 as was said).
But that's a world away from me just hitting a single key in my email
client to suck down the whole thread and apply it to my tree.
For those of us who have to apply a lot of patches, automation is key.
When sending a patch series that wants to be split across multiple
trees, that makes it harder for everyone.
Anyway, I can take this as is, I've spent more time typing this than it
would have taken me to dig out just the single email. Give me a few
days to catch up with it...
thanks,
greg k-h
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [PATCH 3/7] usb: common: usb-conn-gpio: switch psy_cfg from of_node to fwnode
2025-03-08 17:27 ` Greg Kroah-Hartman
@ 2025-03-08 18:27 ` Konrad Dybcio
2025-03-21 16:36 ` Konstantin Ryabitsev
0 siblings, 1 reply; 32+ messages in thread
From: Konrad Dybcio @ 2025-03-08 18:27 UTC (permalink / raw)
To: Greg Kroah-Hartman, Sebastian Reichel, Konstantin Ryabitsev
Cc: Mark Brown, Linus Walleij, Hans de Goede, Liam Girdwood,
Chen-Yu Tsai, Matti Vaittinen, Pali Rohár, Paul Cercueil,
Samuel Holland, David Lechner, Krzysztof Kozlowski,
Marek Szyprowski, Sebastian Krzyszkowiak, Purism Kernel Team,
Bartosz Golaszewski, Konrad Dybcio, Matthias Brugger,
AngeloGioacchino Del Regno, Orson Zhai, Baolin Wang,
Chunyan Zhang, linux-pm, linux-kernel, linux-usb
On 8.03.2025 6:27 PM, Greg Kroah-Hartman wrote:
> On Sat, Mar 08, 2025 at 05:33:05PM +0100, Sebastian Reichel wrote:
>> Hi,
>>
>> On Sat, Mar 08, 2025 at 10:34:45AM +0100, Konrad Dybcio wrote:
>>> On 8.03.2025 6:57 AM, Greg Kroah-Hartman wrote:
>>>> On Sat, Mar 08, 2025 at 02:10:29AM +0100, Sebastian Reichel wrote:
>>>>> On Tue, Feb 25, 2025 at 04:32:50AM +0100, Greg Kroah-Hartman wrote:
>>>>>> On Tue, Feb 25, 2025 at 12:21:36AM +0100, Sebastian Reichel wrote:
>>>>>>> In order to remove .of_node from the power_supply_config struct,
>>>>>>> use .fwnode instead.
>>>>>>>
>>>>>>> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
>>>>>>> ---
>>>>>>> drivers/usb/common/usb-conn-gpio.c | 2 +-
>>>>>>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>>>>>>
>>>>>>> diff --git a/drivers/usb/common/usb-conn-gpio.c b/drivers/usb/common/usb-conn-gpio.c
>>>>>>> index aa710b50791b0282be0a6a26cffdd981b794acaa..1e36be2a28fd5ca5e1495b7923e4d3e25d7cedef 100644
>>>>>>> --- a/drivers/usb/common/usb-conn-gpio.c
>>>>>>> +++ b/drivers/usb/common/usb-conn-gpio.c
>>>>>>> @@ -158,7 +158,7 @@ static int usb_conn_psy_register(struct usb_conn_info *info)
>>>>>>> struct device *dev = info->dev;
>>>>>>> struct power_supply_desc *desc = &info->desc;
>>>>>>> struct power_supply_config cfg = {
>>>>>>> - .of_node = dev->of_node,
>>>>>>> + .fwnode = dev_fwnode(dev),
>>>>>>> };
>>>>>>>
>>>>>>> desc->name = "usb-charger";
>>>>>>>
>>>>>>> --
>>>>>>> 2.47.2
>>>>>>
>>>>>> Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
>>>>>
>>>>> Please just merge this patch through the USB tree.
>>>>>
>>>>> There are no dependencies and I will send a new version for the
>>>>> later patches, but they won't make it to 6.15 as I want enough
>>>>> time in linux-next for them. This patch is rather simple and
>>>>> getting it merged now means we avoid immutable branches or
>>>>> merging through the wrong tree in the 6.16 cycle.
>>>>
>>>> Attempting to merge a single patch out of a series is hard with our
>>>> current tools, you know that.
>>
>> Sorry, I did not know your tooling has issues with that. AFAIK most
>> maintainers are using b4 nowadays, which makes it really easy. Might
>> be I am biased because I mostly work on ARM stuff where series often
>> have patches for the driver and the device tree and thus merging
>> partial patch series is basically the norm.
>
> I do use b4, but it wants to suck the whole series down. If I want to
> pick an individual one out, I have to manually cut the message-id out
> of the email and type out the command and pick the individual commit
> out (or use the -P 3 as was said).
>
> But that's a world away from me just hitting a single key in my email
> client to suck down the whole thread and apply it to my tree.
>
> For those of us who have to apply a lot of patches, automation is key.
> When sending a patch series that wants to be split across multiple
> trees, that makes it harder for everyone.
>
> Anyway, I can take this as is, I've spent more time typing this than it
> would have taken me to dig out just the single email. Give me a few
> days to catch up with it...
Maybe +Konstantin has a better idea, but
b4 shazam <msgid> --single-message
works too, provided you use the very msgid of the patch (i.e. not a reply
to it or so) and should be easy to add a keybind for
Konrad
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [PATCH 3/7] usb: common: usb-conn-gpio: switch psy_cfg from of_node to fwnode
2025-03-08 18:27 ` Konrad Dybcio
@ 2025-03-21 16:36 ` Konstantin Ryabitsev
2025-03-22 3:44 ` Greg Kroah-Hartman
2025-04-11 12:45 ` Greg Kroah-Hartman
0 siblings, 2 replies; 32+ messages in thread
From: Konstantin Ryabitsev @ 2025-03-21 16:36 UTC (permalink / raw)
To: Konrad Dybcio
Cc: Greg Kroah-Hartman, Sebastian Reichel, Mark Brown, Linus Walleij,
Hans de Goede, Liam Girdwood, Chen-Yu Tsai, Matti Vaittinen,
Pali Rohár, Paul Cercueil, Samuel Holland, David Lechner,
Krzysztof Kozlowski, Marek Szyprowski, Sebastian Krzyszkowiak,
Purism Kernel Team, Bartosz Golaszewski, Konrad Dybcio,
Matthias Brugger, AngeloGioacchino Del Regno, Orson Zhai,
Baolin Wang, Chunyan Zhang, linux-pm, linux-kernel, linux-usb
On Sat, Mar 08, 2025 at 07:27:28PM +0100, Konrad Dybcio wrote:
> > I do use b4, but it wants to suck the whole series down. If I want to
> > pick an individual one out, I have to manually cut the message-id out
> > of the email and type out the command and pick the individual commit
> > out (or use the -P 3 as was said).
> >
> > But that's a world away from me just hitting a single key in my email
> > client to suck down the whole thread and apply it to my tree.
Would it help to have an "interactive cherry-pick mode" where it grabs the
whole thread but before it applies it to your tree, it lets you pick the
subset of the patches you want? So, instead of passing -P 3,4, you have a file
open in your $EDITOR where you can just delete the patches you don't want?
-K
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [PATCH 3/7] usb: common: usb-conn-gpio: switch psy_cfg from of_node to fwnode
2025-03-21 16:36 ` Konstantin Ryabitsev
@ 2025-03-22 3:44 ` Greg Kroah-Hartman
2025-04-11 12:45 ` Greg Kroah-Hartman
1 sibling, 0 replies; 32+ messages in thread
From: Greg Kroah-Hartman @ 2025-03-22 3:44 UTC (permalink / raw)
To: Konstantin Ryabitsev
Cc: Konrad Dybcio, Sebastian Reichel, Mark Brown, Linus Walleij,
Hans de Goede, Liam Girdwood, Chen-Yu Tsai, Matti Vaittinen,
Pali Rohár, Paul Cercueil, Samuel Holland, David Lechner,
Krzysztof Kozlowski, Marek Szyprowski, Sebastian Krzyszkowiak,
Purism Kernel Team, Bartosz Golaszewski, Konrad Dybcio,
Matthias Brugger, AngeloGioacchino Del Regno, Orson Zhai,
Baolin Wang, Chunyan Zhang, linux-pm, linux-kernel, linux-usb
On Fri, Mar 21, 2025 at 12:36:53PM -0400, Konstantin Ryabitsev wrote:
> On Sat, Mar 08, 2025 at 07:27:28PM +0100, Konrad Dybcio wrote:
> > > I do use b4, but it wants to suck the whole series down. If I want to
> > > pick an individual one out, I have to manually cut the message-id out
> > > of the email and type out the command and pick the individual commit
> > > out (or use the -P 3 as was said).
> > >
> > > But that's a world away from me just hitting a single key in my email
> > > client to suck down the whole thread and apply it to my tree.
>
> Would it help to have an "interactive cherry-pick mode" where it grabs the
> whole thread but before it applies it to your tree, it lets you pick the
> subset of the patches you want? So, instead of passing -P 3,4, you have a file
> open in your $EDITOR where you can just delete the patches you don't want?
Yes it would!
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [PATCH 3/7] usb: common: usb-conn-gpio: switch psy_cfg from of_node to fwnode
2025-03-21 16:36 ` Konstantin Ryabitsev
2025-03-22 3:44 ` Greg Kroah-Hartman
@ 2025-04-11 12:45 ` Greg Kroah-Hartman
1 sibling, 0 replies; 32+ messages in thread
From: Greg Kroah-Hartman @ 2025-04-11 12:45 UTC (permalink / raw)
To: Konstantin Ryabitsev
Cc: Konrad Dybcio, Sebastian Reichel, Mark Brown, Linus Walleij,
Hans de Goede, Liam Girdwood, Chen-Yu Tsai, Matti Vaittinen,
Pali Rohár, Paul Cercueil, Samuel Holland, David Lechner,
Krzysztof Kozlowski, Marek Szyprowski, Sebastian Krzyszkowiak,
Purism Kernel Team, Bartosz Golaszewski, Konrad Dybcio,
Matthias Brugger, AngeloGioacchino Del Regno, Orson Zhai,
Baolin Wang, Chunyan Zhang, linux-pm, linux-kernel, linux-usb
On Fri, Mar 21, 2025 at 12:36:53PM -0400, Konstantin Ryabitsev wrote:
> On Sat, Mar 08, 2025 at 07:27:28PM +0100, Konrad Dybcio wrote:
> > > I do use b4, but it wants to suck the whole series down. If I want to
> > > pick an individual one out, I have to manually cut the message-id out
> > > of the email and type out the command and pick the individual commit
> > > out (or use the -P 3 as was said).
> > >
> > > But that's a world away from me just hitting a single key in my email
> > > client to suck down the whole thread and apply it to my tree.
>
> Would it help to have an "interactive cherry-pick mode" where it grabs the
> whole thread but before it applies it to your tree, it lets you pick the
> subset of the patches you want? So, instead of passing -P 3,4, you have a file
> open in your $EDITOR where you can just delete the patches you don't want?
Sure, that would be nice, but don't do it just for me, I can live with
having people resend patches to me :)
thanks,
greg k-h
^ permalink raw reply [flat|nested] 32+ messages in thread
end of thread, other threads:[~2025-04-11 12:45 UTC | newest]
Thread overview: 32+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-24 23:21 [PATCH 0/7] power: supply: core: convert to fwnode Sebastian Reichel
2025-02-24 23:21 ` [PATCH 1/7] power: supply: core: get rid of of_node Sebastian Reichel
2025-02-25 10:47 ` AngeloGioacchino Del Regno
2025-02-25 11:14 ` Matti Vaittinen
2025-02-25 13:11 ` Sebastian Reichel
2025-02-25 13:25 ` Matti Vaittinen
2025-02-24 23:21 ` [PATCH 2/7] regulator: act8865-regulator: switch psy_cfg from of_node to fwnode Sebastian Reichel
2025-02-24 23:21 ` [PATCH 3/7] usb: common: usb-conn-gpio: " Sebastian Reichel
2025-02-25 3:32 ` Greg Kroah-Hartman
2025-03-08 1:10 ` Sebastian Reichel
2025-03-08 5:57 ` Greg Kroah-Hartman
2025-03-08 9:34 ` Konrad Dybcio
2025-03-08 16:33 ` Sebastian Reichel
2025-03-08 17:27 ` Greg Kroah-Hartman
2025-03-08 18:27 ` Konrad Dybcio
2025-03-21 16:36 ` Konstantin Ryabitsev
2025-03-22 3:44 ` Greg Kroah-Hartman
2025-04-11 12:45 ` Greg Kroah-Hartman
2025-02-25 10:50 ` AngeloGioacchino Del Regno
2025-02-24 23:21 ` [PATCH 4/7] power: supply: all: " Sebastian Reichel
2025-02-25 2:40 ` Chen-Yu Tsai
2025-02-25 3:39 ` Baolin Wang
2025-02-25 10:47 ` AngeloGioacchino Del Regno
2025-02-24 23:21 ` [PATCH 5/7] power: supply: core: remove of_node from power_supply_config Sebastian Reichel
2025-02-25 10:49 ` AngeloGioacchino Del Regno
2025-02-24 23:21 ` [PATCH 6/7] power: supply: core: battery-info: fully switch to fwnode Sebastian Reichel
2025-02-25 10:49 ` AngeloGioacchino Del Regno
2025-02-24 23:21 ` [PATCH 7/7] power: supply: core: convert to fwnnode Sebastian Reichel
2025-02-25 10:49 ` AngeloGioacchino Del Regno
2025-02-25 13:16 ` Hans de Goede
2025-02-25 21:22 ` Sebastian Reichel
2025-03-08 0:45 ` (subset) [PATCH 0/7] power: supply: core: convert to fwnode Sebastian Reichel
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).