dm: gpio: Allow control of GPIO uclass in SPL
[oweals/u-boot.git] / drivers / i2c / tegra186_bpmp_i2c.c
index 88e8413d9e07fc6e58ca63e45b3017cbbc52213f..793f3f59b5dd9d3f8470ace157484fc71d973f8b 100644 (file)
@@ -1,7 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0
 /*
  * Copyright (c) 2016, NVIDIA CORPORATION.
- *
- * SPDX-License-Identifier: GPL-2.0
  */
 
 #include <common.h>
@@ -86,25 +85,21 @@ static int tegra186_bpmp_i2c_xfer(struct udevice *dev, struct i2c_msg *msg,
        return 0;
 }
 
+static int tegra186_bpmp_probe_chip(struct udevice *bus, uint chip_addr,
+                                   uint chip_flags)
+{
+       return 0;
+}
+
 static int tegra186_bpmp_i2c_probe(struct udevice *dev)
 {
        struct tegra186_bpmp_i2c *priv = dev_get_priv(dev);
-       int ret;
-       struct fdtdec_phandle_args args;
-
-       ret = fdtdec_parse_phandle_with_args(gd->fdt_blob, dev->of_offset,
-                                            "nvidia,bpmp", NULL, 0, 0, &args);
-       if (ret < 0) {
-               debug("%s: fdtdec_parse_phandle_with_args() failed: %d\n",
-                     __func__, ret);
-               return ret;
-       }
 
-       priv->bpmp_bus_id = fdtdec_get_uint(gd->fdt_blob, dev->of_offset,
+       priv->bpmp_bus_id = fdtdec_get_uint(gd->fdt_blob, dev_of_offset(dev),
                                            "nvidia,bpmp-bus-id", U32_MAX);
        if (priv->bpmp_bus_id == U32_MAX) {
                debug("%s: could not parse nvidia,bpmp-bus-id\n", __func__);
-               return -ENODEV;
+               return -EINVAL;
        }
 
        return 0;
@@ -112,6 +107,7 @@ static int tegra186_bpmp_i2c_probe(struct udevice *dev)
 
 static const struct dm_i2c_ops tegra186_bpmp_i2c_ops = {
        .xfer = tegra186_bpmp_i2c_xfer,
+       .probe_chip = tegra186_bpmp_probe_chip,
 };
 
 static const struct udevice_id tegra186_bpmp_i2c_ids[] = {