Lines Matching +full:req +full:- +full:gpios

4  * SPDX-License-Identifier: Apache-2.0
44 *+----------------------------------------------------------------------+
46 *| eSPI controller +-------------+ |
47 *| +-----------+ | Power | +----------+ |
49 *| +------------+ |processor | | controller | | sources | |
50 *| | SPI flash | +-----------+ +-------------+ +----------+ |
52 *| +------------+ | | | |
53 *| | | | +--------+ +---------------+ |
55 *| | | +-----+ +--------+ +----------+ +----v-----+ |
58 *| | | | +--------+ +----------+ +----------+ |
60 *| | | | ------+ | | |
62 *| | | +------v-----+ +---v-------v-------------v----+ |
64 *| | | | access +--->+ | |
65 *| | | +------------+ +------------------------------+ |
67 *| | +-----------+ | |
72 *+----------------------------------------------------------------------+
74 * v +-----------------+
75 * +---------+ | | | | | |
77 * +---------+ | + + + + | eSPI bus
81 * +-----------------+
83 *+-----------------------------------------------------------------------+
88 *+-----------------------------------------------------------------------+
118 * 0-eSPI bus in reset, 1-eSPI bus out-of-reset
120 * Note: There is no need to send this callback for in-band reset.
135 /** Indicates the eSPI HW has received a Out-of-band package from eSPI host.
258 * Virtual wire GPIOs that can be sent from target to controller for
278 /* USB-C port over current */
380 * @brief eSPI out-of-band transaction packet format
455 struct espi_request_packet *req);
457 struct espi_request_packet *req);
524 * +---------+ +---------+ +------+ +---------+ +---------+
527 * +--------+ +---------+ +------+ +---------+ +---------+
530 * +--------------+ ctrl regs | cap ctrl reg| +-----------+
531 * | +-------+ | +--------+ |
532 * | |<------+ | +------->| |
536 * | | +<------------------+ |
537 * | |<-----------| | |
539 * | |----------->+ response | |
540 * | | |------------------>+ |
543 * | | +<------------------+ |
545 * | | +------------------>+ |
553 * @retval -EIO General input / output error, failed to configure device.
554 * @retval -EINVAL invalid capabilities, failed to configure device.
555 * @retval -ENOTSUP capability not supported by eSPI target.
563 (const struct espi_driver_api *)dev->api; in z_impl_espi_config()
565 return api->config(dev, cfg); in z_impl_espi_config()
587 (const struct espi_driver_api *)dev->api; in z_impl_espi_get_channel_status()
589 return api->get_channel_status(dev, ch); in z_impl_espi_get_channel_status()
598 * @param req Address of structure representing a memory,
602 * @retval -ENOTSUP if eSPI controller doesn't support raw packets and instead
604 * @retval -EIO General input / output error, failed to send over the bus.
607 struct espi_request_packet *req);
610 struct espi_request_packet *req) in z_impl_espi_read_request() argument
613 (const struct espi_driver_api *)dev->api; in z_impl_espi_read_request()
615 if (!api->read_request) { in z_impl_espi_read_request()
616 return -ENOTSUP; in z_impl_espi_read_request()
619 return api->read_request(dev, req); in z_impl_espi_read_request()
628 * @param req Address of structure representing a memory, I/O or
632 * @retval -ENOTSUP if eSPI controller doesn't support raw packets and instead
634 * @retval -EINVAL General input / output error, failed to send over the bus.
637 struct espi_request_packet *req);
640 struct espi_request_packet *req) in z_impl_espi_write_request() argument
643 (const struct espi_driver_api *)dev->api; in z_impl_espi_write_request()
645 if (!api->write_request) { in z_impl_espi_write_request()
646 return -ENOTSUP; in z_impl_espi_write_request()
649 return api->write_request(dev, req); in z_impl_espi_write_request()
665 * @retval -ENOTSUP if eSPI peripheral is off or not supported.
666 * @retval -EINVAL for unimplemented lpc opcode, but in range.
677 (const struct espi_driver_api *)dev->api; in z_impl_espi_read_lpc_request()
679 if (!api->read_lpc_request) { in z_impl_espi_read_lpc_request()
680 return -ENOTSUP; in z_impl_espi_read_lpc_request()
683 return api->read_lpc_request(dev, op, data); in z_impl_espi_read_lpc_request()
698 * @retval -ENOTSUP if eSPI peripheral is off or not supported.
699 * @retval -EINVAL for unimplemented lpc opcode, but in range.
710 (const struct espi_driver_api *)dev->api; in z_impl_espi_write_lpc_request()
712 if (!api->write_lpc_request) { in z_impl_espi_write_lpc_request()
713 return -ENOTSUP; in z_impl_espi_write_lpc_request()
716 return api->write_lpc_request(dev, op, data); in z_impl_espi_write_lpc_request()
730 * @retval -EIO General input / output error, failed to send over the bus.
741 (const struct espi_driver_api *)dev->api; in z_impl_espi_send_vwire()
743 return api->send_vwire(dev, signal, level); in z_impl_espi_send_vwire()
756 * @retval -EIO General input / output error, failed request to controller.
767 (const struct espi_driver_api *)dev->api; in z_impl_espi_receive_vwire()
769 return api->receive_vwire(dev, signal, level); in z_impl_espi_receive_vwire()
773 * @brief Sends SMBus transaction (out-of-band) packet over eSPI bus.
781 * @retval -EIO General input / output error, failed request to controller.
790 (const struct espi_driver_api *)dev->api; in z_impl_espi_send_oob()
792 if (!api->send_oob) { in z_impl_espi_send_oob()
793 return -ENOTSUP; in z_impl_espi_send_oob()
796 return api->send_oob(dev, pckt); in z_impl_espi_send_oob()
800 * @brief Receives SMBus transaction (out-of-band) packet from eSPI bus.
808 * @retval -EIO General input / output error, failed request to controller.
817 (const struct espi_driver_api *)dev->api; in z_impl_espi_receive_oob()
819 if (!api->receive_oob) { in z_impl_espi_receive_oob()
820 return -ENOTSUP; in z_impl_espi_receive_oob()
823 return api->receive_oob(dev, pckt); in z_impl_espi_receive_oob()
835 * @retval -ENOTSUP eSPI flash logical channel transactions not supported.
836 * @retval -EBUSY eSPI flash channel is not ready or disabled by controller.
837 * @retval -EIO General input / output error, failed request to controller.
846 (const struct espi_driver_api *)dev->api; in z_impl_espi_read_flash()
848 if (!api->flash_read) { in z_impl_espi_read_flash()
849 return -ENOTSUP; in z_impl_espi_read_flash()
852 return api->flash_read(dev, pckt); in z_impl_espi_read_flash()
864 * @retval -ENOTSUP eSPI flash logical channel transactions not supported.
865 * @retval -EBUSY eSPI flash channel is not ready or disabled by controller.
866 * @retval -EIO General input / output error, failed request to controller.
875 (const struct espi_driver_api *)dev->api; in z_impl_espi_write_flash()
877 if (!api->flash_write) { in z_impl_espi_write_flash()
878 return -ENOTSUP; in z_impl_espi_write_flash()
881 return api->flash_write(dev, pckt); in z_impl_espi_write_flash()
893 * @retval -ENOTSUP eSPI flash logical channel transactions not supported.
894 * @retval -EBUSY eSPI flash channel is not ready or disabled by controller.
895 * @retval -EIO General input / output error, failed request to controller.
904 (const struct espi_driver_api *)dev->api; in z_impl_espi_flash_erase()
906 if (!api->flash_erase) { in z_impl_espi_flash_erase()
907 return -ENOTSUP; in z_impl_espi_flash_erase()
910 return api->flash_erase(dev, pckt); in z_impl_espi_flash_erase()
917 *+-------+ +-------------+ +------+ +---------+
919 *+---+---+ +-------+-----+ +---+--+ +----+----+
922 * +----------------------------> | | |
924 * +----------------------------->+ |
926 * | | IRQ +<------------+ resets the
927 * | | <-----------+ | bus
928 * |<-----------------------------| | |
934 * | | IRQ +<------------+ enables VW
935 * | | <-----------+ | channel
942 * | | <-------------+ event
943 * | +<------------+ |
944 * +<-----------------------------+ callback | |
949 * | | <-------------+ send VWire
950 * | +<------------+ |
951 * +<-----------------------------+ callback | |
956 * +------------------------------>------------>|------------>|
959 * | | <-------------+ send VWire
960 * | +<------------+ |
961 * +<-----------------------------+ callback | |
962 * | App reset host-related | | |
966 * | | +<------------+ send VWire
967 * | <-------------+ |
968 * <------------------------------+ | |
989 callback->handler = handler; in espi_init_callback()
990 callback->evt_type = evt_type; in espi_init_callback()
1009 (const struct espi_driver_api *)dev->api; in espi_add_callback()
1011 if (!api->manage_callback) { in espi_add_callback()
1012 return -ENOTSUP; in espi_add_callback()
1015 return api->manage_callback(dev, callback, true); in espi_add_callback()
1038 (const struct espi_driver_api *)dev->api; in espi_remove_callback()
1040 if (!api->manage_callback) { in espi_remove_callback()
1041 return -ENOTSUP; in espi_remove_callback()
1044 return api->manage_callback(dev, callback, false); in espi_remove_callback()