Received: by 10.213.65.68 with SMTP id h4csp1829359imn; Sun, 8 Apr 2018 12:25:01 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/mBWm+zW08OIQb4pQQxz1CBMSqApAGNN3sTD6FK53taO9qNEU21GicJRd+CwnWq11aF8NH X-Received: by 2002:a17:902:be12:: with SMTP id r18-v6mr33390987pls.173.1523215501055; Sun, 08 Apr 2018 12:25:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523215501; cv=none; d=google.com; s=arc-20160816; b=Bwj/MlMiB5W4X2K6Umx6dw1ZeBdqOilH1OHtKlxqUAZW6u8OjBvs/MzsrTvVBjwrMu amr8XT3gZICUjiBDmafpmdsA6Iphy/OwLrDf5FtkwdWj3BV1nCbhe2lWxT1Ctr4fWT3q xNWOhQSuNORbVeGNH4f0XPB2YGybubxCl/bypLrWLot/WjXRtUghCWsmsDY+GiSbJk3J sN0OLxR4dR0I4XgghK5fqQlTvv6kzr4eN2IJKZk2PYG/SoEkjwCssqpkXZCmmJOLCoEK PC/15SWoiD6rUTaF7lMY2qFyjmnUeZPkZpHsdMPG3ke4h+z1uJiRvH3nBiIZSHRvFSoN bDIw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=o8OWddkfZw9kHBH3b1XRQegi+Y+8UbSQCju6rw1FuRQ=; b=0i5lj948yR4VmSReYcAftvB3u5wb52weO8kpdPVY0Lr5Sf6hJ2BRrUMtlRMmlFmEXw 02zkcmvwEqnwtucmulEDtb5zXh+pKTv4qxtYONpDiK7ct82uOlRd2GvPvbZ1i9LALeD+ cqeOIacuU9X7y8QwA7xyBH6NUPF20T8WumI0zzUtZWH1Yw9Orq6SSmbUxj370/asOkas kvljil1i01ryALB2Yj6ZZVNCEKa4/mH1x73NueYWtm1stB4+br7b2A8TDYMiNa5Tmq0x 2hFLogGZYTiSgRfH+BU8e0vey/e4gNoU80SA4DuHApOnfkyF2F/KB6/Qp2VRuIUAHVlF gMMA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z2-v6si3015448plk.94.2018.04.08.12.23.53; Sun, 08 Apr 2018 12:25:01 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752830AbeDHRkk (ORCPT + 99 others); Sun, 8 Apr 2018 13:40:40 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:54576 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752790AbeDHRkf (ORCPT ); Sun, 8 Apr 2018 13:40:35 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 9D67A81A88C2; Sun, 8 Apr 2018 17:40:34 +0000 (UTC) Received: from shalem.localdomain.com (ovpn-116-39.ams2.redhat.com [10.36.116.39]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0D6C87C47; Sun, 8 Apr 2018 17:40:30 +0000 (UTC) From: Hans de Goede To: Darren Hart , Andy Shevchenko , Ard Biesheuvel , "Luis R . Rodriguez" , Greg Kroah-Hartman , Thomas Gleixner , Ingo Molnar , "H . Peter Anvin" Cc: Hans de Goede , platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org, Peter Jones , Dave Olsthoorn , Will Deacon , Andy Lutomirski , Matt Fleming , David Howells , Mimi Zohar , Josh Triplett , dmitry.torokhov@gmail.com, mfuzzey@parkeon.com, keescook@chromium.org, Kalle Valo , Arend Van Spriel , Linus Torvalds , nbroeking@me.com, bjorn.andersson@linaro.org, Torsten Duwe , x86@kernel.org, linux-efi@vger.kernel.org Subject: [PATCH v3 4/5] platform/x86: touchscreen_dmi: Add EFI embedded firmware info support Date: Sun, 8 Apr 2018 19:40:13 +0200 Message-Id: <20180408174014.21908-5-hdegoede@redhat.com> In-Reply-To: <20180408174014.21908-1-hdegoede@redhat.com> References: <20180408174014.21908-1-hdegoede@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.8]); Sun, 08 Apr 2018 17:40:34 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.8]); Sun, 08 Apr 2018 17:40:34 +0000 (UTC) for IP:'10.11.54.5' DOMAIN:'int-mx05.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'hdegoede@redhat.com' RCPT:'' Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Sofar we have been unable to get permission from the vendors to put the firmware for touchscreens listed in touchscreen_dmi in linux-firmware. Some of the tablets with such a touchscreen have a touchscreen driver, and thus a copy of the firmware, as part of their EFI code. This commit adds the necessary info for the new EFI embedded-firmware code to extract these firmwares, making the touchscreen work OOTB without the user needing to manually add the firmware. Signed-off-by: Hans de Goede --- drivers/firmware/efi/embedded-firmware.c | 3 +++ drivers/platform/x86/Kconfig | 1 + drivers/platform/x86/touchscreen_dmi.c | 26 +++++++++++++++++++++++- include/linux/efi_embedded_fw.h | 2 ++ 4 files changed, 31 insertions(+), 1 deletion(-) diff --git a/drivers/firmware/efi/embedded-firmware.c b/drivers/firmware/efi/embedded-firmware.c index cb57225a340d..26101ac1a282 100644 --- a/drivers/firmware/efi/embedded-firmware.c +++ b/drivers/firmware/efi/embedded-firmware.c @@ -23,6 +23,9 @@ struct embedded_fw { static LIST_HEAD(found_fw_list); static const struct dmi_system_id * const embedded_fw_table[] = { +#ifdef CONFIG_TOUCHSCREEN_DMI + touchscreen_dmi_table, +#endif NULL }; diff --git a/drivers/platform/x86/Kconfig b/drivers/platform/x86/Kconfig index b836576f0fe4..5bb0f5edd7f2 100644 --- a/drivers/platform/x86/Kconfig +++ b/drivers/platform/x86/Kconfig @@ -1197,6 +1197,7 @@ config INTEL_TURBO_MAX_3 config TOUCHSCREEN_DMI bool "DMI based touchscreen configuration info" depends on ACPI && DMI && I2C=y && TOUCHSCREEN_SILEAD + select EFI_EMBEDDED_FIRMWARE if EFI_STUB ---help--- Certain ACPI based tablets with e.g. Silead or Chipone touchscreens do not have enough data in ACPI tables for the touchscreen driver to diff --git a/drivers/platform/x86/touchscreen_dmi.c b/drivers/platform/x86/touchscreen_dmi.c index 87fc839b28f7..6488cd50ba79 100644 --- a/drivers/platform/x86/touchscreen_dmi.c +++ b/drivers/platform/x86/touchscreen_dmi.c @@ -15,12 +15,15 @@ #include #include #include +#include #include #include #include #include struct ts_dmi_data { + /* The EFI embedded-fw code expects this to be the first member! */ + struct efi_embedded_fw_desc embedded_fw; const char *acpi_name; const struct property_entry *properties; }; @@ -31,10 +34,17 @@ static const struct property_entry cube_iwork8_air_props[] = { PROPERTY_ENTRY_BOOL("touchscreen-swapped-x-y"), PROPERTY_ENTRY_STRING("firmware-name", "gsl3670-cube-iwork8-air.fw"), PROPERTY_ENTRY_U32("silead,max-fingers", 10), + PROPERTY_ENTRY_BOOL("efi-embedded-firmware"), { } }; static const struct ts_dmi_data cube_iwork8_air_data = { + .embedded_fw = { + .name = "silead/gsl3670-cube-iwork8-air.fw", + .prefix = { 0xf0, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00 }, + .length = 38808, + .crc = 0xfecde51f, + }, .acpi_name = "MSSL1680:00", .properties = cube_iwork8_air_props, }; @@ -119,10 +129,17 @@ static const struct property_entry pipo_w2s_props[] = { PROPERTY_ENTRY_BOOL("touchscreen-swapped-x-y"), PROPERTY_ENTRY_STRING("firmware-name", "gsl1680-pipo-w2s.fw"), + PROPERTY_ENTRY_BOOL("efi-embedded-firmware"), { } }; static const struct ts_dmi_data pipo_w2s_data = { + .embedded_fw = { + .name = "silead/gsl1680-pipo-w2s.fw", + .prefix = { 0xf0, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00 }, + .length = 39072, + .crc = 0x28d5dc6c, + }, .acpi_name = "MSSL1680:00", .properties = pipo_w2s_props, }; @@ -162,10 +179,17 @@ static const struct property_entry chuwi_hi8_pro_props[] = { PROPERTY_ENTRY_BOOL("touchscreen-swapped-x-y"), PROPERTY_ENTRY_STRING("firmware-name", "gsl3680-chuwi-hi8-pro.fw"), PROPERTY_ENTRY_BOOL("silead,home-button"), + PROPERTY_ENTRY_BOOL("efi-embedded-firmware"), { } }; static const struct ts_dmi_data chuwi_hi8_pro_data = { + .embedded_fw = { + .name = "silead/gsl3680-chuwi-hi8-pro.fw", + .prefix = { 0xf0, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00 }, + .length = 39864, + .crc = 0xfe2bedba, + }, .acpi_name = "MSSL1680:00", .properties = chuwi_hi8_pro_props, }; @@ -277,7 +301,7 @@ static const struct ts_dmi_data teclast_x3_plus_data = { .properties = teclast_x3_plus_props, }; -static const struct dmi_system_id touchscreen_dmi_table[] = { +const struct dmi_system_id touchscreen_dmi_table[] = { { /* CUBE iwork8 Air */ .driver_data = (void *)&cube_iwork8_air_data, diff --git a/include/linux/efi_embedded_fw.h b/include/linux/efi_embedded_fw.h index 0f7d4df3f57a..4c8cfe38ec02 100644 --- a/include/linux/efi_embedded_fw.h +++ b/include/linux/efi_embedded_fw.h @@ -20,6 +20,8 @@ struct efi_embedded_fw_desc { u32 crc; }; +extern const struct dmi_system_id touchscreen_dmi_table[]; + int efi_get_embedded_fw(const char *name, void **dat, size_t *sz, size_t msize); #endif -- 2.17.0