# tCover Linux support

I2C0 @ 0x00\
Address 0x00 is general call address which makes Cover incompatible with standard I2C drivers.

## WDSA Table

```
Name(ABUF, ResourceTemplate()
{
    I2CSerialBus(0, ControllerInitiated, 0x61a80, AddressingMode7Bit, "\\_SB.I2C1", 0, ResourceConsumer, , )
    GpioInt(Level, ActiveLow, Shared, PullDefault, 0, "\\_SB.GPIO", 0, ResourceConsumer, , ) {0x59}
})
Name(EBUF, ResourceTemplate()
{
    I2CSerialBus(0, ControllerInitiated, 0x61a80, AddressingMode7Bit, "\\_SB.I2C1", 0, ResourceConsumer, , )
    GpioInt(Level, ActiveLow, SharedAndWake, PullDefault, 0, "\\_SB.GPIO", 0, ResourceConsumer, , ) {0x75}
})
```

Address 0x00; Speed 400kHz

GPIO Interrupts:\
0x59 -> L1\
0x75 -> O5

{% embed url="<https://docs.microsoft.com/en-us/previous-versions/windows/hardware/design/dn642101(v=vs.85)?redirectedfrom=MSDN>" %}

{% embed url="<https://docs.microsoft.com/en-us/windows-hardware/drivers/bringup/hidi2c-device-specific-method---dsm->" %}

![Captured HID Descriptor without tCover](https://2395005476-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MJQb34R_xPz0ll0scbM%2F-McNhbyY3PwPkJ3Gn-Iu%2F-McNiHtnQxH5dKjdrn2m%2Fimage.png?alt=media\&token=3d0ba987-ef0c-4283-98d5-b1b5d4eb1bdc)

{% embed url="<https://www.google.com/url?sa=t&rct=j&q=&esrc=s&source=web&cd=&cad=rja&uact=8&ved=2ahUKEwjW9vvHiZ7xAhWLh_0HHf3LC2kQFjAAegQIBRAD&url=http%3A%2F%2Fdownload.microsoft.com%2Fdownload%2F7%2Fd%2Fd%2F7dd44bb7-2a7a-4505-ac1c-7227d3d96d5b%2Fhid-over-i2c-protocol-spec-v1-0.docx&usg=AOvVaw32joJ2ViKHgpCbccKBdj2A>" %}

From 5.1.1 HID Descriptor Format

| Offset | Field               | Size | Actual Value | Comment                  |
| ------ | ------------------- | ---- | ------------ | ------------------------ |
| 0      | wHIDDescLength      | 2    | 00 1E        | Dec: 30 -> 30 Bytes read |
| 2      | bcdVersion          | 2    | 01 00        | Version 1.00             |
| 4      | wReportDescLength   | 2    | 00 00        | x                        |
| 6      | wReportDescRegister | 2    | 00 42        | maybe                    |
| 8      | wInputRegister      | 2    | 00 43        | maybe                    |
| 10     | wMaxInputLength     | 2    | 00 00        | x                        |
| 12     | wOutputRegister     | 2    | 00 44        | maybe                    |
| 14     | wMaxOutputLength    | 2    | 00 00        | x                        |
| 16     | wCommandRegister    | 2    | 00 45        | maybe                    |
| 18     | wDataRegister       | 2    | 00 46        | maybe                    |
| 20     | wVendorID           | 2    | 00 00        | x                        |
| 22     | wProuctID           | 2    | 00 00        | x                        |
| 24     | wVersionID          | 2    | 00 00        | x                        |
| 26     | RESERVED            | 4    | 00 00 00 00  |                          |

**All important information** is set to 0x00. I guess standard I2C HID Driver will have a hard time.

HID Descriptor Address is 0x41.\
This makes all the Register fields seem legit.

## Whats wrong here?

It was tested without tCover. Connecting a tCover doesn't change anything.

This should be related to wrong power settings.

Surface RT2 turns on backlight on TypeCover2 when the kernel is booted from UEFI with ACPI.

ACPI does something right according to power settings.\
Now we need to capture the new HID Descriptor for UEFI boot on Surface RT.\
Results should show what to do next

## Observation

Booting Windows without tCover: Windows doesn't send a single byte to tCover.\
Booting Windows with tCover: Windows does send some non HID bytes before the HID Descriptor is read.

That leads to the conclusion that the SoC has a GPIO which acts as tCover detector.
