summaryrefslogtreecommitdiff
path: root/zephyr/include/ap_power/ap_power_espi.h
blob: 2c295054f3e48b9fba615e9971627e534d800056 (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 2022 The ChromiumOS Authors
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file.
 */

/**
 * @file
 * @brief API for power signal ESPI callback.
 */

#ifndef __AP_POWER_AP_POWER_ESPI_H__
#define __AP_POWER_AP_POWER_ESPI_H__

#include <zephyr/drivers/espi.h>

/**
 * @brief ESPI callback for power signal handling.
 *
 * This callback must be registered for the bus events indicated below
 * as part of the common ESPI initialisation and configuration.
 *
 * @param dev ESPI device
 * @param cb Callback structure
 * @param event ESPI event data
 */
void power_signal_espi_cb(const struct device *dev, struct espi_callback *cb,
			  struct espi_event event);

/*
 * The ESPI bus events required for the power signal ESPI callback.
 */
#define POWER_SIGNAL_ESPI_BUS_EVENTS \
	(ESPI_BUS_EVENT_CHANNEL_READY | ESPI_BUS_EVENT_VWIRE_RECEIVED)

#endif /* __AP_POWER_AP_POWER_ESPI_H__ */