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