]> git.ipfire.org Git - thirdparty/u-boot.git/blame - drivers/power/pmic/pmic_max8998.c
Add GPL-2.0+ SPDX-License-Identifier to source files
[thirdparty/u-boot.git] / drivers / power / pmic / pmic_max8998.c
CommitLineData
99385858
ŁM
1/*
2 * Copyright (C) 2011 Samsung Electronics
3 * Lukasz Majewski <l.majewski@samsung.com>
4 *
1a459660 5 * SPDX-License-Identifier: GPL-2.0+
99385858
ŁM
6 */
7
8#include <common.h>
c7336815
ŁM
9#include <power/pmic.h>
10#include <power/max8998_pmic.h>
11#include <errno.h>
99385858 12
c7336815 13int pmic_init(unsigned char bus)
99385858 14{
99385858 15 static const char name[] = "MAX8998_PMIC";
c7336815
ŁM
16 struct pmic *p = pmic_alloc();
17
18 if (!p) {
19 printf("%s: POWER allocation error!\n", __func__);
20 return -ENOMEM;
21 }
99385858
ŁM
22
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;
c7336815 30 p->bus = bus;
99385858
ŁM
31
32 return 0;
33}