e0fdde982e9ebd63aaef2052adadc6f3f0c10cf6
3 * Abnormal Behavior Catcher Common Driver
5 * Copyright (C) 2017 Samsung Electronics
7 * Hyeokseon Yu <hyeokseon.yu@samsung.com>
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
24 #include <linux/kernel.h>
25 #include <linux/module.h>
26 #include <linux/sec_sysfs.h>
27 #include <linux/device.h>
28 #include <linux/platform_device.h>
30 #include <linux/of_device.h>
31 #include <linux/err.h>
32 #include <linux/kthread.h>
33 #include <linux/delay.h>
35 #include <linux/slab.h>
36 #include <linux/suspend.h>
37 #include <linux/workqueue.h>
38 #include <linux/rtc.h>
40 #define ABC_UEVENT_MAX 20
41 #define ABC_BUFFER_MAX 256
42 #define ABC_LOG_STR_LEN 50
43 #define ABC_LOG_MAX 80
45 #define ABC_WAIT_ENABLE_TIMEOUT 10000
49 /* TYPE1 : ABC Driver - ABC Daemon is not used. ABC Driver manage ABC Error */
51 /* TYPE2 : Common Driver - ABC Daemon is used. ABC Daemon manage ABC Error. Common Driver send uevent bypass */
61 struct abc_fault_info
{
62 unsigned long cur_time
;
71 struct abc_fault_info
*abc_element
;
81 struct abc_buffer buffer
;
84 struct abc_platform_data
{
85 struct abc_qdata
*gpu_items
;
86 struct abc_qdata
*aicl_items
;
93 struct abc_log_entry
{
94 struct list_head node
;
95 char abc_log_str
[ABC_LOG_STR_LEN
];
100 struct workqueue_struct
*workqueue
;
101 struct work_struct work
;
102 struct list_head log_list
;
103 struct completion enable_done
;
105 char abc_str
[ABC_BUFFER_MAX
];
106 struct abc_platform_data
*pdata
;
109 extern void sec_abc_send_event(char *str
);
110 extern int sec_abc_get_enabled(void);
111 extern int sec_abc_wait_enabled(void);