OpenBIC
OpenSource Bridge-IC
plat_hook.h
Go to the documentation of this file.
1/*
2 * Copyright (c) Meta Platforms, Inc. and affiliates.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#ifndef PLAT_HOOK_H
18#define PLAT_HOOK_H
19
20typedef struct _i2c_proc_arg {
21 uint8_t bus;
22 uint8_t channel;
24
25/**************************************************************************************************
26 * INIT ARGS
27**************************************************************************************************/
34extern struct k_mutex i2c_hub_mutex;
35
36#define I2C_HUB_MUTEX_TIMEOUT_MS 300
37#define I2C_HUB_CHANNEL_0 0x01
38#define I2C_HUB_CHANNEL_1 0x02
39#define I2C_HUB_CHANNEL_2 0x04
40#define I2C_HUB_CHANNEL_3 0x08
41#define I2C_HUB_CHANNEL_4 0x10
42#define I2C_HUB_CHANNEL_5 0x20
43
44const static uint8_t e1s_mux_channel_opa[] = { I2C_HUB_CHANNEL_5, I2C_HUB_CHANNEL_1,
46const static uint8_t e1s_mux_channel_opb[] = { I2C_HUB_CHANNEL_4, I2C_HUB_CHANNEL_3,
49
50bool pre_i2c_bus_read(sensor_cfg *cfg, void *args);
51bool post_i2c_bus_read(sensor_cfg *cfg, void *args, int *reading);
52bool pre_retimer_read(sensor_cfg *cfg, void *args);
55
56#endif
sq52205_init_arg sq52205_init_args[]
Definition: plat_hook.c:63
ina233_init_arg ina233_init_args[]
Definition: plat_hook.c:541
bool pre_i2c_bus_read(sensor_cfg *cfg, void *args)
Definition: plat_hook.c:1034
bool post_i2c_bus_read(sensor_cfg *cfg, void *args, int *reading)
Definition: plat_hook.c:1056
#define I2C_HUB_CHANNEL_4
Definition: plat_hook.h:41
adc_asd_init_arg adc_expa_asd_init_args[]
Definition: plat_hook.c:40
i2c_proc_arg i2c_proc_args[]
Definition: plat_hook.c:235
void pre_retimer_eeprom_recover()
Definition: plat_hook.c:366
pt5161l_init_arg pt5161l_init_args[]
Definition: plat_hook.c:244
bool pre_retimer_read(sensor_cfg *cfg, void *args)
Definition: plat_hook.c:320
struct _i2c_proc_arg i2c_proc_arg
#define I2C_HUB_CHANNEL_1
Definition: plat_hook.h:38
adc_asd_init_arg adc_expb_asd_init_args[]
Definition: plat_hook.c:56
void post_retimer_eeprom_recover()
Definition: plat_hook.c:376
#define I2C_HUB_CHANNEL_2
Definition: plat_hook.h:39
#define I2C_HUB_CHANNEL_3
Definition: plat_hook.h:40
#define I2C_HUB_CHANNEL_5
Definition: plat_hook.h:42
#define I2C_HUB_CHANNEL_0
Definition: plat_hook.h:37
struct k_mutex i2c_hub_mutex
uint8_t reading[1]
Definition: pldm_monitor.h:3
Definition: sensor.h:364
Definition: plat_hook.h:20
uint8_t channel
Definition: plat_hook.h:22
uint8_t bus
Definition: plat_hook.h:21
Definition: sensor.h:489
Definition: sensor.h:735
Definition: sensor.h:256
Definition: sensor.h:637