From: Vladimir Serbinenko Date: Tue, 23 Feb 2016 09:19:26 +0000 (+0100) Subject: cleaner X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=74cef4ab78b87c393f4d99b03343c71e0f441029;p=thirdparty%2Fgrub.git cleaner --- diff --git a/grub-core/term/arm/cros.c b/grub-core/term/arm/cros.c index d05b99179..7eb239907 100644 --- a/grub-core/term/arm/cros.c +++ b/grub-core/term/arm/cros.c @@ -26,7 +26,7 @@ #include #include #include -#include "cros_ec.h" +#include struct grub_ps2_state ps2_state; diff --git a/grub-core/term/arm/cros_ec.c b/grub-core/term/arm/cros_ec.c index 00b2a4bac..ce58e6c56 100644 --- a/grub-core/term/arm/cros_ec.c +++ b/grub-core/term/arm/cros_ec.c @@ -18,12 +18,10 @@ * along with GRUB. If not, see . */ -#include "cros_ec.h" #include #include #include - -#define MIN(a,b) ((a) < (b) ? (a) : (b)) +#include static grub_uint64_t grub_get_time_us (void) @@ -260,7 +258,8 @@ static int ec_command(int cmd, int cmd_version, return din_len; } -int cros_ec_scan_keyboard(struct cros_ec_keyscan *scan) +int +grub_cros_ec_scan_keyboard(struct grub_cros_ec_keyscan *scan) { if (ec_command(EC_CMD_MKBP_STATE, 0, NULL, 0, scan, sizeof(*scan)) < (int)sizeof(*scan)) diff --git a/grub-core/term/arm/cros_ec.h b/grub-core/term/arm/cros_ec.h deleted file mode 100644 index 95defbeb1..000000000 --- a/grub-core/term/arm/cros_ec.h +++ /dev/null @@ -1,57 +0,0 @@ -#include -/* - * Hard-code the number of columns we happen to know we have right now. It - * would be more correct to call cros_ec_mkbp_info() at startup and determine - * the actual number of keyboard cols from there. - */ -#define CROS_EC_KEYSCAN_COLS 13 -#define CROS_EC_KEYSCAN_ROWS 8 - -/* Information returned by a key scan */ -struct cros_ec_keyscan { - grub_uint8_t data[CROS_EC_KEYSCAN_COLS]; -}; - -typedef struct CrosEcBusOps -{ - int (*init)(struct CrosEcBusOps *me); - - /** - * Send a command to a ChromeOS EC device and return the reply. - * - * The device's internal input/output buffers are used. - * - * @param bus ChromeOS EC bus ops - * @param cmd Command to send (EC_CMD_...) - * @param cmd_version Version of command to send (EC_VER_...) - * @param dout Output data (may be NULL If dout_len=0) - * @param dout_len Size of output data in bytes - * @param dinp Returns pointer to response data - * @param din_len Maximum size of response in bytes - * @return number of bytes in response, or -1 on error - */ - int (*send_command)(struct CrosEcBusOps *me, grub_uint8_t cmd, - int cmd_version, - const void *dout, grub_uint32_t dout_len, - void *din, grub_uint32_t din_len); - - int (*send_packet)(struct CrosEcBusOps *me, - const void *dout, grub_uint32_t dout_len, - void *din, grub_uint32_t din_len); - - /** - * Byte I/O functions. - * - * Read or write a sequence a bytes over the desired protocol. - * Used to support protocol variants - currently only implemented - * for LPC. - * - * @param data Read / write data buffer - * @param port I/O port - * @size Number of bytes to read / write - */ - void (*read)(grub_uint8_t *data, grub_uint16_t port, int size); - void (*write)(const grub_uint8_t *data, grub_uint16_t port, int size); -} CrosEcBusOps; - -int cros_ec_scan_keyboard(struct cros_ec_keyscan *scan); diff --git a/include/grub/arm/cros_ec.h b/include/grub/arm/cros_ec.h new file mode 100644 index 000000000..7c8a940e8 --- /dev/null +++ b/include/grub/arm/cros_ec.h @@ -0,0 +1,16 @@ +#ifndef GRUB_ARM_CROS_EC_H +#define GRUB_ARM_CROS_EC_H 1 + +#include + +#define GRUB_CROS_EC_KEYSCAN_COLS 13 +#define GRUB_CROS_EC_KEYSCAN_ROWS 8 + +struct grub_cros_ec_keyscan { + grub_uint8_t data[CROS_EC_KEYSCAN_COLS]; +}; + +int +grub_cros_ec_scan_keyboard(struct grub_cros_ec_keyscan *scan); + +#endif