summaryrefslogtreecommitdiff
path: root/zephyr/program/corsola/src/kingler/i2c.c
blob: 5bd8aef7d5a9dbf8130495a2fcb966605b55a39e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/* 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.
 */

#include "i2c.h"
#include "i2c/i2c.h"

/* Kingler and Steelix board specific i2c implementation */

#ifdef CONFIG_PLATFORM_EC_I2C_PASSTHRU_RESTRICTED
int board_allow_i2c_passthru(const struct i2c_cmd_desc_t *cmd_desc)
{
	return (i2c_get_device_for_port(cmd_desc->port) ==
			i2c_get_device_for_port(I2C_PORT_VIRTUAL_BATTERY) ||
		i2c_get_device_for_port(cmd_desc->port) ==
			i2c_get_device_for_port(I2C_PORT_EEPROM) ||
		i2c_get_device_for_port(cmd_desc->port) ==
			i2c_get_device_for_port(I2C_PORT_USB_C0));
}
#endif