mb/google/skyrim: Add initial I2C configuration
[coreboot.git] / src / lib / dp_aux.c
blob6a925f13f641b9bc6a55c0c0fcf1434468def419
1 /* SPDX-License-Identifier: GPL-2.0-only */
3 #include <dp_aux.h>
5 bool dp_aux_request_is_write(enum aux_request request)
7 switch (request) {
8 case I2C_RAW_WRITE_AND_STOP:
9 case I2C_RAW_WRITE:
10 case DPCD_WRITE:
11 return true;
12 default:
13 return false;
17 enum i2c_over_aux dp_get_aux_cmd(enum aux_request request, uint32_t remaining_after_this)
19 switch (request) {
20 case I2C_RAW_WRITE_AND_STOP:
21 if (!remaining_after_this)
22 return I2C_OVER_AUX_WRITE_MOT_0;
23 __fallthrough;
24 case I2C_RAW_WRITE:
25 return I2C_OVER_AUX_WRITE_MOT_1;
26 case I2C_RAW_READ_AND_STOP:
27 if (!remaining_after_this)
28 return I2C_OVER_AUX_READ_MOT_0;
29 __fallthrough;
30 case I2C_RAW_READ:
31 return I2C_OVER_AUX_READ_MOT_1;
32 case DPCD_WRITE:
33 return NATIVE_AUX_WRITE;
34 case DPCD_READ:
35 default:
36 return NATIVE_AUX_READ;