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