pmic_max8998.c 626 B

1234567891011121314151617181920212223242526272829303132
  1. // SPDX-License-Identifier: GPL-2.0+
  2. /*
  3. * Copyright (C) 2011 Samsung Electronics
  4. * Lukasz Majewski <l.majewski@samsung.com>
  5. */
  6. #include <common.h>
  7. #include <power/pmic.h>
  8. #include <power/max8998_pmic.h>
  9. #include <errno.h>
  10. int pmic_init(unsigned char bus)
  11. {
  12. static const char name[] = "MAX8998_PMIC";
  13. struct pmic *p = pmic_alloc();
  14. if (!p) {
  15. printf("%s: POWER allocation error!\n", __func__);
  16. return -ENOMEM;
  17. }
  18. puts("Board PMIC init\n");
  19. p->name = name;
  20. p->interface = PMIC_I2C;
  21. p->number_of_regs = PMIC_NUM_OF_REGS;
  22. p->hw.i2c.addr = MAX8998_I2C_ADDR;
  23. p->hw.i2c.tx_num = 1;
  24. p->bus = bus;
  25. return 0;
  26. }