Files
OpenCellular/include/power_button.h
Shawn Nematbakhsh c5e0634054 cleanup: Fix signed vs unsigned typing
- ec_response_thermal_get_threshold.value is unsigned, so it can not be
  less than zero.
- make power_button_wait_for_release() take a signed int, to match its
  existing usage.

BUG=None
TEST=`make buildall -j`
BRANCH=None

Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org>
Change-Id: Ie5748df3d9904d1e417adc38fee18f8cb3ce9750
Reviewed-on: https://chromium-review.googlesource.com/325840
Commit-Ready: Shawn N <shawnn@chromium.org>
Tested-by: Shawn N <shawnn@chromium.org>
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2016-02-03 21:34:47 -08:00

58 lines
1.4 KiB
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);
/**
* Wait for the power button to be released
*
* @param timeout_us Timeout in microseconds, or -1 to wait forever
* @return EC_SUCCESS if ok, or
* EC_ERROR_TIMEOUT if power button failed to release
*/
int power_button_wait_for_release(int timeout_us);
/**
* 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-assert the power button signal to the PCH.
*/
void power_button_pch_press(void);
/**
* 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 */