Lines Matching +full:host +full:- +full:slave

4  * SPDX-License-Identifier: Apache-2.0
6 * Emulator for the generic eSPI Host. This supports basic
7 * host operations.
66 /** Run-time data used by the emulator */
72 /** Virtual Wires states, for one slave only.
73 * With multi-slaves config, the states should be saved per slave */
85 /* eSPI chip-select of the emulated device */
93 * @param data Host emulator data with the vwire array
100 data->vw_state[i] = vw_state_default[i]; in emul_host_init_vw_state()
106 * Find a virtual wire in the array placed in the host data.
108 * @param data Host emulator data with the vwire array
111 * @return -1 if not found
119 if (data->vw_state[idx].sig == vw) { in emul_host_find_index()
124 return -1; in emul_host_find_index()
130 struct espi_host_emul_data *data = target->data; in emul_host_set_vw()
135 if (idx < 0 || data->vw_state[idx].dir != ESPI_TARGET_TO_CONTROLLER) { in emul_host_set_vw()
137 return -EPERM; in emul_host_set_vw()
140 data->vw_state[idx].level = level; in emul_host_set_vw()
148 struct espi_host_emul_data *data = target->data; in emul_host_get_vw()
153 if (idx < 0 || data->vw_state[idx].dir != ESPI_CONTROLLER_TO_TARGET) { in emul_host_get_vw()
155 return -EPERM; in emul_host_get_vw()
158 *level = data->vw_state[idx].level; in emul_host_get_vw()
172 api = (struct emul_espi_driver_api *)espi_dev->api; in emul_espi_host_send_vw()
175 __ASSERT_NO_MSG(api->trigger_event); in emul_espi_host_send_vw()
176 __ASSERT_NO_MSG(api->find_emul); in emul_espi_host_send_vw()
178 emul_espi = api->find_emul(espi_dev, EMUL_ESPI_HOST_CHIPSEL); in emul_espi_host_send_vw()
179 data_host = emul_espi->target->data; in emul_espi_host_send_vw()
182 if (idx < 0 || data_host->vw_state[idx].dir != ESPI_CONTROLLER_TO_TARGET) { in emul_espi_host_send_vw()
184 return -EPERM; in emul_espi_host_send_vw()
187 data_host->vw_state[idx].level = level; in emul_espi_host_send_vw()
193 api->trigger_event(espi_dev, &evt); in emul_espi_host_send_vw()
203 api = (struct emul_espi_driver_api *)espi_dev->api; in emul_espi_host_port80_write()
206 __ASSERT_NO_MSG(api->trigger_event); in emul_espi_host_port80_write()
212 api->trigger_event(espi_dev, &evt); in emul_espi_host_port80_write()
220 struct espi_host_emul_data *data = target->data; in emul_espi_dev_get_acpi_shm()
222 return (uintptr_t)data->shm_acpi_mmap; in emul_espi_dev_get_acpi_shm()
244 * Set up a new eSPI host emulator
252 struct espi_host_emul_data *data = emul->data; in emul_host_init()