drivers: i3c: cdns: grab mutex before adjusting prescalers
Grab the mutex before adjusting the prescalers to make sure no transaction is on going. Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
This commit is contained in:
parent
9c48f7eb37
commit
31e821bef6
1 changed files with 5 additions and 0 deletions
|
|
@ -1603,7 +1603,9 @@ static int cdns_i3c_i2c_api_configure(const struct device *dev, uint32_t config)
|
|||
break;
|
||||
}
|
||||
|
||||
k_mutex_lock(&data->bus_lock, K_FOREVER);
|
||||
cdns_i3c_set_prescalers(dev);
|
||||
k_mutex_unlock(&data->bus_lock);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -1632,7 +1634,10 @@ static int cdns_i3c_configure(const struct device *dev, enum i3c_config_type typ
|
|||
|
||||
data->common.ctrl_config.scl.i3c = ctrl_cfg->scl.i3c;
|
||||
data->common.ctrl_config.scl.i2c = ctrl_cfg->scl.i2c;
|
||||
|
||||
k_mutex_lock(&data->bus_lock, K_FOREVER);
|
||||
cdns_i3c_set_prescalers(dev);
|
||||
k_mutex_unlock(&data->bus_lock);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue