pmic_pfuze3000.c 648 B

1234567891011121314151617181920212223242526272829303132
  1. /*
  2. * Copyright (C) 2015 Freescale Semiconductor, Inc.
  3. * Peng Fan <Peng.Fan@freescale.com>
  4. *
  5. * SPDX-License-Identifier: GPL-2.0+
  6. */
  7. #include <common.h>
  8. #include <errno.h>
  9. #include <i2c.h>
  10. #include <power/pmic.h>
  11. #include <power/pfuze3000_pmic.h>
  12. int power_pfuze3000_init(unsigned char bus)
  13. {
  14. static const char name[] = "PFUZE3000";
  15. struct pmic *p = pmic_alloc();
  16. if (!p) {
  17. printf("%s: POWER allocation error!\n", __func__);
  18. return -ENOMEM;
  19. }
  20. p->name = name;
  21. p->interface = PMIC_I2C;
  22. p->number_of_regs = PMIC_NUM_OF_REGS;
  23. p->hw.i2c.addr = CONFIG_POWER_PFUZE3000_I2C_ADDR;
  24. p->hw.i2c.tx_num = 1;
  25. p->bus = bus;
  26. return 0;
  27. }