Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2300927pxb; Fri, 5 Feb 2021 14:20:11 -0800 (PST) X-Google-Smtp-Source: ABdhPJyZnwHV00lnIKYgRq4mgHfZ6AKQXbKWkOUclUWUWWzv0cAeZW5VqevkbDCyVHQPxJjJWuJW X-Received: by 2002:a17:906:ecb6:: with SMTP id qh22mr6191582ejb.252.1612563611279; Fri, 05 Feb 2021 14:20:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612563611; cv=none; d=google.com; s=arc-20160816; b=UccLEGs6txdjNwU1z5TcS79IBo4Tp8QESrTBg8AMIdn29taybJMx7dc9gMIhZFj+gV c4/3NtOZ+vQxGlxCJ0rYU18WRfC6zl6X/zuOtxxZ4b6JE9apzwBPwZYU8EpbFdh0wFAJ gGBWoA/rzWKDbz464rYTie8vfuGJDqvTC8ssbtrs9VAHr/vqk7Itua4P3qAt1jrJoLpX 3LJSvrsnn2e9fqnvu/0yaOdbWspW1uEEZlxKB3BQf7WBmvon9uZsRzn/VVr5NLWhOjT9 wfCeVbJ2CSUz8gh5xEC5UVEzeZPVVM4MU84pPL4ODgOvlvX8gPIdFI9i6H2ZpNU27Wof mH4Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=wGFSot5cZHiOyK1jNfOjhRiUjOw9qptA+Gtd3INekOI=; b=CWTX0RUirhewCApgrkAQ+DVGH61FLUDieUbaWF65JNkz0C06qU7VpvxSZH6JPaky1V AebmUT5VWsOHpnGJXKnd/Zy0m/0JjpDjF0/2yPcvutI83epJDjYNgRXfP+dgCP6aKfEH HsLdIas/RCnlxDwwyu3KX/PTjxejdmmEMe42GN0b0KDaG1XsjWv3YETGD1tPhZo415bC FmscSmiOMWi3S0w7GqoX02iAJbU/sHpb3Qh4bV+qkmCnPopKN/JTsJsFc/UNqummZ6Md +0rcI5e7K8uHm2Vkt4+J/W9zfgPAE2y3dh4HL8a1b+1VPzmFAbqWfWhdnENkV/7K27sc P1/Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=mMmnXmlU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s17si6187789edw.158.2021.02.05.14.19.46; Fri, 05 Feb 2021 14:20:11 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=mMmnXmlU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232591AbhBEWRl (ORCPT + 99 others); Fri, 5 Feb 2021 17:17:41 -0500 Received: from mail.kernel.org ([198.145.29.99]:44978 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232934AbhBEO5T (ORCPT ); Fri, 5 Feb 2021 09:57:19 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id D64A664FDB; Fri, 5 Feb 2021 14:09:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1612534190; bh=kakrejhfPEv7K2rdS/RUxludqWHupxO+eESYYZUmw+Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mMmnXmlU5uA5a4y8JrXPLFetbY0fJ9ymjYVkgHKzLS4yJTusD2+QBNlyECnCu8nxP naZJq3rL6hPOK0vrZW2NnaqyAkuCYGuQtAiNbytCwZLj25icDr/KWl3UD/ZpzBUqu+ ijeMavzwH1SLt55ZbFjX++b3UtToi/UELbHwgdy4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Bastien Nocera , Dmitry Torokhov , Hans de Goede , Sasha Levin Subject: [PATCH 5.10 21/57] platform/x86: touchscreen_dmi: Add swap-x-y quirk for Goodix touchscreen on Estar Beauty HD tablet Date: Fri, 5 Feb 2021 15:06:47 +0100 Message-Id: <20210205140656.883707295@linuxfoundation.org> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210205140655.982616732@linuxfoundation.org> References: <20210205140655.982616732@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Hans de Goede [ Upstream commit 46c54cf2706122c37497896d56d67b0c0aca2ede ] The Estar Beauty HD (MID 7316R) tablet uses a Goodix touchscreen, with the X and Y coordinates swapped compared to the LCD panel. Add a touchscreen_dmi entry for this adding a "touchscreen-swapped-x-y" device-property to the i2c-client instantiated for this device before the driver binds. This is the first entry of a Goodix touchscreen to touchscreen_dmi.c, so far DMI quirks for Goodix touchscreen's have been added directly to drivers/input/touchscreen/goodix.c. Currently there are 3 DMI tables in goodix.c: 1. rotated_screen[] for devices where the touchscreen is rotated 180 degrees vs the LCD panel 2. inverted_x_screen[] for devices where the X axis is inverted 3. nine_bytes_report[] for devices which use a non standard touch report size Arguably only 3. really needs to be inside the driver and the other 2 cases are better handled through the generic touchscreen DMI quirk mechanism from touchscreen_dmi.c, which allows adding device-props to any i2c-client. Esp. now that goodix.c is using the generic touchscreen_properties code. Alternative to the approach from this patch we could add a 4th dmi_system_id table for devices with swapped-x-y axis to goodix.c, but that seems undesirable. Cc: Bastien Nocera Cc: Dmitry Torokhov Signed-off-by: Hans de Goede Link: https://lore.kernel.org/r/20201224135158.10976-1-hdegoede@redhat.com Signed-off-by: Sasha Levin --- drivers/platform/x86/touchscreen_dmi.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/drivers/platform/x86/touchscreen_dmi.c b/drivers/platform/x86/touchscreen_dmi.c index 5783139d0a119..c4de932302d6b 100644 --- a/drivers/platform/x86/touchscreen_dmi.c +++ b/drivers/platform/x86/touchscreen_dmi.c @@ -263,6 +263,16 @@ static const struct ts_dmi_data digma_citi_e200_data = { .properties = digma_citi_e200_props, }; +static const struct property_entry estar_beauty_hd_props[] = { + PROPERTY_ENTRY_BOOL("touchscreen-swapped-x-y"), + { } +}; + +static const struct ts_dmi_data estar_beauty_hd_data = { + .acpi_name = "GDIX1001:00", + .properties = estar_beauty_hd_props, +}; + static const struct property_entry gp_electronic_t701_props[] = { PROPERTY_ENTRY_U32("touchscreen-size-x", 960), PROPERTY_ENTRY_U32("touchscreen-size-y", 640), @@ -942,6 +952,14 @@ const struct dmi_system_id touchscreen_dmi_table[] = { DMI_MATCH(DMI_BOARD_NAME, "Cherry Trail CR"), }, }, + { + /* Estar Beauty HD (MID 7316R) */ + .driver_data = (void *)&estar_beauty_hd_data, + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "Estar"), + DMI_MATCH(DMI_PRODUCT_NAME, "eSTAR BEAUTY HD Intel Quad core"), + }, + }, { /* GP-electronic T701 */ .driver_data = (void *)&gp_electronic_t701_data, -- 2.27.0