diff --git a/src/kboot.c b/src/kboot.c index 03ed2821c..c60d47059 100644 --- a/src/kboot.c +++ b/src/kboot.c @@ -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) { @@ -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; }