mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2026-01-10 17:41:54 +00:00
The device_state module is used for debouncing GPIO inputs to
determine device state. It was overkill for managing the battery
present state as forwarded to the write protect pin, and split that
handling between 3 files (board.c, wp.c, device_state.c). Move all of
that logic into wp.c so it's easier to maintain.
BUG=none
BRANCH=cr50
TEST=manual
plug in battery (or ground DIOM2)
wp command reports WP enabled
unplug battery (or pull DIOM2 high)
wp command reports WP disabled
Change-Id: I71ab9ce5766ecddae430c63a8b31388935a46180
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/604500
Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
25 lines
544 B
C
25 lines
544 B
C
/* Copyright 2017 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.
|
|
*/
|
|
|
|
#ifndef __EC_BOARD_CR50_WP_H
|
|
#define __EC_BOARD_CR50_WP_H
|
|
|
|
#include "common.h"
|
|
|
|
/**
|
|
* Initialize write protect state.
|
|
*
|
|
* Must be called after case-closed debugging is initialized.
|
|
*/
|
|
void init_wp_state(void);
|
|
|
|
/**
|
|
* Read the FWMP value from TPM NVMEM and set the console restriction
|
|
* appropriately.
|
|
*/
|
|
void read_fwmp(void);
|
|
|
|
#endif /* ! __EC_BOARD_CR50_WP_H */
|