File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -127,23 +127,25 @@ struct mss_i2c_data {
127
127
};
128
128
129
129
130
- static int mss_i2c_configure (const struct device * dev , uint32_t dev_config_raw )
130
+ static int mss_i2c_configure (const struct device * dev , uint32_t dev_config )
131
131
{
132
132
const struct mss_i2c_config * cfg = dev -> config ;
133
133
134
134
uint8_t ctrl = sys_read8 (cfg -> i2c_base_addr + CORE_I2C_CTRL );
135
+ ctrl &= ~CLK_MASK ;
135
136
136
- switch (I2C_SPEED_GET (dev_config_raw )) {
137
+ switch (I2C_SPEED_GET (dev_config )) {
137
138
case I2C_SPEED_STANDARD :
138
- sys_write8 (( ctrl | PCLK_DIV_960 ), cfg -> i2c_base_addr + CORE_I2C_CTRL ) ;
139
+ ctrl |= PCLK_DIV_960 ;
139
140
break ;
140
141
case I2C_SPEED_FAST :
141
- sys_write8 (( ctrl | PCLK_DIV_256 ), cfg -> i2c_base_addr + CORE_I2C_CTRL ) ;
142
+ ctrl |= PCLK_DIV_256 ;
142
143
break ;
143
144
default :
144
145
return - EINVAL ;
145
146
}
146
147
148
+ sys_write8 (ctrl , cfg -> i2c_base_addr + CORE_I2C_CTRL );
147
149
return 0 ;
148
150
}
149
151
You can’t perform that action at this time.
0 commit comments