FROMLIST: power_supply: Use of-thermal cdev registration API
With thermal frameworks of-thermal interface, thermal zone parameters can be defined in devicetree. This includes cooling device mitigation levels for a thermal zone. To take advantage of this, cooling device should use the thermal_of_cooling_device_register API to register a cooling device. Use thermal_of_cooling_device_register API to register the power supply cooling device. This enables power supply cooling device be included in the thermal zone parameter in devicetree. Signed-off-by: Manaf Meethalavalappu Pallikunhi <quic_manafm@quicinc.com> Bug: 211709650 Link: https://lore.kernel.org/linux-pm/1640162489-7847-2-git-send-email-quic_manafm@quicinc.com/ Change-Id: Ie0d527543adb8590ec52df96bf3e4d0f1f022d0a Signed-off-by: Manaf Meethalavalappu Pallikunhi <quic_manafm@quicinc.com>
This commit is contained in:

committed by
Steve Muckle

parent
b90fe5ef8f
commit
2a2327c4e8
@@ -1134,6 +1134,12 @@ static int psy_register_cooler(struct power_supply *psy)
|
|||||||
for (i = 0; i < psy->desc->num_properties; i++) {
|
for (i = 0; i < psy->desc->num_properties; i++) {
|
||||||
if (psy->desc->properties[i] ==
|
if (psy->desc->properties[i] ==
|
||||||
POWER_SUPPLY_PROP_CHARGE_CONTROL_LIMIT) {
|
POWER_SUPPLY_PROP_CHARGE_CONTROL_LIMIT) {
|
||||||
|
if (psy->dev.parent)
|
||||||
|
psy->tcd = thermal_of_cooling_device_register(
|
||||||
|
dev_of_node(psy->dev.parent),
|
||||||
|
(char *)psy->desc->name,
|
||||||
|
psy, &psy_tcd_ops);
|
||||||
|
else
|
||||||
psy->tcd = thermal_cooling_device_register(
|
psy->tcd = thermal_cooling_device_register(
|
||||||
(char *)psy->desc->name,
|
(char *)psy->desc->name,
|
||||||
psy, &psy_tcd_ops);
|
psy, &psy_tcd_ops);
|
||||||
|
Reference in New Issue
Block a user