Files
OpenCellular/include/lpc.h
Vincent Palatin 87d3707f62 Slightly update the host commands API
Preparatory work to use common host command code between ARM and x86.

Every command sends back explicitly the size of the response payload.
The size of the response defaults to 0 ond can be updated.

Add a protocol version number returned as command 0x00 to help with
backward compatibility.

move a couple of function from lpc specific header to host commands to
be able to implement them for the I2C link.

Signed-off-by: Vincent Palatin <vpalatin@chromium.org>

BUG=chrome-os-partner:9614
TEST=make BOARD=link

Change-Id: I6a28edf02996ddf6b7f32a3831d07d5f0271848f
2012-05-14 23:33:21 +00:00

60 lines
1.7 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.
*/
/* LPC module for Chrome EC */
#ifndef __CROS_EC_LPC_H
#define __CROS_EC_LPC_H
#include "common.h"
/* Manually generate an IRQ to host.
* Note that the irq_num == 0 would set the AH bit (Active High).
*/
void lpc_manual_irq(int irq_num);
/* Return a pointer to the memory-mapped buffer. This buffer is writable at
* any time, and the host can read it at any time. */
uint8_t *lpc_get_memmap_range(void);
/* Return true if the TOH is still set */
int lpc_keyboard_has_char(void);
/* Send a byte to host via port 0x60 and asserts IRQ if specified. */
void lpc_keyboard_put_char(uint8_t chr, int send_irq);
/* Return non-zero if the COMx interface has received a character. */
int lpc_comx_has_char(void);
/* Return the next character pending on the COMx interface. */
int lpc_comx_get_char(void);
/* Put a character to the COMx LPC interface. */
void lpc_comx_put_char(int c);
/* Types of host events */
enum lpc_host_event_type {
LPC_HOST_EVENT_SMI = 0,
LPC_HOST_EVENT_SCI,
LPC_HOST_EVENT_WAKE,
};
/* Set one or more SCI/SMI event bits. */
void lpc_set_host_events(uint32_t mask);
/* Clear one or more SCI/SMI event bits. Write 1 to a bit to clear it. */
void lpc_clear_host_events(uint32_t mask);
/* Return the raw SCI/SMI event state. */
uint32_t lpc_get_host_events(void);
/* Set the event mask for the specified event type. */
void lpc_set_host_event_mask(enum lpc_host_event_type type, uint32_t mask);
/* Return the event mask for the specified event type. */
uint32_t lpc_get_host_event_mask(enum lpc_host_event_type type);
#endif /* __CROS_EC_LPC_H */