2014-02-13 07:48:12 +00:00
|
|
|
/*
|
|
|
|
* 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>
|
|
|
|
|
2014-04-23 04:53:56 +00:00
|
|
|
int power_pfuze100_init(unsigned char bus)
|
2014-02-13 07:48:12 +00:00
|
|
|
{
|
2014-08-01 11:50:03 +00:00
|
|
|
static const char name[] = "PFUZE100";
|
2014-02-13 07:48:12 +00:00
|
|
|
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;
|
|
|
|
}
|