Files
OpenCellular/include/button.h
Daisuke Nojiri 05a8637ca0 Fizz: Add recovery button
Cr50 masks the recovery button signal on a proto board when the
power button is being pressed (b:37682117). This bug has to be
fixed for the recovery button to work.

BUG=b:37274183
BRANCH=none
TEST=make buildall

Change-Id: Ia413ffce84d67b6f24f983ccce8ae8277452ac2c
Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/494069
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
2017-05-12 18:46:14 -07:00

65 lines
1.4 KiB
C

/* Copyright (c) 2014 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.
*/
/* Button API for Chrome EC */
#ifndef __CROS_EC_BUTTON_H
#define __CROS_EC_BUTTON_H
#include "common.h"
#include "gpio.h"
#define BUTTON_FLAG_ACTIVE_HIGH (1 << 0)
enum keyboard_button_type {
KEYBOARD_BUTTON_POWER = 0,
KEYBOARD_BUTTON_VOLUME_DOWN,
KEYBOARD_BUTTON_VOLUME_UP,
KEYBOARD_BUTTON_RECOVERY,
KEYBOARD_BUTTON_CAPSENSE_1,
KEYBOARD_BUTTON_CAPSENSE_2,
KEYBOARD_BUTTON_CAPSENSE_3,
KEYBOARD_BUTTON_CAPSENSE_4,
KEYBOARD_BUTTON_CAPSENSE_5,
KEYBOARD_BUTTON_CAPSENSE_6,
KEYBOARD_BUTTON_CAPSENSE_7,
KEYBOARD_BUTTON_CAPSENSE_8,
KEYBOARD_BUTTON_COUNT
};
struct button_config {
const char *name;
enum keyboard_button_type type;
enum gpio_signal gpio;
uint32_t debounce_us;
int flags;
};
/*
* Defined in board.c. Should be CONFIG_BUTTON_COUNT elements long.
*/
extern const struct button_config buttons[];
/*
* Buttons used to decide whether recovery is requested or not
*/
extern const struct button_config *recovery_buttons[];
extern const int recovery_buttons_count;
/*
* Button initialization, called from main.
*/
void button_init(void);
/*
* Interrupt handler for button.
*
* @param signal Signal which triggered the interrupt.
*/
void button_interrupt(enum gpio_signal signal);
#endif /* __CROS_EC_BUTTON_H */