Files
OpenCellular/include/i8042.h
Randall Spangler 090e4f5f8e Clean up i8042 module
Remove unused code paths.  Simplify interfaces.  Clarify comments.
Split the protocol constants into their own header file (since they're
used only by keyboard.c, not i8042.c, which is really keyboard
buffering... and will be renamed so in a followup CL.)

This cleanup reduces binary size by about 200 bytes.

BUG=chrome-os-partner:15579
BRANCH=none
TEST=type on the keyboard; it should still work.

Change-Id: I6acbab5fe5604b4b0c516ba3622e6f41820985d1
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/36271
2012-10-23 17:32:01 -07:00

48 lines
1.2 KiB
C

/* Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*
* i8042 keyboard protocol
*/
#ifndef __CROS_EC_I8042_H
#define __CROS_EC_I8042_H
#include "common.h"
/**
* Flush and reset all i8042 keyboard buffers.
*/
void i8042_flush_buffer(void);
/**
* Notify the i8042 module when a byte is written by the host.
*
* Note: This is called in interrupt context by the LPC interrupt handler.
*
* @param data Byte written by host
* @param is_cmd Is byte command (!=0) or data (0)
*/
void i8042_receive(int data, int is_cmd);
/**
* Enable keyboard IRQ generation.
*
* @param enable Enable (!=0) or disable (0) IRQ generation.
*/
void i8042_enable_keyboard_irq(int enable);
/**
* Send a scan code to the host.
*
* The EC lib will push the scan code bytes to host via port 0x60 and assert
* the IBF flag to trigger an interrupt. The EC lib must queue them if the
* host cannot read the previous byte away in time.
*
* @param len Number of bytes to send to the host
* @param to_host Data to send
*/
void i8042_send_to_host(int len, const uint8_t *to_host);
#endif /* __CROS_EC_I8042_H */