mirror of
https://github.com/AsahiLinux/m1n1
synced 2024-11-26 08:20:18 +00:00
copy the touchscreen calibration
Signed-off-by: Sasha Finkelstein <fnkl.kernel@gmail.com>
This commit is contained in:
parent
90d0cd6b89
commit
d110da1e75
1 changed files with 25 additions and 0 deletions
25
src/kboot.c
25
src/kboot.c
|
@ -660,6 +660,29 @@ static int dt_set_bluetooth(void)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int dt_set_multitouch(void)
|
||||
{
|
||||
const char *path = fdt_get_alias(dt, "touchbar0");
|
||||
if (path == NULL)
|
||||
return 0;
|
||||
|
||||
int node = fdt_path_offset(dt, path);
|
||||
if (node < 0)
|
||||
bail("FDT: alias points at nonexistent node");
|
||||
|
||||
int anode = adt_path_offset(adt, "/arm-io/spi0/multi-touch");
|
||||
if (anode < 0)
|
||||
bail("ADT /arm-io/spi0/multi-touch not found\n");
|
||||
|
||||
u32 len;
|
||||
const u8 *cal_blob = adt_getprop(adt, anode, "multi-touch-calibration", &len);
|
||||
if (!cal_blob || !len)
|
||||
bail("ADT: Failed to get multi-touch-calibration");
|
||||
|
||||
fdt_setprop(dt, node, "apple,z2-cal-blob", cal_blob, len);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int dt_set_wifi(void)
|
||||
{
|
||||
int anode = adt_path_offset(adt, "/arm-io/wlan");
|
||||
|
@ -1873,6 +1896,8 @@ int kboot_prepare_dt(void *fdt)
|
|||
return -1;
|
||||
if (dt_set_gpu(dt))
|
||||
return -1;
|
||||
if (dt_set_multitouch())
|
||||
return -1;
|
||||
if (dt_disable_missing_devs("usb-drd", "usb@", 8))
|
||||
return -1;
|
||||
if (dt_disable_missing_devs("i2c", "i2c@", 8))
|
||||
|
|
Loading…
Reference in a new issue