]>
git.ipfire.org Git - people/ms/u-boot.git/blob - drivers/power/pmic/pmic_tps62362.c
2 * (C) Copyright 2014 Texas Instruments Incorporated - http://www.ti.com
3 * Author: Felipe Balbi <balbi@ti.com>
5 * SPDX-License-Identifier: GPL-2.0+
10 #include <linux/errno.h>
11 #include <power/pmic.h>
12 #include <power/tps62362.h>
15 * tps62362_voltage_update() - Function to change a voltage level, as this
16 * is a multi-step process.
17 * @reg: Register address to write to
18 * @volt_sel: Voltage register value to write
19 * @return: 0 on success, 1 on failure
21 int tps62362_voltage_update(unsigned char reg
, unsigned char volt_sel
)
23 if (reg
> TPS62362_NUM_REGS
)
26 return i2c_write(TPS62362_I2C_ADDR
, reg
, 1, &volt_sel
, 1);
29 int power_tps62362_init(unsigned char bus
)
31 static const char name
[] = "TPS62362";
32 struct pmic
*p
= pmic_alloc();
35 printf("%s: POWER allocation error!\n", __func__
);
40 p
->interface
= PMIC_I2C
;
41 p
->number_of_regs
= TPS62362_NUM_REGS
;
42 p
->hw
.i2c
.addr
= TPS62362_I2C_ADDR
;