/** * union i2c_event : bit access of P2C events * @response: bit 0..1 i2c response type * @status: bit 2..6 status_type * @mem_type: bit 7 0-DRAM; 1-C2P msg o/p * @bus_id: bit 8..11 i2c bus id * @length: bit 12..23 message length * @slave_addr: bit 24-31 slave address
*/ union i2c_event {
u32 ul; struct { enum response_type response : 2; enum status_type status : 5; enum mem_type mem_type : 1;
u8 bus_id : 4;
u32 length : 12;
u32 slave_addr : 8;
} r;
};
/** * struct amd_i2c_common - per bus/i2c adapter context, shared * between the pci and the platform driver * @eventval: MP2 event value set by the IRQ handler * @mp2_dev: MP2 pci device this adapter is part of * @msg: i2c message * @cmd_completion: function called by the IRQ handler to signal * the platform driver * @reqcmd: requested i2c command type * @cmd_success: set to true if the MP2 responded to a command with * the expected status and response type * @bus_id: bus index * @i2c_speed: i2c bus speed determined by the slowest slave * @dma_buf: if msg length > 32, holds the DMA buffer virtual address * @dma_addr: if msg length > 32, holds the DMA buffer address
*/ struct amd_i2c_common { union i2c_event eventval; struct amd_mp2_dev *mp2_dev; struct i2c_msg *msg; void (*cmd_completion)(struct amd_i2c_common *i2c_common); enum i2c_cmd reqcmd;
u8 cmd_success;
u8 bus_id; enum speed_enum i2c_speed;
u8 *dma_buf;
dma_addr_t dma_addr; #ifdef CONFIG_PM int (*suspend)(struct amd_i2c_common *i2c_common); int (*resume)(struct amd_i2c_common *i2c_common); #endif/* CONFIG_PM */
};
/** * struct amd_mp2_dev - per PCI device context * @pci_dev: PCI driver node * @busses: MP2 devices may have up to two busses, * each bus corresponding to an i2c adapter * @mmio: iommapped registers * @c2p_lock: controls access to the C2P mailbox shared between * the two adapters * @c2p_lock_busid: id of the adapter which locked c2p_lock
*/ struct amd_mp2_dev { struct pci_dev *pci_dev; struct amd_i2c_common *busses[2]; void __iomem *mmio; struct mutex c2p_lock;
u8 c2p_lock_busid; unsignedint probed; int dev_irq;
};
/* PCIe communication driver */
int amd_mp2_rw(struct amd_i2c_common *i2c_common, enum i2c_cmd reqcmd); int amd_mp2_bus_enable_set(struct amd_i2c_common *i2c_common, bool enable);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.