mirror of
https://github.com/torvalds/linux.git
synced 2024-11-23 12:42:02 +00:00
i2c: algo: Use generic definitions for bus frequencies
Since we have generic definitions for bus frequencies, let's use them. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
This commit is contained in:
parent
83672db7d6
commit
7b8c4c0b2a
@ -459,17 +459,17 @@ static int pca_init(struct i2c_adapter *adap)
|
||||
/* To avoid integer overflow, use clock/100 for calculations */
|
||||
clock = pca_clock(pca_data) / 100;
|
||||
|
||||
if (pca_data->i2c_clock > 1000000) {
|
||||
if (pca_data->i2c_clock > I2C_MAX_FAST_MODE_PLUS_FREQ) {
|
||||
mode = I2C_PCA_MODE_TURBO;
|
||||
min_tlow = 14;
|
||||
min_thi = 5;
|
||||
raise_fall_time = 22; /* Raise 11e-8s, Fall 11e-8s */
|
||||
} else if (pca_data->i2c_clock > 400000) {
|
||||
} else if (pca_data->i2c_clock > I2C_MAX_FAST_MODE_FREQ) {
|
||||
mode = I2C_PCA_MODE_FASTP;
|
||||
min_tlow = 17;
|
||||
min_thi = 9;
|
||||
raise_fall_time = 22; /* Raise 11e-8s, Fall 11e-8s */
|
||||
} else if (pca_data->i2c_clock > 100000) {
|
||||
} else if (pca_data->i2c_clock > I2C_MAX_STANDARD_MODE_FREQ) {
|
||||
mode = I2C_PCA_MODE_FAST;
|
||||
min_tlow = 44;
|
||||
min_thi = 20;
|
||||
|
Loading…
Reference in New Issue
Block a user