On Monday, July 13, 2015 at 05:23:14 PM, Otavio Salvador wrote:
> cgtqmx6eval has a PFUZE100 FSL PMIC connected to I2C2.
> 
> Add support for it.
> 
> Signed-off-by: Otavio Salvador <ota...@ossystems.com.br>
> ---

[..]

> +/* setup board specific PMIC */
> +int power_init_board(void)
> +{
> +     struct pmic *p;
> +     u32 id1, id2, i;
> +     int ret;
> +     char const *lv_mipi;
> +
> +     /* configure I2C multiplexer */
> +     gpio_direction_output(MX6Q_QMX6_PFUZE_MUX, 1);
> +
> +     power_pfuze100_init(I2C_PMIC);
> +     p = pmic_get("PFUZE100");
> +     if (!p)
> +             return -EINVAL;
> +
> +     ret = pmic_probe(p);
> +     if (ret)
> +             return ret;
> +
> +     pmic_reg_read(p, PFUZE100_DEVICEID, &id1);
> +     pmic_reg_read(p, PFUZE100_REVID, &id2);
> +     printf("PFUZE100 Rev. [%02x/%02x] detected\n", id1, id2);
> +
> +     if (id2 >= 0x20) {

Please trim down the indent hell here ...

if (id2 < 0x20)
        return 0;
...

if (!lv_mipi)
        return 0;

for (...) {
        if (strcmp())
                continue;

}

> +             /* set level of MIPI if specified */
> +             lv_mipi = getenv("lv_mipi");
> +             if (lv_mipi) {
> +                     for (i = 0; i < ARRAY_SIZE(mipi_levels); i++) {
> +                             if (!strcmp(mipi_levels[i].name, lv_mipi)) {
> +                                     printf("set MIPI level %s\n",
> +                                            mipi_levels[i].name);
> +                                     ret = pmic_reg_write(p, 
PFUZE100_VGEN4VOL,
> +                                                          
mipi_levels[i].value);
> +                                     if (ret)
> +                                             return ret;
> +                             }
> +                     }
> +             }
> +     }
> +
> +     return 0;
> +}
> +
[...]
_______________________________________________
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot

Reply via email to