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