upload tizen1.0 source
[kernel/linux-2.6.36.git] / drivers / misc / android_usb.c
1 /*
2  * drivers/misc/android_usb.c
3  *
4  * Copyright (C) 2011 for Samsung Electronics
5  *
6  *
7  * This program is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 2 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, write to the Free Software
19  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
20  *
21  */
22
23  /*-------------------------------------------------------------------------*/
24 #include <linux/platform_device.h>
25
26 extern int dyn_multi_node_create(struct device *dev);
27 extern int dyn_multi_node_delete(struct device *dev);
28
29 static const char driver_name[] = "android_usb";
30
31 static int android_usb_probe(struct platform_device *pdev)
32 {
33         int ret;
34
35         ret = dyn_multi_node_create(&pdev->dev);
36         if (!ret)
37                 printk(KERN_INFO "Fail to create %s node", driver_name);
38
39         return ret;
40 }
41
42 static int android_usb_remove(struct platform_device *pdev)
43 {
44         int ret;
45
46         ret = dyn_multi_node_delete(&pdev->dev);
47         if (!ret)
48                 printk(KERN_INFO "Fail to remove %s node", driver_name);
49
50         return ret;
51 }
52
53
54 static struct platform_driver android_usb_driver = {
55         .probe          = android_usb_probe,
56         .remove         = android_usb_remove,
57         .driver         = {
58                 .owner  = THIS_MODULE,
59                 .name   = driver_name,
60         },
61 };
62
63 static int __init android_usb_init(void)
64 {
65         int ret;
66
67         ret = platform_driver_register(&android_usb_driver);
68         if (!ret)
69                 printk(KERN_INFO "Fail to register %s driver", driver_name);
70
71         return ret;
72 }
73
74 static void __exit android_usb_exit(void)
75 {
76         platform_driver_unregister(&android_usb_driver);
77         printk(KERN_INFO "Unloaded %s driver\n", driver_name);
78 }
79
80 module_init(android_usb_init);
81 module_exit(android_usb_exit);
82
83 MODULE_DESCRIPTION(DRIVER_DESC);
84 MODULE_AUTHOR("Samsung");
85 MODULE_LICENSE("GPL");