Files
OpenCellular/include/power_button.h
Aaron Durbin 97a4fd2751 power_button: expose raw signal assertion
It's useful to expose the logic of the power button assertion
according to the CONFIG active level at the hardware input.
Therefore, provide power_button_signal_asserted().

BUG=chrome-os-partner:31481
BRANCH=None
TEST=Benson tested this on ryu since has the button cables.

Change-Id: Ica48bfe981550700a067406cb72908e14dbccba9
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/213298
Reviewed-by: Alec Berg <alecaberg@chromium.org>
2014-08-21 08:02:00 +00:00

44 lines
1022 B
C

/* Copyright (c) 2013 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.
*/
/* Power button API for Chrome EC */
#ifndef __CROS_EC_POWER_BUTTON_H
#define __CROS_EC_POWER_BUTTON_H
#include "common.h"
/**
* Return non-zero if power button is pressed.
*
* Uses the debounced button state, not the raw signal from the GPIO.
*/
int power_button_is_pressed(void);
/**
* Return non-zero if power button signal asserted at hardware input.
*
*/
int power_button_signal_asserted(void);
/**
* Interrupt handler for power button.
*
* @param signal Signal which triggered the interrupt.
*/
void power_button_interrupt(enum gpio_signal signal);
/**
* For x86 systems, force-deassert the power button signal to the PCH.
*/
void power_button_pch_release(void);
/**
* For x86 systems, force a pulse of the power button signal to the PCH.
*/
void power_button_pch_pulse(void);
#endif /* __CROS_EC_POWER_BUTTON_H */