mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-05 00:33:55 -06:00
hw/i2c: add pca954x i2c-mux switch
The pca954x is an i2c mux, and this adds support for two variants of this device: the pca9546 and pca9548. This device is very common on BMCs to route a different channel to each PCIe i2c bus downstream from the BMC. Signed-off-by: Patrick Venture <venture@google.com> Reviewed-by: Hao Wu <wuhaotsh@google.com> Reviewed-by: Havard Skinnemoen <hskinnemoen@google.com> Message-Id: <20210412194522.664594-5-venture@google.com> Signed-off-by: Corey Minyard <cminyard@mvista.com>
This commit is contained in:
parent
3f9b32595e
commit
065177eece
6 changed files with 325 additions and 0 deletions
19
include/hw/i2c/i2c_mux_pca954x.h
Normal file
19
include/hw/i2c/i2c_mux_pca954x.h
Normal file
|
@ -0,0 +1,19 @@
|
|||
#ifndef QEMU_I2C_MUX_PCA954X
|
||||
#define QEMU_I2C_MUX_PCA954X
|
||||
|
||||
#include "hw/i2c/i2c.h"
|
||||
|
||||
#define TYPE_PCA9546 "pca9546"
|
||||
#define TYPE_PCA9548 "pca9548"
|
||||
|
||||
/**
|
||||
* Retrieves the i2c bus associated with the specified channel on this i2c
|
||||
* mux.
|
||||
* @mux: an i2c mux device.
|
||||
* @channel: the i2c channel requested
|
||||
*
|
||||
* Returns: a pointer to the associated i2c bus.
|
||||
*/
|
||||
I2CBus *pca954x_i2c_get_bus(I2CSlave *mux, uint8_t channel);
|
||||
|
||||
#endif
|
Loading…
Add table
Add a link
Reference in a new issue