platform/x86: x86-android-tablets: Add Nextbook Ares 8A data
authorHans de Goede <hdegoede@redhat.com>
Sat, 29 Apr 2023 10:50:57 +0000 (12:50 +0200)
committerHans de Goede <hdegoede@redhat.com>
Tue, 9 May 2023 09:54:42 +0000 (11:54 +0200)
The Nextbook Ares 8A 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 devices which are
actually present on this tablet by adding the necessary device info to
the x86-android-tablets module.

Note the Ares 8A is the Cherry Trail (CHT) model, the regular Ares 8
is Bay Trail (BYT) based and was already supported. This also updates
the comments for the BYT model to point out this is the BYT model.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20230429105057.7697-3-hdegoede@redhat.com
drivers/platform/x86/x86-android-tablets/dmi.c
drivers/platform/x86/x86-android-tablets/other.c
drivers/platform/x86/x86-android-tablets/x86-android-tablets.h

index 23e640b7003d977136cd8b1e8579109f9aa55741..e00cfa7d7aac65b8cdbce645cfa9e5c6d8ae4e1c 100644 (file)
@@ -127,13 +127,22 @@ const struct dmi_system_id x86_android_tablet_ids[] __initconst = {
                .driver_data = (void *)&medion_lifetab_s10346_info,
        },
        {
-               /* Nextbook Ares 8 */
+               /* Nextbook Ares 8 (BYT version) */
                .matches = {
                        DMI_MATCH(DMI_SYS_VENDOR, "Insyde"),
                        DMI_MATCH(DMI_PRODUCT_NAME, "M890BAP"),
                },
                .driver_data = (void *)&nextbook_ares8_info,
        },
+       {
+               /* Nextbook Ares 8A (CHT version)*/
+               .matches = {
+                       DMI_MATCH(DMI_SYS_VENDOR, "Insyde"),
+                       DMI_MATCH(DMI_PRODUCT_NAME, "CherryTrail"),
+                       DMI_MATCH(DMI_BIOS_VERSION, "M882"),
+               },
+               .driver_data = (void *)&nextbook_ares8a_info,
+       },
        {
                /* Peaq C1010 */
                .matches = {
index fb512c084fe9b37f139f35da509935c62d354a4f..3754d2453cdb03439ea650ff523df1e09c255444 100644 (file)
@@ -311,7 +311,7 @@ const struct x86_dev_info medion_lifetab_s10346_info __initconst = {
        .gpiod_lookup_tables = medion_lifetab_s10346_gpios,
 };
 
-/* Nextbook Ares 8 tablets have an Android factory img with everything hardcoded */
+/* Nextbook Ares 8 (BYT) tablets have an Android factory img with everything hardcoded */
 static const char * const nextbook_ares8_accel_mount_matrix[] = {
        "0", "-1", "0",
        "-1", "0", "0",
@@ -379,6 +379,70 @@ const struct x86_dev_info nextbook_ares8_info __initconst = {
        .gpiod_lookup_tables = nextbook_ares8_gpios,
 };
 
+/* Nextbook Ares 8A (CHT) tablets have an Android factory img with everything hardcoded */
+static const char * const nextbook_ares8a_accel_mount_matrix[] = {
+       "1", "0", "0",
+       "0", "-1", "0",
+       "0", "0", "1"
+};
+
+static const struct property_entry nextbook_ares8a_accel_props[] = {
+       PROPERTY_ENTRY_STRING_ARRAY("mount-matrix", nextbook_ares8a_accel_mount_matrix),
+       { }
+};
+
+static const struct software_node nextbook_ares8a_accel_node = {
+       .properties = nextbook_ares8a_accel_props,
+};
+
+static const struct x86_i2c_client_info nextbook_ares8a_i2c_clients[] __initconst = {
+       {
+               /* Freescale MMA8653FC accel */
+               .board_info = {
+                       .type = "mma8653",
+                       .addr = 0x1d,
+                       .dev_name = "mma8653",
+                       .swnode = &nextbook_ares8a_accel_node,
+               },
+               .adapter_path = "\\_SB_.PCI0.I2C3",
+       }, {
+               /* FT5416DQ9 touchscreen controller */
+               .board_info = {
+                       .type = "edt-ft5x06",
+                       .addr = 0x38,
+                       .dev_name = "ft5416",
+                       .swnode = &nextbook_ares8_touchscreen_node,
+               },
+               .adapter_path = "\\_SB_.PCI0.I2C6",
+               .irq_data = {
+                       .type = X86_ACPI_IRQ_TYPE_GPIOINT,
+                       .chip = "INT33FF:01",
+                       .index = 17,
+                       .trigger = ACPI_EDGE_SENSITIVE,
+                       .polarity = ACPI_ACTIVE_LOW,
+               },
+       },
+};
+
+static struct gpiod_lookup_table nextbook_ares8a_ft5416_gpios = {
+       .dev_id = "i2c-ft5416",
+       .table = {
+               GPIO_LOOKUP("INT33FF:01", 25, "reset", GPIO_ACTIVE_LOW),
+               { }
+       },
+};
+
+static struct gpiod_lookup_table * const nextbook_ares8a_gpios[] = {
+       &nextbook_ares8a_ft5416_gpios,
+       NULL
+};
+
+const struct x86_dev_info nextbook_ares8a_info __initconst = {
+       .i2c_client_info = nextbook_ares8a_i2c_clients,
+       .i2c_client_count = ARRAY_SIZE(nextbook_ares8a_i2c_clients),
+       .gpiod_lookup_tables = nextbook_ares8a_gpios,
+};
+
 /*
  * Peaq C1010
  * This is a standard Windows tablet, but it has a special Dolby button.
index b6802d75dbdd05ab255e445a20c9a5c294091d02..8e9f7238015c5548716931fcb7f3cf5d16d85ee8 100644 (file)
@@ -100,6 +100,7 @@ extern const struct x86_dev_info lenovo_yoga_tab2_830_1050_info;
 extern const struct x86_dev_info lenovo_yt3_info;
 extern const struct x86_dev_info medion_lifetab_s10346_info;
 extern const struct x86_dev_info nextbook_ares8_info;
+extern const struct x86_dev_info nextbook_ares8a_info;
 extern const struct x86_dev_info peaq_c1010_info;
 extern const struct x86_dev_info whitelabel_tm800a550l_info;
 extern const struct x86_dev_info xiaomi_mipad2_info;