On 07/30/2015 12:23 PM, Simon Glass wrote:
Hi Stephen,

On 30 July 2015 at 12:13, Stephen Warren <swar...@wwwdotorg.org> wrote:
On 07/29/2015 05:02 PM, Simon Glass wrote:

Hi Stephen,

On 29 July 2015 at 13:48, Stephen Warren <swar...@wwwdotorg.org> wrote:

diff --git a/board/nvidia/e2220-1170/e2220-1170.c
b/board/nvidia/e2220-1170/e2220-1170.c

+void pin_mux_mmc(void)
+{
+       struct udevice *dev;
+       uchar val;
+       int ret;
+
+       /* Turn on MAX77620 LDO2 to 3.3V for SD card power */
+       ret = i2c_get_chip_for_busnum(0, 0x3c, 1, &dev);
+       if (ret) {
+               printf("%s: Cannot find MAX77620 I2C chip\n", __func__);
+               return;
+       }
+       val = 0xf2;
+       ret = dm_i2c_write(dev, 0x27, &val, 1);
+       if (ret)
+               printf("i2c_write 0 0x3c 0x27 failed: %d\n", ret);


Shouldn't this be in a PMIC driver?


I think the overall amount of code contained in U-Boot ends up being a lot
smaller this way; it simply and directly performs some necessary I2C writes,
and V2 contains better comments describing the operation. This avoids all
the overhead of creating a PMIC driver and instantiating it etc. This code
is also consistent in style with many other Tegra boards. I'm rather
inclined to leave this as-is unless there's some particular advantage you
can state to creating a PMIC driver (I had thought of that original, but
shied away from the large overhead/infrastructure involved with that.)

If this is the only write that happens to the PMIC then that is fine.
But when you add other things, won't we need to adjust more things?

I believe for the set of peripherals we're likely to support in U-Boot, this is enough. On the off-chance we add HDMI or USB3 host support, perhaps we'll need more regulators, but that's not something that's likely to happen soon.
_______________________________________________
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot

Reply via email to