Files
OpenCellular/include/power_button.h
Randall Spangler 2223179cbc Move looking at write protect GPIO to button/switches module
Since that already monitors the WP signal for reporting it as a
switch.  And if we have that code in two places and the WP signal
polarity changes, we'll inevitably forget to change it in the other
place...

BUG=chrome-os-partner:11150
TEST=manual

flashinfo -> WP pin asserted
remove WP screw
flashinfo -> WP pin deasserted

Change-Id: I6091c8bb470c357e02ede8a5b184b2a76b70dc60
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/27720
2012-07-18 15:51:36 -07:00

38 lines
912 B
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.
*/
/* Power button module for Chrome EC */
#ifndef __CROS_EC_POWER_BUTTON_H
#define __CROS_EC_POWER_BUTTON_H
#include "common.h"
#include "gpio.h"
/*
* Interrupt handler for the power button and lid switch. Passed the signal
* which triggered the interrupt.
*/
void power_button_interrupt(enum gpio_signal signal);
/* Power button task */
void power_button_task(void);
/* Return non-zero if AC power is present. */
int power_ac_present(void);
/*
* Return non-zero if lid is open. Uses the debounced lid state, not the raw
* signal from the GPIO.
*/
int power_lid_open_debounced(void);
/**
* Return non-zero if write protect signal is asserted.
*/
int write_protect_asserted(void);
#endif /* __CROS_EC_POWER_BUTTON_H */