drivers: i2c: litex: add get_config and recover_bus
add get_config and recover_bus for the litex i2c driver. Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
This commit is contained in:
parent
2be9ed7103
commit
dd1f9c346d
1 changed files with 16 additions and 0 deletions
|
@ -114,6 +114,13 @@ static int i2c_litex_configure(const struct device *dev, uint32_t dev_config)
|
||||||
return i2c_bitbang_configure(bitbang, dev_config);
|
return i2c_bitbang_configure(bitbang, dev_config);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int i2c_litex_get_config(const struct device *dev, uint32_t *config)
|
||||||
|
{
|
||||||
|
struct i2c_bitbang *bitbang = GET_I2C_BITBANG(dev);
|
||||||
|
|
||||||
|
return i2c_bitbang_get_config(bitbang, config);
|
||||||
|
}
|
||||||
|
|
||||||
static int i2c_litex_transfer(const struct device *dev, struct i2c_msg *msgs,
|
static int i2c_litex_transfer(const struct device *dev, struct i2c_msg *msgs,
|
||||||
uint8_t num_msgs, uint16_t addr)
|
uint8_t num_msgs, uint16_t addr)
|
||||||
{
|
{
|
||||||
|
@ -122,9 +129,18 @@ static int i2c_litex_transfer(const struct device *dev, struct i2c_msg *msgs,
|
||||||
return i2c_bitbang_transfer(bitbang, msgs, num_msgs, addr);
|
return i2c_bitbang_transfer(bitbang, msgs, num_msgs, addr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int i2c_litex_recover_bus(const struct device *dev)
|
||||||
|
{
|
||||||
|
struct i2c_bitbang *bitbang = GET_I2C_BITBANG(dev);
|
||||||
|
|
||||||
|
return i2c_bitbang_recover_bus(bitbang);
|
||||||
|
}
|
||||||
|
|
||||||
static const struct i2c_driver_api i2c_litex_driver_api = {
|
static const struct i2c_driver_api i2c_litex_driver_api = {
|
||||||
.configure = i2c_litex_configure,
|
.configure = i2c_litex_configure,
|
||||||
|
.get_config = i2c_litex_get_config,
|
||||||
.transfer = i2c_litex_transfer,
|
.transfer = i2c_litex_transfer,
|
||||||
|
.recover_bus = i2c_litex_recover_bus,
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Device Instantiation */
|
/* Device Instantiation */
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue