summaryrefstree
path: root/kernel/include/linux/kq/sec_bps.h
blob: 0c8ae11ea730b170609a4d02667cb923a9cc9d40 (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
/*
 * sec_bps.h
 *
 *  Copyright (c) 2019 Samsung Electronics Co., Ltd.
 *      http://www.samsung.com
 *  jaecheol kim <jc22.kim@samsung.com>
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 as
 * published by the Free Software Foundation.
 */

#ifndef SEC_BPS_H
#define SEC_BPS_H

#if defined(CONFIG_SEC_FACTORY)

#include <linux/device.h>
#define NAD_BPS_INFO_MAGIC				0xABCDABCD

enum {
	SEC_BPS_RBPSP = 0,
	SEC_BPS_RBPSF,
	SEC_BPS_N1BPS,
	SEC_BPS_N2BPS,
	SEC_BPS_N3BPS,
	SEC_BPS_N4BPS,
#if defined(CONFIG_SEC_BPS_INFO_ADD)
	SEC_BPS_FACINFO,
#endif

	SEC_BPS_MAX_ID,
};

#if defined(CONFIG_SEC_BPS_INFO_ADD)
/*
 * 0 : PBA : ~ SMD F/T end
 * 1 : SEMI ASSEMBLED : SMD T/T end ~ RF Cal start (booting)
 * 2 : ASSEMBLED : RF Cal start ~
 */
#define SEC_BPS_INFO_FAC_STEP_PBA				0
#define SEC_BPS_INFO_FAC_STEP_SEMI_ASSEMBLED	1
#define SEC_BPS_INFO_FAC_STEP_ASSEMBLED			2
#endif

ssize_t sec_bps_show_attrs(struct device *dev,
							struct device_attribute *attr, char *buf);
ssize_t sec_bps_store_attrs(struct device *dev,
							struct device_attribute *attr,
							const char *buf, size_t count);

#define SEC_BPS_ATTR(_name)							\
{													\
	.attr = { .name = #_name, .mode = 0664 },		\
	.show = sec_bps_show_attrs,						\
	.store = sec_bps_store_attrs,					\
}

#if defined(CONFIG_SEC_FACTORY) && defined(CONFIG_SEC_NAD) && defined(CONFIG_SEC_NAD_BPS_CLASSIFIER)
struct sec_bps_param {
	struct work_struct sec_bps_work;
	int idx;
	int val;
};
static struct sec_bps_param sec_bps_param_data;
#endif

#endif
#endif