1 // SPDX-License-Identifier: GPL-2.0+
3 * (C) Copyright 2014 Texas Instruments Incorporated - http://www.ti.com
4 * Author: Felipe Balbi <balbi@ti.com>
9 #include <linux/errno.h>
10 #include <power/pmic.h>
11 #include <power/tps62362.h>
14 * tps62362_voltage_update() - Function to change a voltage level, as this
15 * is a multi-step process.
16 * @reg: Register address to write to
17 * @volt_sel: Voltage register value to write
18 * @return: 0 on success, 1 on failure
20 int tps62362_voltage_update(unsigned char reg, unsigned char volt_sel)
22 if (reg > TPS62362_NUM_REGS)
25 return i2c_write(TPS62362_I2C_ADDR, reg, 1, &volt_sel, 1);
28 int power_tps62362_init(unsigned char bus)
30 static const char name[] = "TPS62362";
31 struct pmic *p = pmic_alloc();
34 printf("%s: POWER allocation error!\n", __func__);
39 p->interface = PMIC_I2C;
40 p->number_of_regs = TPS62362_NUM_REGS;
41 p->hw.i2c.addr = TPS62362_I2C_ADDR;