summaryrefslogtreecommitdiff
path: root/drivers/platform/x86/x86-android-tablets
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2023-02-21 22:52:58 +0100
committerHans de Goede <hdegoede@redhat.com>2023-03-07 12:08:31 +0100
commit9b1d2662b8c586eb10cb939c7ae2c25bb36d2b61 (patch)
treefcb377815c11a5a7456c9f06e8ea0496bd72dc95 /drivers/platform/x86/x86-android-tablets
parent772cbba5a877eb7c528f3659415373c40e48a057 (diff)
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
Diffstat (limited to 'drivers/platform/x86/x86-android-tablets')
-rw-r--r--drivers/platform/x86/x86-android-tablets/lenovo.c46
1 files changed, 46 insertions, 0 deletions
diff --git a/drivers/platform/x86/x86-android-tablets/lenovo.c b/drivers/platform/x86/x86-android-tablets/lenovo.c
index 290de07d8aa0..4ba4b1e8c7d0 100644
--- a/drivers/platform/x86/x86-android-tablets/lenovo.c
+++ b/drivers/platform/x86/x86-android-tablets/lenovo.c
@@ -12,6 +12,7 @@
#include <linux/efi.h>
#include <linux/gpio/machine.h>
+#include <linux/mfd/intel_soc_pmic.h>
#include <linux/pinctrl/consumer.h>
#include <linux/pinctrl/machine.h>
#include <linux/platform_data/lp855x.h>
@@ -334,6 +335,17 @@ static const struct software_node lenovo_yt3_bq25892_0_node = {
.properties = lenovo_yt3_bq25892_0_props,
};
+static const struct property_entry lenovo_yt3_hideep_ts_props[] = {
+ PROPERTY_ENTRY_U32("touchscreen-size-x", 1600),
+ PROPERTY_ENTRY_U32("touchscreen-size-y", 2560),
+ PROPERTY_ENTRY_U32("touchscreen-max-pressure", 255),
+ { }
+};
+
+static const struct software_node lenovo_yt3_hideep_ts_node = {
+ .properties = lenovo_yt3_hideep_ts_props,
+};
+
static const struct x86_i2c_client_info lenovo_yt3_i2c_clients[] __initconst = {
{
/* bq27500 fuel-gauge for the flat lipo battery behind the screen */
@@ -369,6 +381,22 @@ static const struct x86_i2c_client_info lenovo_yt3_i2c_clients[] __initconst = {
.swnode = &fg_bq25890_1_supply_node,
},
.adapter_path = "\\_SB_.PCI0.I2C2",
+ }, {
+ /* HiDeep IST520E Touchscreen */
+ .board_info = {
+ .type = "hideep_ts",
+ .addr = 0x6c,
+ .dev_name = "hideep_ts",
+ .swnode = &lenovo_yt3_hideep_ts_node,
+ },
+ .adapter_path = "\\_SB_.PCI0.I2C6",
+ .irq_data = {
+ .type = X86_ACPI_IRQ_TYPE_GPIOINT,
+ .chip = "INT33FF:03",
+ .index = 77,
+ .trigger = ACPI_LEVEL_SENSITIVE,
+ .polarity = ACPI_ACTIVE_LOW,
+ },
}
};
@@ -409,11 +437,29 @@ static int __init lenovo_yt3_init(void)
gpiod_set_value(gpiod, 0);
+ /* Enable the regulators used by the touchscreen */
+ intel_soc_pmic_exec_mipi_pmic_seq_element(0x6e, 0x9b, 0x02, 0xff);
+ intel_soc_pmic_exec_mipi_pmic_seq_element(0x6e, 0xa0, 0x02, 0xff);
+
return 0;
}
+static struct gpiod_lookup_table lenovo_yt3_hideep_gpios = {
+ .dev_id = "i2c-hideep_ts",
+ .table = {
+ GPIO_LOOKUP("INT33FF:00", 7, "reset", GPIO_ACTIVE_LOW),
+ { }
+ },
+};
+
+static struct gpiod_lookup_table * const lenovo_yt3_gpios[] = {
+ &lenovo_yt3_hideep_gpios,
+ NULL
+};
+
const struct x86_dev_info lenovo_yt3_info __initconst = {
.i2c_client_info = lenovo_yt3_i2c_clients,
.i2c_client_count = ARRAY_SIZE(lenovo_yt3_i2c_clients),
+ .gpiod_lookup_tables = lenovo_yt3_gpios,
.init = lenovo_yt3_init,
};