• Hans de Goede's avatar
    platform/x86: x86-android-tablets: Use LP8557 in direct mode on both the Yoga 830 and the 1050 · 01862d01
    Hans de Goede authored
    Both the Lenovo Yoga Tablet 2 830 and 1050 models use an TI LP8557 LED
    backlight controller. On the 1050 the LP8557's PWM input is connected to
    the PMIC's PWM output and everything works fine with the defaults
    programmed into the LP8557 by the BIOS.
    
    But on the 830 the LP8557's PWM input is connected to a PWM output coming
    from the LCD panel's controller. The Android code has a hack in the i915
    driver to write the non-standard DSI reg 0x9f with the desired backlight
    level to set the duty-cycle of the LCD's PWM output.
    
    To avoid having to have a similar hack in the mainline kernel the LP8557
    entry in lenovo_yoga_tab2_830_1050_i2c_clients instead just programs the
    LP8557 to directly set the level, ignoring the PWM input.
    
    So far we have only been instantiating the LP8557 i2c_client for direct
    backlight control on the 830 model. But we want hide/disable the
    intel_backlight interface on the 830 model to avoid having 2 backlight
    interfaces for the same LCD panel.
    
    And the 830 and 1050 share the same DMI strings. So this will hide the
    intel_backlight interface on the 1050 model too.
    
    To avoid this causing problems make the backlight handling consistent
    between the 2 models and always directly use the LP8557.
    
    This also simplifies the code.
    Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
    Reviewed-by: default avatarAndy Shevchenko <andy.shevchenko@gmail.com>
    Link: https://lore.kernel.org/r/20230401150737.597417-1-hdegoede@redhat.com
    01862d01
lenovo.c 14.5 KB