summaryrefslogtreecommitdiff
path: root/zephyr/program/corsola/include/variant_db_detection.h
blob: cf86e1ae1cbe877278d3857b98aa2a6f3f7d3476 (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
36
37
38
39
/* Copyright 2021 The ChromiumOS Authors
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file.
 */

/* Corsola daughter board detection */

#ifndef __CROS_EC_CORSOLA_DB_DETECTION_H
#define __CROS_EC_CORSOLA_DB_DETECTION_H

#include <stdint.h>

enum corsola_db_type {
	CORSOLA_DB_UNINIT = -1,
	CORSOLA_DB_NONE,
	CORSOLA_DB_TYPEC,
	CORSOLA_DB_HDMI,
	CORSOLA_DB_COUNT,
};

/*
 * Get the connected daughterboard type.
 *
 * @return		The daughterboard type.
 */
#ifdef CONFIG_VARIANT_CORSOLA_DB_DETECTION
enum corsola_db_type corsola_get_db_type(void);
#elif !defined(CONFIG_TEST)
inline enum corsola_db_type corsola_get_db_type(void)
{
	return CORSOLA_DB_NONE;
}
#endif

/* return the adjusted port count for board overridden usbc/charger functions.
 */
uint8_t board_get_adjusted_usb_pd_port_count(void);

#endif /* __CROS_EC_CORSOLA_DB_DETECTION_H */