• Hans de Goede's avatar
    HID: i2c-hid-of: Allow using i2c-hid-of on non OF platforms · 728ec8b6
    Hans de Goede authored
    There are some x86 tablets / 2-in-1s which ship with Android as their
    factory OS image. These have pretty broken ACPI tables, relying on
    everything being hardcoded in the factory kernel image.
    
    platform/x86/x86-android-tablets.c manually instantiates i2c-clients for
    i2c devices on these tablets to make them work with the mainline kernel.
    
    The Lenovo Yoga Book 1 (yb1-x90f/l) is such a 2-in-1. It has 2 I2C-HID
    devices its main touchscreen and a Wacom digitizer. Its main touchscreen
    can alternatively also be used in HiDeep's native protocol mode but
    for the Wacom digitizer we really need I2C-HID.
    
    This patch allows using i2c-hid-of on non OF platforms so that it can
    bind to a non ACPI instantiated i2c_client on x86 for the Wacom digitizer.
    Note the driver already has an "i2c-over-hid" i2c_device_id (rather then
    an of_device_id).
    
    Besides enabling building on non-OF platforms this also replaces
    the only of_property_read_u32() call with device_property_read_u32() note
    that other properties where already read using device_property_read_...().
    Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
    Reviewed-by: default avatarBenjamin Tissoires <benjamin.tissoires@redhat.com>
    Link: https://lore.kernel.org/r/20230413093625.71146-3-hdegoede@redhat.comSigned-off-by: default avatarBenjamin Tissoires <benjamin.tissoires@redhat.com>
    728ec8b6
i2c-hid-of.c 3.84 KB