summaryrefslogtreecommitdiff
path: root/include/extpower.h
blob: f75a1a5c0618e082ff8a19d0eb5372eade9722cc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
/* 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.
 */

/* External power detection API for Chrome EC */

#ifndef __CROS_EC_EXTPOWER_H
#define __CROS_EC_EXTPOWER_H

#include "common.h"

#ifdef CONFIG_EXTPOWER_SPRING
/* Spring-USB-power-specific methods */
#include "extpower_spring.h"
#endif

/**
 * Return non-zero if external power is present.
 */
int extpower_is_present(void);

/**
 * Interrupt handler for external power GPIOs.
 *
 * @param signal	Signal which triggered the interrupt.
 */
void extpower_interrupt(enum gpio_signal signal);

#ifdef CONFIG_EXTPOWER_FALCO
/* Adapter-specific logic */
#include "extpower_falco.h"
#endif

#endif  /* __CROS_EC_EXTPOWER_H */