i2c_common 19 drivers/i2c/busses/i2c-amd-mp2-pci.c static void amd_mp2_c2p_mutex_lock(struct amd_i2c_common *i2c_common) i2c_common 21 drivers/i2c/busses/i2c-amd-mp2-pci.c struct amd_mp2_dev *privdata = i2c_common->mp2_dev; i2c_common 25 drivers/i2c/busses/i2c-amd-mp2-pci.c privdata->c2p_lock_busid = i2c_common->bus_id; i2c_common 28 drivers/i2c/busses/i2c-amd-mp2-pci.c static void amd_mp2_c2p_mutex_unlock(struct amd_i2c_common *i2c_common) i2c_common 30 drivers/i2c/busses/i2c-amd-mp2-pci.c struct amd_mp2_dev *privdata = i2c_common->mp2_dev; i2c_common 32 drivers/i2c/busses/i2c-amd-mp2-pci.c if (unlikely(privdata->c2p_lock_busid != i2c_common->bus_id)) { i2c_common 35 drivers/i2c/busses/i2c-amd-mp2-pci.c i2c_common->bus_id, privdata->c2p_lock_busid); i2c_common 42 drivers/i2c/busses/i2c-amd-mp2-pci.c static int amd_mp2_cmd(struct amd_i2c_common *i2c_common, i2c_common 45 drivers/i2c/busses/i2c-amd-mp2-pci.c struct amd_mp2_dev *privdata = i2c_common->mp2_dev; i2c_common 48 drivers/i2c/busses/i2c-amd-mp2-pci.c i2c_common->reqcmd = i2c_cmd_base.s.i2c_cmd; i2c_common 57 drivers/i2c/busses/i2c-amd-mp2-pci.c int amd_mp2_bus_enable_set(struct amd_i2c_common *i2c_common, bool enable) i2c_common 59 drivers/i2c/busses/i2c-amd-mp2-pci.c struct amd_mp2_dev *privdata = i2c_common->mp2_dev; i2c_common 63 drivers/i2c/busses/i2c-amd-mp2-pci.c i2c_common->bus_id); i2c_common 67 drivers/i2c/busses/i2c-amd-mp2-pci.c i2c_cmd_base.s.bus_id = i2c_common->bus_id; i2c_common 68 drivers/i2c/busses/i2c-amd-mp2-pci.c i2c_cmd_base.s.i2c_speed = i2c_common->i2c_speed; i2c_common 70 drivers/i2c/busses/i2c-amd-mp2-pci.c amd_mp2_c2p_mutex_lock(i2c_common); i2c_common 72 drivers/i2c/busses/i2c-amd-mp2-pci.c return amd_mp2_cmd(i2c_common, i2c_cmd_base); i2c_common 76 drivers/i2c/busses/i2c-amd-mp2-pci.c static void amd_mp2_cmd_rw_fill(struct amd_i2c_common *i2c_common, i2c_common 81 drivers/i2c/busses/i2c-amd-mp2-pci.c i2c_cmd_base->s.bus_id = i2c_common->bus_id; i2c_common 82 drivers/i2c/busses/i2c-amd-mp2-pci.c i2c_cmd_base->s.i2c_speed = i2c_common->i2c_speed; i2c_common 83 drivers/i2c/busses/i2c-amd-mp2-pci.c i2c_cmd_base->s.slave_addr = i2c_common->msg->addr; i2c_common 84 drivers/i2c/busses/i2c-amd-mp2-pci.c i2c_cmd_base->s.length = i2c_common->msg->len; i2c_common 87 drivers/i2c/busses/i2c-amd-mp2-pci.c int amd_mp2_rw(struct amd_i2c_common *i2c_common, enum i2c_cmd reqcmd) i2c_common 89 drivers/i2c/busses/i2c-amd-mp2-pci.c struct amd_mp2_dev *privdata = i2c_common->mp2_dev; i2c_common 92 drivers/i2c/busses/i2c-amd-mp2-pci.c amd_mp2_cmd_rw_fill(i2c_common, &i2c_cmd_base, reqcmd); i2c_common 93 drivers/i2c/busses/i2c-amd-mp2-pci.c amd_mp2_c2p_mutex_lock(i2c_common); i2c_common 95 drivers/i2c/busses/i2c-amd-mp2-pci.c if (i2c_common->msg->len <= 32) { i2c_common 99 drivers/i2c/busses/i2c-amd-mp2-pci.c i2c_common->msg->buf, i2c_common 100 drivers/i2c/busses/i2c-amd-mp2-pci.c i2c_common->msg->len); i2c_common 103 drivers/i2c/busses/i2c-amd-mp2-pci.c writeq((u64)i2c_common->dma_addr, i2c_common 107 drivers/i2c/busses/i2c-amd-mp2-pci.c return amd_mp2_cmd(i2c_common, i2c_cmd_base); i2c_common 111 drivers/i2c/busses/i2c-amd-mp2-pci.c static void amd_mp2_pci_check_rw_event(struct amd_i2c_common *i2c_common) i2c_common 113 drivers/i2c/busses/i2c-amd-mp2-pci.c struct amd_mp2_dev *privdata = i2c_common->mp2_dev; i2c_common 114 drivers/i2c/busses/i2c-amd-mp2-pci.c int len = i2c_common->eventval.r.length; i2c_common 115 drivers/i2c/busses/i2c-amd-mp2-pci.c u32 slave_addr = i2c_common->eventval.r.slave_addr; i2c_common 118 drivers/i2c/busses/i2c-amd-mp2-pci.c if (unlikely(len != i2c_common->msg->len)) { i2c_common 121 drivers/i2c/busses/i2c-amd-mp2-pci.c len, i2c_common->msg->len); i2c_common 125 drivers/i2c/busses/i2c-amd-mp2-pci.c if (unlikely(slave_addr != i2c_common->msg->addr)) { i2c_common 128 drivers/i2c/busses/i2c-amd-mp2-pci.c slave_addr, i2c_common->msg->addr); i2c_common 133 drivers/i2c/busses/i2c-amd-mp2-pci.c i2c_common->cmd_success = true; i2c_common 136 drivers/i2c/busses/i2c-amd-mp2-pci.c static void __amd_mp2_process_event(struct amd_i2c_common *i2c_common) i2c_common 138 drivers/i2c/busses/i2c-amd-mp2-pci.c struct amd_mp2_dev *privdata = i2c_common->mp2_dev; i2c_common 139 drivers/i2c/busses/i2c-amd-mp2-pci.c enum status_type sts = i2c_common->eventval.r.status; i2c_common 140 drivers/i2c/busses/i2c-amd-mp2-pci.c enum response_type res = i2c_common->eventval.r.response; i2c_common 141 drivers/i2c/busses/i2c-amd-mp2-pci.c int len = i2c_common->eventval.r.length; i2c_common 149 drivers/i2c/busses/i2c-amd-mp2-pci.c switch (i2c_common->reqcmd) { i2c_common 152 drivers/i2c/busses/i2c-amd-mp2-pci.c amd_mp2_pci_check_rw_event(i2c_common); i2c_common 154 drivers/i2c/busses/i2c-amd-mp2-pci.c memcpy_fromio(i2c_common->msg->buf, i2c_common 164 drivers/i2c/busses/i2c-amd-mp2-pci.c amd_mp2_pci_check_rw_event(i2c_common); i2c_common 171 drivers/i2c/busses/i2c-amd-mp2-pci.c i2c_common->cmd_success = true; i2c_common 179 drivers/i2c/busses/i2c-amd-mp2-pci.c i2c_common->cmd_success = true; i2c_common 190 drivers/i2c/busses/i2c-amd-mp2-pci.c void amd_mp2_process_event(struct amd_i2c_common *i2c_common) i2c_common 192 drivers/i2c/busses/i2c-amd-mp2-pci.c struct amd_mp2_dev *privdata = i2c_common->mp2_dev; i2c_common 194 drivers/i2c/busses/i2c-amd-mp2-pci.c if (unlikely(i2c_common->reqcmd == i2c_none)) { i2c_common 197 drivers/i2c/busses/i2c-amd-mp2-pci.c i2c_common->bus_id); i2c_common 201 drivers/i2c/busses/i2c-amd-mp2-pci.c __amd_mp2_process_event(i2c_common); i2c_common 203 drivers/i2c/busses/i2c-amd-mp2-pci.c i2c_common->reqcmd = i2c_none; i2c_common 204 drivers/i2c/busses/i2c-amd-mp2-pci.c amd_mp2_c2p_mutex_unlock(i2c_common); i2c_common 211 drivers/i2c/busses/i2c-amd-mp2-pci.c struct amd_i2c_common *i2c_common; i2c_common 218 drivers/i2c/busses/i2c-amd-mp2-pci.c i2c_common = privdata->busses[bus_id]; i2c_common 219 drivers/i2c/busses/i2c-amd-mp2-pci.c if (!i2c_common) i2c_common 228 drivers/i2c/busses/i2c-amd-mp2-pci.c i2c_common->eventval.ul = val; i2c_common 229 drivers/i2c/busses/i2c-amd-mp2-pci.c i2c_common->cmd_completion(i2c_common); i2c_common 248 drivers/i2c/busses/i2c-amd-mp2-pci.c void amd_mp2_rw_timeout(struct amd_i2c_common *i2c_common) i2c_common 250 drivers/i2c/busses/i2c-amd-mp2-pci.c i2c_common->reqcmd = i2c_none; i2c_common 251 drivers/i2c/busses/i2c-amd-mp2-pci.c amd_mp2_c2p_mutex_unlock(i2c_common); i2c_common 255 drivers/i2c/busses/i2c-amd-mp2-pci.c int amd_mp2_register_cb(struct amd_i2c_common *i2c_common) i2c_common 257 drivers/i2c/busses/i2c-amd-mp2-pci.c struct amd_mp2_dev *privdata = i2c_common->mp2_dev; i2c_common 259 drivers/i2c/busses/i2c-amd-mp2-pci.c if (i2c_common->bus_id > 1) i2c_common 262 drivers/i2c/busses/i2c-amd-mp2-pci.c if (privdata->busses[i2c_common->bus_id]) { i2c_common 264 drivers/i2c/busses/i2c-amd-mp2-pci.c "Bus %d already taken!\n", i2c_common->bus_id); i2c_common 268 drivers/i2c/busses/i2c-amd-mp2-pci.c privdata->busses[i2c_common->bus_id] = i2c_common; i2c_common 274 drivers/i2c/busses/i2c-amd-mp2-pci.c int amd_mp2_unregister_cb(struct amd_i2c_common *i2c_common) i2c_common 276 drivers/i2c/busses/i2c-amd-mp2-pci.c struct amd_mp2_dev *privdata = i2c_common->mp2_dev; i2c_common 278 drivers/i2c/busses/i2c-amd-mp2-pci.c privdata->busses[i2c_common->bus_id] = NULL; i2c_common 388 drivers/i2c/busses/i2c-amd-mp2-pci.c struct amd_i2c_common *i2c_common; i2c_common 393 drivers/i2c/busses/i2c-amd-mp2-pci.c i2c_common = privdata->busses[bus_id]; i2c_common 394 drivers/i2c/busses/i2c-amd-mp2-pci.c if (i2c_common) i2c_common 395 drivers/i2c/busses/i2c-amd-mp2-pci.c i2c_common->suspend(i2c_common); i2c_common 413 drivers/i2c/busses/i2c-amd-mp2-pci.c struct amd_i2c_common *i2c_common; i2c_common 426 drivers/i2c/busses/i2c-amd-mp2-pci.c i2c_common = privdata->busses[bus_id]; i2c_common 427 drivers/i2c/busses/i2c-amd-mp2-pci.c if (i2c_common) { i2c_common 428 drivers/i2c/busses/i2c-amd-mp2-pci.c ret = i2c_common->resume(i2c_common); i2c_common 41 drivers/i2c/busses/i2c-amd-mp2-plat.c static int i2c_amd_dma_map(struct amd_i2c_common *i2c_common) i2c_common 43 drivers/i2c/busses/i2c-amd-mp2-plat.c struct device *dev_pci = &i2c_common->mp2_dev->pci_dev->dev; i2c_common 44 drivers/i2c/busses/i2c-amd-mp2-plat.c struct amd_i2c_dev *i2c_dev = amd_i2c_dev_common(i2c_common); i2c_common 46 drivers/i2c/busses/i2c-amd-mp2-plat.c i2c_common->msg->flags & I2C_M_RD ? i2c_common 49 drivers/i2c/busses/i2c-amd-mp2-plat.c i2c_common->dma_buf = i2c_get_dma_safe_msg_buf(i2c_common->msg, 0); i2c_common 50 drivers/i2c/busses/i2c-amd-mp2-plat.c i2c_common->dma_addr = dma_map_single(dev_pci, i2c_common->dma_buf, i2c_common 51 drivers/i2c/busses/i2c-amd-mp2-plat.c i2c_common->msg->len, i2c_common 54 drivers/i2c/busses/i2c-amd-mp2-plat.c if (unlikely(dma_mapping_error(dev_pci, i2c_common->dma_addr))) { i2c_common 57 drivers/i2c/busses/i2c-amd-mp2-plat.c i2c_common->dma_buf); i2c_common 64 drivers/i2c/busses/i2c-amd-mp2-plat.c static void i2c_amd_dma_unmap(struct amd_i2c_common *i2c_common) i2c_common 66 drivers/i2c/busses/i2c-amd-mp2-plat.c struct device *dev_pci = &i2c_common->mp2_dev->pci_dev->dev; i2c_common 68 drivers/i2c/busses/i2c-amd-mp2-plat.c i2c_common->msg->flags & I2C_M_RD ? i2c_common 71 drivers/i2c/busses/i2c-amd-mp2-plat.c dma_unmap_single(dev_pci, i2c_common->dma_addr, i2c_common 72 drivers/i2c/busses/i2c-amd-mp2-plat.c i2c_common->msg->len, dma_direction); i2c_common 74 drivers/i2c/busses/i2c-amd-mp2-plat.c i2c_put_dma_safe_msg_buf(i2c_common->dma_buf, i2c_common->msg, true); i2c_common 79 drivers/i2c/busses/i2c-amd-mp2-plat.c struct amd_i2c_common *i2c_common = &i2c_dev->common; i2c_common 82 drivers/i2c/busses/i2c-amd-mp2-plat.c i2c_common->cmd_success = false; i2c_common 85 drivers/i2c/busses/i2c-amd-mp2-plat.c static void i2c_amd_cmd_completion(struct amd_i2c_common *i2c_common) i2c_common 87 drivers/i2c/busses/i2c-amd-mp2-plat.c struct amd_i2c_dev *i2c_dev = amd_i2c_dev_common(i2c_common); i2c_common 88 drivers/i2c/busses/i2c-amd-mp2-plat.c union i2c_event *event = &i2c_common->eventval; i2c_common 93 drivers/i2c/busses/i2c-amd-mp2-plat.c i2c_common->msg->buf); i2c_common 100 drivers/i2c/busses/i2c-amd-mp2-plat.c struct amd_i2c_common *i2c_common = &i2c_dev->common; i2c_common 106 drivers/i2c/busses/i2c-amd-mp2-plat.c if ((i2c_common->reqcmd == i2c_read || i2c_common 107 drivers/i2c/busses/i2c-amd-mp2-plat.c i2c_common->reqcmd == i2c_write) && i2c_common 108 drivers/i2c/busses/i2c-amd-mp2-plat.c i2c_common->msg->len > 32) i2c_common 109 drivers/i2c/busses/i2c-amd-mp2-plat.c i2c_amd_dma_unmap(i2c_common); i2c_common 112 drivers/i2c/busses/i2c-amd-mp2-plat.c amd_mp2_rw_timeout(i2c_common); i2c_common 116 drivers/i2c/busses/i2c-amd-mp2-plat.c amd_mp2_process_event(i2c_common); i2c_common 118 drivers/i2c/busses/i2c-amd-mp2-plat.c if (!i2c_common->cmd_success) i2c_common 126 drivers/i2c/busses/i2c-amd-mp2-plat.c struct amd_i2c_common *i2c_common = &i2c_dev->common; i2c_common 129 drivers/i2c/busses/i2c-amd-mp2-plat.c amd_mp2_bus_enable_set(i2c_common, enable); i2c_common 136 drivers/i2c/busses/i2c-amd-mp2-plat.c struct amd_i2c_common *i2c_common = &i2c_dev->common; i2c_common 139 drivers/i2c/busses/i2c-amd-mp2-plat.c i2c_common->msg = pmsg; i2c_common 142 drivers/i2c/busses/i2c-amd-mp2-plat.c if (i2c_amd_dma_map(i2c_common)) i2c_common 146 drivers/i2c/busses/i2c-amd-mp2-plat.c amd_mp2_rw(i2c_common, i2c_read); i2c_common 148 drivers/i2c/busses/i2c-amd-mp2-plat.c amd_mp2_rw(i2c_common, i2c_write); i2c_common 188 drivers/i2c/busses/i2c-amd-mp2-plat.c static int i2c_amd_suspend(struct amd_i2c_common *i2c_common) i2c_common 190 drivers/i2c/busses/i2c-amd-mp2-plat.c struct amd_i2c_dev *i2c_dev = amd_i2c_dev_common(i2c_common); i2c_common 196 drivers/i2c/busses/i2c-amd-mp2-plat.c static int i2c_amd_resume(struct amd_i2c_common *i2c_common) i2c_common 198 drivers/i2c/busses/i2c-amd-mp2-plat.c struct amd_i2c_dev *i2c_dev = amd_i2c_dev_common(i2c_common); i2c_common 334 drivers/i2c/busses/i2c-amd-mp2-plat.c struct amd_i2c_common *i2c_common = &i2c_dev->common; i2c_common 339 drivers/i2c/busses/i2c-amd-mp2-plat.c amd_mp2_unregister_cb(i2c_common); i2c_common 340 drivers/i2c/busses/i2c-amd-mp2-plat.c i2c_common->mp2_dev = NULL; i2c_common 156 drivers/i2c/busses/i2c-amd-mp2.h void (*cmd_completion)(struct amd_i2c_common *i2c_common); i2c_common 164 drivers/i2c/busses/i2c-amd-mp2.h int (*suspend)(struct amd_i2c_common *i2c_common); i2c_common 165 drivers/i2c/busses/i2c-amd-mp2.h int (*resume)(struct amd_i2c_common *i2c_common); i2c_common 196 drivers/i2c/busses/i2c-amd-mp2.h int amd_mp2_rw(struct amd_i2c_common *i2c_common, enum i2c_cmd reqcmd); i2c_common 197 drivers/i2c/busses/i2c-amd-mp2.h int amd_mp2_bus_enable_set(struct amd_i2c_common *i2c_common, bool enable); i2c_common 199 drivers/i2c/busses/i2c-amd-mp2.h void amd_mp2_process_event(struct amd_i2c_common *i2c_common); i2c_common 201 drivers/i2c/busses/i2c-amd-mp2.h void amd_mp2_rw_timeout(struct amd_i2c_common *i2c_common); i2c_common 203 drivers/i2c/busses/i2c-amd-mp2.h int amd_mp2_register_cb(struct amd_i2c_common *i2c_common); i2c_common 204 drivers/i2c/busses/i2c-amd-mp2.h int amd_mp2_unregister_cb(struct amd_i2c_common *i2c_common);