Received: by 10.192.165.148 with SMTP id m20csp2596276imm; Sun, 29 Apr 2018 02:37:02 -0700 (PDT) X-Google-Smtp-Source: AB8JxZq7Y0nLp4xjho/CpkvY+ptF1WI4i29rCSW/JOy9I6LD7wcHh1wyXGG8bsjuVoQOO2+FDQql X-Received: by 2002:a17:902:6bca:: with SMTP id m10-v6mr8647990plt.6.1524994622213; Sun, 29 Apr 2018 02:37:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524994622; cv=none; d=google.com; s=arc-20160816; b=xsjuLr2+0FhYwuzMV/8JLVylRocNBaBfvr+TnIJwgbRYnIBeLO2go3IPtGKfOb+br4 ohqccQ3E+D0WTIU863rEa/ei2deK0OoQoyXhmfzAgWR7d/Q8N4oxSbzGZLYh7MPtXWXH VN5FOjbu+4Ox5zZoNoy4vzZwqYf+PTx6bFTGr5sQrE0uY+sdJJoJ4eYlt0qBuQF/tr9Y nmGaHb3S0wGjPpXdV2ZOAOHTZZCQo2sjL61SLXyI6I2ofPc6B8ay7Knv4dVXLCS5Ocwh BQ3Hje+3lt4WANQTSOCX7d2sQrAyM9fUJtKSVq9K9J7GVE8Qj7AoJFhnoUj0J+i6Mis9 0pLQ== 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=EdVL2eVDaMv845+e8bmrwTyrGFN4p8h9ipa0nn4qqkY=; b=uPVqxz9oxkyAXAdNj7q8um8hb1x5/zQitLGWuRPBPN5+l/CIgav9h/ygg4BREpm+5b gZ/0OL5kbOgQgJTbqOMZxy/nnWRDwoYBt67RSpDfLIcHpXQoIyMsxyqHkeszyvLhvnof vWATOM1g9/JYdWQZRZn+UMIq+4k6TqU3b1aNMOH0304B5yUbpd3Jxsh/RLKaaO3Ror9k 4qayKfHSK/tL49TIf7rOPWKJXuiB5fAna/ONiaW5gMPFpDAvyiEsdTgIEAP7nNpFwoCT j1L3yc7q1EKg6uA8nZKCx8ICq+LezjHQ6h6DkBKIZzkiXAaNf0HCqgmKp6GXSHLZc47e vZSg== 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 p88si5409573pfk.134.2018.04.29.02.36.43; Sun, 29 Apr 2018 02:37:02 -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 S1753314AbeD2JgY (ORCPT + 99 others); Sun, 29 Apr 2018 05:36:24 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:52868 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753167AbeD2JgS (ORCPT ); Sun, 29 Apr 2018 05:36:18 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id CA301427097F; Sun, 29 Apr 2018 09:36:17 +0000 (UTC) Received: from shalem.localdomain.com (ovpn-116-27.ams2.redhat.com [10.36.116.27]) by smtp.corp.redhat.com (Postfix) with ESMTP id 933C7215CDA7; Sun, 29 Apr 2018 09:36:14 +0000 (UTC) From: Hans de Goede To: Ard Biesheuvel , "Luis R . Rodriguez" , Greg Kroah-Hartman , Thomas Gleixner , Ingo Molnar , "H . Peter Anvin" Cc: Hans de Goede , Peter Jones , Dave Olsthoorn , Will Deacon , Andy Lutomirski , Matt Fleming , David Howells , Mimi Zohar , Josh Triplett , dmitry.torokhov@gmail.com, mfuzzey@parkeon.com, Kalle Valo , Arend Van Spriel , Linus Torvalds , nbroeking@me.com, bjorn.andersson@linaro.org, Torsten Duwe , Kees Cook , x86@kernel.org, linux-efi@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v5 4/5] platform/x86: touchscreen_dmi: Add EFI embedded firmware info support Date: Sun, 29 Apr 2018 11:35:57 +0200 Message-Id: <20180429093558.5411-5-hdegoede@redhat.com> In-Reply-To: <20180429093558.5411-1-hdegoede@redhat.com> References: <20180429093558.5411-1-hdegoede@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.7]); Sun, 29 Apr 2018 09:36:17 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.7]); Sun, 29 Apr 2018 09:36:17 +0000 (UTC) for IP:'10.11.54.6' DOMAIN:'int-mx06.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. Acked-by: Andy Shevchenko Acked-by: Ard Biesheuvel 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 22a0f598b53d..36a93a6938f0 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 7ff206e5edfe..cc4d95459190 100644 --- a/drivers/platform/x86/Kconfig +++ b/drivers/platform/x86/Kconfig @@ -1199,6 +1199,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 ---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