summaryrefstree
path: root/kernel/include/linux/secgpio_dvs.h
blob: 20a84d95ca71c6fdea0e98d18fb0a9b412272c78 (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
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
76
77
/*
 * secgpio_dvs.h -- Samsung GPIO debugging and verification system
 */

#ifndef __SECGPIO_DVS_H
#define __SECGPIO_DVS_H

#include <linux/types.h>

enum gdvs_phone_status {
	PHONE_INIT = 0,
	PHONE_SLEEP,
	GDVS_PHONE_STATUS_MAX
};

enum gdvs_io_value {
	GDVS_IO_FUNC = 0x00,
	GDVS_IO_IN,
	GDVS_IO_OUT,
};

enum gdvs_pupd_value {
	GDVS_PUPD_NP = 0x00,
	GDVS_PUPD_PD,
	GDVS_PUPD_PU,
	GDVS_PUPD_KEEPER,
	GDVS_PUPD_ERR = 0x3F
};

struct gpiomap_result {
	unsigned char *init;
	unsigned char *sleep;
};

#ifdef SECGPIO_SLEEP_DEBUGGING
enum sleepdata_phase {
	SLDATA_START = 0,
	SLDATA_DATA,
	SLDATA_END
};

struct sleepdebug_gpioinfo {
	int gpio_num;
	unsigned char io;
	unsigned char pupd;
	unsigned char lh;
};

struct sleepdebug_gpiotable {
	bool active;
	int gpio_count;
	struct sleepdebug_gpioinfo *gpioinfo;
};
#endif /* SECGPIO_SLEEP_DEBUGGING */

struct gpio_dvs {
	struct gpiomap_result *result;
	unsigned int count;
	bool check_init;
	bool check_sleep;
	void (*check_gpio_status)(unsigned char phonestate);
	int (*get_gpio_base)(void);	
#ifdef SECGPIO_SLEEP_DEBUGGING
	struct sleepdebug_gpiotable *sdebugtable;
	void (*set_sleepgpio)(void);
	void (*undo_sleepgpio)(void);
#endif /* SECGPIO_SLEEP_DEBUGGING */
};

void gpio_dvs_check_initgpio(void);
void gpio_dvs_check_sleepgpio(void);
#ifdef SECGPIO_SLEEP_DEBUGGING
void gpio_dvs_set_sleepgpio(void);
void gpio_dvs_undo_sleepgpio(void);
#endif /* SECGPIO_SLEEP_DEBUGGING */

#endif /* __SECGPIO_DVS_H */