]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
cleaner
authorVladimir Serbinenko <phcoder@gmail.com>
Tue, 23 Feb 2016 09:19:26 +0000 (10:19 +0100)
committerVladimir Serbinenko <phcoder@gmail.com>
Tue, 23 Feb 2016 09:19:26 +0000 (10:19 +0100)
grub-core/term/arm/cros.c
grub-core/term/arm/cros_ec.c
grub-core/term/arm/cros_ec.h [deleted file]
include/grub/arm/cros_ec.h [new file with mode: 0644]

index d05b991795976a99383d08f7e5b848bd4ce3d4d6..7eb239907d87fcd8b80b2267821448562beac307 100644 (file)
@@ -26,7 +26,7 @@
 #include <grub/term.h>
 #include <grub/time.h>
 #include <grub/fdtbus.h>
-#include "cros_ec.h"
+#include <grub/cros_ec.h>
 
 struct grub_ps2_state ps2_state;
 
index 00b2a4bac47adb7d5e9273580dea96b1c2532a74..ce58e6c56e7c12560993d58304b6dc58ae134056 100644 (file)
  *  along with GRUB.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-#include "cros_ec.h"
 #include <grub/mm.h>
 #include <grub/time.h>
 #include <grub/misc.h>
-
-#define MIN(a,b) ((a) < (b) ? (a) : (b))
+#include <grub/cros_ec.h>
 
 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 (file)
index 95defbe..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-#include <grub/types.h>
-/*
- * 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 (file)
index 0000000..7c8a940
--- /dev/null
@@ -0,0 +1,16 @@
+#ifndef GRUB_ARM_CROS_EC_H
+#define GRUB_ARM_CROS_EC_H 1
+
+#include <grub/types.h>
+
+#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