Lines Matching full:i2c

11  * @brief Nuvoton NPCX smb/i2c port driver
13 * This file contains the driver of SMBus/I2C buses (ports) which provides
14 * pin-muxing for each i2c io-pads. In order to support "SMBus Multi-Bus"
16 * between Zephyr i2c api functions and i2c controller driver which provides
17 * full support for SMBus/I2C transactions.
23 * SDA_N Port 0----| |----| SMB/I2C |
33 #include <zephyr/drivers/i2c.h>
35 #include <zephyr/dt-bindings/i2c/i2c.h>
42 #include "i2c-priv.h"
53 /* I2C api functions */
60 LOG_ERR("Cannot find i2c controller on port%02x!", in i2c_npcx_port_configure()
73 /* Configure i2c controller */ in i2c_npcx_port_configure()
84 LOG_ERR("Cannot find i2c controller on port%02x!", config->port); in i2c_npcx_port_get_config()
105 LOG_ERR("Cannot find i2c controller on port%02x!", in i2c_npcx_port_transfer()
110 /* Lock mutex of i2c/smb controller */ in i2c_npcx_port_transfer()
113 /* Switch correct port for i2c controller first */ in i2c_npcx_port_transfer()
116 /* Start transaction with i2c controller */ in i2c_npcx_port_transfer()
120 /* Unlock mutex of i2c/smb controller */ in i2c_npcx_port_transfer()
131 LOG_ERR("Cannot find i2c controller on port%02x!", config->port); in i2c_npcx_port_recover_bus()
135 /* Lock mutex of i2c/smb controller */ in i2c_npcx_port_recover_bus()
140 /* Unlock mutex of i2c/smb controller */ in i2c_npcx_port_recover_bus()
157 LOG_ERR("Cannot find i2c controller on port%02x!", config->port); in i2c_npcx_target_register()
170 LOG_ERR("Cannot find i2c controller on port%02x!", config->port); in i2c_npcx_target_unregister()
178 /* I2C driver registration */
185 /* Configure pin-mux for I2C device */ in i2c_npcx_port_init()
188 LOG_ERR("I2C pinctrl setup failed (%d)", ret); in i2c_npcx_port_init()
193 /* Setup initial i2c configuration */ in i2c_npcx_port_init()
203 static DEVICE_API(i2c, i2c_port_npcx_driver_api) = {
217 /* I2C port init macro functions */