rmi_read_block should report 0 on success

That is what is required in the rmi_driver implementation, so use it.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
add inline helper when reading only one block

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Use BIT() macro in various places

I find it a little bit more easy to read BIT(4) than 0x10 when we are
testing the bits in a u8.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Various small cleanings

no functional changes:
- 0xN -> 0x0N
- 0xNNN -> 0x0NNN
- match 80 hcars in a line

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
input_event: fix interrupt handlings

There is no guarantee that F11 is before F30, so check the actual
interrupt_base.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
input_event: accept other interrupts sources

The HID FW only reports F11 and F30 reports, so do not bail out
if the interrupt contains something else.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
F11: read sensor dimension from the FW

The sensor can reports its dimensions in query 15 to 18.
Use the reported values to compute the actual resolution.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Do not init features and input reports

The following messages are observed:

Mar 20 15:17:31 t540p kernel: cp2112 0003:10C4:EA90.001B: hidraw0: USB HID v1.01 Device [Silicon Laboratories CP2112 HID USB-to-SMBus Bridge] on usb-0000:00:14.0-6/input0
Mar 20 15:17:31 t540p kernel: cp2112 0003:10C4:EA90.001B: Part Number: 0x0C Device Version: 0x02
Mar 20 15:17:31 t540p kernel: i2c_hid 10-002c: failed to retrieve report from device.

So the device do not like to be polled for its features also.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
F30: fix ctrl2 address

it was off by one: Ctrl0 is only present if both has_gpio and has_led
are set to 1.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
F30: implement buttons properly

Now that Ctrl 2 address is valid, we can export the buttons and remove
the debug messages.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
F30: actual buttons have a pull up resistor

The device declares 3 buttons even if only one is physically here.
The current mapping makes that this button will be mapped to BTN_MIDDLE.

This is a little bit worrying. Actually, the button has a pull up resistor
so use this to know which inputs are actually used.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>