kernel_optimize_test/include/linux/efi_embedded_fw.h
Hans de Goede 835e1b86ef 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 <andy.shevchenko@gmail.com>
Acked-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20200115163554.101315-10-hdegoede@redhat.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-03-20 14:57:54 +01:00

44 lines
1.1 KiB
C

/* SPDX-License-Identifier: GPL-2.0 */
#ifndef _LINUX_EFI_EMBEDDED_FW_H
#define _LINUX_EFI_EMBEDDED_FW_H
#include <linux/list.h>
#include <linux/mod_devicetable.h>
#define EFI_EMBEDDED_FW_PREFIX_LEN 8
/*
* This struct and efi_embedded_fw_list are private to the efi-embedded fw
* implementation they are in this header for use by lib/test_firmware.c only!
*/
struct efi_embedded_fw {
struct list_head list;
const char *name;
const u8 *data;
size_t length;
};
extern struct list_head efi_embedded_fw_list;
/**
* struct efi_embedded_fw_desc - This struct is used by the EFI embedded-fw
* code to search for embedded firmwares.
*
* @name: Name to register the firmware with if found
* @prefix: First 8 bytes of the firmware
* @length: Length of the firmware in bytes including prefix
* @sha256: SHA256 of the firmware
*/
struct efi_embedded_fw_desc {
const char *name;
u8 prefix[EFI_EMBEDDED_FW_PREFIX_LEN];
u32 length;
u8 sha256[32];
};
extern const struct dmi_system_id touchscreen_dmi_table[];
int efi_get_embedded_fw(const char *name, const u8 **dat, size_t *sz);
#endif