Skip to content

Commit 945dc6e

Browse files
rgundinashif
authored andcommitted
drivers: i2c_mchp_xec: Set Default Configuration
The default configuration is made to be "master" at "standard speed". This makes it possible to use the driver without having to configure it. Signed-off-by: Rajavardhan Gundi <[email protected]>
1 parent ff4e84b commit 945dc6e

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

drivers/i2c/i2c_mchp_xec.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -619,10 +619,20 @@ static int i2c_xec_init(const struct device *dev)
619619
{
620620
struct i2c_xec_data *data =
621621
(struct i2c_xec_data *const) (dev->data);
622+
int ret;
622623

623624
data->pending_stop = 0;
624625
data->slave_attached = false;
625626

627+
/* Default configuration */
628+
ret = i2c_xec_configure(dev,
629+
I2C_MODE_MASTER |
630+
I2C_SPEED_SET(I2C_SPEED_STANDARD));
631+
if (ret) {
632+
LOG_ERR("i2c configure failed %d", ret);
633+
return ret;
634+
}
635+
626636
#ifdef CONFIG_I2C_SLAVE
627637
const struct i2c_xec_config *config =
628638
(const struct i2c_xec_config *const) (dev->config);

0 commit comments

Comments
 (0)