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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
|
/*
* Copyright (C) 2012, 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.
*
*/
#include <linux/init.h>
#include <linux/module.h>
#include <linux/platform_device.h>
#include <net/sock.h>
#include <net/netlink.h>
#include <linux/skbuff.h>
#include <linux/netlink.h>
#include <linux/mutex.h>
#include <linux/device.h>
#include <linux/err.h>
#include <linux/sec_class.h>
#include "adsp.h"
static u8 msg_size[MSG_SENSOR_MAX] = {
MSG_ACCEL_MAX,
MSG_GYRO_MAX,
MSG_MAG_MAX,
MSG_PRESSURE_MAX,
MSG_LIGHT_MAX,
MSG_PROX_MAX,
MSG_TYPE_SIZE_ZERO,
MSG_MOBEAM_MAX,
#ifdef CONFIG_SUPPORT_DUAL_6AXIS
MSG_ACCEL_MAX,
MSG_GYRO_MAX,
#endif
#ifdef CONFIG_SUPPORT_DUAL_OPTIC
MSG_LIGHT_MAX,
MSG_PROX_MAX,
#endif
#ifdef CONFIG_SUPPORT_SUB_MOBEAM
MSG_MOBEAM_MAX,
#endif
MSG_TYPE_SIZE_ZERO, /* PHYSICAL_SENSOR_SYSFS */
MSG_GYRO_TEMP_MAX,
#ifdef CONFIG_SUPPORT_DUAL_6AXIS
MSG_GYRO_TEMP_MAX,
#endif
MSG_PRESSURE_TEMP_MAX,
MSG_TYPE_SIZE_ZERO,
#ifdef CONFIG_SUPPORT_VIRTUAL_OPTIC
MSG_TYPE_SIZE_ZERO,
#endif
MSG_TYPE_SIZE_ZERO,
#ifdef CONFIG_SUPPORT_AK0997X
MSG_DIGITAL_HALL_MAX,
MSG_DIGITAL_HALL_ANGLE_MAX,
MSG_DIGITAL_HALL_ANGLE_MAX,
#endif
#ifdef CONFIG_SUPPORT_DUAL_DDI_COPR_FOR_LIGHT_SENSOR
MSG_DDI_MAX,
#endif
MSG_TYPE_SIZE_ZERO,
MSG_TYPE_SIZE_ZERO
};
/* The netlink socket */
struct adsp_data *data;
DEFINE_MUTEX(factory_mutex);
#ifdef CONFIG_SUPPORT_BRIGHTNESS_NOTIFY_FOR_LIGHT_SENSOR
struct adsp_data* adsp_get_struct_data(void)
{
return data;
}
#endif
/* Function used to send message to the user space */
int adsp_unicast(void *param, int param_size, u16 sensor_type,
u32 portid, u16 msg_type)
{
struct sk_buff *skb;
struct nlmsghdr *nlh;
void *msg;
int ret = -1;
u16 nlmsg_type = (sensor_type << 8) | msg_type;
if (data->restrict_mode && msg_type == MSG_TYPE_SET_ACCEL_MOTOR) {
pr_err("[FACTORY] %s - restrict_mode\n", __func__);
return ret;
}
data->ready_flag[msg_type] &= ~(1 << sensor_type);
skb = nlmsg_new(param_size, GFP_KERNEL);
if (!skb) {
pr_err("[FACTORY] %s - nlmsg_new fail\n", __func__);
return -ENOMEM;
}
nlh = nlmsg_put(skb, portid, 0, nlmsg_type, param_size, 0);
if (nlh == NULL) {
pr_err("[FACTORY] %s - nlmsg_put fail\n", __func__);
nlmsg_free(skb);
return -EMSGSIZE;
}
msg = nlmsg_data(nlh);
memcpy(msg, param, param_size);
NETLINK_CB(skb).dst_group = 0;
ret = nlmsg_unicast(data->adsp_skt, skb, PID);
if (ret != 0)
pr_err("[FACTORY] %s - ret = %d\n", __func__, ret);
return ret;
}
#if defined(CONFIG_SUPPORT_DEVICE_MODE) || defined(CONFIG_VBUS_NOTIFIER)
struct adsp_data* adsp_ssc_core_register(unsigned int type,
struct device_attribute *attributes[])
{
int ret = 0;
data->sensor_attr[type] = attributes;
ret = sensors_register(&data->sensor_device[type], data,
data->sensor_attr[type], "ssc_core");
data->sysfs_created[type] = true;
pr_info("[FACTORY] %s - type:%u ptr:%pK\n",
__func__, type, data->sensor_device[type]);
return data;
}
struct adsp_data* adsp_ssc_core_unregister(unsigned int type)
{
pr_info("[FACTORY] %s - type:%u ptr:%pK\n",
__func__, type, data->sensor_device[type]);
if (data->sysfs_created[type]) {
sensors_unregister(data->sensor_device[type],
data->sensor_attr[type]);
data->sysfs_created[type] = false;
} else {
pr_info("[FACTORY] %s: skip type %u\n", __func__, type);
}
return data;
}
#endif
int adsp_factory_register(unsigned int type,
struct device_attribute *attributes[])
{
int ret = 0;
char *dev_name;
switch (type) {
case MSG_ACCEL:
dev_name = "accelerometer_sensor";
break;
case MSG_GYRO:
dev_name = "gyro_sensor";
break;
#ifdef CONFIG_SUPPORT_DUAL_6AXIS
case MSG_ACCEL_SUB:
dev_name = "sub_accelerometer_sensor";
break;
case MSG_GYRO_SUB:
dev_name = "sub_gyro_sensor";
break;
#endif
case MSG_MAG:
dev_name = "magnetic_sensor";
break;
case MSG_PRESSURE:
dev_name = "barometer_sensor";
break;
case MSG_LIGHT:
dev_name = "light_sensor";
break;
case MSG_PROX:
dev_name = "proximity_sensor";
break;
#ifdef CONFIG_SUPPORT_DUAL_OPTIC
case MSG_LIGHT_SUB:
dev_name = "sub_light_sensor";
break;
case MSG_PROX_SUB:
dev_name = "sub_proximity_sensor";
break;
#endif
case MSG_SSC_CORE:
dev_name = "ssc_core";
break;
case MSG_HH_HOLE:
dev_name = "hidden_hole";
break;
#ifdef CONFIG_SUPPORT_HIDDEN_HOLE_SUB
case MSG_HH_HOLE_SUB:
dev_name = "hidden_hole_sub";
break;
#endif
#ifdef CONFIG_SUPPORT_AK0997X
case MSG_DIGITAL_HALL:
dev_name = "digital_hall";
break;
#endif
default:
dev_name = "unknown_sensor";
break;
}
data->sensor_attr[type] = attributes;
ret = sensors_register(&data->sensor_device[type], data,
data->sensor_attr[type], dev_name);
data->sysfs_created[type] = true;
pr_info("[FACTORY] %s - type:%u ptr:%pK\n",
__func__, type, data->sensor_device[type]);
return ret;
}
int adsp_factory_unregister(unsigned int type)
{
pr_info("[FACTORY] %s - type:%u ptr:%pK\n",
__func__, type, data->sensor_device[type]);
if (data->sysfs_created[type]) {
sensors_unregister(data->sensor_device[type],
data->sensor_attr[type]);
data->sysfs_created[type] = false;
} else {
pr_info("[FACTORY] %s: skip type %u\n", __func__, type);
}
return 0;
}
int get_prox_raw_data(int *raw_data, int *offset)
{
uint8_t cnt = 0;
mutex_lock(&data->prox_factory_mutex);
adsp_unicast(NULL, 0, MSG_PROX, 0, MSG_TYPE_GET_RAW_DATA);
while (!(data->ready_flag[MSG_TYPE_GET_RAW_DATA] & 1 << MSG_PROX) &&
cnt++ < TIMEOUT_CNT)
usleep_range(500, 550);
data->ready_flag[MSG_TYPE_GET_RAW_DATA] &= ~(1 << MSG_PROX);
if (cnt >= TIMEOUT_CNT) {
pr_err("[FACTORY] %s: Timeout!!!\n", __func__);
mutex_unlock(&data->prox_factory_mutex);
return -1;
}
*raw_data = data->msg_buf[MSG_PROX][0];
*offset = data->msg_buf[MSG_PROX][1];
mutex_unlock(&data->prox_factory_mutex);
return 0;
}
#ifdef CONFIG_SUPPORT_DUAL_OPTIC
int get_sub_prox_raw_data(int *raw_data, int *offset)
{
uint8_t cnt = 0;
mutex_lock(&data->prox_factory_mutex);
adsp_unicast(NULL, 0, MSG_PROX_SUB, 0, MSG_TYPE_GET_RAW_DATA);
while (!(data->ready_flag[MSG_TYPE_GET_RAW_DATA] & 1 << MSG_PROX_SUB) &&
cnt++ < TIMEOUT_CNT)
usleep_range(500, 550);
data->ready_flag[MSG_TYPE_GET_RAW_DATA] &= ~(1 << MSG_PROX_SUB);
if (cnt >= TIMEOUT_CNT) {
pr_err("[FACTORY] %s: Timeout!!!\n", __func__);
mutex_unlock(&data->prox_factory_mutex);
return -1;
}
*raw_data = data->msg_buf[MSG_PROX_SUB][0];
*offset = data->msg_buf[MSG_PROX_SUB][1];
mutex_unlock(&data->prox_factory_mutex);
return 0;
}
#endif
int get_accel_raw_data(int32_t *raw_data)
{
uint8_t cnt = 0;
adsp_unicast(NULL, 0, MSG_ACCEL, 0, MSG_TYPE_GET_RAW_DATA);
while (!(data->ready_flag[MSG_TYPE_GET_RAW_DATA] & 1 << MSG_ACCEL) &&
cnt++ < TIMEOUT_CNT)
usleep_range(500, 550);
data->ready_flag[MSG_TYPE_GET_RAW_DATA] &= ~(1 << MSG_ACCEL);
if (cnt >= TIMEOUT_CNT) {
pr_err("[FACTORY] %s: Timeout!!!\n", __func__);
return -1;
}
memcpy(raw_data, &data->msg_buf[MSG_ACCEL][0], sizeof(int32_t) * 3);
return 0;
}
#ifdef CONFIG_SUPPORT_DUAL_6AXIS
int get_sub_accel_raw_data(int32_t *raw_data)
{
uint8_t cnt = 0;
adsp_unicast(NULL, 0, MSG_ACCEL_SUB, 0, MSG_TYPE_GET_RAW_DATA);
while (!(data->ready_flag[MSG_TYPE_GET_RAW_DATA] & 1 << MSG_ACCEL_SUB) &&
cnt++ < TIMEOUT_CNT)
usleep_range(500, 550);
data->ready_flag[MSG_TYPE_GET_RAW_DATA] &= ~(1 << MSG_ACCEL_SUB);
if (cnt >= TIMEOUT_CNT) {
pr_err("[FACTORY] %s: Timeout!!!\n", __func__);
return -1;
}
memcpy(raw_data, &data->msg_buf[MSG_ACCEL_SUB][0], sizeof(int32_t) * 3);
return 0;
}
#endif
#ifdef CONFIG_SEC_FACTORY
int get_mag_raw_data(int32_t *raw_data)
{
uint8_t cnt = 0;
adsp_unicast(NULL, 0, MSG_MAG, 0, MSG_TYPE_GET_RAW_DATA);
while (!(data->ready_flag[MSG_TYPE_GET_RAW_DATA] & 1 << MSG_MAG) &&
cnt++ < TIMEOUT_CNT)
usleep_range(500, 550);
data->ready_flag[MSG_TYPE_GET_RAW_DATA] &= ~(1 << MSG_MAG);
if (cnt >= TIMEOUT_CNT) {
pr_err("[FACTORY] %s: Timeout!!!\n", __func__);
return -1;
}
memcpy(raw_data, &data->msg_buf[MSG_MAG][0], sizeof(int32_t) * 3);
return 0;
}
#endif
#ifdef CONFIG_SUPPORT_MOBEAM
void adsp_mobeam_register(struct device_attribute *attributes[])
{
int i;
data->mobeam_device = sec_device_create(0, data, "sec_barcode_emul");
for (i = 0; attributes[i] != NULL; i++) {
if (device_create_file(data->mobeam_device, attributes[i]) < 0)
pr_err("%s fail to create %d", __func__, i);
}
}
void adsp_mobeam_unregister(struct device_attribute *attributes[])
{
int i;
for (i = 0; attributes[i] != NULL; i++)
device_remove_file(data->mobeam_device, attributes[i]);
}
#ifdef CONFIG_SUPPORT_SUB_MOBEAM
void adsp_sub_mobeam_register(struct device_attribute *attributes[])
{
int i;
data->sub_mobeam_device = sec_device_create(0, data, "sec_sub_barcode_emul");
for (i = 0; attributes[i] != NULL; i++) {
if (device_create_file(data->sub_mobeam_device, attributes[i]) < 0)
pr_err("%s fail to create %d", __func__, i);
}
}
void adsp_sub_mobeam_unregister(struct device_attribute *attributes[])
{
int i;
for (i = 0; attributes[i] != NULL; i++)
device_remove_file(data->sub_mobeam_device, attributes[i]);
}
#endif
#endif
#ifdef CONFIG_SUPPORT_AK0997X
int get_hall_angle_data(int32_t *raw_data)
{
uint8_t cnt = 0;
mutex_lock(&data->digital_hall_mutex);
adsp_unicast(NULL, 0, MSG_DIGITAL_HALL_ANGLE, 0, MSG_TYPE_GET_RAW_DATA);
while (!(data->ready_flag[MSG_TYPE_GET_RAW_DATA] & 1 << MSG_DIGITAL_HALL_ANGLE) &&
cnt++ < TIMEOUT_CNT)
usleep_range(500, 550);
data->ready_flag[MSG_TYPE_GET_RAW_DATA] &= ~(1 << MSG_DIGITAL_HALL_ANGLE);
if (cnt >= TIMEOUT_CNT) {
pr_err("[FACTORY] %s: Timeout!!!\n", __func__);
return -1;
}
pr_info("[FACTORY] %s - st %d/%d, akm %d/%d, lf %d/%d, hall %d/%d/%d(uT)\n",
__func__, data->msg_buf[MSG_DIGITAL_HALL_ANGLE][0],
data->msg_buf[MSG_DIGITAL_HALL_ANGLE][1],
data->msg_buf[MSG_DIGITAL_HALL_ANGLE][2],
data->msg_buf[MSG_DIGITAL_HALL_ANGLE][3],
data->msg_buf[MSG_DIGITAL_HALL_ANGLE][4],
data->msg_buf[MSG_DIGITAL_HALL_ANGLE][5],
data->msg_buf[MSG_DIGITAL_HALL_ANGLE][6],
data->msg_buf[MSG_DIGITAL_HALL_ANGLE][7],
data->msg_buf[MSG_DIGITAL_HALL_ANGLE][8]);
*raw_data = data->msg_buf[MSG_DIGITAL_HALL_ANGLE][2];
mutex_unlock(&data->digital_hall_mutex);
return 0;
}
#endif
static int process_received_msg(struct sk_buff *skb, struct nlmsghdr *nlh)
{
u16 sensor_type = nlh->nlmsg_type >> 8;
u16 msg_type = nlh->nlmsg_type & 0xff;
/* check the boundary to prevent memory attack */
if (msg_type >= MSG_TYPE_MAX || sensor_type >= MSG_SENSOR_MAX ||
nlh->nlmsg_len - (int32_t)sizeof(struct nlmsghdr) >
sizeof(int32_t) * msg_size[sensor_type]) {
pr_err("[FACTORY] %d, %d, %d\n", msg_type, sensor_type, nlh->nlmsg_len);
return 0;
}
if (sensor_type == MSG_FACTORY_INIT_CMD) {
accel_factory_init_work(data);
#ifdef CONFIG_SUPPORT_DUAL_6AXIS
sub_accel_factory_init_work(data);
#endif
#ifdef CONFIG_SUPPORT_HIDDEN_HOLE
hidden_hole_init_work();
#endif
#ifdef CONFIG_SUPPORT_HIDDEN_HOLE_SUB
hidden_hole_sub_init_work();
#endif
#ifdef CONFIG_SUPPORT_DEVICE_MODE
sns_device_mode_init_work();
#endif
#if defined(CONFIG_SUPPORT_DUAL_OPTIC) && defined(CONFIG_SUPPORT_DEVICE_MODE)
sns_flip_init_work();
#endif
#ifdef CONFIG_SUPPORT_PROX_CALIBRATION
prox_cal_init_work(data);
#endif
#ifdef CONFIG_SUPPORT_LIGHT_CALIBRATION
light_cal_init_work(data);
#endif
#ifdef CONFIG_SUPPORT_PROX_POWER_ON_CAL
prox_factory_init_work();
#endif
#ifdef CONFIG_VBUS_NOTIFIER
sns_vbus_init_work();
#endif
#ifdef CONFIG_SUPPORT_AK0997X
digital_hall_factory_auto_cal_init_work();
#endif
#ifdef CONFIG_SUPPORT_LIGHT_SEAMLESS
light_seamless_init_work(data);
#endif
return 0;
}
memcpy(data->msg_buf[sensor_type],
(int32_t *)NLMSG_DATA(nlh),
nlh->nlmsg_len - (int32_t)sizeof(struct nlmsghdr));
data->ready_flag[msg_type] |= 1 << sensor_type;
return 0;
}
static void factory_receive_skb(struct sk_buff *skb)
{
struct netlink_ext_ack extack = {};
struct nlmsghdr *nlh;
int len;
int err;
nlh = (struct nlmsghdr *)skb->data;
len = skb->len;
while (NLMSG_OK(nlh, len)) {
err = process_received_msg(skb, nlh);
/* if err or if this message says it wants a response */
if (err || (nlh->nlmsg_flags & NLM_F_ACK))
netlink_ack(skb, nlh, err, &extack);
nlh = NLMSG_NEXT(nlh, len);
}
}
/* Receive messages from netlink socket. */
static void factory_test_result_receive(struct sk_buff *skb)
{
mutex_lock(&factory_mutex);
factory_receive_skb(skb);
mutex_unlock(&factory_mutex);
}
struct netlink_kernel_cfg netlink_cfg = {
.input = factory_test_result_receive,
};
static int __init factory_adsp_init(void)
{
int i;
pr_info("[FACTORY] %s\n", __func__);
data = kzalloc(sizeof(*data), GFP_KERNEL);
for (i = 0; i < MSG_SENSOR_MAX; i++) {
if (msg_size[i] > 0)
data->msg_buf[i] = kzalloc(sizeof(int32_t) * msg_size[i],
GFP_KERNEL);
}
data->adsp_skt = netlink_kernel_create(&init_net,
NETLINK_ADSP_FAC, &netlink_cfg);
for (i = 0; i < MSG_SENSOR_MAX; i++)
data->sysfs_created[i] = false;
for (i = 0; i < MSG_TYPE_MAX; i++)
data->ready_flag[i] = 0;
data->restrict_mode = false;
data->turn_over_crash = 0;
mutex_init(&data->accel_factory_mutex);
mutex_init(&data->prox_factory_mutex);
mutex_init(&data->light_factory_mutex);
mutex_init(&data->remove_sysfs_mutex);
#ifdef CONFIG_SUPPORT_AK0997X
mutex_init(&data->digital_hall_mutex);
#endif
#ifdef CONFIG_SUPPORT_LIGHT_CALIBRATION
INIT_DELAYED_WORK(&data->light_cal_work, light_cal_read_work_func);
#endif
INIT_DELAYED_WORK(&data->light_copr_debug_work,
light_copr_debug_work_func);
#ifdef CONFIG_SUPPORT_BRIGHTNESS_NOTIFY_FOR_LIGHT_SENSOR
INIT_WORK(&data->light_br_work, light_brightness_work_func);
#endif
INIT_DELAYED_WORK(&data->accel_cal_work, accel_cal_work_func);
#ifdef CONFIG_SUPPORT_DUAL_6AXIS
INIT_DELAYED_WORK(&data->sub_accel_cal_work, sub_accel_cal_work_func);
#endif
#ifdef CONFIG_SUPPORT_LIGHT_SEAMLESS
INIT_DELAYED_WORK(&data->light_seamless_work, light_seamless_work_func);
#endif
pr_info("[FACTORY] %s: Timer Init\n", __func__);
return 0;
}
static void __exit factory_adsp_exit(void)
{
int i;
mutex_destroy(&data->accel_factory_mutex);
mutex_destroy(&data->prox_factory_mutex);
mutex_destroy(&data->light_factory_mutex);
mutex_destroy(&data->remove_sysfs_mutex);
#ifdef CONFIG_SUPPORT_AK0997X
mutex_destroy(&data->digital_hall_mutex);
#endif
#ifdef CONFIG_SUPPORT_LIGHT_CALIBRATION
cancel_delayed_work_sync(&data->light_cal_work);
#endif
cancel_delayed_work_sync(&data->light_copr_debug_work);
#ifdef CONFIG_SUPPORT_BRIGHTNESS_NOTIFY_FOR_LIGHT_SENSOR
cancel_work_sync(&data->light_br_work);
#endif
cancel_delayed_work_sync(&data->accel_cal_work);
#ifdef CONFIG_SUPPORT_DUAL_6AXIS
cancel_delayed_work_sync(&data->sub_accel_cal_work);
#endif
#ifdef CONFIG_SUPPORT_LIGHT_SEAMLESS
cancel_delayed_work_sync(&data->light_seamless_work);
#endif
for (i = 0; i < MSG_SENSOR_MAX; i++)
kfree(data->msg_buf[i]);
pr_info("[FACTORY] %s\n", __func__);
}
module_init(factory_adsp_init);
module_exit(factory_adsp_exit);
MODULE_DESCRIPTION("Support for factory test sensors (adsp)");
MODULE_LICENSE("GPL");
|