@@ -87,6 +87,49 @@ static bool espi_emul_get_channel_status(const struct device *dev, enum espi_cha
8787 return (data -> cfg .channel_caps & ch );
8888}
8989
90+ static int espi_emul_read_lpc_request (const struct device * dev ,
91+ enum lpc_peripheral_opcode op ,
92+ uint32_t * data )
93+ {
94+ const struct emul_espi_device_api * api ;
95+ struct espi_emul * emul ;
96+ struct espi_emul_data * emul_data = dev -> data ;
97+
98+ if (!(emul_data -> cfg .channel_caps & ESPI_CHANNEL_VWIRE )) {
99+ LOG_ERR ("bad channel vwire" );
100+ return - EINVAL ;
101+ }
102+
103+ emul = espi_emul_find (dev , EMUL_ESPI_HOST_CHIPSEL );
104+ if (!emul ) {
105+ LOG_ERR ("espi_emul not found" );
106+ return - ENOTSUP ;
107+ }
108+
109+ __ASSERT_NO_MSG (emul -> api );
110+ api = emul -> api ;
111+
112+ switch (op ) {
113+ #ifdef CONFIG_ESPI_PERIPHERAL_ACPI_SHM_REGION
114+ case EACPI_GET_SHARED_MEMORY :
115+ __ASSERT_NO_MSG (api -> get_acpi_shm );
116+ * data = (uint32_t )api -> get_acpi_shm (emul );
117+ break ;
118+ #endif
119+ default :
120+ return - EINVAL ;
121+ }
122+ return 0 ;
123+ }
124+
125+ static int espi_emul_write_lpc_request (const struct device * dev , enum lpc_peripheral_opcode op ,
126+ uint32_t * data )
127+ {
128+ ARG_UNUSED (dev );
129+
130+ return - EINVAL ;
131+ }
132+
90133static int espi_emul_send_vwire (const struct device * dev , enum espi_vwire_signal vw , uint8_t level )
91134{
92135 const struct emul_espi_device_api * api ;
@@ -172,6 +215,8 @@ static struct emul_espi_driver_api emul_espi_driver_api = {
172215 .espi_api = {
173216 .config = espi_emul_config ,
174217 .get_channel_status = espi_emul_get_channel_status ,
218+ .read_lpc_request = espi_emul_read_lpc_request ,
219+ .write_lpc_request = espi_emul_write_lpc_request ,
175220 .send_vwire = espi_emul_send_vwire ,
176221 .receive_vwire = espi_emul_receive_vwire ,
177222 .manage_callback = espi_emul_manage_callback
0 commit comments