diff options
author | Adam Ford <aford173@gmail.com> | 2018-08-20 20:24:35 -0500 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2018-09-11 21:38:47 -0400 |
commit | 410c505cc145d570662ef0f841a942e650f8b1df (patch) | |
tree | 3fc4bc92a0664e850810e8f2d4d88039efc80e0c | |
parent | afa8cdd60755784a74ec4683106a2abe718f9623 (diff) |
DM: OMAP24XX_I2C: Reduce overhead when used with OF_PLATDATA
Platforms with limited resources in SPL may enably OF_PLATDATA,
this limits some of the library functions and cannot extract data
from the device tree. This patch adds additional wrappers around
these functions to only allow them when OF_CONTROL is enabled and
OF_PLATDATA is not.
Signed-off-by: Adam Ford <aford173@gmail.com>
-rw-r--r-- | drivers/i2c/omap24xx_i2c.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/drivers/i2c/omap24xx_i2c.c b/drivers/i2c/omap24xx_i2c.c index 0759585c9e..54bf35e552 100644 --- a/drivers/i2c/omap24xx_i2c.c +++ b/drivers/i2c/omap24xx_i2c.c @@ -890,6 +890,7 @@ static int omap_i2c_probe(struct udevice *bus) return 0; } +#if CONFIG_IS_ENABLED(OF_CONTROL) && !CONFIG_IS_ENABLED(OF_PLATDATA) static int omap_i2c_ofdata_to_platdata(struct udevice *bus) { struct omap_i2c *priv = dev_get_priv(bus); @@ -901,23 +902,26 @@ static int omap_i2c_ofdata_to_platdata(struct udevice *bus) return 0; } -static const struct dm_i2c_ops omap_i2c_ops = { - .xfer = omap_i2c_xfer, - .probe_chip = omap_i2c_probe_chip, - .set_bus_speed = omap_i2c_set_bus_speed, -}; - static const struct udevice_id omap_i2c_ids[] = { { .compatible = "ti,omap3-i2c" }, { .compatible = "ti,omap4-i2c" }, { } }; +#endif + +static const struct dm_i2c_ops omap_i2c_ops = { + .xfer = omap_i2c_xfer, + .probe_chip = omap_i2c_probe_chip, + .set_bus_speed = omap_i2c_set_bus_speed, +}; U_BOOT_DRIVER(i2c_omap) = { .name = "i2c_omap", .id = UCLASS_I2C, +#if CONFIG_IS_ENABLED(OF_CONTROL) && !CONFIG_IS_ENABLED(OF_PLATDATA) .of_match = omap_i2c_ids, .ofdata_to_platdata = omap_i2c_ofdata_to_platdata, +#endif .probe = omap_i2c_probe, .priv_auto_alloc_size = sizeof(struct omap_i2c), .ops = &omap_i2c_ops, |