1# Copyright (c) 2020 Linumiz
2#
3# SPDX-License-Identifier: Apache-2.0
4
5menuconfig BQ274XX
6	bool "BQ274xx Fuel Gauge"
7	default y
8	depends on DT_HAS_TI_BQ274XX_ENABLED
9	select I2C
10	help
11	  Enable I2C-based driver for BQ274xx Fuel Gauge.
12
13if BQ274XX
14
15config BQ274XX_PM
16	bool "BQ274XX Power Management"
17	depends on PM_DEVICE
18	default y
19	help
20	  This option enables the device power management feature of the
21	  BQ274XX.
22	  Note: if the int_gpios pin is not used then this feature must be
23	  disabled.
24
25choice BQ274XX_TRIGGER_MODE
26	prompt "Trigger mode"
27	default BQ274XX_TRIGGER_NONE
28	help
29	  Specify the type of triggering to be used by the driver.
30
31config BQ274XX_TRIGGER_NONE
32	bool "No trigger"
33
34config BQ274XX_TRIGGER_GLOBAL_THREAD
35	bool "Use global thread"
36	depends on GPIO
37	depends on $(dt_compat_any_has_prop,$(DT_COMPAT_TI_BQ274XX),int-gpios)
38	select BQ274XX_TRIGGER
39
40config BQ274XX_TRIGGER_OWN_THREAD
41	bool "Use own thread"
42	depends on GPIO
43	depends on $(dt_compat_any_has_prop,$(DT_COMPAT_TI_BQ274XX),int-gpios)
44	select BQ274XX_TRIGGER
45
46endchoice # BQ274XX_TRIGGER_MODE
47
48config BQ274XX_TRIGGER
49	bool
50
51config BQ274XX_THREAD_PRIORITY
52	int "Thread priority"
53	depends on BQ274XX_TRIGGER_OWN_THREAD
54	default 10
55	help
56	  Priority of thread used by the driver to handle interrupts.
57
58config BQ274XX_THREAD_STACK_SIZE
59	int "Thread stack size"
60	depends on BQ274XX_TRIGGER_OWN_THREAD
61	default 1024
62	help
63	  Stack size of thread used by the driver to handle interrupts.
64
65endif # BQ274XX
66