summaryrefslogtreecommitdiffstats
path: root/drivers/power/pmic/pmic_pfuze100.c
diff options
context:
space:
mode:
authorAlbert ARIBAUD <albert.u.boot@aribaud.net>2014-03-13 17:43:35 +0100
committerAlbert ARIBAUD <albert.u.boot@aribaud.net>2014-03-13 17:43:35 +0100
commit08798026f24bd7c706e70372f8c323f0702c9a15 (patch)
treef8bf5d1866393c82a96dc062814274076482a0e3 /drivers/power/pmic/pmic_pfuze100.c
parentaadf3192f83a55dbbdb0d395ee5af88b6560edcb (diff)
parent81a1d6173cd255c5c04c332ed69498c6e173515f (diff)
downloadu-boot-08798026f24bd7c706e70372f8c323f0702c9a15.tar.gz
u-boot-08798026f24bd7c706e70372f8c323f0702c9a15.tar.xz
u-boot-08798026f24bd7c706e70372f8c323f0702c9a15.zip
Merge branch 'u-boot-imx/master' into 'u-boot-arm/master'
Diffstat (limited to 'drivers/power/pmic/pmic_pfuze100.c')
-rw-r--r--drivers/power/pmic/pmic_pfuze100.c32
1 files changed, 32 insertions, 0 deletions
diff --git a/drivers/power/pmic/pmic_pfuze100.c b/drivers/power/pmic/pmic_pfuze100.c
new file mode 100644
index 0000000000..22c1f15eeb
--- /dev/null
+++ b/drivers/power/pmic/pmic_pfuze100.c
@@ -0,0 +1,32 @@
+/*
+ * Copyright (C) 2014 Gateworks Corporation
+ * Tim Harvey <tharvey@gateworks.com>
+ *
+ * SPDX-License-Identifier: GPL-2.0+
+ */
+
+#include <common.h>
+#include <errno.h>
+#include <i2c.h>
+#include <power/pmic.h>
+#include <power/pfuze100_pmic.h>
+
+int pmic_init(unsigned char bus)
+{
+ static const char name[] = "PFUZE100_PMIC";
+ struct pmic *p = pmic_alloc();
+
+ if (!p) {
+ printf("%s: POWER allocation error!\n", __func__);
+ return -ENOMEM;
+ }
+
+ p->name = name;
+ p->interface = PMIC_I2C;
+ p->number_of_regs = PMIC_NUM_OF_REGS;
+ p->hw.i2c.addr = CONFIG_POWER_PFUZE100_I2C_ADDR;
+ p->hw.i2c.tx_num = 1;
+ p->bus = bus;
+
+ return 0;
+}