hc
2024-12-19 9370bb92b2d16684ee45cf24e879c93c509162da
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
/*
 * Copyright (c) 2016, Fuzhou Rockchip Electronics Co., Ltd
 *
 * 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.
 */
 
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/soc/rockchip/rk_vendor_storage.h>
 
static int (*_vendor_read)(u32 id, void *pbuf, u32 size);
static int (*_vendor_write)(u32 id, void *pbuf, u32 size);
 
int rk_vendor_read(u32 id, void *pbuf, u32 size)
{
   if (_vendor_read)
       return _vendor_read(id, pbuf, size);
   return -1;
}
EXPORT_SYMBOL(rk_vendor_read);
 
int rk_vendor_write(u32 id, void *pbuf, u32 size)
{
   if (_vendor_write)
       return _vendor_write(id, pbuf, size);
   return -1;
}
EXPORT_SYMBOL(rk_vendor_write);
 
int rk_vendor_register(void *read, void *write)
{
   _vendor_read = read;
   _vendor_write =  write;
 
   return 0;
}
EXPORT_SYMBOL(rk_vendor_register);
 
bool is_rk_vendor_ready(void)
{
   if (_vendor_read)
       return true;
   return false;
}
EXPORT_SYMBOL(is_rk_vendor_ready);
 
MODULE_LICENSE("GPL");