6b5bc77c9b
Stefan thinks they don't add value. Command used: sed -i -e '/file is part of /d' $(git grep "file is part of " |egrep ":( */\*.*\*/\$|#|;#|-- | *\* )" | cut -d: -f1 |grep -v crossgcc |grep -v gcov | grep -v /elf.h |grep -v nvramtool) The exceptions are for: - crossgcc (patch file) - gcov (imported from gcc) - elf.h (imported from GNU's libc) - nvramtool (more complicated header) The removed lines are: - fmt.Fprintln(f, "/* This file is part of the coreboot project. */") -# This file is part of a set of unofficial pre-commit hooks available -/* This file is part of coreboot */ -# This file is part of msrtool. -/* This file is part of msrtool. */ - * This file is part of ncurses, designed to be appended after curses.h.in -/* This file is part of pgtblgen. */ - * This file is part of the coreboot project. - /* This file is part of the coreboot project. */ -# This file is part of the coreboot project. -# This file is part of the coreboot project. -## This file is part of the coreboot project. --- This file is part of the coreboot project. -/* This file is part of the coreboot project */ -/* This file is part of the coreboot project. */ -;## This file is part of the coreboot project. -# This file is part of the coreboot project. It originated in the - * This file is part of the coreinfo project. -## This file is part of the coreinfo project. - * This file is part of the depthcharge project. -/* This file is part of the depthcharge project. */ -/* This file is part of the ectool project. */ - * This file is part of the GNU C Library. - * This file is part of the libpayload project. -## This file is part of the libpayload project. -/* This file is part of the Linux kernel. */ -## This file is part of the superiotool project. -/* This file is part of the superiotool project */ -/* This file is part of uio_usbdebug */ Change-Id: I82d872b3b337388c93d5f5bf704e9ee9e53ab3a9 Signed-off-by: Patrick Georgi <pgeorgi@google.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/41194 Reviewed-by: HAOUAS Elyes <ehaouas@noos.fr> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
51 lines
1.5 KiB
C
51 lines
1.5 KiB
C
/* SPDX-License-Identifier: GPL-2.0-only */
|
|
|
|
#include <acpi/acpigen.h>
|
|
#include <acpi/acpigen_dsm.h>
|
|
|
|
/* ------------------- I2C HID DSM ---------------------------- */
|
|
|
|
#define ACPI_DSM_I2C_HID_UUID "3CDFF6F7-4267-4555-AD05-B30A3D8938DE"
|
|
|
|
static void i2c_hid_func0_cb(void *arg)
|
|
{
|
|
/* ToInteger (Arg1, Local2) */
|
|
acpigen_write_to_integer(ARG1_OP, LOCAL2_OP);
|
|
/* If (LEqual (Local2, 0x0)) */
|
|
acpigen_write_if_lequal_op_int(LOCAL2_OP, 0x0);
|
|
/* Return (Buffer (One) { 0x1f }) */
|
|
acpigen_write_return_singleton_buffer(0x1f);
|
|
acpigen_pop_len(); /* Pop : If */
|
|
/* Else */
|
|
acpigen_write_else();
|
|
/* If (LEqual (Local2, 0x1)) */
|
|
acpigen_write_if_lequal_op_int(LOCAL2_OP, 0x1);
|
|
/* Return (Buffer (One) { 0x3f }) */
|
|
acpigen_write_return_singleton_buffer(0x3f);
|
|
acpigen_pop_len(); /* Pop : If */
|
|
/* Else */
|
|
acpigen_write_else();
|
|
/* Return (Buffer (One) { 0x0 }) */
|
|
acpigen_write_return_singleton_buffer(0x0);
|
|
acpigen_pop_len(); /* Pop : Else */
|
|
acpigen_pop_len(); /* Pop : Else */
|
|
}
|
|
|
|
static void i2c_hid_func1_cb(void *arg)
|
|
{
|
|
struct dsm_i2c_hid_config *config = arg;
|
|
acpigen_write_return_byte(config->hid_desc_reg_offset);
|
|
}
|
|
|
|
static void (*i2c_hid_callbacks[2])(void *) = {
|
|
i2c_hid_func0_cb,
|
|
i2c_hid_func1_cb,
|
|
};
|
|
|
|
void acpigen_write_dsm_i2c_hid(struct dsm_i2c_hid_config *config)
|
|
{
|
|
acpigen_write_dsm(ACPI_DSM_I2C_HID_UUID, i2c_hid_callbacks,
|
|
ARRAY_SIZE(i2c_hid_callbacks), config);
|
|
}
|
|
|
|
/* ------------------- End: I2C HID DSM ------------------------- */
|