History

i2c: core: Provide generic definitions for bus frequencies

There are few maximum bus frequencies being used in the I²C core code. Provide generic definitions for bus frequencies and use them in the core. The drivers may use predefined constants where it is appropriate. Some of them are already using these under slightly different names. We will convert them later to use newly introduced defines. Note, the name of modes are chosen to follow well established naming scheme [1]. These definitions will also help to avoid typos in the numbers that may lead to subtle errors. [1]: https://en.wikipedia.org/wiki/I%C2%B2C#Differences_between_modes

Andy Shevchenko committed 6 years ago

Commit e6282fc1 parent e7c69fd3 files · +13 −5Browse files

Showing the changes to include/linux (1 of 3 files). Show all

Unified · Split

include/linux/i2c.h+8−0
@@ -39,6 +39,14 @@ enum i2c_slave_event; · 38 unmodified lines
39typedef int (*i2c_slave_cb_t)(struct i2c_client *client,39typedef int (*i2c_slave_cb_t)(struct i2c_client *client,
40 enum i2c_slave_event event, u8 *val);40 enum i2c_slave_event event, u8 *val);
41 41
42/* I2C Frequency Modes */
43#define I2C_MAX_STANDARD_MODE_FREQ 100000
44#define I2C_MAX_FAST_MODE_FREQ 400000
45#define I2C_MAX_FAST_MODE_PLUS_FREQ 1000000
46#define I2C_MAX_TURBO_MODE_FREQ 1400000
47#define I2C_MAX_HIGH_SPEED_MODE_FREQ 3400000
48#define I2C_MAX_ULTRA_FAST_MODE_FREQ 5000000
49
42struct module;50struct module;
43struct property_entry;51struct property_entry;
44 52