summaryrefslogtreecommitdiff
path: root/drivers/i2c/designware_i2c.h
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2020-01-23 11:48:11 -0700
committerHeiko Schocher <hs@denx.de>2020-01-27 07:21:05 +0100
commit80a03db4f3bfac8220d0445c33aee24c5a3c13b1 (patch)
treeb18ea1de3a654c683fe59aec4b000a97f0d9369f /drivers/i2c/designware_i2c.h
parent9bb743d9c76b5aa98bc29e54aeefea1204a31c15 (diff)
i2c: designware_i2c: Read device-tree properties
The i2c controller defines a few timing properties. Read these in and store them for use by the driver. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Heiko Schocher <hs@denx.de>
Diffstat (limited to 'drivers/i2c/designware_i2c.h')
-rw-r--r--drivers/i2c/designware_i2c.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/drivers/i2c/designware_i2c.h b/drivers/i2c/designware_i2c.h
index 5b477830d4..f32dc0f854 100644
--- a/drivers/i2c/designware_i2c.h
+++ b/drivers/i2c/designware_i2c.h
@@ -167,10 +167,24 @@ struct dw_scl_sda_cfg {
u32 sda_hold;
};
+/**
+ * struct dw_i2c - private information for the bus
+ *
+ * @regs: Registers pointer
+ * @scl_sda_cfg: Deprecated information for x86 (should move to device tree)
+ * @resets: Resets for the I2C controller
+ * @scl_rise_time_ns: Configured SCL rise time in nanoseconds
+ * @scl_fall_time_ns: Configured SCL fall time in nanoseconds
+ * @sda_hold_time_ns: Configured SDA hold time in nanoseconds
+ * @clk: Clock input to the I2C controller
+ */
struct dw_i2c {
struct i2c_regs *regs;
struct dw_scl_sda_cfg *scl_sda_cfg;
struct reset_ctl_bulk resets;
+ u32 scl_rise_time_ns;
+ u32 scl_fall_time_ns;
+ u32 sda_hold_time_ns;
#if CONFIG_IS_ENABLED(CLK)
struct clk clk;
#endif
@@ -180,5 +194,6 @@ extern const struct dm_i2c_ops designware_i2c_ops;
int designware_i2c_probe(struct udevice *bus);
int designware_i2c_remove(struct udevice *dev);
+int designware_i2c_ofdata_to_platdata(struct udevice *bus);
#endif /* __DW_I2C_H_ */