1 // SPDX-License-Identifier: GPL-2.0+ 2 /* 3 * Copyright (C) 2011 Samsung Electronics 4 * Lukasz Majewski <l.majewski (at) samsung.com> 5 */ 6 7 #include <common.h> 8 #include <power/pmic.h> 9 #include <power/max8998_pmic.h> 10 #include <errno.h> 11 12 int pmic_init(unsigned char bus) 13 { 14 static const char name[] = "MAX8998_PMIC"; 15 struct pmic *p = pmic_alloc(); 16 17 if (!p) { 18 printf("%s: POWER allocation error!\n", __func__); 19 return -ENOMEM; 20 } 21 22 puts("Board PMIC init\n"); 23 24 p->name = name; 25 p->interface = PMIC_I2C; 26 p->number_of_regs = PMIC_NUM_OF_REGS; 27 p->hw.i2c.addr = MAX8998_I2C_ADDR; 28 p->hw.i2c.tx_num = 1; 29 p->bus = bus; 30 31 return 0; 32 } 33