Repository navigation
Expand file tree
/
Copy pathb68231c.diff
More file actions
75 lines (70 loc) · 2.61 KB
/
Copy pathb68231c.diff
File metadata and controls
75 lines (70 loc) · 2.61 KB
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
From b68231cfc28da8633d7e69993917a38dff95e75c Mon Sep 17 00:00:00 2001
From: lijirui <jirui.li@tinno.com>
Date: Wed, 04 Sep 2024 11:36:53 +0800
Subject: [PATCH] <REQ><EKLAMU-30><[charger] add moto turbo power animation[2/4]>
Change-Id: Ie42510a1abf5666985101555e94d38a90324a3ac
---
diff --git a/drivers/power/supply/mtk_charger.c b/drivers/power/supply/mtk_charger.c
index 7a2c780..4a2544a 100755
--- a/drivers/power/supply/mtk_charger.c
+++ b/drivers/power/supply/mtk_charger.c
@@ -98,6 +98,8 @@
extern bool turbo_charger_active;
extern int ffc_reduce_count;
extern bool is_turbo_charger_ready;
+static unsigned int turbo_power_mode = 0;
+static unsigned int turbo_test_mode = 0;
#endif /* CONFIG_OEM_TURBO_CHARGER */
/*TN End modified by hao.jia/809321 20240628 CR/EKLAMU-202 */
@@ -1874,6 +1876,41 @@
}
static DEVICE_ATTR_RW(battery_protection_mode);
/* TN End modified by jirui.li/860702 20240814 CR/EKLAMU-1339 */
+
+/* TN Begin modified by jirui.li/860702 20240814 CR/EKLAMU-30 */
+static ssize_t turbo_power_mode_show(struct device *dev,
+ struct device_attribute *attr, char *buf)
+{
+ struct mtk_charger *pinfo = dev->driver_data;
+ int value = 0;
+ int chr_type = get_charger_type(pinfo);
+ if ((chr_type == POWER_SUPPLY_TYPE_USB_QC3 || chr_type == POWER_SUPPLY_TYPE_USB_QC3P) ||
+ (pinfo->pe50.apdo_cap.pdp > 15 && chr_type == POWER_SUPPLY_TYPE_USB_DCP)) {
+ turbo_power_mode = 1;
+ } else {
+ turbo_power_mode = 0;
+ }
+ value = turbo_power_mode || turbo_test_mode;
+ pr_info("%s value %d\n", __FUNCTION__, value);
+ return sprintf(buf, "%d\n", value);
+}
+static ssize_t turbo_power_mode_store(struct device *dev,
+ struct device_attribute *attr,
+ const char *buf, size_t size)
+{
+ signed int temp;
+ if (kstrtoint(buf, 10, &temp) == 0) {
+ chr_info("%s %s demo_mode_limit\n", __func__, temp ? "enable" : "disable");
+ if (temp == 1)
+ turbo_test_mode = 1;
+ else
+ turbo_test_mode = 0;
+ } else
+ chr_err("%s: format error!\n", __func__);
+ return size;
+}
+static DEVICE_ATTR_RW(turbo_power_mode);
+/* TN End modified by jirui.li/860702 20240814 CR/EKLAMU-30 */
#endif /* CONFIG_OEM_TINNO_CHARGER */
/* TN End modified by hao.jia/809321 20240718 CR/EKLAMU-202 */
@@ -5550,6 +5587,11 @@
if (ret)
goto _out;
/* TN End modified by jirui.li/860702 20240814 CR/EKLAMU-1339 */
+/* TN Begin modified by jirui.li/860702 20240814 CR/EKLAMU-30 */
+ ret = device_create_file(&(pdev->dev), &dev_attr_turbo_power_mode);
+ if (ret)
+ goto _out;
+/* TN End modified by jirui.li/860702 20240814 CR/EKLAMU-30 */
#endif /* CONFIG_OEM_TINNO_CHARGER */
/* TN End modified by hao.jia/809321 20240718 CR/EKLAMU-202 */