vrled.c revision 1.1.2.2 1 1.1.2.2 bouyer /* $NetBSD: vrled.c,v 1.1.2.2 2000/11/20 20:48:03 bouyer Exp $ */
2 1.1.2.2 bouyer
3 1.1.2.2 bouyer /*
4 1.1.2.2 bouyer * Copyright (c) 2000 SATO Kazumi. All rights reserved.
5 1.1.2.2 bouyer *
6 1.1.2.2 bouyer * Redistribution and use in source and binary forms, with or without
7 1.1.2.2 bouyer * modification, are permitted provided that the following conditions
8 1.1.2.2 bouyer * are met:
9 1.1.2.2 bouyer * 1. Redistributions of source code must retain the above copyright
10 1.1.2.2 bouyer * notice, this list of conditions and the following disclaimer.
11 1.1.2.2 bouyer * 2. Redistributions in binary form must reproduce the above copyright
12 1.1.2.2 bouyer * notice, this list of conditions and the following disclaimer in the
13 1.1.2.2 bouyer * documentation and/or other materials provided with the distribution.
14 1.1.2.2 bouyer *
15 1.1.2.2 bouyer * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
16 1.1.2.2 bouyer * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17 1.1.2.2 bouyer * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18 1.1.2.2 bouyer * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
19 1.1.2.2 bouyer * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20 1.1.2.2 bouyer * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
21 1.1.2.2 bouyer * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22 1.1.2.2 bouyer * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23 1.1.2.2 bouyer * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24 1.1.2.2 bouyer * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25 1.1.2.2 bouyer * SUCH DAMAGE.
26 1.1.2.2 bouyer */
27 1.1.2.2 bouyer
28 1.1.2.2 bouyer #include <sys/param.h>
29 1.1.2.2 bouyer #include <sys/systm.h>
30 1.1.2.2 bouyer #include <sys/device.h>
31 1.1.2.2 bouyer #include <sys/reboot.h>
32 1.1.2.2 bouyer
33 1.1.2.2 bouyer #include <machine/bus.h>
34 1.1.2.2 bouyer #include <machine/config_hook.h>
35 1.1.2.2 bouyer
36 1.1.2.2 bouyer #include <hpcmips/vr/vripvar.h>
37 1.1.2.2 bouyer #include <hpcmips/vr/vrledvar.h>
38 1.1.2.2 bouyer #include <hpcmips/vr/vrledreg.h>
39 1.1.2.2 bouyer
40 1.1.2.2 bouyer
41 1.1.2.2 bouyer #ifdef VRLEDDEBUG
42 1.1.2.2 bouyer #ifndef VRLEDDEBUG_CONF
43 1.1.2.2 bouyer #define VRLEDDEBUG_CONF 0
44 1.1.2.2 bouyer #endif /* VRLEDDEBUG_CONF */
45 1.1.2.2 bouyer int vrleddebug = VRLEDDEBUG_CONF;
46 1.1.2.2 bouyer #define DPRINTF(arg) if (vrleddebug) printf arg;
47 1.1.2.2 bouyer #define VPRINTF(arg) if (bootverbose||vrleddebug) printf arg;
48 1.1.2.2 bouyer #else /* VRLEDDEBUG */
49 1.1.2.2 bouyer #define DPRINTF(arg)
50 1.1.2.2 bouyer #define VPRINTF(arg) if (bootverbose) printf arg;
51 1.1.2.2 bouyer #endif /* VRLEDDEBUG */
52 1.1.2.2 bouyer
53 1.1.2.2 bouyer static int vrledmatch __P((struct device *, struct cfdata *, void *));
54 1.1.2.2 bouyer static void vrledattach __P((struct device *, struct device *, void *));
55 1.1.2.2 bouyer
56 1.1.2.2 bouyer static void vrled_write __P((struct vrled_softc *, int, unsigned short));
57 1.1.2.2 bouyer static unsigned short vrled_read __P((struct vrled_softc *, int));
58 1.1.2.2 bouyer
59 1.1.2.2 bouyer static void vrled_stop __P((struct vrled_softc *));
60 1.1.2.2 bouyer static void vrled_on __P((struct vrled_softc *));
61 1.1.2.2 bouyer static void vrled_blink __P((struct vrled_softc *));
62 1.1.2.2 bouyer static void vrled_flash __P((struct vrled_softc *));
63 1.1.2.2 bouyer static void vrled_change_state __P((struct vrled_softc *));
64 1.1.2.2 bouyer static int vrled_event __P((void *, int, long, void *));
65 1.1.2.2 bouyer
66 1.1.2.2 bouyer int vrled_intr __P((void *));
67 1.1.2.2 bouyer
68 1.1.2.2 bouyer struct cfattach vrled_ca = {
69 1.1.2.2 bouyer sizeof(struct vrled_softc), vrledmatch, vrledattach
70 1.1.2.2 bouyer };
71 1.1.2.2 bouyer
72 1.1.2.2 bouyer struct vrled_softc *this_led;
73 1.1.2.2 bouyer
74 1.1.2.2 bouyer static inline void
75 1.1.2.2 bouyer vrled_write(sc, port, val)
76 1.1.2.2 bouyer struct vrled_softc *sc;
77 1.1.2.2 bouyer int port;
78 1.1.2.2 bouyer unsigned short val;
79 1.1.2.2 bouyer {
80 1.1.2.2 bouyer bus_space_write_2(sc->sc_iot, sc->sc_ioh, port, val);
81 1.1.2.2 bouyer }
82 1.1.2.2 bouyer
83 1.1.2.2 bouyer static inline unsigned short
84 1.1.2.2 bouyer vrled_read(sc, port)
85 1.1.2.2 bouyer struct vrled_softc *sc;
86 1.1.2.2 bouyer int port;
87 1.1.2.2 bouyer {
88 1.1.2.2 bouyer return bus_space_read_2(sc->sc_iot, sc->sc_ioh, port);
89 1.1.2.2 bouyer }
90 1.1.2.2 bouyer
91 1.1.2.2 bouyer static int
92 1.1.2.2 bouyer vrledmatch(parent, cf, aux)
93 1.1.2.2 bouyer struct device *parent;
94 1.1.2.2 bouyer struct cfdata *cf;
95 1.1.2.2 bouyer void *aux;
96 1.1.2.2 bouyer {
97 1.1.2.2 bouyer return 1;
98 1.1.2.2 bouyer }
99 1.1.2.2 bouyer
100 1.1.2.2 bouyer static void
101 1.1.2.2 bouyer vrledattach(parent, self, aux)
102 1.1.2.2 bouyer struct device *parent;
103 1.1.2.2 bouyer struct device *self;
104 1.1.2.2 bouyer void *aux;
105 1.1.2.2 bouyer {
106 1.1.2.2 bouyer struct vrled_softc *sc = (struct vrled_softc *)self;
107 1.1.2.2 bouyer struct vrip_attach_args *va = aux;
108 1.1.2.2 bouyer
109 1.1.2.2 bouyer bus_space_tag_t iot = va->va_iot;
110 1.1.2.2 bouyer bus_space_handle_t ioh;
111 1.1.2.2 bouyer
112 1.1.2.2 bouyer if (bus_space_map(iot, va->va_addr, 1, 0, &ioh)) {
113 1.1.2.2 bouyer printf(": can't map bus space\n");
114 1.1.2.2 bouyer return;
115 1.1.2.2 bouyer }
116 1.1.2.2 bouyer
117 1.1.2.2 bouyer sc->sc_iot = iot;
118 1.1.2.2 bouyer sc->sc_ioh = ioh;
119 1.1.2.2 bouyer
120 1.1.2.2 bouyer if (!(sc->sc_handler =
121 1.1.2.2 bouyer vrip_intr_establish(va->va_vc, va->va_intr, IPL_TTY,
122 1.1.2.2 bouyer vrled_intr, sc))) {
123 1.1.2.2 bouyer printf (": can't map interrupt line.\n");
124 1.1.2.2 bouyer return;
125 1.1.2.2 bouyer }
126 1.1.2.2 bouyer
127 1.1.2.2 bouyer printf("\n");
128 1.1.2.2 bouyer /* clear interrupt status */
129 1.1.2.2 bouyer vrled_write(sc, LEDINT_REG_W, LEDINT_ALL);
130 1.1.2.2 bouyer
131 1.1.2.2 bouyer /* basic setup */
132 1.1.2.2 bouyer sc->sc_state_cnt = 1;
133 1.1.2.2 bouyer vrled_write(sc, LEDASTC_REG_W, 1); /* 1time */
134 1.1.2.2 bouyer vrled_write(sc, LEDCNT_REG_W, LEDCNT_AUTOSTOP);
135 1.1.2.2 bouyer vrled_stop(sc);
136 1.1.2.2 bouyer
137 1.1.2.2 bouyer sc->sc_hook = config_hook(CONFIG_HOOK_POWERCONTROL,
138 1.1.2.2 bouyer CONFIG_HOOK_POWERCONTROL_LED,
139 1.1.2.2 bouyer CONFIG_HOOK_SHARE,
140 1.1.2.2 bouyer vrled_event, sc);
141 1.1.2.2 bouyer this_led = sc;
142 1.1.2.2 bouyer }
143 1.1.2.2 bouyer
144 1.1.2.2 bouyer
145 1.1.2.2 bouyer /*
146 1.1.2.2 bouyer * LED interrupt handler.
147 1.1.2.2 bouyer *
148 1.1.2.2 bouyer */
149 1.1.2.2 bouyer int
150 1.1.2.2 bouyer vrled_intr(arg)
151 1.1.2.2 bouyer void *arg;
152 1.1.2.2 bouyer {
153 1.1.2.2 bouyer struct vrled_softc *sc = arg;
154 1.1.2.2 bouyer unsigned int intstat;
155 1.1.2.2 bouyer
156 1.1.2.2 bouyer intstat = vrled_read(sc, LEDINT_REG_W);
157 1.1.2.2 bouyer /* clear interrupt status */
158 1.1.2.2 bouyer vrled_write(sc, LEDINT_REG_W, intstat);
159 1.1.2.2 bouyer if (intstat&LEDINT_AUTOSTOP) {
160 1.1.2.2 bouyer vrled_change_state(sc);
161 1.1.2.2 bouyer }
162 1.1.2.2 bouyer return 0;
163 1.1.2.2 bouyer }
164 1.1.2.2 bouyer
165 1.1.2.2 bouyer /*
166 1.1.2.2 bouyer * LED turn OFF
167 1.1.2.2 bouyer *
168 1.1.2.2 bouyer */
169 1.1.2.2 bouyer void
170 1.1.2.2 bouyer vrled_stop(sc)
171 1.1.2.2 bouyer struct vrled_softc *sc;
172 1.1.2.2 bouyer {
173 1.1.2.2 bouyer vrled_write(sc, LEDHTS_REG_W, LEDHTS_DIV16SEC);
174 1.1.2.2 bouyer vrled_write(sc, LEDLTS_REG_W, LEDLTS_4SEC);
175 1.1.2.2 bouyer vrled_write(sc, LEDASTC_REG_W, 2); /* 2time */
176 1.1.2.2 bouyer vrled_write(sc, LEDCNT_REG_W, LEDCNT_AUTOSTOP);
177 1.1.2.2 bouyer
178 1.1.2.2 bouyer sc->sc_state = LEDOFF;
179 1.1.2.2 bouyer sc->sc_next = LEDOFF;
180 1.1.2.2 bouyer }
181 1.1.2.2 bouyer
182 1.1.2.2 bouyer /*
183 1.1.2.2 bouyer * LED turn ON
184 1.1.2.2 bouyer *
185 1.1.2.2 bouyer */
186 1.1.2.2 bouyer void
187 1.1.2.2 bouyer vrled_on(sc)
188 1.1.2.2 bouyer struct vrled_softc *sc;
189 1.1.2.2 bouyer {
190 1.1.2.2 bouyer vrled_write(sc, LEDHTS_REG_W, LEDHTS_SEC);
191 1.1.2.2 bouyer vrled_write(sc, LEDLTS_REG_W, LEDLTS_DIV16SEC);
192 1.1.2.2 bouyer vrled_write(sc, LEDASTC_REG_W, 2); /* 2time */
193 1.1.2.2 bouyer vrled_write(sc, LEDCNT_REG_W, LEDCNT_AUTOSTOP|LEDCNT_BLINK);
194 1.1.2.2 bouyer
195 1.1.2.2 bouyer sc->sc_state = LEDON;
196 1.1.2.2 bouyer sc->sc_next = LEDON;
197 1.1.2.2 bouyer }
198 1.1.2.2 bouyer
199 1.1.2.2 bouyer /*
200 1.1.2.2 bouyer * LED blink
201 1.1.2.2 bouyer *
202 1.1.2.2 bouyer */
203 1.1.2.2 bouyer void
204 1.1.2.2 bouyer vrled_blink(sc)
205 1.1.2.2 bouyer struct vrled_softc *sc;
206 1.1.2.2 bouyer {
207 1.1.2.2 bouyer int ledhts;
208 1.1.2.2 bouyer int ledlts;
209 1.1.2.2 bouyer
210 1.1.2.2 bouyer switch (sc->sc_next) {
211 1.1.2.2 bouyer case LED1SB:
212 1.1.2.2 bouyer ledhts = LEDHTS_DIV2SEC;
213 1.1.2.2 bouyer ledlts = LEDLTS_DIV2SEC;
214 1.1.2.2 bouyer break;
215 1.1.2.2 bouyer case LED2SB:
216 1.1.2.2 bouyer ledhts = LEDHTS_SEC;
217 1.1.2.2 bouyer ledlts = LEDLTS_SEC;
218 1.1.2.2 bouyer break;
219 1.1.2.2 bouyer default:
220 1.1.2.2 bouyer vrled_stop(sc);
221 1.1.2.2 bouyer return;
222 1.1.2.2 bouyer }
223 1.1.2.2 bouyer
224 1.1.2.2 bouyer vrled_write(sc, LEDHTS_REG_W, ledhts);
225 1.1.2.2 bouyer vrled_write(sc, LEDLTS_REG_W, ledlts);
226 1.1.2.2 bouyer vrled_write(sc, LEDASTC_REG_W, 2); /* 2time */
227 1.1.2.2 bouyer vrled_write(sc, LEDCNT_REG_W, LEDCNT_AUTOSTOP);
228 1.1.2.2 bouyer vrled_write(sc, LEDCNT_REG_W, LEDCNT_AUTOSTOP|LEDCNT_BLINK);
229 1.1.2.2 bouyer
230 1.1.2.2 bouyer sc->sc_state = sc->sc_next;
231 1.1.2.2 bouyer }
232 1.1.2.2 bouyer
233 1.1.2.2 bouyer /*
234 1.1.2.2 bouyer * LED flash once
235 1.1.2.2 bouyer *
236 1.1.2.2 bouyer */
237 1.1.2.2 bouyer void
238 1.1.2.2 bouyer vrled_flash(sc)
239 1.1.2.2 bouyer struct vrled_softc *sc;
240 1.1.2.2 bouyer {
241 1.1.2.2 bouyer int ledhts;
242 1.1.2.2 bouyer int ledlts;
243 1.1.2.2 bouyer
244 1.1.2.2 bouyer switch (sc->sc_next) {
245 1.1.2.2 bouyer case LED8DIVF:
246 1.1.2.2 bouyer ledhts = LEDHTS_DIV16SEC;
247 1.1.2.2 bouyer ledlts = LEDLTS_DIV16SEC;
248 1.1.2.2 bouyer break;
249 1.1.2.2 bouyer case LED4DIVF:
250 1.1.2.2 bouyer ledhts = LEDHTS_DIV8SEC;
251 1.1.2.2 bouyer ledlts = LEDLTS_DIV8SEC;
252 1.1.2.2 bouyer break;
253 1.1.2.2 bouyer case LED2DIVF:
254 1.1.2.2 bouyer ledhts = LEDHTS_DIV4SEC;
255 1.1.2.2 bouyer ledlts = LEDLTS_DIV4SEC;
256 1.1.2.2 bouyer break;
257 1.1.2.2 bouyer case LED1SF:
258 1.1.2.2 bouyer ledhts = LEDHTS_DIV2SEC;
259 1.1.2.2 bouyer ledlts = LEDLTS_DIV2SEC;
260 1.1.2.2 bouyer break;
261 1.1.2.2 bouyer default:
262 1.1.2.2 bouyer vrled_stop(sc);
263 1.1.2.2 bouyer return;
264 1.1.2.2 bouyer }
265 1.1.2.2 bouyer
266 1.1.2.2 bouyer vrled_write(sc, LEDHTS_REG_W, ledhts);
267 1.1.2.2 bouyer vrled_write(sc, LEDLTS_REG_W, ledlts);
268 1.1.2.2 bouyer vrled_write(sc, LEDASTC_REG_W, 2); /* 2time */
269 1.1.2.2 bouyer vrled_write(sc, LEDCNT_REG_W, LEDCNT_AUTOSTOP|LEDCNT_BLINK);
270 1.1.2.2 bouyer
271 1.1.2.2 bouyer sc->sc_state = sc->sc_next;
272 1.1.2.2 bouyer sc->sc_next = LEDOFF;
273 1.1.2.2 bouyer sc->sc_state_cnt = 1;
274 1.1.2.2 bouyer }
275 1.1.2.2 bouyer
276 1.1.2.2 bouyer /*
277 1.1.2.2 bouyer * Change LED state
278 1.1.2.2 bouyer *
279 1.1.2.2 bouyer */
280 1.1.2.2 bouyer void
281 1.1.2.2 bouyer vrled_change_state(sc)
282 1.1.2.2 bouyer struct vrled_softc *sc;
283 1.1.2.2 bouyer {
284 1.1.2.2 bouyer
285 1.1.2.2 bouyer switch (sc->sc_next) {
286 1.1.2.2 bouyer case LEDOFF:
287 1.1.2.2 bouyer vrled_stop(sc);
288 1.1.2.2 bouyer break;
289 1.1.2.2 bouyer case LEDON:
290 1.1.2.2 bouyer vrled_on(sc);
291 1.1.2.2 bouyer break;
292 1.1.2.2 bouyer case LED1SB:
293 1.1.2.2 bouyer case LED2SB:
294 1.1.2.2 bouyer vrled_blink(sc);
295 1.1.2.2 bouyer break;
296 1.1.2.2 bouyer case LED8DIVF:
297 1.1.2.2 bouyer case LED4DIVF:
298 1.1.2.2 bouyer case LED2DIVF:
299 1.1.2.2 bouyer case LED1SF:
300 1.1.2.2 bouyer vrled_flash(sc);
301 1.1.2.2 bouyer break;
302 1.1.2.2 bouyer default:
303 1.1.2.2 bouyer vrled_stop(sc);
304 1.1.2.2 bouyer break;
305 1.1.2.2 bouyer }
306 1.1.2.2 bouyer }
307 1.1.2.2 bouyer
308 1.1.2.2 bouyer /*
309 1.1.2.2 bouyer * Set LED state
310 1.1.2.2 bouyer *
311 1.1.2.2 bouyer */
312 1.1.2.2 bouyer void
313 1.1.2.2 bouyer vrled_set_state(sc, state)
314 1.1.2.2 bouyer struct vrled_softc *sc;
315 1.1.2.2 bouyer vrled_status state;
316 1.1.2.2 bouyer {
317 1.1.2.2 bouyer
318 1.1.2.2 bouyer int ledstate;
319 1.1.2.2 bouyer
320 1.1.2.2 bouyer ledstate = vrled_read(sc, LEDCNT_REG_W);
321 1.1.2.2 bouyer if (ledstate&LEDCNT_BLINK) { /* currently processing */
322 1.1.2.2 bouyer if (sc->sc_next == state)
323 1.1.2.2 bouyer sc->sc_state_cnt++;
324 1.1.2.2 bouyer switch (sc->sc_next) {
325 1.1.2.2 bouyer case LEDOFF:
326 1.1.2.2 bouyer case LEDON:
327 1.1.2.2 bouyer sc->sc_next = state;
328 1.1.2.2 bouyer break;
329 1.1.2.2 bouyer case LED8DIVF:
330 1.1.2.2 bouyer case LED4DIVF:
331 1.1.2.2 bouyer case LED2DIVF:
332 1.1.2.2 bouyer case LED1SF:
333 1.1.2.2 bouyer switch (state) {
334 1.1.2.2 bouyer case LEDOFF:
335 1.1.2.2 bouyer case LED8DIVF:
336 1.1.2.2 bouyer case LED4DIVF:
337 1.1.2.2 bouyer case LED2DIVF:
338 1.1.2.2 bouyer case LED1SF:
339 1.1.2.2 bouyer sc->sc_next = state;
340 1.1.2.2 bouyer break;
341 1.1.2.2 bouyer default:
342 1.1.2.2 bouyer break;
343 1.1.2.2 bouyer }
344 1.1.2.2 bouyer break;
345 1.1.2.2 bouyer case LED1SB:
346 1.1.2.2 bouyer case LED2SB:
347 1.1.2.2 bouyer switch (state) {
348 1.1.2.2 bouyer case LEDOFF:
349 1.1.2.2 bouyer case LEDON:
350 1.1.2.2 bouyer case LED1SB:
351 1.1.2.2 bouyer case LED2SB:
352 1.1.2.2 bouyer sc->sc_next = state;
353 1.1.2.2 bouyer break;
354 1.1.2.2 bouyer default:
355 1.1.2.2 bouyer break;
356 1.1.2.2 bouyer }
357 1.1.2.2 bouyer break;
358 1.1.2.2 bouyer default:
359 1.1.2.2 bouyer sc->sc_next = LEDOFF;
360 1.1.2.2 bouyer break;
361 1.1.2.2 bouyer }
362 1.1.2.2 bouyer return;
363 1.1.2.2 bouyer }
364 1.1.2.2 bouyer sc->sc_next = state;
365 1.1.2.2 bouyer vrled_change_state(sc);
366 1.1.2.2 bouyer }
367 1.1.2.2 bouyer
368 1.1.2.2 bouyer /*
369 1.1.2.2 bouyer * LED config hook events
370 1.1.2.2 bouyer *
371 1.1.2.2 bouyer */
372 1.1.2.2 bouyer int
373 1.1.2.2 bouyer vrled_event(ctx, type, id, msg)
374 1.1.2.2 bouyer void *ctx;
375 1.1.2.2 bouyer int type;
376 1.1.2.2 bouyer long id;
377 1.1.2.2 bouyer void *msg;
378 1.1.2.2 bouyer {
379 1.1.2.2 bouyer struct vrled_softc *sc = (struct vrled_softc *)ctx;
380 1.1.2.2 bouyer int why =(int)msg;
381 1.1.2.2 bouyer
382 1.1.2.2 bouyer if (type != CONFIG_HOOK_POWERCONTROL
383 1.1.2.2 bouyer || id != CONFIG_HOOK_POWERCONTROL_LED)
384 1.1.2.2 bouyer return 1;
385 1.1.2.2 bouyer
386 1.1.2.2 bouyer switch (why) {
387 1.1.2.2 bouyer case PWCTL_LED_OFF:
388 1.1.2.2 bouyer vrled_set_state(sc, LEDOFF);
389 1.1.2.2 bouyer break;
390 1.1.2.2 bouyer case PWCTL_LED_ON:
391 1.1.2.2 bouyer vrled_set_state(sc, LEDON);
392 1.1.2.2 bouyer break;
393 1.1.2.2 bouyer case PWCTL_LED_FLASH:
394 1.1.2.2 bouyer vrled_set_state(sc, LED8DIVF);
395 1.1.2.2 bouyer break;
396 1.1.2.2 bouyer case PWCTL_LED_FLASH2:
397 1.1.2.2 bouyer vrled_set_state(sc, LED4DIVF);
398 1.1.2.2 bouyer break;
399 1.1.2.2 bouyer case PWCTL_LED_FLASH5:
400 1.1.2.2 bouyer vrled_set_state(sc, LED2DIVF);
401 1.1.2.2 bouyer break;
402 1.1.2.2 bouyer case PWCTL_LED_BLINK:
403 1.1.2.2 bouyer vrled_set_state(sc, LED1SB);
404 1.1.2.2 bouyer break;
405 1.1.2.2 bouyer case PWCTL_LED_BLINK2:
406 1.1.2.2 bouyer vrled_set_state(sc, LED2SB);
407 1.1.2.2 bouyer break;
408 1.1.2.2 bouyer default:
409 1.1.2.2 bouyer vrled_set_state(sc, LEDOFF);
410 1.1.2.2 bouyer }
411 1.1.2.2 bouyer return (0);
412 1.1.2.2 bouyer }
413 1.1.2.2 bouyer
414 1.1.2.2 bouyer /* end */
415