blob: a6d97252bc9e644de9f467864a6de9e82aed3bd4 [file] [log] [blame]
Tom Rini10e47792018-05-06 17:58:06 -04001// SPDX-License-Identifier: GPL-2.0+
Adrian Alonso9072cb22015-08-11 11:19:49 -05002/*
3 * Copyright (C) 2015 Freescale Semiconductor, Inc.
4 * Peng Fan <Peng.Fan@freescale.com>
Adrian Alonso9072cb22015-08-11 11:19:49 -05005 */
6
7#include <common.h>
8#include <errno.h>
9#include <i2c.h>
10#include <power/pmic.h>
11#include <power/pfuze3000_pmic.h>
12
13int power_pfuze3000_init(unsigned char bus)
14{
15 static const char name[] = "PFUZE3000";
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;
Trent Piepho3713c9b2018-04-25 10:06:00 -070025 p->number_of_regs = PFUZE3000_NUM_OF_REGS;
Tom Riniadce81d2022-12-04 10:13:36 -050026 p->hw.i2c.addr = CFG_POWER_PFUZE3000_I2C_ADDR;
Adrian Alonso9072cb22015-08-11 11:19:49 -050027 p->hw.i2c.tx_num = 1;
28 p->bus = bus;
29
30 return 0;
31}