Lines Matching +full:bat +full:- +full:present

1 // SPDX-License-Identifier: GPL-2.0-only
3 * Copyright (c) 2019-2020, The Linux Foundation. All rights reserved.
190 /* mWh or mAh, based on info->power_unit */
227 bool present; member
321 reinit_completion(&battmgr->ack); in qcom_battmgr_request()
323 battmgr->error = 0; in qcom_battmgr_request()
325 ret = pmic_glink_send(battmgr->client, data, len); in qcom_battmgr_request()
329 left = wait_for_completion_timeout(&battmgr->ack, HZ); in qcom_battmgr_request()
331 return -ETIMEDOUT; in qcom_battmgr_request()
333 return battmgr->error; in qcom_battmgr_request()
430 return -EINVAL; in qcom_battmgr_bat_sm8350_update()
434 mutex_lock(&battmgr->lock); in qcom_battmgr_bat_sm8350_update()
436 mutex_unlock(&battmgr->lock); in qcom_battmgr_bat_sm8350_update()
446 mutex_lock(&battmgr->lock); in qcom_battmgr_bat_sc8280xp_update()
448 if (!battmgr->info.valid) { in qcom_battmgr_bat_sc8280xp_update()
452 battmgr->info.valid = true; in qcom_battmgr_bat_sc8280xp_update()
462 ret = -ENODATA; in qcom_battmgr_bat_sc8280xp_update()
470 ret = -ENODATA; in qcom_battmgr_bat_sc8280xp_update()
476 mutex_unlock(&battmgr->lock); in qcom_battmgr_bat_sc8280xp_update()
485 enum qcom_battmgr_unit unit = battmgr->unit; in qcom_battmgr_bat_get_property()
488 if (!battmgr->service_up) in qcom_battmgr_bat_get_property()
489 return -EAGAIN; in qcom_battmgr_bat_get_property()
491 if (battmgr->variant == QCOM_BATTMGR_SC8280XP) in qcom_battmgr_bat_get_property()
500 val->intval = battmgr->status.status; in qcom_battmgr_bat_get_property()
503 val->intval = battmgr->info.charge_type; in qcom_battmgr_bat_get_property()
506 val->intval = battmgr->status.health; in qcom_battmgr_bat_get_property()
509 val->intval = battmgr->info.present; in qcom_battmgr_bat_get_property()
512 val->intval = battmgr->info.technology; in qcom_battmgr_bat_get_property()
515 val->intval = battmgr->info.cycle_count; in qcom_battmgr_bat_get_property()
518 val->intval = battmgr->info.voltage_max_design; in qcom_battmgr_bat_get_property()
521 val->intval = battmgr->info.voltage_max; in qcom_battmgr_bat_get_property()
524 val->intval = battmgr->status.voltage_now; in qcom_battmgr_bat_get_property()
527 val->intval = battmgr->status.voltage_ocv; in qcom_battmgr_bat_get_property()
530 val->intval = battmgr->status.current_now; in qcom_battmgr_bat_get_property()
533 val->intval = battmgr->status.power_now; in qcom_battmgr_bat_get_property()
537 return -ENODATA; in qcom_battmgr_bat_get_property()
538 val->intval = battmgr->info.design_capacity; in qcom_battmgr_bat_get_property()
542 return -ENODATA; in qcom_battmgr_bat_get_property()
543 val->intval = battmgr->info.last_full_capacity; in qcom_battmgr_bat_get_property()
547 return -ENODATA; in qcom_battmgr_bat_get_property()
548 val->intval = battmgr->info.capacity_low; in qcom_battmgr_bat_get_property()
552 return -ENODATA; in qcom_battmgr_bat_get_property()
553 val->intval = battmgr->status.capacity; in qcom_battmgr_bat_get_property()
556 val->intval = battmgr->info.charge_count; in qcom_battmgr_bat_get_property()
560 return -ENODATA; in qcom_battmgr_bat_get_property()
561 val->intval = battmgr->info.design_capacity; in qcom_battmgr_bat_get_property()
565 return -ENODATA; in qcom_battmgr_bat_get_property()
566 val->intval = battmgr->info.last_full_capacity; in qcom_battmgr_bat_get_property()
570 return -ENODATA; in qcom_battmgr_bat_get_property()
571 val->intval = battmgr->info.capacity_low; in qcom_battmgr_bat_get_property()
575 return -ENODATA; in qcom_battmgr_bat_get_property()
576 val->intval = battmgr->status.capacity; in qcom_battmgr_bat_get_property()
579 val->intval = battmgr->status.percent; in qcom_battmgr_bat_get_property()
582 val->intval = battmgr->status.temperature; in qcom_battmgr_bat_get_property()
585 val->intval = battmgr->status.discharge_time; in qcom_battmgr_bat_get_property()
588 val->intval = battmgr->status.charge_time; in qcom_battmgr_bat_get_property()
591 val->intval = battmgr->info.year; in qcom_battmgr_bat_get_property()
594 val->intval = battmgr->info.month; in qcom_battmgr_bat_get_property()
597 val->intval = battmgr->info.day; in qcom_battmgr_bat_get_property()
600 val->strval = battmgr->info.model_number; in qcom_battmgr_bat_get_property()
603 val->strval = battmgr->info.oem_info; in qcom_battmgr_bat_get_property()
606 val->strval = battmgr->info.serial_number; in qcom_battmgr_bat_get_property()
609 return -EINVAL; in qcom_battmgr_bat_get_property()
641 .name = "qcom-battmgr-bat",
671 .name = "qcom-battmgr-bat",
685 if (!battmgr->service_up) in qcom_battmgr_ac_get_property()
686 return -EAGAIN; in qcom_battmgr_ac_get_property()
694 val->intval = battmgr->ac.online; in qcom_battmgr_ac_get_property()
697 return -EINVAL; in qcom_battmgr_ac_get_property()
708 .name = "qcom-battmgr-ac",
732 return -EINVAL; in qcom_battmgr_usb_sm8350_update()
736 mutex_lock(&battmgr->lock); in qcom_battmgr_usb_sm8350_update()
738 mutex_unlock(&battmgr->lock); in qcom_battmgr_usb_sm8350_update()
750 if (!battmgr->service_up) in qcom_battmgr_usb_get_property()
751 return -EAGAIN; in qcom_battmgr_usb_get_property()
753 if (battmgr->variant == QCOM_BATTMGR_SC8280XP) in qcom_battmgr_usb_get_property()
762 val->intval = battmgr->usb.online; in qcom_battmgr_usb_get_property()
765 val->intval = battmgr->usb.voltage_now; in qcom_battmgr_usb_get_property()
768 val->intval = battmgr->usb.voltage_max; in qcom_battmgr_usb_get_property()
771 val->intval = battmgr->usb.current_now; in qcom_battmgr_usb_get_property()
774 val->intval = battmgr->usb.current_max; in qcom_battmgr_usb_get_property()
777 val->intval = battmgr->usb.current_limit; in qcom_battmgr_usb_get_property()
780 val->intval = battmgr->usb.usb_type; in qcom_battmgr_usb_get_property()
783 return -EINVAL; in qcom_battmgr_usb_get_property()
807 .name = "qcom-battmgr-usb",
827 .name = "qcom-battmgr-usb",
851 return -EINVAL; in qcom_battmgr_wls_sm8350_update()
855 mutex_lock(&battmgr->lock); in qcom_battmgr_wls_sm8350_update()
857 mutex_unlock(&battmgr->lock); in qcom_battmgr_wls_sm8350_update()
869 if (!battmgr->service_up) in qcom_battmgr_wls_get_property()
870 return -EAGAIN; in qcom_battmgr_wls_get_property()
872 if (battmgr->variant == QCOM_BATTMGR_SC8280XP) in qcom_battmgr_wls_get_property()
881 val->intval = battmgr->wireless.online; in qcom_battmgr_wls_get_property()
884 val->intval = battmgr->wireless.voltage_now; in qcom_battmgr_wls_get_property()
887 val->intval = battmgr->wireless.voltage_max; in qcom_battmgr_wls_get_property()
890 val->intval = battmgr->wireless.current_now; in qcom_battmgr_wls_get_property()
893 val->intval = battmgr->wireless.current_max; in qcom_battmgr_wls_get_property()
896 return -EINVAL; in qcom_battmgr_wls_get_property()
907 .name = "qcom-battmgr-wls",
923 .name = "qcom-battmgr-wls",
934 size_t payload_len = len - sizeof(struct pmic_glink_hdr); in qcom_battmgr_notification()
937 if (payload_len != sizeof(msg->notification)) { in qcom_battmgr_notification()
938 dev_warn(battmgr->dev, "ignoring notification with invalid length\n"); in qcom_battmgr_notification()
942 notification = le32_to_cpu(msg->notification); in qcom_battmgr_notification()
945 battmgr->info.valid = false; in qcom_battmgr_notification()
949 power_supply_changed(battmgr->bat_psy); in qcom_battmgr_notification()
952 power_supply_changed(battmgr->usb_psy); in qcom_battmgr_notification()
955 power_supply_changed(battmgr->wls_psy); in qcom_battmgr_notification()
958 dev_err(battmgr->dev, "unknown notification: %#x\n", notification); in qcom_battmgr_notification()
967 /* Some firmware versions return Pascal-style strings */ in qcom_battmgr_sc8280xp_strcpy()
968 if (len < BATTMGR_STRING_LEN && len == strnlen(src + 1, BATTMGR_STRING_LEN - 1)) { in qcom_battmgr_sc8280xp_strcpy()
994 unsigned int opcode = le32_to_cpu(resp->hdr.opcode); in qcom_battmgr_sc8280xp_callback()
997 size_t payload_len = len - sizeof(struct pmic_glink_hdr); in qcom_battmgr_sc8280xp_callback()
1000 dev_warn(battmgr->dev, "invalid payload length for %#x: %zd\n", in qcom_battmgr_sc8280xp_callback()
1007 battmgr->error = 0; in qcom_battmgr_sc8280xp_callback()
1010 if (payload_len != sizeof(resp->info)) { in qcom_battmgr_sc8280xp_callback()
1011 dev_warn(battmgr->dev, in qcom_battmgr_sc8280xp_callback()
1014 battmgr->error = -ENODATA; in qcom_battmgr_sc8280xp_callback()
1018 battmgr->unit = le32_to_cpu(resp->info.power_unit); in qcom_battmgr_sc8280xp_callback()
1020 battmgr->info.present = true; in qcom_battmgr_sc8280xp_callback()
1021 battmgr->info.design_capacity = le32_to_cpu(resp->info.design_capacity) * 1000; in qcom_battmgr_sc8280xp_callback()
1022 battmgr->info.last_full_capacity = le32_to_cpu(resp->info.last_full_capacity) * 1000; in qcom_battmgr_sc8280xp_callback()
1023 battmgr->info.voltage_max_design = le32_to_cpu(resp->info.design_voltage) * 1000; in qcom_battmgr_sc8280xp_callback()
1024 battmgr->info.capacity_low = le32_to_cpu(resp->info.capacity_low) * 1000; in qcom_battmgr_sc8280xp_callback()
1025 battmgr->info.cycle_count = le32_to_cpu(resp->info.cycle_count); in qcom_battmgr_sc8280xp_callback()
1026 qcom_battmgr_sc8280xp_strcpy(battmgr->info.model_number, resp->info.model_number); in qcom_battmgr_sc8280xp_callback()
1027 qcom_battmgr_sc8280xp_strcpy(battmgr->info.serial_number, resp->info.serial_number); in qcom_battmgr_sc8280xp_callback()
1028 battmgr->info.technology = qcom_battmgr_sc8280xp_parse_technology(resp->info.battery_chemistry); in qcom_battmgr_sc8280xp_callback()
1029 qcom_battmgr_sc8280xp_strcpy(battmgr->info.oem_info, resp->info.oem_info); in qcom_battmgr_sc8280xp_callback()
1030 battmgr->info.day = resp->info.day; in qcom_battmgr_sc8280xp_callback()
1031 battmgr->info.month = resp->info.month; in qcom_battmgr_sc8280xp_callback()
1032 battmgr->info.year = le16_to_cpu(resp->info.year); in qcom_battmgr_sc8280xp_callback()
1035 if (payload_len != sizeof(resp->status)) { in qcom_battmgr_sc8280xp_callback()
1036 dev_warn(battmgr->dev, in qcom_battmgr_sc8280xp_callback()
1039 battmgr->error = -ENODATA; in qcom_battmgr_sc8280xp_callback()
1043 state = le32_to_cpu(resp->status.battery_state); in qcom_battmgr_sc8280xp_callback()
1045 battmgr->status.status = POWER_SUPPLY_STATUS_DISCHARGING; in qcom_battmgr_sc8280xp_callback()
1047 battmgr->status.status = POWER_SUPPLY_STATUS_CHARGING; in qcom_battmgr_sc8280xp_callback()
1049 battmgr->status.status = POWER_SUPPLY_STATUS_NOT_CHARGING; in qcom_battmgr_sc8280xp_callback()
1051 battmgr->status.capacity = le32_to_cpu(resp->status.capacity) * 1000; in qcom_battmgr_sc8280xp_callback()
1052 battmgr->status.power_now = le32_to_cpu(resp->status.rate) * 1000; in qcom_battmgr_sc8280xp_callback()
1053 battmgr->status.voltage_now = le32_to_cpu(resp->status.battery_voltage) * 1000; in qcom_battmgr_sc8280xp_callback()
1054 …battmgr->status.temperature = qcom_battmgr_sc8280xp_convert_temp(le32_to_cpu(resp->status.temperat… in qcom_battmgr_sc8280xp_callback()
1056 source = le32_to_cpu(resp->status.charging_source); in qcom_battmgr_sc8280xp_callback()
1057 battmgr->ac.online = source == BATTMGR_CHARGING_SOURCE_AC; in qcom_battmgr_sc8280xp_callback()
1058 battmgr->usb.online = source == BATTMGR_CHARGING_SOURCE_USB; in qcom_battmgr_sc8280xp_callback()
1059 battmgr->wireless.online = source == BATTMGR_CHARGING_SOURCE_WIRELESS; in qcom_battmgr_sc8280xp_callback()
1062 battmgr->status.discharge_time = le32_to_cpu(resp->time); in qcom_battmgr_sc8280xp_callback()
1065 battmgr->status.charge_time = le32_to_cpu(resp->time); in qcom_battmgr_sc8280xp_callback()
1068 dev_warn(battmgr->dev, "unknown message %#x\n", opcode); in qcom_battmgr_sc8280xp_callback()
1072 complete(&battmgr->ack); in qcom_battmgr_sc8280xp_callback()
1080 unsigned int opcode = le32_to_cpu(resp->hdr.opcode); in qcom_battmgr_sm8350_callback()
1081 size_t payload_len = len - sizeof(struct pmic_glink_hdr); in qcom_battmgr_sm8350_callback()
1085 dev_warn(battmgr->dev, "invalid payload length for %#x: %zd\n", in qcom_battmgr_sm8350_callback()
1092 property = le32_to_cpu(resp->intval.property); in qcom_battmgr_sm8350_callback()
1094 if (payload_len != sizeof(resp->strval)) { in qcom_battmgr_sm8350_callback()
1095 dev_warn(battmgr->dev, in qcom_battmgr_sm8350_callback()
1098 battmgr->error = -ENODATA; in qcom_battmgr_sm8350_callback()
1102 if (payload_len != sizeof(resp->intval)) { in qcom_battmgr_sm8350_callback()
1103 dev_warn(battmgr->dev, in qcom_battmgr_sm8350_callback()
1106 battmgr->error = -ENODATA; in qcom_battmgr_sm8350_callback()
1110 battmgr->error = le32_to_cpu(resp->intval.result); in qcom_battmgr_sm8350_callback()
1111 if (battmgr->error) in qcom_battmgr_sm8350_callback()
1117 battmgr->status.status = le32_to_cpu(resp->intval.value); in qcom_battmgr_sm8350_callback()
1120 battmgr->status.health = le32_to_cpu(resp->intval.value); in qcom_battmgr_sm8350_callback()
1123 battmgr->info.present = le32_to_cpu(resp->intval.value); in qcom_battmgr_sm8350_callback()
1126 battmgr->info.charge_type = le32_to_cpu(resp->intval.value); in qcom_battmgr_sm8350_callback()
1129 battmgr->status.percent = le32_to_cpu(resp->intval.value) / 100; in qcom_battmgr_sm8350_callback()
1132 battmgr->status.voltage_ocv = le32_to_cpu(resp->intval.value); in qcom_battmgr_sm8350_callback()
1135 battmgr->status.voltage_now = le32_to_cpu(resp->intval.value); in qcom_battmgr_sm8350_callback()
1138 battmgr->info.voltage_max = le32_to_cpu(resp->intval.value); in qcom_battmgr_sm8350_callback()
1141 battmgr->status.current_now = le32_to_cpu(resp->intval.value); in qcom_battmgr_sm8350_callback()
1144 val = le32_to_cpu(resp->intval.value); in qcom_battmgr_sm8350_callback()
1145 battmgr->status.temperature = DIV_ROUND_CLOSEST(val, 10); in qcom_battmgr_sm8350_callback()
1148 battmgr->info.technology = le32_to_cpu(resp->intval.value); in qcom_battmgr_sm8350_callback()
1151 battmgr->info.charge_count = le32_to_cpu(resp->intval.value); in qcom_battmgr_sm8350_callback()
1154 battmgr->info.cycle_count = le32_to_cpu(resp->intval.value); in qcom_battmgr_sm8350_callback()
1157 battmgr->info.design_capacity = le32_to_cpu(resp->intval.value); in qcom_battmgr_sm8350_callback()
1160 battmgr->info.last_full_capacity = le32_to_cpu(resp->intval.value); in qcom_battmgr_sm8350_callback()
1163 strscpy(battmgr->info.model_number, resp->strval.model, BATTMGR_STRING_LEN); in qcom_battmgr_sm8350_callback()
1166 battmgr->status.charge_time = le32_to_cpu(resp->intval.value); in qcom_battmgr_sm8350_callback()
1169 battmgr->status.discharge_time = le32_to_cpu(resp->intval.value); in qcom_battmgr_sm8350_callback()
1172 battmgr->status.power_now = le32_to_cpu(resp->intval.value); in qcom_battmgr_sm8350_callback()
1175 dev_warn(battmgr->dev, "unknown property %#x\n", property); in qcom_battmgr_sm8350_callback()
1180 property = le32_to_cpu(resp->intval.property); in qcom_battmgr_sm8350_callback()
1181 if (payload_len != sizeof(resp->intval)) { in qcom_battmgr_sm8350_callback()
1182 dev_warn(battmgr->dev, in qcom_battmgr_sm8350_callback()
1185 battmgr->error = -ENODATA; in qcom_battmgr_sm8350_callback()
1189 battmgr->error = le32_to_cpu(resp->intval.result); in qcom_battmgr_sm8350_callback()
1190 if (battmgr->error) in qcom_battmgr_sm8350_callback()
1195 battmgr->usb.online = le32_to_cpu(resp->intval.value); in qcom_battmgr_sm8350_callback()
1198 battmgr->usb.voltage_now = le32_to_cpu(resp->intval.value); in qcom_battmgr_sm8350_callback()
1201 battmgr->usb.voltage_max = le32_to_cpu(resp->intval.value); in qcom_battmgr_sm8350_callback()
1204 battmgr->usb.current_now = le32_to_cpu(resp->intval.value); in qcom_battmgr_sm8350_callback()
1207 battmgr->usb.current_max = le32_to_cpu(resp->intval.value); in qcom_battmgr_sm8350_callback()
1210 battmgr->usb.current_limit = le32_to_cpu(resp->intval.value); in qcom_battmgr_sm8350_callback()
1213 battmgr->usb.usb_type = le32_to_cpu(resp->intval.value); in qcom_battmgr_sm8350_callback()
1216 dev_warn(battmgr->dev, "unknown property %#x\n", property); in qcom_battmgr_sm8350_callback()
1221 property = le32_to_cpu(resp->intval.property); in qcom_battmgr_sm8350_callback()
1222 if (payload_len != sizeof(resp->intval)) { in qcom_battmgr_sm8350_callback()
1223 dev_warn(battmgr->dev, in qcom_battmgr_sm8350_callback()
1226 battmgr->error = -ENODATA; in qcom_battmgr_sm8350_callback()
1230 battmgr->error = le32_to_cpu(resp->intval.result); in qcom_battmgr_sm8350_callback()
1231 if (battmgr->error) in qcom_battmgr_sm8350_callback()
1236 battmgr->wireless.online = le32_to_cpu(resp->intval.value); in qcom_battmgr_sm8350_callback()
1239 battmgr->wireless.voltage_now = le32_to_cpu(resp->intval.value); in qcom_battmgr_sm8350_callback()
1242 battmgr->wireless.voltage_max = le32_to_cpu(resp->intval.value); in qcom_battmgr_sm8350_callback()
1245 battmgr->wireless.current_now = le32_to_cpu(resp->intval.value); in qcom_battmgr_sm8350_callback()
1248 battmgr->wireless.current_max = le32_to_cpu(resp->intval.value); in qcom_battmgr_sm8350_callback()
1251 dev_warn(battmgr->dev, "unknown property %#x\n", property); in qcom_battmgr_sm8350_callback()
1256 battmgr->error = 0; in qcom_battmgr_sm8350_callback()
1259 dev_warn(battmgr->dev, "unknown message %#x\n", opcode); in qcom_battmgr_sm8350_callback()
1264 complete(&battmgr->ack); in qcom_battmgr_sm8350_callback()
1271 unsigned int opcode = le32_to_cpu(hdr->opcode); in qcom_battmgr_callback()
1275 else if (battmgr->variant == QCOM_BATTMGR_SC8280XP) in qcom_battmgr_callback()
1293 dev_err(battmgr->dev, "failed to request power notifications\n"); in qcom_battmgr_enable_worker()
1301 battmgr->service_up = true; in qcom_battmgr_pdr_notify()
1302 schedule_work(&battmgr->enable_work); in qcom_battmgr_pdr_notify()
1304 battmgr->service_up = false; in qcom_battmgr_pdr_notify()
1309 { .compatible = "qcom,sc8180x-pmic-glink", .data = (void *)QCOM_BATTMGR_SC8280XP },
1310 { .compatible = "qcom,sc8280xp-pmic-glink", .data = (void *)QCOM_BATTMGR_SC8280XP },
1324 struct device *dev = &adev->dev; in qcom_battmgr_probe()
1328 return -ENOMEM; in qcom_battmgr_probe()
1330 battmgr->dev = dev; in qcom_battmgr_probe()
1333 psy_cfg.of_node = adev->dev.of_node; in qcom_battmgr_probe()
1336 psy_cfg_supply.of_node = adev->dev.of_node; in qcom_battmgr_probe()
1340 INIT_WORK(&battmgr->enable_work, qcom_battmgr_enable_worker); in qcom_battmgr_probe()
1341 mutex_init(&battmgr->lock); in qcom_battmgr_probe()
1342 init_completion(&battmgr->ack); in qcom_battmgr_probe()
1344 match = of_match_device(qcom_battmgr_of_variants, dev->parent); in qcom_battmgr_probe()
1346 battmgr->variant = (unsigned long)match->data; in qcom_battmgr_probe()
1348 battmgr->variant = QCOM_BATTMGR_SM8350; in qcom_battmgr_probe()
1350 if (battmgr->variant == QCOM_BATTMGR_SC8280XP) { in qcom_battmgr_probe()
1351 battmgr->bat_psy = devm_power_supply_register(dev, &sc8280xp_bat_psy_desc, &psy_cfg); in qcom_battmgr_probe()
1352 if (IS_ERR(battmgr->bat_psy)) in qcom_battmgr_probe()
1353 return dev_err_probe(dev, PTR_ERR(battmgr->bat_psy), in qcom_battmgr_probe()
1356 battmgr->ac_psy = devm_power_supply_register(dev, &sc8280xp_ac_psy_desc, &psy_cfg_supply); in qcom_battmgr_probe()
1357 if (IS_ERR(battmgr->ac_psy)) in qcom_battmgr_probe()
1358 return dev_err_probe(dev, PTR_ERR(battmgr->ac_psy), in qcom_battmgr_probe()
1361 battmgr->usb_psy = devm_power_supply_register(dev, &sc8280xp_usb_psy_desc, &psy_cfg_supply); in qcom_battmgr_probe()
1362 if (IS_ERR(battmgr->usb_psy)) in qcom_battmgr_probe()
1363 return dev_err_probe(dev, PTR_ERR(battmgr->usb_psy), in qcom_battmgr_probe()
1366 battmgr->wls_psy = devm_power_supply_register(dev, &sc8280xp_wls_psy_desc, &psy_cfg_supply); in qcom_battmgr_probe()
1367 if (IS_ERR(battmgr->wls_psy)) in qcom_battmgr_probe()
1368 return dev_err_probe(dev, PTR_ERR(battmgr->wls_psy), in qcom_battmgr_probe()
1371 battmgr->bat_psy = devm_power_supply_register(dev, &sm8350_bat_psy_desc, &psy_cfg); in qcom_battmgr_probe()
1372 if (IS_ERR(battmgr->bat_psy)) in qcom_battmgr_probe()
1373 return dev_err_probe(dev, PTR_ERR(battmgr->bat_psy), in qcom_battmgr_probe()
1376 battmgr->usb_psy = devm_power_supply_register(dev, &sm8350_usb_psy_desc, &psy_cfg_supply); in qcom_battmgr_probe()
1377 if (IS_ERR(battmgr->usb_psy)) in qcom_battmgr_probe()
1378 return dev_err_probe(dev, PTR_ERR(battmgr->usb_psy), in qcom_battmgr_probe()
1381 battmgr->wls_psy = devm_power_supply_register(dev, &sm8350_wls_psy_desc, &psy_cfg_supply); in qcom_battmgr_probe()
1382 if (IS_ERR(battmgr->wls_psy)) in qcom_battmgr_probe()
1383 return dev_err_probe(dev, PTR_ERR(battmgr->wls_psy), in qcom_battmgr_probe()
1387 battmgr->client = devm_pmic_glink_client_alloc(dev, PMIC_GLINK_OWNER_BATTMGR, in qcom_battmgr_probe()
1391 if (IS_ERR(battmgr->client)) in qcom_battmgr_probe()
1392 return PTR_ERR(battmgr->client); in qcom_battmgr_probe()
1394 pmic_glink_client_register(battmgr->client); in qcom_battmgr_probe()
1400 { .name = "pmic_glink.power-supply", },