summaryrefslogtreecommitdiffstats
path: root/drivers/power
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2015-04-14 21:03:26 -0600
committerTom Warren <twarren@nvidia.com>2015-05-13 09:24:07 -0700
commitd55b7d4c53c78d4a4fbe28b65e8d50f184b53ce9 (patch)
tree58fcbe45288e7a9e346783f613488c79177f4881 /drivers/power
parentec7466443432966db95ed2324732ee810bfa8229 (diff)
downloadtalos-obmc-uboot-d55b7d4c53c78d4a4fbe28b65e8d50f184b53ce9.tar.gz
talos-obmc-uboot-d55b7d4c53c78d4a4fbe28b65e8d50f184b53ce9.zip
power: Export register access functions from as3722
With the full PMIC framework we may be able to avoid this. But for now we need access to the PMIC. Signed-off-by: Simon Glass <sjg@chromium.org> Signed-off-by: Tom Warren <twarren@nvidia.com>
Diffstat (limited to 'drivers/power')
-rw-r--r--drivers/power/as3722.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/drivers/power/as3722.c b/drivers/power/as3722.c
index a60bb5f83f..c09e1de06f 100644
--- a/drivers/power/as3722.c
+++ b/drivers/power/as3722.c
@@ -27,7 +27,7 @@
#define AS3722_DEVICE_ID 0x0c
#define AS3722_ASIC_ID2 0x91
-static int as3722_read(struct udevice *pmic, u8 reg, u8 *value)
+int as3722_read(struct udevice *pmic, u8 reg, u8 *value)
{
int err;
@@ -38,7 +38,7 @@ static int as3722_read(struct udevice *pmic, u8 reg, u8 *value)
return 0;
}
-static int as3722_write(struct udevice *pmic, u8 reg, u8 value)
+int as3722_write(struct udevice *pmic, u8 reg, u8 value)
{
int err;
@@ -234,6 +234,15 @@ int as3722_gpio_direction_output(struct udevice *pmic, unsigned int gpio,
return 0;
}
+/* Temporary function until we get the pmic framework */
+int as3722_get(struct udevice **devp)
+{
+ int bus = 0;
+ int address = 0x40;
+
+ return i2c_get_chip_for_busnum(bus, address, 1, devp);
+}
+
int as3722_init(struct udevice **devp)
{
struct udevice *pmic;
@@ -258,7 +267,8 @@ int as3722_init(struct udevice **devp)
debug("AS3722 revision %#x found on I2C bus %u, address %#x\n",
revision, bus, address);
- *devp = pmic;
+ if (devp)
+ *devp = pmic;
return 0;
}
OpenPOWER on IntegriCloud