Skip to content

Commit

Permalink
platform/x86: intel_cht_int33fe: Drop Lenovo Yogabook YB1-X9x code
Browse files Browse the repository at this point in the history
Move the Lenovo Yogabook YB1-X9x fuel-gauge instantiation code over to
the x86-android-tablets module, which already deals with this for various
other devices.

This removes the need to have a special intel_cht_int33fe_microb module
just for Lenovo Yogabook YB1-X9x laptops.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20220206220220.88491-3-hdegoede@redhat.com
  • Loading branch information
Hans de Goede committed Feb 11, 2022
1 parent 915623a commit bb22fc5
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 118 deletions.
18 changes: 7 additions & 11 deletions drivers/platform/x86/intel/int33fe/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,15 @@ config INTEL_CHT_INT33FE
depends on USB_ROLES_INTEL_XHCI=y || (USB_ROLES_INTEL_XHCI=m && m)
depends on TYPEC_MUX_PI3USB30532=y || (TYPEC_MUX_PI3USB30532=m && m)
help
This driver add support for the INT33FE ACPI device found on
some Intel Cherry Trail devices.
This driver add support for the INT33FE ACPI device found on the
GPD win and the GPD pocket.

There are two kinds of INT33FE ACPI device possible: for hardware
with USB Type-C and Micro-B connectors. This driver supports both.

The INT33FE ACPI device has a CRS table with I2cSerialBusV2
resources for Fuel Gauge Controller and (in the Type-C variant)
FUSB302 USB Type-C Controller and PI3USB30532 USB switch.
The INT33FE ACPI device on these mini laptops contains I2cSerialBusV2
resources for a MAX17042 Fuel Gauge, FUSB302 USB Type-C Controller
and PI3USB30532 USB switch.
This driver instantiates i2c-clients for these, so that standard
i2c drivers for these chips can bind to the them.

If you enable this driver it is advised to also select
CONFIG_BATTERY_BQ27XXX=m or CONFIG_BATTERY_BQ27XXX_I2C=m for Micro-B
device and CONFIG_TYPEC_FUSB302=m and CONFIG_BATTERY_MAX17042=m
for Type-C device.
CONFIG_TYPEC_FUSB302=m, CONFIG_TYPEC_MUX_PI3USB30532=m and
CONFIG_BATTERY_MAX17042=m.
2 changes: 1 addition & 1 deletion drivers/platform/x86/intel/int33fe/Makefile
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# SPDX-License-Identifier: GPL-2.0-only
obj-$(CONFIG_INTEL_CHT_INT33FE) += intel_cht_int33fe_typec.o intel_cht_int33fe_microb.o
obj-$(CONFIG_INTEL_CHT_INT33FE) += intel_cht_int33fe_typec.o
106 changes: 0 additions & 106 deletions drivers/platform/x86/intel/int33fe/intel_cht_int33fe_microb.c

This file was deleted.

27 changes: 27 additions & 0 deletions drivers/platform/x86/x86-android-tablets.c
Original file line number Diff line number Diff line change
Expand Up @@ -679,6 +679,25 @@ static const struct x86_dev_info czc_p10t __initconst = {
.init = czc_p10t_init,
};

/* Lenovo Yoga Book X90F / X91F / X91L need manual instantiation of the fg client */
static const struct x86_i2c_client_info lenovo_yogabook_x9x_i2c_clients[] __initconst = {
{
/* BQ27542 fuel-gauge */
.board_info = {
.type = "bq27542",
.addr = 0x55,
.dev_name = "bq27542",
.swnode = &fg_bq25890_supply_node,
},
.adapter_path = "\\_SB_.PCI0.I2C1",
},
};

static const struct x86_dev_info lenovo_yogabook_x9x_info __initconst = {
.i2c_client_info = lenovo_yogabook_x9x_i2c_clients,
.i2c_client_count = ARRAY_SIZE(lenovo_yogabook_x9x_i2c_clients),
};

/* Nextbook Ares 8 tablets have an Android factory img with everything hardcoded */
static const char * const nextbook_ares8_accel_mount_matrix[] = {
"0", "-1", "0",
Expand Down Expand Up @@ -915,6 +934,14 @@ static const struct dmi_system_id x86_android_tablet_ids[] __initconst = {
},
.driver_data = (void *)&czc_p10t,
},
{
/* Lenovo Yoga Book X90F / X91F / X91L */
.matches = {
/* Non exact match to match all versions */
DMI_MATCH(DMI_PRODUCT_NAME, "Lenovo YB1-X9"),
},
.driver_data = (void *)&lenovo_yogabook_x9x_info,
},
{
/* Nextbook Ares 8 */
.matches = {
Expand Down

0 comments on commit bb22fc5

Please sign in to comment.