]> git.ipfire.org Git - people/ms/u-boot.git/blame - drivers/power/power_dialog.c
net: sh_eth: Fix DT base address fetching
[people/ms/u-boot.git] / drivers / power / power_dialog.c
CommitLineData
20831061
FE
1/*
2 * Copyright (C) 2011 Samsung Electronics
3 * Lukasz Majewski <l.majewski@samsung.com>
4 *
1a459660 5 * SPDX-License-Identifier: GPL-2.0+
20831061
FE
6 */
7
8#include <common.h>
c7336815 9#include <power/pmic.h>
20831061 10#include <dialog_pmic.h>
c7336815 11#include <errno.h>
20831061 12
c7336815 13int pmic_dialog_init(unsigned char bus)
20831061 14{
20831061 15 static const char name[] = "DIALOG_PMIC";
c7336815
ŁM
16 struct pmic *p = pmic_alloc();
17
18 if (!p) {
19 printf("%s: POWER allocation error!\n", __func__);
20 return -ENOMEM;
21 }
20831061
FE
22
23 p->name = name;
ed5157e8 24 p->number_of_regs = DIALOG_NUM_OF_REGS;
20831061
FE
25
26 p->interface = PMIC_I2C;
27 p->hw.i2c.addr = CONFIG_SYS_DIALOG_PMIC_I2C_ADDR;
28 p->hw.i2c.tx_num = 1;
c7336815 29 p->bus = bus;
20831061
FE
30
31 return 0;
32}