summaryrefslogtreecommitdiff
path: root/include/driver/charger/isl9241_public.h
blob: cccce15bd787506708f73e45453d8b8c5b8b12e7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
/* Copyright 2021 The ChromiumOS Authors
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file.
 *
 * Renesas (Intersil) ISL-9241 battery charger public header
 */

#ifndef __CROS_EC_DRIVER_CHARGER_ISL9241_PUBLIC_H
#define __CROS_EC_DRIVER_CHARGER_ISL9241_PUBLIC_H

#define ISL9241_ADDR_FLAGS 0x09

/* Default minimum VIN voltage controlled by ISL9241_REG_VIN_VOLTAGE */
#define ISL9241_BC12_MIN_VOLTAGE 4096

extern const struct charger_drv isl9241_drv;

/**
 * Set AC prochot threshold
 *
 * @param chgnum: Index into charger chips
 * @param ma: AC prochot threshold current in mA, multiple of 128mA
 * @return EC_SUCCESS or error
 */
int isl9241_set_ac_prochot(int chgnum, int ma);

/**
 * Set DC prochot threshold
 *
 * @param chgnum: Index into charger chips
 * @param ma: DC prochot threshold current in mA, multiple of 256mA
 * @return EC_SUCCESS or error
 */
int isl9241_set_dc_prochot(int chgnum, int ma);

#ifdef CONFIG_CHARGER_RAA489110
#define ISL9241_AC_PROCHOT_CURRENT_MIN 32 /* mA */
#else /* CONFIG_CHARGER_ISL9241 */
#define ISL9241_AC_PROCHOT_CURRENT_MIN 128 /* mA */
#endif
#define ISL9241_AC_PROCHOT_CURRENT_MAX 6400 /* mA */
#define ISL9241_DC_PROCHOT_CURRENT_MIN 256 /* mA */
#define ISL9241_DC_PROCHOT_CURRENT_MAX 12800 /* mA */

#endif /* __CROS_EC_DRIVER_CHARGER_ISL9241_PUBLIC_H */