Commit 09dd99dd authored by Hans de Goede's avatar Hans de Goede
Browse files

platform/x86: x86-android-tablets: Add Nextbook Ares 8 data



The Nextbook Ares 8 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.

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/20220205191356.225505-6-hdegoede@redhat.com
parent fdac7c8a
Loading
Loading
Loading
Loading
+87 −1
Original line number Diff line number Diff line
@@ -669,6 +669,84 @@ static const struct x86_dev_info czc_p10t __initconst = {
	.init = czc_p10t_init,
};

/* Nextbook Ares 8 tablets have an Android factory img with everything hardcoded */
static const char * const nextbook_ares8_accel_mount_matrix[] = {
	"0", "-1", "0",
	"-1", "0", "0",
	"0", "0", "1"
};

static const struct property_entry nextbook_ares8_accel_props[] = {
	PROPERTY_ENTRY_STRING_ARRAY("mount-matrix", nextbook_ares8_accel_mount_matrix),
	{ }
};

static const struct software_node nextbook_ares8_accel_node = {
	.properties = nextbook_ares8_accel_props,
};

static const struct property_entry nextbook_ares8_touchscreen_props[] = {
	PROPERTY_ENTRY_U32("touchscreen-size-x", 800),
	PROPERTY_ENTRY_U32("touchscreen-size-y", 1280),
	{ }
};

static const struct software_node nextbook_ares8_touchscreen_node = {
	.properties = nextbook_ares8_touchscreen_props,
};

static const struct x86_i2c_client_info nextbook_ares8_i2c_clients[] __initconst = {
	{
		/* Freescale MMA8653FC accel */
		.board_info = {
			.type = "mma8653",
			.addr = 0x1d,
			.dev_name = "mma8653",
			.swnode = &nextbook_ares8_accel_node,
		},
		.adapter_path = "\\_SB_.I2C3",
	}, {
		/* FT5416DQ9 touchscreen controller */
		.board_info = {
			.type = "edt-ft5x06",
			.addr = 0x38,
			.dev_name = "ft5416",
			.swnode = &nextbook_ares8_touchscreen_node,
		},
		.adapter_path = "\\_SB_.I2C4",
		.irq_data = {
			.type = X86_ACPI_IRQ_TYPE_GPIOINT,
			.chip = "INT33FC:02",
			.index = 3,
			.trigger = ACPI_EDGE_SENSITIVE,
			.polarity = ACPI_ACTIVE_LOW,
		},
	},
};

static struct gpiod_lookup_table nextbook_ares8_int3496_gpios = {
	.dev_id = "intel-int3496",
	.table = {
		GPIO_LOOKUP("INT33FC:02", 1, "mux", GPIO_ACTIVE_HIGH),
		GPIO_LOOKUP("INT33FC:02", 18, "id", GPIO_ACTIVE_HIGH),
		{ }
	},
};

static struct gpiod_lookup_table * const nextbook_ares8_gpios[] = {
	&nextbook_ares8_int3496_gpios,
	NULL
};

static const struct x86_dev_info nextbook_ares8_info __initconst = {
	.i2c_client_info = nextbook_ares8_i2c_clients,
	.i2c_client_count = ARRAY_SIZE(nextbook_ares8_i2c_clients),
	.pdev_info = int3496_pdevs,
	.pdev_count = ARRAY_SIZE(int3496_pdevs),
	.gpiod_lookup_tables = nextbook_ares8_gpios,
	.invalid_aei_gpiochip = "INT33FC:02",
};

/*
 * Whitelabel (sold as various brands) TM800A550L tablets.
 * These tablet's DSDT contains a whole bunch of bogus ACPI I2C devices
@@ -830,7 +908,7 @@ static const struct dmi_system_id x86_android_tablet_ids[] __initconst = {
		.driver_data = (void *)&czc_p10t,
	},
	{
		/* A variant of CZC P10T */
		/* CZC P10T variant */
		.ident = "ViewSonic ViewPad 10",
		.matches = {
			DMI_MATCH(DMI_SYS_VENDOR, "ViewSonic"),
@@ -838,6 +916,14 @@ static const struct dmi_system_id x86_android_tablet_ids[] __initconst = {
		},
		.driver_data = (void *)&czc_p10t,
	},
	{
		/* Nextbook Ares 8 */
		.matches = {
			DMI_MATCH(DMI_SYS_VENDOR, "Insyde"),
			DMI_MATCH(DMI_PRODUCT_NAME, "M890BAP"),
		},
		.driver_data = (void *)&nextbook_ares8_info,
	},
	{
		/* Whitelabel (sold as various brands) TM800A550L */
		.matches = {