summaryrefstree
path: root/kernel/drivers/sensorhub/stm32/ssp_debug.h
blob: 052cec7679a302b14a376e77b2f85c90b364b00b (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
46
47
/*
 *  Copyright (C) 2015, Samsung Electronics Co. Ltd. All Rights Reserved.
 *
 *  This program is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation; either version 2 of the License, or
 *  (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 */

#ifndef __SSP_DEBUG_H__
#define __SSP_DEBUG_H__

#include "ssp.h"
#if CONFIG_SEC_DEBUG
#include <linux/sec_debug.h>
#endif
#include <linux/fs.h>


#define SSP_DEBUG_TIMER_SEC	(5 * HZ)
#define LIMIT_RESET_CNT		20
#define LIMIT_TIMEOUT_CNT	1
#define DUMP_FILE_PATH		"/data/log/MCU_DUMP"
#define DEBUG_DUMP_FILE_PATH	"/data/log/SensorHubDump"
#define DEBUG_DUMP_DATA_COMPLETE 0xDD


struct ssp_data;

void ssp_dump_task(struct work_struct *work);
int print_mcu_debug(char *pchRcvDataFrame, int *pDataIdx,
		int iRcvDataFrameLength);
void reset_mcu(struct ssp_data *data);
void sync_sensor_state(struct ssp_data *data);
void enable_debug_timer(struct ssp_data *data);
void disable_debug_timer(struct ssp_data *data);
int initialize_debug_timer(struct ssp_data *data);
int debug_crash_dump(struct ssp_data *data, char *pchRcvDataFrame, int iLength);
void print_dataframe(struct ssp_data *data, char *dataframe, int frame_len);

#endif