From af1a266670d040d2f4083ff309d732d648afba2a Mon Sep 17 00:00:00 2001 From: Angelos Mouzakitis Date: Tue, 10 Oct 2023 14:33:42 +0000 Subject: Add submodule dependency files Change-Id: Iaf8d18082d3991dec7c0ebbea540f092188eb4ec --- roms/u-boot/drivers/power/pmic/pmic_pca9450.c | 31 +++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 roms/u-boot/drivers/power/pmic/pmic_pca9450.c (limited to 'roms/u-boot/drivers/power/pmic/pmic_pca9450.c') diff --git a/roms/u-boot/drivers/power/pmic/pmic_pca9450.c b/roms/u-boot/drivers/power/pmic/pmic_pca9450.c new file mode 100644 index 000000000..8c4d0a923 --- /dev/null +++ b/roms/u-boot/drivers/power/pmic/pmic_pca9450.c @@ -0,0 +1,31 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Copyright 2019 NXP + */ + +#include +#include +#include +#include +#include + +static const char pca9450_name[] = "PCA9450"; + +int power_pca9450_init(unsigned char bus, unsigned char addr) +{ + struct pmic *p = pmic_alloc(); + + if (!p) { + printf("%s: POWER allocation error!\n", __func__); + return -ENOMEM; + } + + p->name = pca9450_name; + p->interface = PMIC_I2C; + p->number_of_regs = PCA9450_REG_NUM; + p->hw.i2c.addr = addr; + p->hw.i2c.tx_num = 1; + p->bus = bus; + + return 0; +} -- cgit 1.2.3-korg