From 670fc3230d2067af3c49da5e3071b0f53f919b37 Mon Sep 17 00:00:00 2001 From: Kumar Gala Date: Thu, 10 Aug 2017 11:22:24 -0500 Subject: [PATCH] i2c: Cleanup dts clock-frequency property usage Clarify that the clock-frequency is the bitrate at boot and introduce defines that .dts files can use to set the clock-frequency. Signed-off-by: Kumar Gala --- dts/common/yaml/i2c.yaml | 2 +- include/dt-bindings/i2c/i2c.h | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 include/dt-bindings/i2c/i2c.h diff --git a/dts/common/yaml/i2c.yaml b/dts/common/yaml/i2c.yaml index 480631338a6..65b50af72dd 100644 --- a/dts/common/yaml/i2c.yaml +++ b/dts/common/yaml/i2c.yaml @@ -18,7 +18,7 @@ properties: - clock-frequency : type: int category: optional - description: Maximum I2C bus clock frequency in Hz + description: Initial clock frequency in Hz generation: define - clocks: type: array diff --git a/include/dt-bindings/i2c/i2c.h b/include/dt-bindings/i2c/i2c.h new file mode 100644 index 00000000000..358fc947096 --- /dev/null +++ b/include/dt-bindings/i2c/i2c.h @@ -0,0 +1,15 @@ +/* + * Copyright (c) 2017 Linaro Limited + * + * SPDX-License-Identifier: Apache-2.0 + */ +#ifndef __DT_BINDINGS_I2C_I2C_H +#define __DT_BINDINGS_I2C_I2C_H + +#define I2C_BITRATE_STANDARD 100000 /* 100 Kbit/s */ +#define I2C_BITRATE_FAST 400000 /* 400 Kbit/s */ +#define I2C_BITRATE_FAST_PLUS 1000000 /* 1 Mbit/s */ +#define I2C_BITRATE_HIGH 3400000 /* 3.4 Mbit/s */ +#define I2C_BITRATE_ULTRA 5000000 /* 5 Mbit/s */ + +#endif /* __DT_BINDINGS_I2C_I2C_H */