This source file includes following definitions.
- lubbock_pcmcia_hw_init
- lubbock_pcmcia_configure_socket
- pcmcia_lubbock_init
1
2
3
4
5
6
7
8
9
10
11
12
13 #include <linux/module.h>
14 #include <linux/kernel.h>
15 #include <linux/device.h>
16 #include <linux/errno.h>
17 #include <linux/init.h>
18 #include <linux/delay.h>
19
20 #include <mach/hardware.h>
21 #include <asm/hardware/sa1111.h>
22 #include <asm/mach-types.h>
23
24 #include "sa1111_generic.h"
25 #include "max1600.h"
26
27 static int lubbock_pcmcia_hw_init(struct soc_pcmcia_socket *skt)
28 {
29 struct max1600 *m;
30 int ret;
31
32 ret = max1600_init(skt->socket.dev.parent, &m,
33 skt->nr ? MAX1600_CHAN_B : MAX1600_CHAN_A,
34 MAX1600_CODE_HIGH);
35 if (ret == 0)
36 skt->driver_data = m;
37
38 return ret;
39 }
40
41 static int
42 lubbock_pcmcia_configure_socket(struct soc_pcmcia_socket *skt,
43 const socket_state_t *state)
44 {
45 struct max1600 *m = skt->driver_data;
46 int ret = 0;
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 again:
79 switch (skt->nr) {
80 case 0:
81 case 1:
82 break;
83
84 default:
85 ret = -1;
86 }
87
88 if (ret == 0)
89 ret = sa1111_pcmcia_configure_socket(skt, state);
90 if (ret == 0)
91 ret = max1600_configure(m, state->Vcc, state->Vpp);
92
93 #if 1
94 if (ret == 0 && state->Vcc == 33) {
95 struct pcmcia_state new_state;
96
97
98
99
100
101
102
103
104
105
106
107 mdelay(3);
108
109 sa1111_pcmcia_socket_state(skt, &new_state);
110
111 if (!new_state.vs_3v && !new_state.vs_Xv) {
112
113
114
115 max1600_configure(m, 0, 0);
116
117
118
119
120 mdelay(100);
121
122
123
124
125
126
127
128 ((socket_state_t *)state)->Vcc = 50;
129 ((socket_state_t *)state)->Vpp = 50;
130 goto again;
131 }
132 }
133 #endif
134
135 return ret;
136 }
137
138 static struct pcmcia_low_level lubbock_pcmcia_ops = {
139 .owner = THIS_MODULE,
140 .hw_init = lubbock_pcmcia_hw_init,
141 .configure_socket = lubbock_pcmcia_configure_socket,
142 .first = 0,
143 .nr = 2,
144 };
145
146 #include "pxa2xx_base.h"
147
148 int pcmcia_lubbock_init(struct sa1111_dev *sadev)
149 {
150 pxa2xx_drv_pcmcia_ops(&lubbock_pcmcia_ops);
151 pxa2xx_configure_sockets(&sadev->dev, &lubbock_pcmcia_ops);
152 return sa1111_pcmcia_add(sadev, &lubbock_pcmcia_ops,
153 pxa2xx_drv_pcmcia_add_one);
154 }
155
156 MODULE_LICENSE("GPL");