[U-Boot] [PATCH v3 2/3] pmic:pfuze implement pmic_mode_init
Fabio Estevam
festevam at gmail.com
Fri Jan 16 16:34:22 CET 2015
On Fri, Jan 16, 2015 at 1:25 PM, Peng Fan <Peng.Fan at freescale.com> wrote:
> +int pfuze_mode_init(struct pmic *p, u32 mode)
> +{
> + unsigned char offset, i, switch_num;
> + u32 id, ret;
> +
> + pmic_reg_read(p, PFUZE100_DEVICEID, &id);
> + id = id & 0xf;
> +
> + if (id == 0) {
> + switch_num = 6;
> + offset = PFUZE100_SW1CMODE;
> + } else if (id == 1) {
> + switch_num = 4;
> + offset = PFUZE100_SW2MODE;
> + } else {
> + printf("Not supported, id=%d\n", id);
> + return -1;
return -EINVAL would be better.
More information about the U-Boot
mailing list