kboot: disable touchbar on missing calibration data

There is at least on Macbook Pro (M1, 13-inch) with missing
"multi-touch-calibration" in the ADT. Disabling the device as error
handling instead of refusing to boot the kernel.

Signed-off-by: Janne Grunau <j@jannau.net>
This commit is contained in:
Janne Grunau 2023-09-18 22:52:07 +02:00 committed by Hector Martin
parent ea64e7bda4
commit 7e5d12d33e

View file

@ -671,8 +671,12 @@ static int dt_set_multitouch(void)
u32 len; u32 len;
const u8 *cal_blob = adt_getprop(adt, anode, "multi-touch-calibration", &len); const u8 *cal_blob = adt_getprop(adt, anode, "multi-touch-calibration", &len);
if (!cal_blob || !len) if (!cal_blob || !len) {
bail("ADT: Failed to get multi-touch-calibration\n"); printf("ADT: Failed to get multi-touch-calibration from %s, disable %s\n", adt_touchbar,
fdt_get_name(dt, node, NULL));
fdt_setprop_string(dt, node, "status", "disabled");
return 0;
}
fdt_setprop(dt, node, "apple,z2-cal-blob", cal_blob, len); fdt_setprop(dt, node, "apple,z2-cal-blob", cal_blob, len);
return 0; return 0;