blob: 9dd1c46ea220bf3d258b597713b2d7b782b0097d [file] [log] [blame]
Tom Rini83d290c2018-05-06 17:58:06 -04001// SPDX-License-Identifier: GPL-2.0+
Hou Zhiqiang762161b2016-12-09 16:08:57 +08002/*
3 * Copyright 2016 Freescale Semiconductor, Inc.
4 * Hou Zhiqiang <Zhiqiang.Hou@freescale.com>
Hou Zhiqiang762161b2016-12-09 16:08:57 +08005 */
6
7#include <common.h>
8#include <errno.h>
9#include <i2c.h>
10#include <power/pmic.h>
11#include <power/mc34vr500_pmic.h>
12
13int power_mc34vr500_init(unsigned char bus)
14{
15 static const char name[] = "MC34VR500";
16 struct pmic *p = pmic_alloc();
17
18 if (!p) {
19 printf("%s: POWER allocation error!\n", __func__);
20 return -ENOMEM;
21 }
22
23 p->name = name;
24 p->interface = PMIC_I2C;
25 p->number_of_regs = MC34VR500_NUM_OF_REGS;
26 p->hw.i2c.addr = MC34VR500_I2C_ADDR;
27 p->hw.i2c.tx_num = 1;
28 p->bus = bus;
29
30 return 0;
31}