~pmdj/ubuntu/trusty/qemu/2.9+applesmc+fadtv3

« back to all changes in this revision

Viewing changes to roms/u-boot/drivers/power/power_dialog.c

  • Committer: Phil Dennis-Jordan
  • Date: 2017-07-21 08:03:43 UTC
  • mfrom: (1.1.1)
  • Revision ID: phil@philjordan.eu-20170721080343-2yr2vdj7713czahv
New upstream release 2.9.0.

Show diffs side-by-side

added added

removed removed

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