diff options
author | Simon Glass <sjg@chromium.org> | 2020-01-23 11:48:26 -0700 |
---|---|---|
committer | Heiko Schocher <hs@denx.de> | 2020-01-27 07:25:00 +0100 |
commit | 2034f6c27fc91407fe8bbd36670714b77d9ef1dc (patch) | |
tree | ca1b480da809db0882686df664689552135bf0bb /drivers/i2c/designware_i2c.c | |
parent | 23ad52ebb1e5b322e22c5c6b9d1a06b36fdc97c0 (diff) | |
download | u-boot-2034f6c27fc91407fe8bbd36670714b77d9ef1dc.zip u-boot-2034f6c27fc91407fe8bbd36670714b77d9ef1dc.tar.gz u-boot-2034f6c27fc91407fe8bbd36670714b77d9ef1dc.tar.bz2 |
i2c: designware_i2c: Do more in the probe() method
Move some of the code currently in the ofdata_to_platdata() method to
probe() so that it is not executed when generating ACPI tables.
Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'drivers/i2c/designware_i2c.c')
-rw-r--r-- | drivers/i2c/designware_i2c.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/drivers/i2c/designware_i2c.c b/drivers/i2c/designware_i2c.c index 39af25a..c8c5d2c 100644 --- a/drivers/i2c/designware_i2c.c +++ b/drivers/i2c/designware_i2c.c @@ -704,6 +704,7 @@ static int designware_i2c_probe_chip(struct udevice *bus, uint chip_addr, int designware_i2c_ofdata_to_platdata(struct udevice *bus) { struct dw_i2c *priv = dev_get_priv(bus); + int ret; if (!priv->regs) priv->regs = (struct i2c_regs *)devfdt_get_addr_ptr(bus); @@ -711,14 +712,6 @@ int designware_i2c_ofdata_to_platdata(struct udevice *bus) dev_read_u32(bus, "i2c-scl-falling-time-ns", &priv->scl_fall_time_ns); dev_read_u32(bus, "i2c-sda-hold-time-ns", &priv->sda_hold_time_ns); - return 0; -} - -int designware_i2c_probe(struct udevice *bus) -{ - struct dw_i2c *priv = dev_get_priv(bus); - int ret; - ret = reset_get_bulk(bus, &priv->resets); if (ret) dev_warn(bus, "Can't get reset: %d\n", ret); @@ -738,6 +731,13 @@ int designware_i2c_probe(struct udevice *bus) } #endif + return 0; +} + +int designware_i2c_probe(struct udevice *bus) +{ + struct dw_i2c *priv = dev_get_priv(bus); + return __dw_i2c_init(priv->regs, 0, 0); } |