Blame view
drivers/power/power_dialog.c
617 Bytes
20831061d
|
1 2 3 4 |
/* * Copyright (C) 2011 Samsung Electronics * Lukasz Majewski <l.majewski@samsung.com> * |
1a4596601
|
5 |
* SPDX-License-Identifier: GPL-2.0+ |
20831061d
|
6 7 8 |
*/ #include <common.h> |
c73368150
|
9 |
#include <power/pmic.h> |
20831061d
|
10 |
#include <dialog_pmic.h> |
c73368150
|
11 |
#include <errno.h> |
20831061d
|
12 |
|
c73368150
|
13 |
int pmic_dialog_init(unsigned char bus) |
20831061d
|
14 |
{ |
20831061d
|
15 |
static const char name[] = "DIALOG_PMIC"; |
c73368150
|
16 17 18 19 20 21 22 |
struct pmic *p = pmic_alloc(); if (!p) { printf("%s: POWER allocation error! ", __func__); return -ENOMEM; } |
20831061d
|
23 24 |
p->name = name; |
ed5157e88
|
25 |
p->number_of_regs = DIALOG_NUM_OF_REGS; |
20831061d
|
26 27 28 29 |
p->interface = PMIC_I2C; p->hw.i2c.addr = CONFIG_SYS_DIALOG_PMIC_I2C_ADDR; p->hw.i2c.tx_num = 1; |
c73368150
|
30 |
p->bus = bus; |
20831061d
|
31 32 33 |
return 0; } |