blob: 05bed361f5cafcce604720266fe671b51ae3988f (
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
78
79
80
81
|
/*
* Copyright 2007-2010 Freescale Semiconductor, Inc. All Rights Reserved.
*/
/*
* The code contained herein is licensed under the GNU General Public
* License. You may obtain a copy of the GNU General Public License
* Version 2 or later at the following locations:
*
* http://www.opensource.org/licenses/gpl-license.html
* http://www.gnu.org/copyleft/gpl.html
*/
#include <linux/module.h>
#include <linux/init.h>
#include <linux/slab.h>
#include <linux/ctype.h>
#include <linux/types.h>
#include <linux/delay.h>
#include <linux/device.h>
#include <linux/i2c.h>
struct i2c_client *i2c_slave_client;
static int i2c_slave_client_probe(struct i2c_client *adapter);
static int i2c_slave_client_remove(struct i2c_client *client);
static struct i2c_driver i2c_slave_client_driver = {
.driver = {
.owner = THIS_MODULE,
.name = "i2c-slave-client",
},
.probe = i2c_slave_client_probe,
.remove = i2c_slave_client_remove,
};
/*!
* ov2640 I2C attach function
*
* @param adapter struct i2c_adapter *
* @return Error code indicating success or failure
*/
static int i2c_slave_client_probe(struct i2c_client *client)
{
i2c_slave_client = client;
return 0;
}
/*!
* ov2640 I2C detach function
*
* @param client struct i2c_client *
* @return Error code indicating success or failure
*/
static int i2c_slave_client_remove(struct i2c_client *client)
{
return 0;
}
/*!
* ov2640 init function
*
* @return Error code indicating success or failure
*/
static __init int i2c_slave_client_init(void)
{
return i2c_add_driver(&i2c_slave_client_driver);
}
/*!
* OV2640 cleanup function
*
* @return Error code indicating success or failure
*/
static void __exit i2c_slave_client_clean(void)
{
i2c_del_driver(&i2c_slave_client_driver);
}
module_init(i2c_slave_client_init);
module_exit(i2c_slave_client_clean);
MODULE_AUTHOR("Freescale Semiconductor, Inc.");
MODULE_DESCRIPTION("I2c Slave Client Driver");
MODULE_LICENSE("GPL");
|