Lines Matching full:peripheral
42 * Emulate SMBus peripheral device, connected to the bus as
46 /* List of peripheral devices registered */
49 void emul_register_smbus_peripheral(struct smbus_peripheral *peripheral) in emul_register_smbus_peripheral() argument
51 sys_slist_prepend(&peripherals, &peripheral->node); in emul_register_smbus_peripheral()
56 struct smbus_peripheral *peripheral, *tmp; in emul_get_smbus_peripheral() local
58 SYS_SLIST_FOR_EACH_CONTAINER_SAFE(&peripherals, peripheral, tmp, node) { in emul_get_smbus_peripheral()
59 if (peripheral->addr == addr) { in emul_get_smbus_peripheral()
60 return peripheral; in emul_get_smbus_peripheral()
69 struct smbus_peripheral *peripheral, *tmp, *found = NULL; in peripheral_handle_smbalert() local
71 SYS_SLIST_FOR_EACH_CONTAINER_SAFE(&peripherals, peripheral, tmp, node) { in peripheral_handle_smbalert()
72 if (peripheral->smbalert && !peripheral->smbalert_handled) { in peripheral_handle_smbalert()
73 found = peripheral; in peripheral_handle_smbalert()
92 struct smbus_peripheral *peripheral, *tmp; in peripheral_handle_host_notify() local
94 SYS_SLIST_FOR_EACH_CONTAINER_SAFE(&peripherals, peripheral, tmp, node) { in peripheral_handle_host_notify()
95 if (peripheral->host_notify) { in peripheral_handle_host_notify()
96 LOG_DBG("Save own peripheral address to NDA"); in peripheral_handle_host_notify()
97 io_area[PCH_SMBUS_NDA] = peripheral->addr << 1; in peripheral_handle_host_notify()
109 struct smbus_peripheral *peripheral; in peripheral_write() local
111 peripheral = emul_get_smbus_peripheral(addr); in peripheral_write()
112 if (peripheral) { in peripheral_write()
113 peripheral->raw_data[reg] = value; in peripheral_write()
114 LOG_DBG("peripheral: [0x%02x] <= 0x%02x", reg, value); in peripheral_write()
116 LOG_ERR("Peripheral not found, addr 0x%02x", addr); in peripheral_write()
123 struct smbus_peripheral *peripheral; in peripheral_read() local
125 peripheral = emul_get_smbus_peripheral(addr); in peripheral_read()
126 if (peripheral) { in peripheral_read()
127 *value = peripheral->raw_data[reg]; in peripheral_read()
128 LOG_DBG("peripheral: [0x%02x] => 0x%02x", reg, *value); in peripheral_read()
130 LOG_ERR("Peripheral not found, addr 0x%02x", addr); in peripheral_read()
140 struct smbus_peripheral *peripheral; in emul_start_smbus_protocol() local
150 peripheral = emul_get_smbus_peripheral(addr); in emul_start_smbus_protocol()
151 if (peripheral == NULL) { in emul_start_smbus_protocol()
240 * count is set by peripheral device, just in emul_start_smbus_protocol()