History log of /linux-master/drivers/platform/x86/x86-android-tablets/lenovo.c
Revision Date Author Comments
# 492b1194 09-May-2024 Hans de Goede <hdegoede@redhat.com>

platform/x86: x86-android-tablets: Pass struct device to init()

Pass a struct device pointer for x86_android_tablet_device to the board
specific init() functions, so that these functions can use this for
e.g. devm_*() functions.

Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20240509141207.63570-1-hdegoede@redhat.com


# 3eee73ad 06-Apr-2024 Hans de Goede <hdegoede@redhat.com>

platform/x86: x86-android-tablets: Add Lenovo Yoga Tablet 2 Pro 1380F/L data

The Lenovo Yoga Tablet 2 Pro 1380F/L is a x86 ACPI tablet which ships with
Android x86 as factory OS. Its DSDT contains a bunch of I2C devices which
are not actually there, causing various resource conflicts. Enumeration of
these is skipped through the acpi_quirk_skip_i2c_client_enumeration().

Add support for manually instantiating the I2C + other devices which are
actually present on this tablet by adding the necessary device info to
the x86-android-tablets module.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20240406125058.13624-2-hdegoede@redhat.com


# bd8905d7 16-Feb-2024 Hans de Goede <hdegoede@redhat.com>

platform/x86: x86-android-tablets: Fix keyboard touchscreen on Lenovo Yogabook1 X90

After commit 4014ae236b1d ("platform/x86: x86-android-tablets: Stop using
gpiolib private APIs") the touchscreen in the keyboard half of
the Lenovo Yogabook1 X90 stopped working with the following error:

Goodix-TS i2c-goodix_ts: error -EBUSY: Failed to get irq GPIO

The problem is that when getting the IRQ for instantiated i2c_client-s
from a GPIO (rather then using an IRQ directly from the IOAPIC),
x86_acpi_irq_helper_get() now properly requests the GPIO, which disallows
other drivers from requesting it. Normally this is a good thing, but
the goodix touchscreen also uses the IRQ as an output during reset
to select which of its 2 possible I2C addresses should be used.

Add a new free_gpio flag to struct x86_acpi_irq_data to deal with this
and release the GPIO after getting the IRQ in this special case.

Fixes: 4014ae236b1d ("platform/x86: x86-android-tablets: Stop using gpiolib private APIs")
Cc: stable@vger.kernel.org
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20240216201721.239791-2-hdegoede@redhat.com


# 93ec6f22 04-Nov-2023 Hans de Goede <hdegoede@redhat.com>

platform/x86: x86-android-tablets: Fix backlight ctrl for Lenovo Yoga Tab 3 Pro YT3-X90F

Fix the maximum brightness being much too low on the Yoga Tab 3 Pro.

The LP8557 backlight controller can either be configured to multiply its
PWM input and the I2C register set level (requiring both to be at 100%
for 100% output); or to only take the I2C register set level into account.

Multiplying the 2 levels is useful because this will turn off the backlight
when the panel goes off and turns off its PWM output.

But on the YT3-X90F the panel's PWM output defaults to a duty-cycle of much
less then 100%, severely limiting max brightness. In this case the LP8557
should be configured to only take the I2C register into account and
the i915 driver must turn off the backlight separately using a VBT MIPI
sequence to turn off the backlight.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20231104205828.63139-4-hdegoede@redhat.com


# 115779bf 04-Nov-2023 Hans de Goede <hdegoede@redhat.com>

platform/x86: x86-android-tablets: Add audio codec info for Lenovo Yoga Tab 3 Pro YT3-X90F

The SPI attached WM5102 codec on the Lenovo Yoga Tab 3 Pro YT3-X90F
is not described in the ACPI tables.

Add info to instantiate the SPI device for the codec manually.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20231104205828.63139-3-hdegoede@redhat.com


# 45ae16ec 15-Sep-2023 Hans de Goede <hdegoede@redhat.com>

platform/x86: x86-android-tablets: Fix Lenovo Yoga Tablet 2 830F/L vs 1050F/L detection

gpio_crystalcove pin 10 is already in input mode and passing GPIOD_IN
when requesting the GPIO changes its pull-up/-down settings causing
the 830F/L to get misdetected as 1050F/L.

Switch to using GPIOD_ASIS when requesting the GPIO to fix
the misdetection.

Fixes: 4014ae236b1d ("platform/x86: x86-android-tablets: Stop using gpiolib private APIs")
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20230915214933.62595-1-hdegoede@redhat.com


# 9578db79 09-Sep-2023 Hans de Goede <hdegoede@redhat.com>

platform/x86: x86-android-tablets: Drop "linux,power-supply-name" from lenovo_yt3_bq25892_0_props[]

The "linux,power-supply-name" property is a left-over from an earlier
attempt to allow properties to specify the power_supply class-device name.

The patch to read this property never made it upstream (and is no longer
necessary). Drop the unused property.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20230909141816.58358-9-hdegoede@redhat.com


# 4014ae23 09-Sep-2023 Hans de Goede <hdegoede@redhat.com>

platform/x86: x86-android-tablets: Stop using gpiolib private APIs

Refactor x86_android_tablet_get_gpiod() to no longer use
gpiolib private functions like gpiochip_find().

As a bonus this allows specifying that the GPIO is active-low,
like the /CE (charge enable) pin on the bq25892 charger on
the Lenovo Yoga Tablet 3.

Reported-by: Bartosz Golaszewski <brgl@bgdev.pl>
Closes: https://lore.kernel.org/platform-driver-x86/20230905185309.131295-12-brgl@bgdev.pl/
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20230909141816.58358-7-hdegoede@redhat.com


# 6dc6c0c1 05-May-2023 Hans de Goede <hdegoede@redhat.com>

platform/x86: x86-android-tablets: Add support for more then 1 gpio_key

Modify the gpio_keys support in x86_android_tablet_init() for
tablets which have more then 1 key/button which needs to be handled
by the gpio_keys driver.

This requires copying over the struct gpio_keys_button from
the x86_gpio_button struct array to a new gpio_keys_button struct array,
as an added benefit this allows marking the per model x86_gpio_button
arrays __initconst so that they all can be freed after module init().

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Link: https://lore.kernel.org/r/20230505205901.42649-1-hdegoede@redhat.com


# fbc29478 29-Apr-2023 Hans de Goede <hdegoede@redhat.com>

platform/x86: x86-android-tablets: Add Lenovo Yoga Book lid switch

Add x86_gpio_button info for the yb1-x90f/l describing the lid switch
on the Lenovo Yoga Book Android models.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20230429180230.97716-2-hdegoede@redhat.com


# d190a778 29-Apr-2023 Hans de Goede <hdegoede@redhat.com>

platform/x86: x86-android-tablets: Fix Bluetooth on Lenovo Yoga Book

The Lenovo Yoga Book yb1-x90f/l has (another) bug in its DSDT where
the UART resource for the BTH0 ACPI device contains
"\\_SB.PCIO.URT1" as path to the UART.

Note that is with a letter 'O' instead of the number '0' which is wrong.

Add a x86_serdev_info entry to make the x86-android-tablets module
manually setup the /sys/bus/serial device for the Bluetooth UART
to fix Bluetooth not working due to this bug.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20230429180230.97716-1-hdegoede@redhat.com


# d2beb6f2 28-Apr-2023 Hans de Goede <hdegoede@redhat.com>

platform/x86: x86-android-tablets: Add ALS sensor support for Yoga Tablet 2 1050/830 series

The Yoga Tablet 2 1050/830 series have an AL3320A ambient light sensor,
add this to the list of i2c_clients to instantiate on these models.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20230429105057.7697-1-hdegoede@redhat.com


# e578c943 16-Apr-2023 Hans de Goede <hdegoede@redhat.com>

platform/x86: x86-android-tablets: Add accelerometer support for Yoga Tablet 2 1050/830 series

The Yoga Tablet 2 1050/830 series have a LSM303DA accelerometer +
magnetometer (IMU), add this to the list of i2c_clients to
instantiate on these models.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20230416212841.311152-4-hdegoede@redhat.com


# 1d3f7a31 16-Apr-2023 Hans de Goede <hdegoede@redhat.com>

platform/x86: x86-android-tablets: Add "yogabook-touch-kbd-digitizer-switch" pdev for Lenovo Yoga Book

Add a "yogabook-touch-kbd-digitizer-switch" platform-device, for
the lenovo-yogabook driver to bind to, to the x86_dev_info for
the Lenovo Yoga Book 1 Android models (yb1-x90f/l).

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20230416212841.311152-3-hdegoede@redhat.com


# 95b829f8 16-Apr-2023 Hans de Goede <hdegoede@redhat.com>

platform/x86: x86-android-tablets: Add Wacom digitizer info for Lenovo Yoga Book

The Lenovo Yoga Book has a wacom digitizer in its keyboard half,
add the necessary info to instantiate an i2c_client for the digitizer.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20230416212841.311152-2-hdegoede@redhat.com


# 02377e98 16-Apr-2023 Hans de Goede <hdegoede@redhat.com>

platform/x86: x86-android-tablets: Update Yoga Book HiDeep touchscreen comment

After recent i2c-hid-of changes, the i2c-hid-of driver could be used
for the Yoga Book HiDeep touchscreen comment instead of the native hideep
driver. Update the comment to reflect this.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20230416212841.311152-1-hdegoede@redhat.com


# c69fec50 01-Apr-2023 Hans de Goede <hdegoede@redhat.com>

platform/x86: x86-android-tablets: Add Lenovo Yoga Book X90F/L data

The Lenovo Yoga Book X90F/L is a x86 ACPI tablet which ships with Android
x86 as factory OS. Its DSDT contains a bunch of I2C devices which are not
actually there, causing various resource conflicts. Enumeration of these
is skipped through the acpi_quirk_skip_i2c_client_enumeration().

Add support for manually instantiating the I2C + other devices which are
actually present on this tablet by adding the necessary device info to
the x86-android-tablets module.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/20230401150737.597417-3-hdegoede@redhat.com


# ec5a4565 01-Apr-2023 Hans de Goede <hdegoede@redhat.com>

platform/x86: x86-android-tablets: Share lp855x_platform_data between different models

Various Lenovo models use a TI LP8557 LED backlight controller and
the necessary platform_data is the same for the different models.

Currently there are 2 identical copies and the upcoming support for
the Lenovo Yoga Book X90F/L would add a 3th identical copy.

Move to sharing the lp855x_platform_data between different models
to avoid this duplication.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/20230401150737.597417-2-hdegoede@redhat.com


# 01862d01 01-Apr-2023 Hans de Goede <hdegoede@redhat.com>

platform/x86: x86-android-tablets: Use LP8557 in direct mode on both the Yoga 830 and the 1050

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: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/20230401150737.597417-1-hdegoede@redhat.com


# 5f250f8a 28-Feb-2023 Hans de Goede <hdegoede@redhat.com>

platform/x86: x86-android-tablets: Lenovo Yoga Book match is for YB1-X91 models only

When support for instantiating an i2c-client for the fuel-gauge was
added for the Windows based Yoga Book YB1-X91F/L models, the assumption
was made that this would apply to the Android based YB1-X90F/L models too.

But these have a completely different BIOS with completely different DMI
strings. Update the existing YB1-X91 support to reflect that it only
applies to the YB1-X91F/L models.

Cc: Yauhen Kharuzhy <jekhor@gmail.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/20230301092331.7038-15-hdegoede@redhat.com


# dadbc368 25-Feb-2023 Hans de Goede <hdegoede@redhat.com>

platform/x86: x86-android-tablets: Add LID switch support for Yoga Tablet 2 1050/830 series

The Yoga Tablet 2 1050/830 series have a HALL sensor for detecting
when their (optional) case/cover is closed over the screen.

Their Windows counterparts (alsmost the same HW, different BIOS)
model this as a LID switch. Add support for reporting this as
a LID switch on the Android models too.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/20230301092331.7038-14-hdegoede@redhat.com


# 607fbac0 22-Feb-2023 Hans de Goede <hdegoede@redhat.com>

platform/x86: x86-android-tablets: Add backlight ctrl for Lenovo Yoga Tab 3 Pro YT3-X90F

The YT3 uses an TI LP8557 LED backlight controller, the LP8557's PWM input
is connected to a PWM output coming from the LCD panel's controller.

The Android kernel has a hack in the i915 driver to write the non-standard
DSI reg 0x51 with the desired level to set the duty-cycle of the LCD's PWM.

To avoid having to have a similar hack in the mainline kernel program
instantiate an i2c-client for the LP8557 with platform-data to have
the LP8557 to directly set the level (ignoring its PWM input), this allows
backlight brightness control through a backlight device registered by
the lp855x_bl driver.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/20230301092331.7038-13-hdegoede@redhat.com


# 9b1d2662 21-Feb-2023 Hans de Goede <hdegoede@redhat.com>

platform/x86: x86-android-tablets: Add touchscreen support for Lenovo Yoga Tab 3 Pro YT3-X90F

Add the necessary info to instantiate the I2C device for the touchscreen
on Lenovo Yoga Tab 3 Pro YT3-X90F tablets.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/20230301092331.7038-12-hdegoede@redhat.com


# 7bf974f6 19-Feb-2023 Hans de Goede <hdegoede@redhat.com>

platform/x86: x86-android-tablets: Move Lenovo tablets to their own file

Move the info for the Lenovo tablets to their own lenovo.c file.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/20230301092331.7038-8-hdegoede@redhat.com