summaryrefslogtreecommitdiff
path: root/drivers/power/pmic/pmic_pfuze100.c
diff options
context:
space:
mode:
authorTim Harvey <tharvey@gateworks.com>2014-02-12 23:48:12 -0800
committerStefano Babic <sbabic@denx.de>2014-03-05 12:02:31 +0100
commit91baa6f7ff632c8d8b8f925ab12406f989da476e (patch)
tree8b4e8432cb7bff92578872728efdc592b645b7e9 /drivers/power/pmic/pmic_pfuze100.c
parentda781c60e5d55904d77931fcb63f25e65e2228be (diff)
downloadu-boot-imx-91baa6f7ff632c8d8b8f925ab12406f989da476e.zip
u-boot-imx-91baa6f7ff632c8d8b8f925ab12406f989da476e.tar.gz
u-boot-imx-91baa6f7ff632c8d8b8f925ab12406f989da476e.tar.bz2
power: add PFUZE100 PMIC driver
Signed-off-by: Tim Harvey <tharvey@gateworks.com> Acked-by: Stefano Babic <sbabic@denx.de>
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 0000000..22c1f15
--- /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;
+}