blob: ca2f504cc7a11cd0238dc29dd30eea5b38b69b11 [file] [log] [blame]
Łukasz Majewskibad888c2011-10-03 19:45:50 +00001/*
2 * Copyright (C) 2011 Samsung Electronics
3 * Lukasz Majewski <l.majewski@samsung.com>
4 *
Wolfgang Denkd79de1d2013-07-08 09:37:19 +02005 * SPDX-License-Identifier: GPL-2.0+
Łukasz Majewskibad888c2011-10-03 19:45:50 +00006 */
7
8#include <common.h>
Łukasz Majewski1c6dba12012-11-13 03:21:55 +00009#include <power/pmic.h>
10#include <power/max8998_pmic.h>
11#include <errno.h>
Łukasz Majewskibad888c2011-10-03 19:45:50 +000012
Łukasz Majewski1c6dba12012-11-13 03:21:55 +000013int pmic_init(unsigned char bus)
Łukasz Majewskibad888c2011-10-03 19:45:50 +000014{
Łukasz Majewskibad888c2011-10-03 19:45:50 +000015 static const char name[] = "MAX8998_PMIC";
Łukasz Majewski1c6dba12012-11-13 03:21:55 +000016 struct pmic *p = pmic_alloc();
17
18 if (!p) {
19 printf("%s: POWER allocation error!\n", __func__);
20 return -ENOMEM;
21 }
Łukasz Majewskibad888c2011-10-03 19:45:50 +000022
23 puts("Board PMIC init\n");
24
25 p->name = name;
26 p->interface = PMIC_I2C;
27 p->number_of_regs = PMIC_NUM_OF_REGS;
28 p->hw.i2c.addr = MAX8998_I2C_ADDR;
29 p->hw.i2c.tx_num = 1;
Łukasz Majewski1c6dba12012-11-13 03:21:55 +000030 p->bus = bus;
Łukasz Majewskibad888c2011-10-03 19:45:50 +000031
32 return 0;
33}