summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYe Li <ye.li@nxp.com>2019-01-30 22:05:43 -0800
committerYe Li <ye.li@nxp.com>2022-04-06 18:03:05 +0800
commitbeb5642773daa7d8376dc7f895e3fa1214ee546f (patch)
tree5cf8930ba5edb30518026e7db6608ce7d28e0ac0
parent4769df6bcc2d8ee954bfa95486fdd76da87611dc (diff)
MLK-20886-4 lpi2c: Provide override binding function
We provide override binding function, so the ARCH level can use it to determine if it is ok to bind with lpi2c driver. Signed-off-by: Ye Li <ye.li@nxp.com> (cherry picked from commit b19418270a3d532eacb1069606fa2ab100e04601) (cherry picked from commit 3624faca59ed1dda7cd5f9c688598ea4941cac61) (cherry picked from commit 7cdd8d0ff362c26fd1c5b7682a6b69393ccda59c) (cherry picked from commit 22ac887ad8fb5b44be2f13175d97951343e76707) (cherry picked from commit e1f5476bd466739322cdc5dccc46c88f331ca052)
-rw-r--r--drivers/i2c/imx_lpi2c.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/drivers/i2c/imx_lpi2c.c b/drivers/i2c/imx_lpi2c.c
index 92c500327b..961a6b567d 100644
--- a/drivers/i2c/imx_lpi2c.c
+++ b/drivers/i2c/imx_lpi2c.c
@@ -1,6 +1,7 @@
// SPDX-License-Identifier: GPL-2.0+
/*
* Copyright 2016 Freescale Semiconductors, Inc.
+ * Copyright 2019 NXP
*/
#include <common.h>
@@ -502,6 +503,18 @@ static int imx_lpi2c_probe(struct udevice *bus)
return 0;
}
+int __weak board_imx_lpi2c_bind(struct udevice *dev)
+{
+ return 0;
+}
+
+static int imx_lpi2c_bind(struct udevice *dev)
+{
+ debug("imx_lpi2c_bind, %s, seq %d\n", dev->name, dev_seq(dev));
+
+ return board_imx_lpi2c_bind(dev);
+}
+
static const struct dm_i2c_ops imx_lpi2c_ops = {
.xfer = imx_lpi2c_xfer,
.probe_chip = imx_lpi2c_probe_chip,
@@ -518,6 +531,7 @@ U_BOOT_DRIVER(imx_lpi2c) = {
.name = "imx_lpi2c",
.id = UCLASS_I2C,
.of_match = imx_lpi2c_ids,
+ .bind = imx_lpi2c_bind,
.probe = imx_lpi2c_probe,
.priv_auto = sizeof(struct imx_lpi2c_bus),
.ops = &imx_lpi2c_ops,