1 // SPDX-License-Identifier: GPL-2.0+
3 * Copyright (C) 2013 Samsung Electronics
4 * Piotr Wilczek <p.wilczek@samsung.com>
8 #include <power/pmic.h>
9 #include <power/battery.h>
10 #include <power/max77693_pmic.h>
13 static struct battery battery_trats
;
15 static int power_battery_charge(struct pmic
*bat
)
17 struct power_battery
*p_bat
= bat
->pbat
;
19 if (bat
->chrg
->chrg_state(p_bat
->chrg
, PMIC_CHARGER_ENABLE
, 450))
25 static int power_battery_init_trats2(struct pmic
*bat_
,
31 bat_
->pbat
->chrg
= chrg_
;
32 bat_
->pbat
->muic
= muic_
;
35 bat_
->chrg
= chrg_
->chrg
;
36 bat_
->chrg
->chrg_type
= muic_
->chrg
->chrg_type
;
40 static struct power_battery power_bat_trats2
= {
41 .bat
= &battery_trats
,
42 .battery_init
= power_battery_init_trats2
,
43 .battery_charge
= power_battery_charge
,
46 int power_bat_init(unsigned char bus
)
48 static const char name
[] = "BAT_TRATS2";
49 struct pmic
*p
= pmic_alloc();
52 printf("%s: POWER allocation error!\n", __func__
);
56 debug("Board BAT init\n");
58 p
->interface
= PMIC_NONE
;
62 p
->pbat
= &power_bat_trats2
;