Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 15 additions & 7 deletions src/kboot.c
Original file line number Diff line number Diff line change
Expand Up @@ -964,9 +964,9 @@ static int dt_set_als(void)
}

/*
* The D2355 Lightning charger (A10X iPad Pro 2) scales its input-current
* limit by the unit's calibration in the ADT's /charger node. Copy the
* table into the charger's node.
* The D2355 Lightning charger (A9X iPad Pro 9.7-inch and A10X iPad Pro 2)
* scales its input-current limit by the unit's calibration in the ADT's
* /charger node. Copy the table into the charger's node.
*/
static int dt_set_charger_calibration(void)
{
Expand All @@ -982,12 +982,20 @@ static int dt_set_charger_calibration(void)

u32 len;
const u8 *table = adt_getprop(adt, anode, "usb-input-limit-calibration-hv", &len);
if (!table || len != 84) {
printf("ADT: charger input-limit calibration missing\n");
if (table && len == 84) {
if (fdt_setprop(dt, node, "apple,usb-input-limit-calibration-hv", table, len) < 0)
bail("FDT: failed to set apple,usb-input-limit-calibration-hv\n");
return 0;
}
if (fdt_setprop(dt, node, "apple,usb-input-limit-calibration-hv", table, len) < 0)
bail("FDT: failed to set apple,usb-input-limit-calibration-hv\n");

table = adt_getprop(adt, anode, "usb-input-limit-calibration", &len);
if (table && len == 24) {
if (fdt_setprop(dt, node, "apple,usb-input-limit-calibration", table, len) < 0)
bail("FDT: failed to set apple,usb-input-limit-calibration\n");
return 0;
}

printf("ADT: charger input-limit calibration missing\n");
return 0;
}

Expand Down
Loading