Tom Rini | 83d290c | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0+ |
Łukasz Majewski | 9938585 | 2011-10-03 19:45:50 +0000 | [diff] [blame] | 2 | /* |
| 3 | * Copyright (C) 2011 Samsung Electronics |
| 4 | * Lukasz Majewski <l.majewski@samsung.com> |
Łukasz Majewski | 9938585 | 2011-10-03 19:45:50 +0000 | [diff] [blame] | 5 | */ |
| 6 | |
| 7 | #include <common.h> |
Łukasz Majewski | c733681 | 2012-11-13 03:21:55 +0000 | [diff] [blame] | 8 | #include <power/pmic.h> |
| 9 | #include <power/max8998_pmic.h> |
| 10 | #include <errno.h> |
Łukasz Majewski | 9938585 | 2011-10-03 19:45:50 +0000 | [diff] [blame] | 11 | |
Łukasz Majewski | c733681 | 2012-11-13 03:21:55 +0000 | [diff] [blame] | 12 | int pmic_init(unsigned char bus) |
Łukasz Majewski | 9938585 | 2011-10-03 19:45:50 +0000 | [diff] [blame] | 13 | { |
Łukasz Majewski | 9938585 | 2011-10-03 19:45:50 +0000 | [diff] [blame] | 14 | static const char name[] = "MAX8998_PMIC"; |
Łukasz Majewski | c733681 | 2012-11-13 03:21:55 +0000 | [diff] [blame] | 15 | struct pmic *p = pmic_alloc(); |
| 16 | |
| 17 | if (!p) { |
| 18 | printf("%s: POWER allocation error!\n", __func__); |
| 19 | return -ENOMEM; |
| 20 | } |
Łukasz Majewski | 9938585 | 2011-10-03 19:45:50 +0000 | [diff] [blame] | 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; |
Łukasz Majewski | c733681 | 2012-11-13 03:21:55 +0000 | [diff] [blame] | 29 | p->bus = bus; |
Łukasz Majewski | 9938585 | 2011-10-03 19:45:50 +0000 | [diff] [blame] | 30 | |
| 31 | return 0; |
| 32 | } |