rk3026: i2s add several attempts to double confirm i2s frac effect
[firefly-linux-kernel-4.4.55.git] / arch / arm / mach-rk319x / rk_timer.c
1 #include <linux/platform_device.h>
2 #include <asm/mach/time.h>
3 #include <mach/io.h>
4 #include <mach/irqs.h>
5
6 #define TIMER_NAME      "rk_timer"
7 #define BASE            RK319X_TIMER_BASE
8 #define OFFSET          0x20
9
10 static struct resource rk_timer_resources[] __initdata = {
11         {
12                 .name   = "cs_base",
13                 .start  = (unsigned long) BASE + 4 * OFFSET,
14                 .flags  = IORESOURCE_MEM,
15         }, {
16                 .name   = "cs_clk",
17                 .start  = (unsigned long) "timer4",
18         }, {
19                 .name   = "cs_pclk",
20                 .start  = (unsigned long) "pclk_timer",
21         },
22
23         {
24                 .name   = "ce_base0",
25                 .start  = (unsigned long) BASE + 0 * OFFSET,
26                 .flags  = IORESOURCE_MEM,
27         }, {
28                 .name   = "ce_irq0",
29                 .start  = (unsigned long) IRQ_TIMER0,
30                 .flags  = IORESOURCE_IRQ,
31         }, {
32                 .name   = "ce_clk0",
33                 .start  = (unsigned long) "timer0",
34         }, {
35                 .name   = "ce_pclk0",
36                 .start  = (unsigned long) "pclk_timer",
37         },
38
39         {
40                 .name   = "ce_base1",
41                 .start  = (unsigned long) BASE + 1 * OFFSET,
42                 .flags  = IORESOURCE_MEM,
43         }, {
44                 .name   = "ce_irq1",
45                 .start  = (unsigned long) IRQ_TIMER1,
46                 .flags  = IORESOURCE_IRQ,
47         }, {
48                 .name   = "ce_clk1",
49                 .start  = (unsigned long) "timer1",
50         }, {
51                 .name   = "ce_pclk1",
52                 .start  = (unsigned long) "pclk_timer",
53         },
54
55         {
56                 .name   = "ce_base2",
57                 .start  = (unsigned long) BASE + 2 * OFFSET,
58                 .flags  = IORESOURCE_MEM,
59         }, {
60                 .name   = "ce_irq2",
61                 .start  = (unsigned long) IRQ_TIMER2,
62                 .flags  = IORESOURCE_IRQ,
63         }, {
64                 .name   = "ce_clk2",
65                 .start  = (unsigned long) "timer2",
66         }, {
67                 .name   = "ce_pclk2",
68                 .start  = (unsigned long) "pclk_timer",
69         },
70
71         {
72                 .name   = "ce_base3",
73                 .start  = (unsigned long) BASE + 3 * OFFSET,
74                 .flags  = IORESOURCE_MEM,
75         }, {
76                 .name   = "ce_irq3",
77                 .start  = (unsigned long) IRQ_TIMER3,
78                 .flags  = IORESOURCE_IRQ,
79         }, {
80                 .name   = "ce_clk3",
81                 .start  = (unsigned long) "timer3",
82         }, {
83                 .name   = "ce_pclk3",
84                 .start  = (unsigned long) "pclk_timer",
85         },
86 };
87
88 static struct platform_device rk_timer_device __initdata = {
89         .name           = TIMER_NAME,
90         .id             = 0,
91         .resource       = rk_timer_resources,
92         .num_resources  = ARRAY_SIZE(rk_timer_resources),
93 };
94
95 static struct platform_device *rk_timer_devices[] __initdata = {
96         &rk_timer_device,
97 };
98
99 static void __init rk_timer_init(void)
100 {
101         early_platform_add_devices(rk_timer_devices, ARRAY_SIZE(rk_timer_devices));
102         early_platform_driver_register_all(TIMER_NAME);
103         early_platform_driver_probe(TIMER_NAME, 1, 0);
104 }
105
106 struct sys_timer rk30_timer = {
107         .init = rk_timer_init
108 };