Skip to content

Commit 835e1b8

Browse files
jwrdegoedegregkh
authored andcommitted
platform/x86: touchscreen_dmi: Add EFI embedded firmware info support
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 <[email protected]> Acked-by: Ard Biesheuvel <[email protected]> Signed-off-by: Hans de Goede <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 85bfb4a commit 835e1b8

File tree

4 files changed

+46
-1
lines changed

4 files changed

+46
-1
lines changed

drivers/firmware/efi/embedded-firmware.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ EXPORT_SYMBOL_GPL(efi_embedded_fw_list);
2121
static bool checked_for_fw;
2222

2323
static const struct dmi_system_id * const embedded_fw_table[] = {
24+
#ifdef CONFIG_TOUCHSCREEN_DMI
25+
touchscreen_dmi_table,
26+
#endif
2427
NULL
2528
};
2629

drivers/platform/x86/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1252,6 +1252,7 @@ config INTEL_TURBO_MAX_3
12521252
config TOUCHSCREEN_DMI
12531253
bool "DMI based touchscreen configuration info"
12541254
depends on ACPI && DMI && I2C=y && TOUCHSCREEN_SILEAD
1255+
select EFI_EMBEDDED_FIRMWARE if EFI
12551256
---help---
12561257
Certain ACPI based tablets with e.g. Silead or Chipone touchscreens
12571258
do not have enough data in ACPI tables for the touchscreen driver to

drivers/platform/x86/touchscreen_dmi.c

Lines changed: 40 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,15 @@
1111
#include <linux/acpi.h>
1212
#include <linux/device.h>
1313
#include <linux/dmi.h>
14+
#include <linux/efi_embedded_fw.h>
1415
#include <linux/i2c.h>
1516
#include <linux/notifier.h>
1617
#include <linux/property.h>
1718
#include <linux/string.h>
1819

1920
struct ts_dmi_data {
21+
/* The EFI embedded-fw code expects this to be the first member! */
22+
struct efi_embedded_fw_desc embedded_fw;
2023
const char *acpi_name;
2124
const struct property_entry *properties;
2225
};
@@ -64,6 +67,15 @@ static const struct property_entry chuwi_hi8_pro_props[] = {
6467
};
6568

6669
static const struct ts_dmi_data chuwi_hi8_pro_data = {
70+
.embedded_fw = {
71+
.name = "silead/gsl3680-chuwi-hi8-pro.fw",
72+
.prefix = { 0xf0, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00 },
73+
.length = 39864,
74+
.sha256 = { 0xc0, 0x88, 0xc5, 0xef, 0xd1, 0x70, 0x77, 0x59,
75+
0x4e, 0xe9, 0xc4, 0xd8, 0x2e, 0xcd, 0xbf, 0x95,
76+
0x32, 0xd9, 0x03, 0x28, 0x0d, 0x48, 0x9f, 0x92,
77+
0x35, 0x37, 0xf6, 0x8b, 0x2a, 0xe4, 0x73, 0xff },
78+
},
6779
.acpi_name = "MSSL1680:00",
6880
.properties = chuwi_hi8_pro_props,
6981
};
@@ -181,6 +193,15 @@ static const struct property_entry cube_iwork8_air_props[] = {
181193
};
182194

183195
static const struct ts_dmi_data cube_iwork8_air_data = {
196+
.embedded_fw = {
197+
.name = "silead/gsl3670-cube-iwork8-air.fw",
198+
.prefix = { 0xf0, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00 },
199+
.length = 38808,
200+
.sha256 = { 0xff, 0x62, 0x2d, 0xd1, 0x8a, 0x78, 0x04, 0x7b,
201+
0x33, 0x06, 0xb0, 0x4f, 0x7f, 0x02, 0x08, 0x9c,
202+
0x96, 0xd4, 0x9f, 0x04, 0xe1, 0x47, 0x25, 0x25,
203+
0x60, 0x77, 0x41, 0x33, 0xeb, 0x12, 0x82, 0xfc },
204+
},
184205
.acpi_name = "MSSL1680:00",
185206
.properties = cube_iwork8_air_props,
186207
};
@@ -387,6 +408,15 @@ static const struct property_entry onda_v80_plus_v3_props[] = {
387408
};
388409

389410
static const struct ts_dmi_data onda_v80_plus_v3_data = {
411+
.embedded_fw = {
412+
.name = "silead/gsl3676-onda-v80-plus-v3.fw",
413+
.prefix = { 0xf0, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00 },
414+
.length = 37224,
415+
.sha256 = { 0x8f, 0xbd, 0x8f, 0x0c, 0x6b, 0xba, 0x5b, 0xf5,
416+
0xa3, 0xc7, 0xa3, 0xc0, 0x4f, 0xcd, 0xdf, 0x32,
417+
0xcc, 0xe4, 0x70, 0xd6, 0x46, 0x9c, 0xd7, 0xa7,
418+
0x4b, 0x82, 0x3f, 0xab, 0xc7, 0x90, 0xea, 0x23 },
419+
},
390420
.acpi_name = "MSSL1680:00",
391421
.properties = onda_v80_plus_v3_props,
392422
};
@@ -449,6 +479,15 @@ static const struct property_entry pipo_w2s_props[] = {
449479
};
450480

451481
static const struct ts_dmi_data pipo_w2s_data = {
482+
.embedded_fw = {
483+
.name = "silead/gsl1680-pipo-w2s.fw",
484+
.prefix = { 0xf0, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00 },
485+
.length = 39072,
486+
.sha256 = { 0xd0, 0x58, 0xc4, 0x7d, 0x55, 0x2d, 0x62, 0x18,
487+
0xd1, 0x6a, 0x71, 0x73, 0x0b, 0x3f, 0xbe, 0x60,
488+
0xbb, 0x45, 0x8c, 0x52, 0x27, 0xb7, 0x18, 0xf4,
489+
0x31, 0x00, 0x6a, 0x49, 0x76, 0xd8, 0x7c, 0xd3 },
490+
},
452491
.acpi_name = "MSSL1680:00",
453492
.properties = pipo_w2s_props,
454493
};
@@ -641,7 +680,7 @@ static const struct ts_dmi_data trekstor_surftab_wintron70_data = {
641680
};
642681

643682
/* NOTE: Please keep this table sorted alphabetically */
644-
static const struct dmi_system_id touchscreen_dmi_table[] = {
683+
const struct dmi_system_id touchscreen_dmi_table[] = {
645684
{
646685
/* Chuwi Hi8 */
647686
.driver_data = (void *)&chuwi_hi8_data,

include/linux/efi_embedded_fw.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ struct efi_embedded_fw_desc {
3636
u8 sha256[32];
3737
};
3838

39+
extern const struct dmi_system_id touchscreen_dmi_table[];
40+
3941
int efi_get_embedded_fw(const char *name, const u8 **dat, size_t *sz);
4042

4143
#endif

0 commit comments

Comments
 (0)