This source file includes following definitions.
- goldfish_setup
- goldfish_init
1
2
3
4
5
6
7
8 #include <linux/kernel.h>
9 #include <linux/irq.h>
10 #include <linux/platform_device.h>
11
12
13
14
15
16
17 #define GOLDFISH_PDEV_BUS_BASE (0xff001000)
18 #define GOLDFISH_PDEV_BUS_END (0xff7fffff)
19 #define GOLDFISH_PDEV_BUS_IRQ (4)
20
21 #define GOLDFISH_TTY_BASE (0x2000)
22
23 static struct resource goldfish_pdev_bus_resources[] = {
24 {
25 .start = GOLDFISH_PDEV_BUS_BASE,
26 .end = GOLDFISH_PDEV_BUS_END,
27 .flags = IORESOURCE_MEM,
28 },
29 {
30 .start = GOLDFISH_PDEV_BUS_IRQ,
31 .end = GOLDFISH_PDEV_BUS_IRQ,
32 .flags = IORESOURCE_IRQ,
33 }
34 };
35
36 static bool goldfish_enable __initdata;
37
38 static int __init goldfish_setup(char *str)
39 {
40 goldfish_enable = true;
41 return 0;
42 }
43 __setup("goldfish", goldfish_setup);
44
45 static int __init goldfish_init(void)
46 {
47 if (!goldfish_enable)
48 return -ENODEV;
49
50 platform_device_register_simple("goldfish_pdev_bus", -1,
51 goldfish_pdev_bus_resources, 2);
52 return 0;
53 }
54 device_initcall(goldfish_init);